@jinn-network/client 0.1.6 → 0.1.7-canary.d4e4e183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/deployments/deployment-jinn-mvi-l1-sepolia-fast.json +23 -4
- package/deployments/deployment-jinn-mvi-l1-sepolia.json +23 -4
- package/deployments/deployment-jinn-mvi-l2-baseSepolia.json +5 -4
- package/dist/adapters/mech/adapter.d.ts +38 -1
- package/dist/adapters/mech/adapter.js +241 -54
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +17 -4
- package/dist/adapters/mech/contracts.js +8 -2
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe-revert.d.ts +20 -0
- package/dist/adapters/mech/safe-revert.js +12 -4
- package/dist/adapters/mech/safe-revert.js.map +1 -1
- package/dist/adapters/mech/safe.d.ts +5 -1
- package/dist/adapters/mech/safe.js +27 -8
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/verdict-code.d.ts +1 -0
- package/dist/adapters/mech/verdict-code.js +18 -0
- package/dist/adapters/mech/verdict-code.js.map +1 -1
- package/dist/api/admin-endpoint.d.ts +15 -3
- package/dist/api/admin-endpoint.js +24 -2
- package/dist/api/admin-endpoint.js.map +1 -1
- package/dist/api/bootstrap-endpoint.js +49 -0
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +73 -0
- package/dist/api/codex-doctor-endpoint.js +177 -0
- package/dist/api/codex-doctor-endpoint.js.map +1 -0
- package/dist/api/discovery-endpoint.d.ts +1 -0
- package/dist/api/discovery-endpoint.js +26 -0
- package/dist/api/discovery-endpoint.js.map +1 -1
- package/dist/api/fleet-build.d.ts +1 -0
- package/dist/api/fleet-build.js +2 -1
- package/dist/api/fleet-build.js.map +1 -1
- package/dist/api/gather-status.d.ts +11 -0
- package/dist/api/gather-status.js +400 -4
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/hermes-doctor-endpoint.d.ts +117 -0
- package/dist/api/hermes-doctor-endpoint.js +229 -23
- package/dist/api/hermes-doctor-endpoint.js.map +1 -1
- package/dist/api/launcher-status.d.ts +21 -16
- package/dist/api/launcher-status.js +2 -1
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +10 -0
- package/dist/api/portfolio-v0-build.js +24 -5
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +10 -0
- package/dist/api/prediction-v1-build.js +7 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +31 -1
- package/dist/api/server.js +68 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +16 -0
- package/dist/api/setup-endpoints.js +78 -4
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/setup-retry-endpoint.d.ts +19 -0
- package/dist/api/setup-retry-endpoint.js +32 -0
- package/dist/api/setup-retry-endpoint.js.map +1 -0
- package/dist/api/solvernets-endpoints.d.ts +8 -0
- package/dist/api/solvernets-endpoints.js +71 -43
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +72 -0
- package/dist/api/status-build.js +73 -18
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/task-run-routing.d.ts +7 -0
- package/dist/api/task-run-routing.js +12 -0
- package/dist/api/task-run-routing.js.map +1 -0
- package/dist/api/task-runs-build.d.ts +21 -0
- package/dist/api/task-runs-build.js +14 -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/chain-read-errors.d.ts +10 -0
- package/dist/chain-read-errors.js +15 -0
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/auth.js +1 -1
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/create.js +3 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +2 -0
- package/dist/cli/commands/doctor.js +2 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/rewards.js +11 -7
- package/dist/cli/commands/rewards.js.map +1 -1
- package/dist/cli/commands/solver-nets.js +24 -9
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/tasks.js +86 -9
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/update.d.ts +10 -0
- package/dist/cli/commands/update.js +36 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/introspection-context.js +5 -0
- package/dist/cli/introspection-context.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +3 -1
- package/dist/cli/task-native-readiness.js +28 -6
- package/dist/cli/task-native-readiness.js.map +1 -1
- package/dist/config.d.ts +106 -5
- package/dist/config.js +97 -18
- package/dist/config.js.map +1 -1
- package/dist/daemon/checkpoint-loop.d.ts +48 -0
- package/dist/daemon/checkpoint-loop.js +76 -0
- package/dist/daemon/checkpoint-loop.js.map +1 -0
- package/dist/daemon/creator.d.ts +1 -1
- package/dist/daemon/creator.js +7 -3
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +19 -0
- package/dist/daemon/daemon.js +68 -1
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/eviction-loop.d.ts +40 -0
- package/dist/daemon/eviction-loop.js +67 -0
- package/dist/daemon/eviction-loop.js.map +1 -0
- package/dist/daemon/jinn-claim-loop-wiring.d.ts +33 -0
- package/dist/daemon/jinn-claim-loop-wiring.js +40 -0
- package/dist/daemon/jinn-claim-loop-wiring.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.d.ts +24 -17
- package/dist/daemon/jinn-claim-loop.js +77 -23
- package/dist/daemon/jinn-claim-loop.js.map +1 -1
- package/dist/daemon/skip-log-dedup.d.ts +69 -0
- package/dist/daemon/skip-log-dedup.js +106 -0
- package/dist/daemon/skip-log-dedup.js.map +1 -0
- package/dist/dashboard/assets/index-BUlE8F3Y.js +330 -0
- package/dist/dashboard/assets/index-blqc7eqq.css +32 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/factory.d.ts +17 -5
- package/dist/discovery/factory.js +46 -18
- package/dist/discovery/factory.js.map +1 -1
- package/dist/discovery/http.js +142 -3
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.d.ts +5 -0
- package/dist/discovery/onchain.js +407 -15
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +45 -1
- package/dist/discovery/types.js +8 -10
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.d.ts +7 -0
- package/dist/discovery/with-fallback.js +10 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +92 -1
- package/dist/earning/bootstrap.js +203 -63
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/contracts.d.ts +14 -0
- package/dist/earning/contracts.js +17 -5
- package/dist/earning/contracts.js.map +1 -1
- package/dist/earning/funding-plan.js +27 -18
- package/dist/earning/funding-plan.js.map +1 -1
- package/dist/earning/jinn-rewards.d.ts +46 -0
- package/dist/earning/jinn-rewards.js +32 -0
- package/dist/earning/jinn-rewards.js.map +1 -1
- package/dist/earning/safe-adapter.d.ts +2 -0
- package/dist/earning/safe-adapter.js +26 -12
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/store.d.ts +8 -0
- package/dist/earning/store.js.map +1 -1
- package/dist/earning/testnet-setup-migration.d.ts +12 -0
- package/dist/earning/testnet-setup-migration.js +27 -1
- package/dist/earning/testnet-setup-migration.js.map +1 -1
- package/dist/earning/types.d.ts +15 -0
- package/dist/erc8004/reputation.d.ts +8 -0
- package/dist/erc8004/reputation.js +22 -3
- package/dist/erc8004/reputation.js.map +1 -1
- package/dist/harnesses/cost-estimates.d.ts +145 -0
- package/dist/harnesses/cost-estimates.js +297 -0
- package/dist/harnesses/cost-estimates.js.map +1 -0
- package/dist/harnesses/engine/engine.d.ts +72 -0
- package/dist/harnesses/engine/engine.js +105 -8
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +51 -1
- package/dist/harnesses/engine/persistence.js +118 -5
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/work-dir-reaper.d.ts +65 -0
- package/dist/harnesses/engine/work-dir-reaper.js +100 -0
- package/dist/harnesses/engine/work-dir-reaper.js.map +1 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js +40 -0
- package/dist/harnesses/impls/hermes-agent/adapter.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.d.ts +20 -0
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +40 -6
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +59 -1
- package/dist/harnesses/impls/hermes-agent/harness.js +104 -0
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/index.d.ts +7 -0
- package/dist/harnesses/impls/index.js +16 -1
- package/dist/harnesses/impls/index.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +38 -4
- package/dist/harnesses/impls/learner/harness.js +96 -2
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/plugin-path.d.ts +0 -13
- package/dist/harnesses/impls/learner/plugin-path.js +35 -15
- package/dist/harnesses/impls/learner/plugin-path.js.map +1 -1
- package/dist/harnesses/impls/learner/types.d.ts +11 -0
- package/dist/harnesses/impls/stub.d.ts +58 -0
- package/dist/harnesses/impls/stub.js +89 -0
- package/dist/harnesses/impls/stub.js.map +1 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.d.ts +69 -50
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +178 -93
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.d.ts +12 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js +121 -7
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/harness.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +15 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +54 -4
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.d.ts +6 -0
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/index.js.map +1 -1
- package/dist/harnesses/readiness-registry.js +9 -1
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/main.js +371 -82
- package/dist/main.js.map +1 -1
- package/dist/observability/emit-event.d.ts +1 -1
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/operator-errors.d.ts +7 -0
- package/dist/operator-errors.js +13 -1
- package/dist/operator-errors.js.map +1 -1
- package/dist/plugins/learner/.claude-plugin/plugin.json +9 -0
- package/dist/plugins/learner/.codex-plugin/plugin.json +39 -0
- package/dist/plugins/learner/AGENTS.md +40 -0
- package/dist/plugins/learner/CLAUDE.md +33 -0
- package/dist/plugins/learner/README.md +59 -0
- package/dist/plugins/learner/hooks/hooks.json +16 -0
- package/dist/plugins/learner/hooks/session-start +38 -0
- package/dist/plugins/learner/skills/learn/SKILL.md +412 -0
- package/dist/plugins/learner/skills/learn/analyst-prompt.md +68 -0
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +94 -0
- package/dist/plugins/learner/skills/learn/explorer-prompt.md +53 -0
- package/dist/plugins/learner/skills/learn/planner-prompt.md +87 -0
- package/dist/plugins/learner/skills/learn/promoter-prompt.md +113 -0
- package/dist/plugins/learner/skills/learn/step-worker-prompt.md +47 -0
- package/dist/plugins/learner/skills/learn/strategist-prompt.md +85 -0
- package/dist/restart-daemon.d.ts +90 -0
- package/dist/restart-daemon.js +95 -0
- package/dist/restart-daemon.js.map +1 -0
- package/dist/setup/halt-mode.d.ts +14 -0
- package/dist/setup/halt-mode.js +17 -0
- package/dist/setup/halt-mode.js.map +1 -0
- package/dist/solver-nets/prediction-operator-ux.js +43 -3
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-nets/registry.d.ts +1 -0
- package/dist/solver-nets/registry.js +1 -1
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-pool-cache.d.ts +58 -0
- package/dist/solver-types/_swe-rebench-v2-pool-cache.js +87 -0
- package/dist/solver-types/_swe-rebench-v2-pool-cache.js.map +1 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.d.ts +1 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js +10 -0
- package/dist/solver-types/_swe-rebench-v2-substrate.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +65 -0
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +243 -26
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +22 -7
- package/dist/solver-types/swe-rebench-v2-auto.js +45 -20
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +13 -2
- package/dist/solver-types/swe-rebench-v2.js +233 -94
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +10 -2
- package/dist/solvernets/daemon-init.js +22 -2
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.js +35 -7
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/store.d.ts +5 -0
- package/dist/solvernets/store.js +1 -0
- package/dist/solvernets/store.js.map +1 -1
- package/dist/store/store.d.ts +15 -0
- package/dist/store/store.js +118 -3
- package/dist/store/store.js.map +1 -1
- package/dist/tasks/sources.d.ts +18 -1
- package/dist/tasks/sources.js +33 -5
- package/dist/tasks/sources.js.map +1 -1
- package/dist/tx-retry.d.ts +151 -19
- package/dist/tx-retry.js +286 -32
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/payloads/prediction-apy-v0.d.ts +5 -5
- package/dist/types/payloads/prediction-v0.d.ts +5 -5
- package/dist/types/task-document.d.ts +392 -0
- package/dist/types/task-document.js +10 -0
- package/dist/types/task-document.js.map +1 -1
- package/dist/types/task.d.ts +28 -0
- package/dist/util/extract-tx-hash.d.ts +14 -0
- package/dist/util/extract-tx-hash.js +19 -0
- package/dist/util/extract-tx-hash.js.map +1 -0
- package/dist/vendor/@jinn-network/sdk/dist/contracts.js +1 -1
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.d.ts +3 -0
- package/dist/vendor/@jinn-network/sdk/dist/solvernets/manifest-schema.js +1 -0
- package/package.json +29 -12
- package/dist/dashboard/assets/index-DOlzFN8a.css +0 -32
- package/dist/dashboard/assets/index-NkZ7CTAT.js +0 -140
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
var Ig=e=>{throw TypeError(e)};var Rd=(e,t,r)=>t.has(e)||Ig("Cannot "+r);var F=(e,t,r)=>(Rd(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>t.has(e)?Ig("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,n)=>(Rd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Re=(e,t,r)=>(Rd(e,t,"access private method"),r);var Zl=(e,t,r,n)=>({set _(s){ue(e,t,s,r)},get _(){return F(e,t,n)}});function bk(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 Sx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cx={exports:{}},Hu={},kx={exports:{}},Ae={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Al=Symbol.for("react.element"),wk=Symbol.for("react.portal"),Sk=Symbol.for("react.fragment"),Ck=Symbol.for("react.strict_mode"),kk=Symbol.for("react.profiler"),Ek=Symbol.for("react.provider"),jk=Symbol.for("react.context"),Rk=Symbol.for("react.forward_ref"),Nk=Symbol.for("react.suspense"),Pk=Symbol.for("react.memo"),Tk=Symbol.for("react.lazy"),Bg=Symbol.iterator;function Ak(e){return e===null||typeof e!="object"?null:(e=Bg&&e[Bg]||e["@@iterator"],typeof e=="function"?e:null)}var Ex={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},jx=Object.assign,Rx={};function ta(e,t,r){this.props=e,this.context=t,this.refs=Rx,this.updater=r||Ex}ta.prototype.isReactComponent={};ta.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ta.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nx(){}Nx.prototype=ta.prototype;function yp(e,t,r){this.props=e,this.context=t,this.refs=Rx,this.updater=r||Ex}var xp=yp.prototype=new Nx;xp.constructor=yp;jx(xp,ta.prototype);xp.isPureReactComponent=!0;var Fg=Array.isArray,Px=Object.prototype.hasOwnProperty,bp={current:null},Tx={key:!0,ref:!0,__self:!0,__source:!0};function Ax(e,t,r){var n,s={},i=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Px.call(t,n)&&!Tx.hasOwnProperty(n)&&(s[n]=t[n]);var o=arguments.length-2;if(o===1)s.children=r;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in o=e.defaultProps,o)s[n]===void 0&&(s[n]=o[n]);return{$$typeof:Al,type:e,key:i,ref:l,props:s,_owner:bp.current}}function Dk(e,t){return{$$typeof:Al,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function wp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Al}function Lk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var $g=/\/+/g;function Nd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lk(""+e.key):t.toString(36)}function Pc(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Al:case wk:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+Nd(l,0):n,Fg(s)?(r="",e!=null&&(r=e.replace($g,"$&/")+"/"),Pc(s,t,r,"",function(u){return u})):s!=null&&(wp(s)&&(s=Dk(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace($g,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",Fg(e))for(var o=0;o<e.length;o++){i=e[o];var c=n+Nd(i,o);l+=Pc(i,t,r,c,s)}else if(c=Ak(e),typeof c=="function")for(e=c.call(e),o=0;!(i=e.next()).done;)i=i.value,c=n+Nd(i,o++),l+=Pc(i,t,r,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Xl(e,t,r){if(e==null)return e;var n=[],s=0;return Pc(e,n,"","",function(i){return t.call(r,i,s++)}),n}function Ok(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 Gt={current:null},Tc={transition:null},Mk={ReactCurrentDispatcher:Gt,ReactCurrentBatchConfig:Tc,ReactCurrentOwner:bp};function Dx(){throw Error("act(...) is not supported in production builds of React.")}Ae.Children={map:Xl,forEach:function(e,t,r){Xl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Xl(e,function(){t++}),t},toArray:function(e){return Xl(e,function(t){return t})||[]},only:function(e){if(!wp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ae.Component=ta;Ae.Fragment=Sk;Ae.Profiler=kk;Ae.PureComponent=yp;Ae.StrictMode=Ck;Ae.Suspense=Nk;Ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mk;Ae.act=Dx;Ae.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=jx({},e.props),s=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=bp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Px.call(t,c)&&!Tx.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:Al,type:e.type,key:s,ref:i,props:n,_owner:l}};Ae.createContext=function(e){return e={$$typeof:jk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ek,_context:e},e.Consumer=e};Ae.createElement=Ax;Ae.createFactory=function(e){var t=Ax.bind(null,e);return t.type=e,t};Ae.createRef=function(){return{current:null}};Ae.forwardRef=function(e){return{$$typeof:Rk,render:e}};Ae.isValidElement=wp;Ae.lazy=function(e){return{$$typeof:Tk,_payload:{_status:-1,_result:e},_init:Ok}};Ae.memo=function(e,t){return{$$typeof:Pk,type:e,compare:t===void 0?null:t}};Ae.startTransition=function(e){var t=Tc.transition;Tc.transition={};try{e()}finally{Tc.transition=t}};Ae.unstable_act=Dx;Ae.useCallback=function(e,t){return Gt.current.useCallback(e,t)};Ae.useContext=function(e){return Gt.current.useContext(e)};Ae.useDebugValue=function(){};Ae.useDeferredValue=function(e){return Gt.current.useDeferredValue(e)};Ae.useEffect=function(e,t){return Gt.current.useEffect(e,t)};Ae.useId=function(){return Gt.current.useId()};Ae.useImperativeHandle=function(e,t,r){return Gt.current.useImperativeHandle(e,t,r)};Ae.useInsertionEffect=function(e,t){return Gt.current.useInsertionEffect(e,t)};Ae.useLayoutEffect=function(e,t){return Gt.current.useLayoutEffect(e,t)};Ae.useMemo=function(e,t){return Gt.current.useMemo(e,t)};Ae.useReducer=function(e,t,r){return Gt.current.useReducer(e,t,r)};Ae.useRef=function(e){return Gt.current.useRef(e)};Ae.useState=function(e){return Gt.current.useState(e)};Ae.useSyncExternalStore=function(e,t,r){return Gt.current.useSyncExternalStore(e,t,r)};Ae.useTransition=function(){return Gt.current.useTransition()};Ae.version="18.3.1";kx.exports=Ae;var C=kx.exports;const Q=Sx(C),zu=bk({__proto__:null,default:Q},[C]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ik=C,Bk=Symbol.for("react.element"),Fk=Symbol.for("react.fragment"),$k=Object.prototype.hasOwnProperty,Hk=Ik.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zk={key:!0,ref:!0,__self:!0,__source:!0};function Lx(e,t,r){var n,s={},i=null,l=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)$k.call(t,n)&&!zk.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:Bk,type:e,key:i,ref:l,props:s,_owner:Hk.current}}Hu.Fragment=Fk;Hu.jsx=Lx;Hu.jsxs=Lx;Cx.exports=Hu;var a=Cx.exports,Nh={},Ox={exports:{}},wr={},Mx={exports:{}},Ix={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,P){var D=R.length;R.push(P);e:for(;0<D;){var M=D-1>>>1,B=R[M];if(0<s(B,P))R[M]=P,R[D]=B,D=M;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var P=R[0],D=R.pop();if(D!==P){R[0]=D;e:for(var M=0,B=R.length,q=B>>>1;M<q;){var Z=2*(M+1)-1,ee=R[Z],J=Z+1,A=R[J];if(0>s(ee,D))J<B&&0>s(A,ee)?(R[M]=A,R[J]=D,M=J):(R[M]=ee,R[Z]=D,M=Z);else if(J<B&&0>s(A,D))R[M]=A,R[J]=D,M=J;else break e}}return P}function s(R,P){var D=R.sortIndex-P.sortIndex;return D!==0?D:R.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var c=[],u=[],g=1,d=null,v=3,_=!1,b=!1,x=!1,f=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(R){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=R)n(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=r(u)}}function y(R){if(x=!1,m(R),!b)if(r(c)!==null)b=!0,U(w);else{var P=r(u);P!==null&&K(y,P.startTime-R)}}function w(R,P){b=!1,x&&(x=!1,p(S),S=-1),_=!0;var D=v;try{for(m(P),d=r(c);d!==null&&(!(d.expirationTime>P)||R&&!O());){var M=d.callback;if(typeof M=="function"){d.callback=null,v=d.priorityLevel;var B=M(d.expirationTime<=P);P=e.unstable_now(),typeof B=="function"?d.callback=B:d===r(c)&&n(c),m(P)}else n(c);d=r(c)}if(d!==null)var q=!0;else{var Z=r(u);Z!==null&&K(y,Z.startTime-P),q=!1}return q}finally{d=null,v=D,_=!1}}var k=!1,j=null,S=-1,E=5,N=-1;function O(){return!(e.unstable_now()-N<E)}function T(){if(j!==null){var R=e.unstable_now();N=R;var P=!0;try{P=j(!0,R)}finally{P?L():(k=!1,j=null)}}else k=!1}var L;if(typeof h=="function")L=function(){h(T)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,W=$.port2;$.port1.onmessage=T,L=function(){W.postMessage(null)}}else L=function(){f(T,0)};function U(R){j=R,k||(k=!0,L())}function K(R,P){S=f(function(){R(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){b||_||(b=!0,U(w))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(R){switch(v){case 1:case 2:case 3:var P=3;break;default:P=v}var D=v;v=P;try{return R()}finally{v=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,P){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var D=v;v=R;try{return P()}finally{v=D}},e.unstable_scheduleCallback=function(R,P,D){var M=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?M+D:M):D=M,R){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=D+B,R={id:g++,callback:P,priorityLevel:R,startTime:D,expirationTime:B,sortIndex:-1},D>M?(R.sortIndex=D,t(u,R),r(c)===null&&R===r(u)&&(x?(p(S),S=-1):x=!0,K(y,D-M))):(R.sortIndex=B,t(c,R),b||_||(b=!0,U(w))),R},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(R){var P=v;return function(){var D=v;v=P;try{return R.apply(this,arguments)}finally{v=D}}}})(Ix);Mx.exports=Ix;var Uk=Mx.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Wk=C,xr=Uk;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Bx=new Set,tl={};function Li(e,t){Bo(e,t),Bo(e+"Capture",t)}function Bo(e,t){for(tl[e]=t,e=0;e<t.length;e++)Bx.add(t[e])}var Yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ph=Object.prototype.hasOwnProperty,Vk=/^[: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]*$/,Hg={},zg={};function qk(e){return Ph.call(zg,e)?!0:Ph.call(Hg,e)?!1:Vk.test(e)?zg[e]=!0:(Hg[e]=!0,!1)}function Kk(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gk(e,t,r,n){if(t===null||typeof t>"u"||Kk(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Yt(e,t,r,n,s,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new Yt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new Yt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new Yt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new Yt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Tt[e]=new Yt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new Yt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new Yt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new Yt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new Yt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sp=/[\-:]([a-z])/g;function Cp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Sp,Cp);Tt[t]=new Yt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Sp,Cp);Tt[t]=new Yt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Sp,Cp);Tt[t]=new Yt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tt[e]=new Yt(e,1,!1,e.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Yt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tt[e]=new Yt(e,1,!1,e.toLowerCase(),null,!0,!0)});function kp(e,t,r,n){var s=Tt.hasOwnProperty(t)?Tt[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Gk(t,r,s,n)&&(r=null),n||s===null?qk(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ns=Wk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Jl=Symbol.for("react.element"),eo=Symbol.for("react.portal"),to=Symbol.for("react.fragment"),Ep=Symbol.for("react.strict_mode"),Th=Symbol.for("react.profiler"),Fx=Symbol.for("react.provider"),$x=Symbol.for("react.context"),jp=Symbol.for("react.forward_ref"),Ah=Symbol.for("react.suspense"),Dh=Symbol.for("react.suspense_list"),Rp=Symbol.for("react.memo"),ps=Symbol.for("react.lazy"),Hx=Symbol.for("react.offscreen"),Ug=Symbol.iterator;function _a(e){return e===null||typeof e!="object"?null:(e=Ug&&e[Ug]||e["@@iterator"],typeof e=="function"?e:null)}var it=Object.assign,Pd;function Oa(e){if(Pd===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Pd=t&&t[1]||""}return`
|
|
34
|
+
`+Pd+e}var Td=!1;function Ad(e,t){if(!e||Td)return"";Td=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
|
|
35
|
+
`),i=n.stack.split(`
|
|
36
|
+
`),l=s.length-1,o=i.length-1;1<=l&&0<=o&&s[l]!==i[o];)o--;for(;1<=l&&0<=o;l--,o--)if(s[l]!==i[o]){if(l!==1||o!==1)do if(l--,o--,0>o||s[l]!==i[o]){var c=`
|
|
37
|
+
`+s[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=o);break}}}finally{Td=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Oa(e):""}function Yk(e){switch(e.tag){case 5:return Oa(e.type);case 16:return Oa("Lazy");case 13:return Oa("Suspense");case 19:return Oa("SuspenseList");case 0:case 2:case 15:return e=Ad(e.type,!1),e;case 11:return e=Ad(e.type.render,!1),e;case 1:return e=Ad(e.type,!0),e;default:return""}}function Lh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case to:return"Fragment";case eo:return"Portal";case Th:return"Profiler";case Ep:return"StrictMode";case Ah:return"Suspense";case Dh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $x:return(e.displayName||"Context")+".Consumer";case Fx:return(e._context.displayName||"Context")+".Provider";case jp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rp:return t=e.displayName||null,t!==null?t:Lh(e.type)||"Memo";case ps:t=e._payload,e=e._init;try{return Lh(e(t))}catch{}}return null}function Qk(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lh(t);case 8:return t===Ep?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ws(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zk(e){var t=zx(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ec(e){e._valueTracker||(e._valueTracker=Zk(e))}function Ux(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zx(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Kc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oh(e,t){var r=t.checked;return it({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Wg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ws(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Wx(e,t){t=t.checked,t!=null&&kp(e,"checked",t,!1)}function Mh(e,t){Wx(e,t);var r=Ws(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ih(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ih(e,t.type,Ws(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Ih(e,t,r){(t!=="number"||Kc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ma=Array.isArray;function po(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=""+Ws(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 Bh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return it({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qg(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ne(92));if(Ma(r)){if(1<r.length)throw Error(ne(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ws(r)}}function Vx(e,t){var r=Ws(t.value),n=Ws(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Kg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function qx(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Fh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?qx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var tc,Kx=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(tc=tc||document.createElement("div"),tc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=tc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ua={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xk=["Webkit","ms","Moz","O"];Object.keys(Ua).forEach(function(e){Xk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ua[t]=Ua[e]})});function Gx(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ua.hasOwnProperty(e)&&Ua[e]?(""+t).trim():t+"px"}function Yx(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Gx(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var Jk=it({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $h(e,t){if(t){if(Jk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function Hh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zh=null;function Np(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uh=null,mo=null,go=null;function Gg(e){if(e=Ol(e)){if(typeof Uh!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=Ku(t),Uh(e.stateNode,e.type,t))}}function Qx(e){mo?go?go.push(e):go=[e]:mo=e}function Zx(){if(mo){var e=mo,t=go;if(go=mo=null,Gg(e),t)for(e=0;e<t.length;e++)Gg(t[e])}}function Xx(e,t){return e(t)}function Jx(){}var Dd=!1;function e0(e,t,r){if(Dd)return e(t,r);Dd=!0;try{return Xx(e,t,r)}finally{Dd=!1,(mo!==null||go!==null)&&(Jx(),Zx())}}function nl(e,t){var r=e.stateNode;if(r===null)return null;var n=Ku(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ne(231,t,typeof r));return r}var Wh=!1;if(Yn)try{var ya={};Object.defineProperty(ya,"passive",{get:function(){Wh=!0}}),window.addEventListener("test",ya,ya),window.removeEventListener("test",ya,ya)}catch{Wh=!1}function eE(e,t,r,n,s,i,l,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(g){this.onError(g)}}var Wa=!1,Gc=null,Yc=!1,Vh=null,tE={onError:function(e){Wa=!0,Gc=e}};function rE(e,t,r,n,s,i,l,o,c){Wa=!1,Gc=null,eE.apply(tE,arguments)}function nE(e,t,r,n,s,i,l,o,c){if(rE.apply(this,arguments),Wa){if(Wa){var u=Gc;Wa=!1,Gc=null}else throw Error(ne(198));Yc||(Yc=!0,Vh=u)}}function Oi(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 t0(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 Yg(e){if(Oi(e)!==e)throw Error(ne(188))}function sE(e){var t=e.alternate;if(!t){if(t=Oi(e),t===null)throw Error(ne(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 Yg(s),e;if(i===n)return Yg(s),t;i=i.sibling}throw Error(ne(188))}if(r.return!==n.return)r=s,n=i;else{for(var l=!1,o=s.child;o;){if(o===r){l=!0,r=s,n=i;break}if(o===n){l=!0,n=s,r=i;break}o=o.sibling}if(!l){for(o=i.child;o;){if(o===r){l=!0,r=i,n=s;break}if(o===n){l=!0,n=i,r=s;break}o=o.sibling}if(!l)throw Error(ne(189))}}if(r.alternate!==n)throw Error(ne(190))}if(r.tag!==3)throw Error(ne(188));return r.stateNode.current===r?e:t}function r0(e){return e=sE(e),e!==null?n0(e):null}function n0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=n0(e);if(t!==null)return t;e=e.sibling}return null}var s0=xr.unstable_scheduleCallback,Qg=xr.unstable_cancelCallback,iE=xr.unstable_shouldYield,oE=xr.unstable_requestPaint,ft=xr.unstable_now,aE=xr.unstable_getCurrentPriorityLevel,Pp=xr.unstable_ImmediatePriority,i0=xr.unstable_UserBlockingPriority,Qc=xr.unstable_NormalPriority,lE=xr.unstable_LowPriority,o0=xr.unstable_IdlePriority,Uu=null,bn=null;function cE(e){if(bn&&typeof bn.onCommitFiberRoot=="function")try{bn.onCommitFiberRoot(Uu,e,void 0,(e.current.flags&128)===128)}catch{}}var tn=Math.clz32?Math.clz32:hE,uE=Math.log,dE=Math.LN2;function hE(e){return e>>>=0,e===0?32:31-(uE(e)/dE|0)|0}var rc=64,nc=4194304;function Ia(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Zc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,l=r&268435455;if(l!==0){var o=l&~s;o!==0?n=Ia(o):(i&=l,i!==0&&(n=Ia(i)))}else l=r&~s,l!==0?n=Ia(l):i!==0&&(n=Ia(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-tn(t),s=1<<r,n|=e[r],t&=~s;return n}function fE(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pE(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-tn(i),o=1<<l,c=s[l];c===-1?(!(o&r)||o&n)&&(s[l]=fE(o,t)):c<=t&&(e.expiredLanes|=o),i&=~o}}function qh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function a0(){var e=rc;return rc<<=1,!(rc&4194240)&&(rc=64),e}function Ld(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Dl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tn(t),e[t]=r}function mE(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-tn(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function Tp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-tn(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var ze=0;function l0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var c0,Ap,u0,d0,h0,Kh=!1,sc=[],Ds=null,Ls=null,Os=null,sl=new Map,il=new Map,_s=[],gE="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zg(e,t){switch(e){case"focusin":case"focusout":Ds=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":sl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":il.delete(t.pointerId)}}function xa(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=Ol(t),t!==null&&Ap(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function vE(e,t,r,n,s){switch(t){case"focusin":return Ds=xa(Ds,e,t,r,n,s),!0;case"dragenter":return Ls=xa(Ls,e,t,r,n,s),!0;case"mouseover":return Os=xa(Os,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return sl.set(i,xa(sl.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,il.set(i,xa(il.get(i)||null,e,t,r,n,s)),!0}return!1}function f0(e){var t=oi(e.target);if(t!==null){var r=Oi(t);if(r!==null){if(t=r.tag,t===13){if(t=t0(r),t!==null){e.blockedOn=t,h0(e.priority,function(){u0(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 Ac(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Gh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);zh=n,r.target.dispatchEvent(n),zh=null}else return t=Ol(r),t!==null&&Ap(t),e.blockedOn=r,!1;t.shift()}return!0}function Xg(e,t,r){Ac(e)&&r.delete(t)}function _E(){Kh=!1,Ds!==null&&Ac(Ds)&&(Ds=null),Ls!==null&&Ac(Ls)&&(Ls=null),Os!==null&&Ac(Os)&&(Os=null),sl.forEach(Xg),il.forEach(Xg)}function ba(e,t){e.blockedOn===t&&(e.blockedOn=null,Kh||(Kh=!0,xr.unstable_scheduleCallback(xr.unstable_NormalPriority,_E)))}function ol(e){function t(s){return ba(s,e)}if(0<sc.length){ba(sc[0],e);for(var r=1;r<sc.length;r++){var n=sc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ds!==null&&ba(Ds,e),Ls!==null&&ba(Ls,e),Os!==null&&ba(Os,e),sl.forEach(t),il.forEach(t),r=0;r<_s.length;r++)n=_s[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<_s.length&&(r=_s[0],r.blockedOn===null);)f0(r),r.blockedOn===null&&_s.shift()}var vo=ns.ReactCurrentBatchConfig,Xc=!0;function yE(e,t,r,n){var s=ze,i=vo.transition;vo.transition=null;try{ze=1,Dp(e,t,r,n)}finally{ze=s,vo.transition=i}}function xE(e,t,r,n){var s=ze,i=vo.transition;vo.transition=null;try{ze=4,Dp(e,t,r,n)}finally{ze=s,vo.transition=i}}function Dp(e,t,r,n){if(Xc){var s=Gh(e,t,r,n);if(s===null)Wd(e,t,n,Jc,r),Zg(e,n);else if(vE(s,e,t,r,n))n.stopPropagation();else if(Zg(e,n),t&4&&-1<gE.indexOf(e)){for(;s!==null;){var i=Ol(s);if(i!==null&&c0(i),i=Gh(e,t,r,n),i===null&&Wd(e,t,n,Jc,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else Wd(e,t,n,null,r)}}var Jc=null;function Gh(e,t,r,n){if(Jc=null,e=Np(n),e=oi(e),e!==null)if(t=Oi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=t0(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 Jc=e,null}function p0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(aE()){case Pp:return 1;case i0:return 4;case Qc:case lE:return 16;case o0:return 536870912;default:return 16}default:return 16}}var Ns=null,Lp=null,Dc=null;function m0(){if(Dc)return Dc;var e,t=Lp,r=t.length,n,s="value"in Ns?Ns.value:Ns.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 Dc=s.slice(e,1<n?1-n:void 0)}function Lc(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 ic(){return!0}function Jg(){return!1}function Sr(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 o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ic:Jg,this.isPropagationStopped=Jg,this}return it(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=ic)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),t}var ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Op=Sr(ra),Ll=it({},ra,{view:0,detail:0}),bE=Sr(Ll),Od,Md,wa,Wu=it({},Ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mp,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!==wa&&(wa&&e.type==="mousemove"?(Od=e.screenX-wa.screenX,Md=e.screenY-wa.screenY):Md=Od=0,wa=e),Od)},movementY:function(e){return"movementY"in e?e.movementY:Md}}),ev=Sr(Wu),wE=it({},Wu,{dataTransfer:0}),SE=Sr(wE),CE=it({},Ll,{relatedTarget:0}),Id=Sr(CE),kE=it({},ra,{animationName:0,elapsedTime:0,pseudoElement:0}),EE=Sr(kE),jE=it({},ra,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),RE=Sr(jE),NE=it({},ra,{data:0}),tv=Sr(NE),PE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TE={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"},AE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=AE[e])?!!t[e]:!1}function Mp(){return DE}var LE=it({},Ll,{key:function(e){if(e.key){var t=PE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?TE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mp,charCode:function(e){return e.type==="keypress"?Lc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),OE=Sr(LE),ME=it({},Wu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rv=Sr(ME),IE=it({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mp}),BE=Sr(IE),FE=it({},ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),$E=Sr(FE),HE=it({},Wu,{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}),zE=Sr(HE),UE=[9,13,27,32],Ip=Yn&&"CompositionEvent"in window,Va=null;Yn&&"documentMode"in document&&(Va=document.documentMode);var WE=Yn&&"TextEvent"in window&&!Va,g0=Yn&&(!Ip||Va&&8<Va&&11>=Va),nv=" ",sv=!1;function v0(e,t){switch(e){case"keyup":return UE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ro=!1;function VE(e,t){switch(e){case"compositionend":return _0(t);case"keypress":return t.which!==32?null:(sv=!0,nv);case"textInput":return e=t.data,e===nv&&sv?null:e;default:return null}}function qE(e,t){if(ro)return e==="compositionend"||!Ip&&v0(e,t)?(e=m0(),Dc=Lp=Ns=null,ro=!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 g0&&t.locale!=="ko"?null:t.data;default:return null}}var KE={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 iv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!KE[e.type]:t==="textarea"}function y0(e,t,r,n){Qx(n),t=eu(t,"onChange"),0<t.length&&(r=new Op("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qa=null,al=null;function GE(e){P0(e,0)}function Vu(e){var t=io(e);if(Ux(t))return e}function YE(e,t){if(e==="change")return t}var x0=!1;if(Yn){var Bd;if(Yn){var Fd="oninput"in document;if(!Fd){var ov=document.createElement("div");ov.setAttribute("oninput","return;"),Fd=typeof ov.oninput=="function"}Bd=Fd}else Bd=!1;x0=Bd&&(!document.documentMode||9<document.documentMode)}function av(){qa&&(qa.detachEvent("onpropertychange",b0),al=qa=null)}function b0(e){if(e.propertyName==="value"&&Vu(al)){var t=[];y0(t,al,e,Np(e)),e0(GE,t)}}function QE(e,t,r){e==="focusin"?(av(),qa=t,al=r,qa.attachEvent("onpropertychange",b0)):e==="focusout"&&av()}function ZE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vu(al)}function XE(e,t){if(e==="click")return Vu(t)}function JE(e,t){if(e==="input"||e==="change")return Vu(t)}function ej(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var on=typeof Object.is=="function"?Object.is:ej;function ll(e,t){if(on(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(!Ph.call(t,s)||!on(e[s],t[s]))return!1}return!0}function lv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cv(e,t){var r=lv(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=lv(r)}}function w0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?w0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function S0(){for(var e=window,t=Kc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Kc(e.document)}return t}function Bp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function tj(e){var t=S0(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&w0(r.ownerDocument.documentElement,r)){if(n!==null&&Bp(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=cv(r,i);var l=cv(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rj=Yn&&"documentMode"in document&&11>=document.documentMode,no=null,Yh=null,Ka=null,Qh=!1;function uv(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Qh||no==null||no!==Kc(n)||(n=no,"selectionStart"in n&&Bp(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}),Ka&&ll(Ka,n)||(Ka=n,n=eu(Yh,"onSelect"),0<n.length&&(t=new Op("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=no)))}function oc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var so={animationend:oc("Animation","AnimationEnd"),animationiteration:oc("Animation","AnimationIteration"),animationstart:oc("Animation","AnimationStart"),transitionend:oc("Transition","TransitionEnd")},$d={},C0={};Yn&&(C0=document.createElement("div").style,"AnimationEvent"in window||(delete so.animationend.animation,delete so.animationiteration.animation,delete so.animationstart.animation),"TransitionEvent"in window||delete so.transitionend.transition);function qu(e){if($d[e])return $d[e];if(!so[e])return e;var t=so[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in C0)return $d[e]=t[r];return e}var k0=qu("animationend"),E0=qu("animationiteration"),j0=qu("animationstart"),R0=qu("transitionend"),N0=new Map,dv="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Zs(e,t){N0.set(e,t),Li(t,[e])}for(var Hd=0;Hd<dv.length;Hd++){var zd=dv[Hd],nj=zd.toLowerCase(),sj=zd[0].toUpperCase()+zd.slice(1);Zs(nj,"on"+sj)}Zs(k0,"onAnimationEnd");Zs(E0,"onAnimationIteration");Zs(j0,"onAnimationStart");Zs("dblclick","onDoubleClick");Zs("focusin","onFocus");Zs("focusout","onBlur");Zs(R0,"onTransitionEnd");Bo("onMouseEnter",["mouseout","mouseover"]);Bo("onMouseLeave",["mouseout","mouseover"]);Bo("onPointerEnter",["pointerout","pointerover"]);Bo("onPointerLeave",["pointerout","pointerover"]);Li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Li("onBeforeInput",["compositionend","keypress","textInput","paste"]);Li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ba="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(" "),ij=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ba));function hv(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,nE(n,t,void 0,e),e.currentTarget=null}function P0(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 o=n[l],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==i&&s.isPropagationStopped())break e;hv(s,o,u),i=c}else for(l=0;l<n.length;l++){if(o=n[l],c=o.instance,u=o.currentTarget,o=o.listener,c!==i&&s.isPropagationStopped())break e;hv(s,o,u),i=c}}}if(Yc)throw e=Vh,Yc=!1,Vh=null,e}function Ge(e,t){var r=t[tf];r===void 0&&(r=t[tf]=new Set);var n=e+"__bubble";r.has(n)||(T0(t,e,2,!1),r.add(n))}function Ud(e,t,r){var n=0;t&&(n|=4),T0(r,e,n,t)}var ac="_reactListening"+Math.random().toString(36).slice(2);function cl(e){if(!e[ac]){e[ac]=!0,Bx.forEach(function(r){r!=="selectionchange"&&(ij.has(r)||Ud(r,!1,e),Ud(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ac]||(t[ac]=!0,Ud("selectionchange",!1,t))}}function T0(e,t,r,n){switch(p0(t)){case 1:var s=yE;break;case 4:s=xE;break;default:s=Dp}r=s.bind(null,t,r,e),s=void 0,!Wh||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 Wd(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 o=n.stateNode.containerInfo;if(o===s||o.nodeType===8&&o.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;l=l.return}for(;o!==null;){if(l=oi(o),l===null)return;if(c=l.tag,c===5||c===6){n=i=l;continue e}o=o.parentNode}}n=n.return}e0(function(){var u=i,g=Np(r),d=[];e:{var v=N0.get(e);if(v!==void 0){var _=Op,b=e;switch(e){case"keypress":if(Lc(r)===0)break e;case"keydown":case"keyup":_=OE;break;case"focusin":b="focus",_=Id;break;case"focusout":b="blur",_=Id;break;case"beforeblur":case"afterblur":_=Id;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":_=ev;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=SE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=BE;break;case k0:case E0:case j0:_=EE;break;case R0:_=$E;break;case"scroll":_=bE;break;case"wheel":_=zE;break;case"copy":case"cut":case"paste":_=RE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=rv}var x=(t&4)!==0,f=!x&&e==="scroll",p=x?v!==null?v+"Capture":null:v;x=[];for(var h=u,m;h!==null;){m=h;var y=m.stateNode;if(m.tag===5&&y!==null&&(m=y,p!==null&&(y=nl(h,p),y!=null&&x.push(ul(h,y,m)))),f)break;h=h.return}0<x.length&&(v=new _(v,b,null,r,g),d.push({event:v,listeners:x}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",v&&r!==zh&&(b=r.relatedTarget||r.fromElement)&&(oi(b)||b[Qn]))break e;if((_||v)&&(v=g.window===g?g:(v=g.ownerDocument)?v.defaultView||v.parentWindow:window,_?(b=r.relatedTarget||r.toElement,_=u,b=b?oi(b):null,b!==null&&(f=Oi(b),b!==f||b.tag!==5&&b.tag!==6)&&(b=null)):(_=null,b=u),_!==b)){if(x=ev,y="onMouseLeave",p="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(x=rv,y="onPointerLeave",p="onPointerEnter",h="pointer"),f=_==null?v:io(_),m=b==null?v:io(b),v=new x(y,h+"leave",_,r,g),v.target=f,v.relatedTarget=m,y=null,oi(g)===u&&(x=new x(p,h+"enter",b,r,g),x.target=m,x.relatedTarget=f,y=x),f=y,_&&b)t:{for(x=_,p=b,h=0,m=x;m;m=zi(m))h++;for(m=0,y=p;y;y=zi(y))m++;for(;0<h-m;)x=zi(x),h--;for(;0<m-h;)p=zi(p),m--;for(;h--;){if(x===p||p!==null&&x===p.alternate)break t;x=zi(x),p=zi(p)}x=null}else x=null;_!==null&&fv(d,v,_,x,!1),b!==null&&f!==null&&fv(d,f,b,x,!0)}}e:{if(v=u?io(u):window,_=v.nodeName&&v.nodeName.toLowerCase(),_==="select"||_==="input"&&v.type==="file")var w=YE;else if(iv(v))if(x0)w=JE;else{w=ZE;var k=QE}else(_=v.nodeName)&&_.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(w=XE);if(w&&(w=w(e,u))){y0(d,w,r,g);break e}k&&k(e,v,u),e==="focusout"&&(k=v._wrapperState)&&k.controlled&&v.type==="number"&&Ih(v,"number",v.value)}switch(k=u?io(u):window,e){case"focusin":(iv(k)||k.contentEditable==="true")&&(no=k,Yh=u,Ka=null);break;case"focusout":Ka=Yh=no=null;break;case"mousedown":Qh=!0;break;case"contextmenu":case"mouseup":case"dragend":Qh=!1,uv(d,r,g);break;case"selectionchange":if(rj)break;case"keydown":case"keyup":uv(d,r,g)}var j;if(Ip)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else ro?v0(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(g0&&r.locale!=="ko"&&(ro||S!=="onCompositionStart"?S==="onCompositionEnd"&&ro&&(j=m0()):(Ns=g,Lp="value"in Ns?Ns.value:Ns.textContent,ro=!0)),k=eu(u,S),0<k.length&&(S=new tv(S,e,null,r,g),d.push({event:S,listeners:k}),j?S.data=j:(j=_0(r),j!==null&&(S.data=j)))),(j=WE?VE(e,r):qE(e,r))&&(u=eu(u,"onBeforeInput"),0<u.length&&(g=new tv("onBeforeInput","beforeinput",null,r,g),d.push({event:g,listeners:u}),g.data=j))}P0(d,t)})}function ul(e,t,r){return{instance:e,listener:t,currentTarget:r}}function eu(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=nl(e,r),i!=null&&n.unshift(ul(e,i,s)),i=nl(e,t),i!=null&&n.push(ul(e,i,s))),e=e.return}return n}function zi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fv(e,t,r,n,s){for(var i=t._reactName,l=[];r!==null&&r!==n;){var o=r,c=o.alternate,u=o.stateNode;if(c!==null&&c===n)break;o.tag===5&&u!==null&&(o=u,s?(c=nl(r,i),c!=null&&l.unshift(ul(r,c,o))):s||(c=nl(r,i),c!=null&&l.push(ul(r,c,o)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var oj=/\r\n?/g,aj=/\u0000|\uFFFD/g;function pv(e){return(typeof e=="string"?e:""+e).replace(oj,`
|
|
38
|
+
`).replace(aj,"")}function lc(e,t,r){if(t=pv(t),pv(e)!==t&&r)throw Error(ne(425))}function tu(){}var Zh=null,Xh=null;function Jh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ef=typeof setTimeout=="function"?setTimeout:void 0,lj=typeof clearTimeout=="function"?clearTimeout:void 0,mv=typeof Promise=="function"?Promise:void 0,cj=typeof queueMicrotask=="function"?queueMicrotask:typeof mv<"u"?function(e){return mv.resolve(null).then(e).catch(uj)}:ef;function uj(e){setTimeout(function(){throw e})}function Vd(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),ol(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);ol(t)}function Ms(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function gv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var na=Math.random().toString(36).slice(2),_n="__reactFiber$"+na,dl="__reactProps$"+na,Qn="__reactContainer$"+na,tf="__reactEvents$"+na,dj="__reactListeners$"+na,hj="__reactHandles$"+na;function oi(e){var t=e[_n];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Qn]||r[_n]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=gv(e);e!==null;){if(r=e[_n])return r;e=gv(e)}return t}e=r,r=e.parentNode}return null}function Ol(e){return e=e[_n]||e[Qn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function io(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function Ku(e){return e[dl]||null}var rf=[],oo=-1;function Xs(e){return{current:e}}function Qe(e){0>oo||(e.current=rf[oo],rf[oo]=null,oo--)}function Ve(e,t){oo++,rf[oo]=e.current,e.current=t}var Vs={},$t=Xs(Vs),nr=Xs(!1),ki=Vs;function Fo(e,t){var r=e.type.contextTypes;if(!r)return Vs;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function sr(e){return e=e.childContextTypes,e!=null}function ru(){Qe(nr),Qe($t)}function vv(e,t,r){if($t.current!==Vs)throw Error(ne(168));Ve($t,t),Ve(nr,r)}function A0(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ne(108,Qk(e)||"Unknown",s));return it({},r,n)}function nu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vs,ki=$t.current,Ve($t,e),Ve(nr,nr.current),!0}function _v(e,t,r){var n=e.stateNode;if(!n)throw Error(ne(169));r?(e=A0(e,t,ki),n.__reactInternalMemoizedMergedChildContext=e,Qe(nr),Qe($t),Ve($t,e)):Qe(nr),Ve(nr,r)}var Fn=null,Gu=!1,qd=!1;function D0(e){Fn===null?Fn=[e]:Fn.push(e)}function fj(e){Gu=!0,D0(e)}function Js(){if(!qd&&Fn!==null){qd=!0;var e=0,t=ze;try{var r=Fn;for(ze=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Fn=null,Gu=!1}catch(s){throw Fn!==null&&(Fn=Fn.slice(e+1)),s0(Pp,Js),s}finally{ze=t,qd=!1}}return null}var ao=[],lo=0,su=null,iu=0,kr=[],Er=0,Ei=null,Wn=1,Vn="";function si(e,t){ao[lo++]=iu,ao[lo++]=su,su=e,iu=t}function L0(e,t,r){kr[Er++]=Wn,kr[Er++]=Vn,kr[Er++]=Ei,Ei=e;var n=Wn;e=Vn;var s=32-tn(n)-1;n&=~(1<<s),r+=1;var i=32-tn(t)+s;if(30<i){var l=s-s%5;i=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Wn=1<<32-tn(t)+s|r<<s|n,Vn=i+e}else Wn=1<<i|r<<s|n,Vn=e}function Fp(e){e.return!==null&&(si(e,1),L0(e,1,0))}function $p(e){for(;e===su;)su=ao[--lo],ao[lo]=null,iu=ao[--lo],ao[lo]=null;for(;e===Ei;)Ei=kr[--Er],kr[Er]=null,Vn=kr[--Er],kr[Er]=null,Wn=kr[--Er],kr[Er]=null}var vr=null,gr=null,Xe=!1,Xr=null;function O0(e,t){var r=Tr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function yv(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,vr=e,gr=Ms(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,vr=e,gr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ei!==null?{id:Wn,overflow:Vn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Tr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,vr=e,gr=null,!0):!1;default:return!1}}function nf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sf(e){if(Xe){var t=gr;if(t){var r=t;if(!yv(e,t)){if(nf(e))throw Error(ne(418));t=Ms(r.nextSibling);var n=vr;t&&yv(e,t)?O0(n,r):(e.flags=e.flags&-4097|2,Xe=!1,vr=e)}}else{if(nf(e))throw Error(ne(418));e.flags=e.flags&-4097|2,Xe=!1,vr=e}}}function xv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;vr=e}function cc(e){if(e!==vr)return!1;if(!Xe)return xv(e),Xe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Jh(e.type,e.memoizedProps)),t&&(t=gr)){if(nf(e))throw M0(),Error(ne(418));for(;t;)O0(e,t),t=Ms(t.nextSibling)}if(xv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){gr=Ms(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}gr=null}}else gr=vr?Ms(e.stateNode.nextSibling):null;return!0}function M0(){for(var e=gr;e;)e=Ms(e.nextSibling)}function $o(){gr=vr=null,Xe=!1}function Hp(e){Xr===null?Xr=[e]:Xr.push(e)}var pj=ns.ReactCurrentBatchConfig;function Sa(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ne(309));var n=r.stateNode}if(!n)throw Error(ne(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var o=s.refs;l===null?delete o[i]:o[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(ne(284));if(!r._owner)throw Error(ne(290,e))}return e}function uc(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bv(e){var t=e._init;return t(e._payload)}function I0(e){function t(p,h){if(e){var m=p.deletions;m===null?(p.deletions=[h],p.flags|=16):m.push(h)}}function r(p,h){if(!e)return null;for(;h!==null;)t(p,h),h=h.sibling;return null}function n(p,h){for(p=new Map;h!==null;)h.key!==null?p.set(h.key,h):p.set(h.index,h),h=h.sibling;return p}function s(p,h){return p=$s(p,h),p.index=0,p.sibling=null,p}function i(p,h,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<h?(p.flags|=2,h):m):(p.flags|=2,h)):(p.flags|=1048576,h)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function o(p,h,m,y){return h===null||h.tag!==6?(h=Jd(m,p.mode,y),h.return=p,h):(h=s(h,m),h.return=p,h)}function c(p,h,m,y){var w=m.type;return w===to?g(p,h,m.props.children,y,m.key):h!==null&&(h.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ps&&bv(w)===h.type)?(y=s(h,m.props),y.ref=Sa(p,h,m),y.return=p,y):(y=Hc(m.type,m.key,m.props,null,p.mode,y),y.ref=Sa(p,h,m),y.return=p,y)}function u(p,h,m,y){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=eh(m,p.mode,y),h.return=p,h):(h=s(h,m.children||[]),h.return=p,h)}function g(p,h,m,y,w){return h===null||h.tag!==7?(h=Si(m,p.mode,y,w),h.return=p,h):(h=s(h,m),h.return=p,h)}function d(p,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Jd(""+h,p.mode,m),h.return=p,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Jl:return m=Hc(h.type,h.key,h.props,null,p.mode,m),m.ref=Sa(p,null,h),m.return=p,m;case eo:return h=eh(h,p.mode,m),h.return=p,h;case ps:var y=h._init;return d(p,y(h._payload),m)}if(Ma(h)||_a(h))return h=Si(h,p.mode,m,null),h.return=p,h;uc(p,h)}return null}function v(p,h,m,y){var w=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:o(p,h,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Jl:return m.key===w?c(p,h,m,y):null;case eo:return m.key===w?u(p,h,m,y):null;case ps:return w=m._init,v(p,h,w(m._payload),y)}if(Ma(m)||_a(m))return w!==null?null:g(p,h,m,y,null);uc(p,m)}return null}function _(p,h,m,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return p=p.get(m)||null,o(h,p,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Jl:return p=p.get(y.key===null?m:y.key)||null,c(h,p,y,w);case eo:return p=p.get(y.key===null?m:y.key)||null,u(h,p,y,w);case ps:var k=y._init;return _(p,h,m,k(y._payload),w)}if(Ma(y)||_a(y))return p=p.get(m)||null,g(h,p,y,w,null);uc(h,y)}return null}function b(p,h,m,y){for(var w=null,k=null,j=h,S=h=0,E=null;j!==null&&S<m.length;S++){j.index>S?(E=j,j=null):E=j.sibling;var N=v(p,j,m[S],y);if(N===null){j===null&&(j=E);break}e&&j&&N.alternate===null&&t(p,j),h=i(N,h,S),k===null?w=N:k.sibling=N,k=N,j=E}if(S===m.length)return r(p,j),Xe&&si(p,S),w;if(j===null){for(;S<m.length;S++)j=d(p,m[S],y),j!==null&&(h=i(j,h,S),k===null?w=j:k.sibling=j,k=j);return Xe&&si(p,S),w}for(j=n(p,j);S<m.length;S++)E=_(j,p,S,m[S],y),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?S:E.key),h=i(E,h,S),k===null?w=E:k.sibling=E,k=E);return e&&j.forEach(function(O){return t(p,O)}),Xe&&si(p,S),w}function x(p,h,m,y){var w=_a(m);if(typeof w!="function")throw Error(ne(150));if(m=w.call(m),m==null)throw Error(ne(151));for(var k=w=null,j=h,S=h=0,E=null,N=m.next();j!==null&&!N.done;S++,N=m.next()){j.index>S?(E=j,j=null):E=j.sibling;var O=v(p,j,N.value,y);if(O===null){j===null&&(j=E);break}e&&j&&O.alternate===null&&t(p,j),h=i(O,h,S),k===null?w=O:k.sibling=O,k=O,j=E}if(N.done)return r(p,j),Xe&&si(p,S),w;if(j===null){for(;!N.done;S++,N=m.next())N=d(p,N.value,y),N!==null&&(h=i(N,h,S),k===null?w=N:k.sibling=N,k=N);return Xe&&si(p,S),w}for(j=n(p,j);!N.done;S++,N=m.next())N=_(j,p,S,N.value,y),N!==null&&(e&&N.alternate!==null&&j.delete(N.key===null?S:N.key),h=i(N,h,S),k===null?w=N:k.sibling=N,k=N);return e&&j.forEach(function(T){return t(p,T)}),Xe&&si(p,S),w}function f(p,h,m,y){if(typeof m=="object"&&m!==null&&m.type===to&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Jl:e:{for(var w=m.key,k=h;k!==null;){if(k.key===w){if(w=m.type,w===to){if(k.tag===7){r(p,k.sibling),h=s(k,m.props.children),h.return=p,p=h;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===ps&&bv(w)===k.type){r(p,k.sibling),h=s(k,m.props),h.ref=Sa(p,k,m),h.return=p,p=h;break e}r(p,k);break}else t(p,k);k=k.sibling}m.type===to?(h=Si(m.props.children,p.mode,y,m.key),h.return=p,p=h):(y=Hc(m.type,m.key,m.props,null,p.mode,y),y.ref=Sa(p,h,m),y.return=p,p=y)}return l(p);case eo:e:{for(k=m.key;h!==null;){if(h.key===k)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){r(p,h.sibling),h=s(h,m.children||[]),h.return=p,p=h;break e}else{r(p,h);break}else t(p,h);h=h.sibling}h=eh(m,p.mode,y),h.return=p,p=h}return l(p);case ps:return k=m._init,f(p,h,k(m._payload),y)}if(Ma(m))return b(p,h,m,y);if(_a(m))return x(p,h,m,y);uc(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(r(p,h.sibling),h=s(h,m),h.return=p,p=h):(r(p,h),h=Jd(m,p.mode,y),h.return=p,p=h),l(p)):r(p,h)}return f}var Ho=I0(!0),B0=I0(!1),ou=Xs(null),au=null,co=null,zp=null;function Up(){zp=co=au=null}function Wp(e){var t=ou.current;Qe(ou),e._currentValue=t}function of(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 _o(e,t){au=e,zp=co=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rr=!0),e.firstContext=null)}function Mr(e){var t=e._currentValue;if(zp!==e)if(e={context:e,memoizedValue:t,next:null},co===null){if(au===null)throw Error(ne(308));co=e,au.dependencies={lanes:0,firstContext:e}}else co=co.next=e;return t}var ai=null;function Vp(e){ai===null?ai=[e]:ai.push(e)}function F0(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Vp(t)):(r.next=s.next,s.next=r),t.interleaved=r,Zn(e,n)}function Zn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ms=!1;function qp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Is(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Le&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Zn(e,r)}return s=n.interleaved,s===null?(t.next=t,Vp(n)):(t.next=s.next,s.next=t),n.interleaved=t,Zn(e,r)}function Oc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tp(e,r)}}function wv(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=l:i=i.next=l,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function lu(e,t,r,n){var s=e.updateQueue;ms=!1;var i=s.firstBaseUpdate,l=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,u=c.next;c.next=null,l===null?i=u:l.next=u,l=c;var g=e.alternate;g!==null&&(g=g.updateQueue,o=g.lastBaseUpdate,o!==l&&(o===null?g.firstBaseUpdate=u:o.next=u,g.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;l=0,g=u=c=null,o=i;do{var v=o.lane,_=o.eventTime;if((n&v)===v){g!==null&&(g=g.next={eventTime:_,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var b=e,x=o;switch(v=t,_=r,x.tag){case 1:if(b=x.payload,typeof b=="function"){d=b.call(_,d,v);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=x.payload,v=typeof b=="function"?b.call(_,d,v):b,v==null)break e;d=it({},d,v);break e;case 2:ms=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,v=s.effects,v===null?s.effects=[o]:v.push(o))}else _={eventTime:_,lane:v,tag:o.tag,payload:o.payload,callback:o.callback,next:null},g===null?(u=g=_,c=d):g=g.next=_,l|=v;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;v=o,o=v.next,v.next=null,s.lastBaseUpdate=v,s.shared.pending=null}}while(!0);if(g===null&&(c=d),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=g,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Ri|=l,e.lanes=l,e.memoizedState=d}}function Sv(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(ne(191,s));s.call(n)}}}var Ml={},wn=Xs(Ml),hl=Xs(Ml),fl=Xs(Ml);function li(e){if(e===Ml)throw Error(ne(174));return e}function Kp(e,t){switch(Ve(fl,t),Ve(hl,e),Ve(wn,Ml),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Fh(t,e)}Qe(wn),Ve(wn,t)}function zo(){Qe(wn),Qe(hl),Qe(fl)}function H0(e){li(fl.current);var t=li(wn.current),r=Fh(t,e.type);t!==r&&(Ve(hl,e),Ve(wn,r))}function Gp(e){hl.current===e&&(Qe(wn),Qe(hl))}var Je=Xs(0);function cu(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Kd=[];function Yp(){for(var e=0;e<Kd.length;e++)Kd[e]._workInProgressVersionPrimary=null;Kd.length=0}var Mc=ns.ReactCurrentDispatcher,Gd=ns.ReactCurrentBatchConfig,ji=0,st=null,bt=null,Et=null,uu=!1,Ga=!1,pl=0,mj=0;function At(){throw Error(ne(321))}function Qp(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!on(e[r],t[r]))return!1;return!0}function Zp(e,t,r,n,s,i){if(ji=i,st=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mc.current=e===null||e.memoizedState===null?yj:xj,e=r(n,s),Ga){i=0;do{if(Ga=!1,pl=0,25<=i)throw Error(ne(301));i+=1,Et=bt=null,t.updateQueue=null,Mc.current=bj,e=r(n,s)}while(Ga)}if(Mc.current=du,t=bt!==null&&bt.next!==null,ji=0,Et=bt=st=null,uu=!1,t)throw Error(ne(300));return e}function Xp(){var e=pl!==0;return pl=0,e}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?st.memoizedState=Et=e:Et=Et.next=e,Et}function Ir(){if(bt===null){var e=st.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Et===null?st.memoizedState:Et.next;if(t!==null)Et=t,bt=e;else{if(e===null)throw Error(ne(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Et===null?st.memoizedState=Et=e:Et=Et.next=e}return Et}function ml(e,t){return typeof t=="function"?t(e):t}function Yd(e){var t=Ir(),r=t.queue;if(r===null)throw Error(ne(311));r.lastRenderedReducer=e;var n=bt,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var l=s.next;s.next=i.next,i.next=l}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var o=l=null,c=null,u=i;do{var g=u.lane;if((ji&g)===g)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:g,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=d,l=n):c=c.next=d,st.lanes|=g,Ri|=g}u=u.next}while(u!==null&&u!==i);c===null?l=n:c.next=o,on(n,t.memoizedState)||(rr=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,st.lanes|=i,Ri|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Qd(e){var t=Ir(),r=t.queue;if(r===null)throw Error(ne(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);on(i,t.memoizedState)||(rr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function z0(){}function U0(e,t){var r=st,n=Ir(),s=t(),i=!on(n.memoizedState,s);if(i&&(n.memoizedState=s,rr=!0),n=n.queue,Jp(q0.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Et!==null&&Et.memoizedState.tag&1){if(r.flags|=2048,gl(9,V0.bind(null,r,n,s,t),void 0,null),jt===null)throw Error(ne(349));ji&30||W0(r,t,s)}return s}function W0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=st.updateQueue,t===null?(t={lastEffect:null,stores:null},st.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function V0(e,t,r,n){t.value=r,t.getSnapshot=n,K0(t)&&G0(e)}function q0(e,t,r){return r(function(){K0(t)&&G0(e)})}function K0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!on(e,r)}catch{return!0}}function G0(e){var t=Zn(e,1);t!==null&&rn(t,e,1,-1)}function Cv(e){var t=pn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ml,lastRenderedState:e},t.queue=e,e=e.dispatch=_j.bind(null,st,e),[t.memoizedState,e]}function gl(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=st.updateQueue,t===null?(t={lastEffect:null,stores:null},st.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Y0(){return Ir().memoizedState}function Ic(e,t,r,n){var s=pn();st.flags|=e,s.memoizedState=gl(1|t,r,void 0,n===void 0?null:n)}function Yu(e,t,r,n){var s=Ir();n=n===void 0?null:n;var i=void 0;if(bt!==null){var l=bt.memoizedState;if(i=l.destroy,n!==null&&Qp(n,l.deps)){s.memoizedState=gl(t,r,i,n);return}}st.flags|=e,s.memoizedState=gl(1|t,r,i,n)}function kv(e,t){return Ic(8390656,8,e,t)}function Jp(e,t){return Yu(2048,8,e,t)}function Q0(e,t){return Yu(4,2,e,t)}function Z0(e,t){return Yu(4,4,e,t)}function X0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function J0(e,t,r){return r=r!=null?r.concat([e]):null,Yu(4,4,X0.bind(null,t,e),r)}function em(){}function eb(e,t){var r=Ir();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Qp(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function tb(e,t){var r=Ir();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Qp(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function rb(e,t,r){return ji&21?(on(r,t)||(r=a0(),st.lanes|=r,Ri|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rr=!0),e.memoizedState=r)}function gj(e,t){var r=ze;ze=r!==0&&4>r?r:4,e(!0);var n=Gd.transition;Gd.transition={};try{e(!1),t()}finally{ze=r,Gd.transition=n}}function nb(){return Ir().memoizedState}function vj(e,t,r){var n=Fs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},sb(e))ib(t,r);else if(r=F0(e,t,r,n),r!==null){var s=Kt();rn(r,e,n,s),ob(r,t,n)}}function _j(e,t,r){var n=Fs(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(sb(e))ib(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,o=i(l,r);if(s.hasEagerState=!0,s.eagerState=o,on(o,l)){var c=t.interleaved;c===null?(s.next=s,Vp(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=F0(e,t,s,n),r!==null&&(s=Kt(),rn(r,e,n,s),ob(r,t,n))}}function sb(e){var t=e.alternate;return e===st||t!==null&&t===st}function ib(e,t){Ga=uu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ob(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Tp(e,r)}}var du={readContext:Mr,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},yj={readContext:Mr,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Mr,useEffect:kv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ic(4194308,4,X0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ic(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ic(4,2,e,t)},useMemo:function(e,t){var r=pn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=pn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=vj.bind(null,st,e),[n.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:Cv,useDebugValue:em,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=Cv(!1),t=e[0];return e=gj.bind(null,e[1]),pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=st,s=pn();if(Xe){if(r===void 0)throw Error(ne(407));r=r()}else{if(r=t(),jt===null)throw Error(ne(349));ji&30||W0(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,kv(q0.bind(null,n,i,e),[e]),n.flags|=2048,gl(9,V0.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=pn(),t=jt.identifierPrefix;if(Xe){var r=Vn,n=Wn;r=(n&~(1<<32-tn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=pl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=mj++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xj={readContext:Mr,useCallback:eb,useContext:Mr,useEffect:Jp,useImperativeHandle:J0,useInsertionEffect:Q0,useLayoutEffect:Z0,useMemo:tb,useReducer:Yd,useRef:Y0,useState:function(){return Yd(ml)},useDebugValue:em,useDeferredValue:function(e){var t=Ir();return rb(t,bt.memoizedState,e)},useTransition:function(){var e=Yd(ml)[0],t=Ir().memoizedState;return[e,t]},useMutableSource:z0,useSyncExternalStore:U0,useId:nb,unstable_isNewReconciler:!1},bj={readContext:Mr,useCallback:eb,useContext:Mr,useEffect:Jp,useImperativeHandle:J0,useInsertionEffect:Q0,useLayoutEffect:Z0,useMemo:tb,useReducer:Qd,useRef:Y0,useState:function(){return Qd(ml)},useDebugValue:em,useDeferredValue:function(e){var t=Ir();return bt===null?t.memoizedState=e:rb(t,bt.memoizedState,e)},useTransition:function(){var e=Qd(ml)[0],t=Ir().memoizedState;return[e,t]},useMutableSource:z0,useSyncExternalStore:U0,useId:nb,unstable_isNewReconciler:!1};function Yr(e,t){if(e&&e.defaultProps){t=it({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function af(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:it({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Qu={isMounted:function(e){return(e=e._reactInternals)?Oi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Kt(),s=Fs(e),i=qn(n,s);i.payload=t,r!=null&&(i.callback=r),t=Is(e,i,s),t!==null&&(rn(t,e,s,n),Oc(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Kt(),s=Fs(e),i=qn(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Is(e,i,s),t!==null&&(rn(t,e,s,n),Oc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Kt(),n=Fs(e),s=qn(r,n);s.tag=2,t!=null&&(s.callback=t),t=Is(e,s,n),t!==null&&(rn(t,e,n,r),Oc(t,e,n))}};function Ev(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?!ll(r,n)||!ll(s,i):!0}function ab(e,t,r){var n=!1,s=Vs,i=t.contextType;return typeof i=="object"&&i!==null?i=Mr(i):(s=sr(t)?ki:$t.current,n=t.contextTypes,i=(n=n!=null)?Fo(e,s):Vs),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qu,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function jv(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&&Qu.enqueueReplaceState(t,t.state,null)}function lf(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},qp(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Mr(i):(i=sr(t)?ki:$t.current,s.context=Fo(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(af(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Qu.enqueueReplaceState(s,s.state,null),lu(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Uo(e,t){try{var r="",n=t;do r+=Yk(n),n=n.return;while(n);var s=r}catch(i){s=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Zd(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function cf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var wj=typeof WeakMap=="function"?WeakMap:Map;function lb(e,t,r){r=qn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){fu||(fu=!0,yf=n),cf(e,t)},r}function cb(e,t,r){r=qn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){cf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){cf(e,t),typeof n!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function Rv(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new wj;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=Mj.bind(null,e,t,r),t.then(e,e))}function Nv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Pv(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=qn(-1,1),t.tag=2,Is(r,t,1))),r.lanes|=1),e)}var Sj=ns.ReactCurrentOwner,rr=!1;function Vt(e,t,r,n){t.child=e===null?B0(t,null,r,n):Ho(t,e.child,r,n)}function Tv(e,t,r,n,s){r=r.render;var i=t.ref;return _o(t,s),n=Zp(e,t,r,n,i,s),r=Xp(),e!==null&&!rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Xn(e,t,s)):(Xe&&r&&Fp(t),t.flags|=1,Vt(e,t,n,s),t.child)}function Av(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!lm(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,ub(e,t,i,n,s)):(e=Hc(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var l=i.memoizedProps;if(r=r.compare,r=r!==null?r:ll,r(l,n)&&e.ref===t.ref)return Xn(e,t,s)}return t.flags|=1,e=$s(i,n),e.ref=t.ref,e.return=t,t.child=e}function ub(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(ll(i,n)&&e.ref===t.ref)if(rr=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(rr=!0);else return t.lanes=e.lanes,Xn(e,t,s)}return uf(e,t,r,n,s)}function db(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ve(ho,ur),ur|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ve(ho,ur),ur|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ve(ho,ur),ur|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Ve(ho,ur),ur|=n;return Vt(e,t,s,r),t.child}function hb(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function uf(e,t,r,n,s){var i=sr(r)?ki:$t.current;return i=Fo(t,i),_o(t,s),r=Zp(e,t,r,n,i,s),n=Xp(),e!==null&&!rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Xn(e,t,s)):(Xe&&n&&Fp(t),t.flags|=1,Vt(e,t,r,s),t.child)}function Dv(e,t,r,n,s){if(sr(r)){var i=!0;nu(t)}else i=!1;if(_o(t,s),t.stateNode===null)Bc(e,t),ab(t,r,n),lf(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,o=t.memoizedProps;l.props=o;var c=l.context,u=r.contextType;typeof u=="object"&&u!==null?u=Mr(u):(u=sr(r)?ki:$t.current,u=Fo(t,u));var g=r.getDerivedStateFromProps,d=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==n||c!==u)&&jv(t,l,n,u),ms=!1;var v=t.memoizedState;l.state=v,lu(t,n,l,s),c=t.memoizedState,o!==n||v!==c||nr.current||ms?(typeof g=="function"&&(af(t,r,g,n),c=t.memoizedState),(o=ms||Ev(t,r,o,n,v,c,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),l.props=n,l.state=c,l.context=u,n=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,$0(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Yr(t.type,o),l.props=u,d=t.pendingProps,v=l.context,c=r.contextType,typeof c=="object"&&c!==null?c=Mr(c):(c=sr(r)?ki:$t.current,c=Fo(t,c));var _=r.getDerivedStateFromProps;(g=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o!==d||v!==c)&&jv(t,l,n,c),ms=!1,v=t.memoizedState,l.state=v,lu(t,n,l,s);var b=t.memoizedState;o!==d||v!==b||nr.current||ms?(typeof _=="function"&&(af(t,r,_,n),b=t.memoizedState),(u=ms||Ev(t,r,u,n,v,b,c)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,b,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,b,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=b),l.props=n,l.state=b,l.context=c,n=u):(typeof l.componentDidUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),n=!1)}return df(e,t,r,n,i,s)}function df(e,t,r,n,s,i){hb(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&_v(t,r,!1),Xn(e,t,i);n=t.stateNode,Sj.current=t;var o=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=Ho(t,e.child,null,i),t.child=Ho(t,null,o,i)):Vt(e,t,o,i),t.memoizedState=n.state,s&&_v(t,r,!0),t.child}function fb(e){var t=e.stateNode;t.pendingContext?vv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&vv(e,t.context,!1),Kp(e,t.containerInfo)}function Lv(e,t,r,n,s){return $o(),Hp(s),t.flags|=256,Vt(e,t,r,n),t.child}var hf={dehydrated:null,treeContext:null,retryLane:0};function ff(e){return{baseLanes:e,cachePool:null,transitions:null}}function pb(e,t,r){var n=t.pendingProps,s=Je.current,i=!1,l=(t.flags&128)!==0,o;if((o=l)||(o=e!==null&&e.memoizedState===null?!1:(s&2)!==0),o?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ve(Je,s&1),e===null)return sf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,i?(n=t.mode,i=t.child,l={mode:"hidden",children:l},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=Ju(l,n,0,null),e=Si(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ff(r),t.memoizedState=hf,e):tm(t,l));if(s=e.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return Cj(e,t,l,n,o,s,r);if(i){i=n.fallback,l=t.mode,s=e.child,o=s.sibling;var c={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=$s(s,c),n.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=$s(o,i):(i=Si(i,l,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,l=e.child.memoizedState,l=l===null?ff(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~r,t.memoizedState=hf,n}return i=e.child,e=i.sibling,n=$s(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function tm(e,t){return t=Ju({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function dc(e,t,r,n){return n!==null&&Hp(n),Ho(t,e.child,null,r),e=tm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cj(e,t,r,n,s,i,l){if(r)return t.flags&256?(t.flags&=-257,n=Zd(Error(ne(422))),dc(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=Ju({mode:"visible",children:n.children},s,0,null),i=Si(i,s,l,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Ho(t,e.child,null,l),t.child.memoizedState=ff(l),t.memoizedState=hf,i);if(!(t.mode&1))return dc(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var o=n.dgst;return n=o,i=Error(ne(419)),n=Zd(i,n,void 0),dc(e,t,l,n)}if(o=(l&e.childLanes)!==0,rr||o){if(n=jt,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Zn(e,s),rn(n,e,s,-1))}return am(),n=Zd(Error(ne(421))),dc(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Ij.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,gr=Ms(s.nextSibling),vr=t,Xe=!0,Xr=null,e!==null&&(kr[Er++]=Wn,kr[Er++]=Vn,kr[Er++]=Ei,Wn=e.id,Vn=e.overflow,Ei=t),t=tm(t,n.children),t.flags|=4096,t)}function Ov(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),of(e.return,t,r)}function Xd(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function mb(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(Vt(e,t,n.children,r),n=Je.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ov(e,r,t);else if(e.tag===19)Ov(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ve(Je,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&cu(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Xd(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&cu(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Xd(t,!0,r,null,i);break;case"together":Xd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ri|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,r=$s(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=$s(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function kj(e,t,r){switch(t.tag){case 3:fb(t),$o();break;case 5:H0(t);break;case 1:sr(t.type)&&nu(t);break;case 4:Kp(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Ve(ou,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ve(Je,Je.current&1),t.flags|=128,null):r&t.child.childLanes?pb(e,t,r):(Ve(Je,Je.current&1),e=Xn(e,t,r),e!==null?e.sibling:null);Ve(Je,Je.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return mb(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ve(Je,Je.current),n)break;return null;case 22:case 23:return t.lanes=0,db(e,t,r)}return Xn(e,t,r)}var gb,pf,vb,_b;gb=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};pf=function(){};vb=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,li(wn.current);var i=null;switch(r){case"input":s=Oh(e,s),n=Oh(e,n),i=[];break;case"select":s=it({},s,{value:void 0}),n=it({},n,{value:void 0}),i=[];break;case"textarea":s=Bh(e,s),n=Bh(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=tu)}$h(r,n);var l;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(l in o)o.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(tl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(o=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(l in o)!o.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in c)c.hasOwnProperty(l)&&o[l]!==c[l]&&(r||(r={}),r[l]=c[l])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(tl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ge("scroll",e),i||o===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};_b=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ca(e,t){if(!Xe)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 Dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Ej(e,t,r){var n=t.pendingProps;switch($p(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dt(t),null;case 1:return sr(t.type)&&ru(),Dt(t),null;case 3:return n=t.stateNode,zo(),Qe(nr),Qe($t),Yp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(cc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xr!==null&&(wf(Xr),Xr=null))),pf(e,t),Dt(t),null;case 5:Gp(t);var s=li(fl.current);if(r=t.type,e!==null&&t.stateNode!=null)vb(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ne(166));return Dt(t),null}if(e=li(wn.current),cc(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[_n]=t,n[dl]=i,e=(t.mode&1)!==0,r){case"dialog":Ge("cancel",n),Ge("close",n);break;case"iframe":case"object":case"embed":Ge("load",n);break;case"video":case"audio":for(s=0;s<Ba.length;s++)Ge(Ba[s],n);break;case"source":Ge("error",n);break;case"img":case"image":case"link":Ge("error",n),Ge("load",n);break;case"details":Ge("toggle",n);break;case"input":Wg(n,i),Ge("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Ge("invalid",n);break;case"textarea":qg(n,i),Ge("invalid",n)}$h(r,i),s=null;for(var l in i)if(i.hasOwnProperty(l)){var o=i[l];l==="children"?typeof o=="string"?n.textContent!==o&&(i.suppressHydrationWarning!==!0&&lc(n.textContent,o,e),s=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&lc(n.textContent,o,e),s=["children",""+o]):tl.hasOwnProperty(l)&&o!=null&&l==="onScroll"&&Ge("scroll",n)}switch(r){case"input":ec(n),Vg(n,i,!0);break;case"textarea":ec(n),Kg(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=tu)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=qx(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[_n]=t,e[dl]=n,gb(e,t,!1,!1),t.stateNode=e;e:{switch(l=Hh(r,n),r){case"dialog":Ge("cancel",e),Ge("close",e),s=n;break;case"iframe":case"object":case"embed":Ge("load",e),s=n;break;case"video":case"audio":for(s=0;s<Ba.length;s++)Ge(Ba[s],e);s=n;break;case"source":Ge("error",e),s=n;break;case"img":case"image":case"link":Ge("error",e),Ge("load",e),s=n;break;case"details":Ge("toggle",e),s=n;break;case"input":Wg(e,n),s=Oh(e,n),Ge("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=it({},n,{value:void 0}),Ge("invalid",e);break;case"textarea":qg(e,n),s=Bh(e,n),Ge("invalid",e);break;default:s=n}$h(r,s),o=s;for(i in o)if(o.hasOwnProperty(i)){var c=o[i];i==="style"?Yx(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Kx(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&rl(e,c):typeof c=="number"&&rl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(tl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Ge("scroll",e):c!=null&&kp(e,i,c,l))}switch(r){case"input":ec(e),Vg(e,n,!1);break;case"textarea":ec(e),Kg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Ws(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?po(e,!!n.multiple,i,!1):n.defaultValue!=null&&po(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=tu)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Dt(t),null;case 6:if(e&&t.stateNode!=null)_b(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ne(166));if(r=li(fl.current),li(wn.current),cc(t)){if(n=t.stateNode,r=t.memoizedProps,n[_n]=t,(i=n.nodeValue!==r)&&(e=vr,e!==null))switch(e.tag){case 3:lc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&lc(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[_n]=t,t.stateNode=n}return Dt(t),null;case 13:if(Qe(Je),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Xe&&gr!==null&&t.mode&1&&!(t.flags&128))M0(),$o(),t.flags|=98560,i=!1;else if(i=cc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(ne(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ne(317));i[_n]=t}else $o(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dt(t),i=!1}else Xr!==null&&(wf(Xr),Xr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Je.current&1?St===0&&(St=3):am())),t.updateQueue!==null&&(t.flags|=4),Dt(t),null);case 4:return zo(),pf(e,t),e===null&&cl(t.stateNode.containerInfo),Dt(t),null;case 10:return Wp(t.type._context),Dt(t),null;case 17:return sr(t.type)&&ru(),Dt(t),null;case 19:if(Qe(Je),i=t.memoizedState,i===null)return Dt(t),null;if(n=(t.flags&128)!==0,l=i.rendering,l===null)if(n)Ca(i,!1);else{if(St!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=cu(e),l!==null){for(t.flags|=128,Ca(i,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ve(Je,Je.current&1|2),t.child}e=e.sibling}i.tail!==null&&ft()>Wo&&(t.flags|=128,n=!0,Ca(i,!1),t.lanes=4194304)}else{if(!n)if(e=cu(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ca(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Xe)return Dt(t),null}else 2*ft()-i.renderingStartTime>Wo&&r!==1073741824&&(t.flags|=128,n=!0,Ca(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(r=i.last,r!==null?r.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ft(),t.sibling=null,r=Je.current,Ve(Je,n?r&1|2:r&1),t):(Dt(t),null);case 22:case 23:return om(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?ur&1073741824&&(Dt(t),t.subtreeFlags&6&&(t.flags|=8192)):Dt(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function jj(e,t){switch($p(t),t.tag){case 1:return sr(t.type)&&ru(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zo(),Qe(nr),Qe($t),Yp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gp(t),null;case 13:if(Qe(Je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));$o()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qe(Je),null;case 4:return zo(),null;case 10:return Wp(t.type._context),null;case 22:case 23:return om(),null;case 24:return null;default:return null}}var hc=!1,Mt=!1,Rj=typeof WeakSet=="function"?WeakSet:Set,fe=null;function uo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){lt(e,t,n)}else r.current=null}function mf(e,t,r){try{r()}catch(n){lt(e,t,n)}}var Mv=!1;function Nj(e,t){if(Zh=Xc,e=S0(),Bp(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,o=-1,c=-1,u=0,g=0,d=e,v=null;t:for(;;){for(var _;d!==r||s!==0&&d.nodeType!==3||(o=l+s),d!==i||n!==0&&d.nodeType!==3||(c=l+n),d.nodeType===3&&(l+=d.nodeValue.length),(_=d.firstChild)!==null;)v=d,d=_;for(;;){if(d===e)break t;if(v===r&&++u===s&&(o=l),v===i&&++g===n&&(c=l),(_=d.nextSibling)!==null)break;d=v,v=d.parentNode}d=_}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Xh={focusedElem:e,selectionRange:r},Xc=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var x=b.memoizedProps,f=b.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?x:Yr(t.type,x),f);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(y){lt(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return b=Mv,Mv=!1,b}function Ya(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&mf(t,r,i)}s=s.next}while(s!==n)}}function Zu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function gf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function yb(e){var t=e.alternate;t!==null&&(e.alternate=null,yb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_n],delete t[dl],delete t[tf],delete t[dj],delete t[hj])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xb(e){return e.tag===5||e.tag===3||e.tag===4}function Iv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=tu));else if(n!==4&&(e=e.child,e!==null))for(vf(e,t,r),e=e.sibling;e!==null;)vf(e,t,r),e=e.sibling}function _f(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(_f(e,t,r),e=e.sibling;e!==null;)_f(e,t,r),e=e.sibling}var Rt=null,Zr=!1;function cs(e,t,r){for(r=r.child;r!==null;)bb(e,t,r),r=r.sibling}function bb(e,t,r){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(Uu,r)}catch{}switch(r.tag){case 5:Mt||uo(r,t);case 6:var n=Rt,s=Zr;Rt=null,cs(e,t,r),Rt=n,Zr=s,Rt!==null&&(Zr?(e=Rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Rt.removeChild(r.stateNode));break;case 18:Rt!==null&&(Zr?(e=Rt,r=r.stateNode,e.nodeType===8?Vd(e.parentNode,r):e.nodeType===1&&Vd(e,r),ol(e)):Vd(Rt,r.stateNode));break;case 4:n=Rt,s=Zr,Rt=r.stateNode.containerInfo,Zr=!0,cs(e,t,r),Rt=n,Zr=s;break;case 0:case 11:case 14:case 15:if(!Mt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&mf(r,t,l),s=s.next}while(s!==n)}cs(e,t,r);break;case 1:if(!Mt&&(uo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){lt(r,t,o)}cs(e,t,r);break;case 21:cs(e,t,r);break;case 22:r.mode&1?(Mt=(n=Mt)||r.memoizedState!==null,cs(e,t,r),Mt=n):cs(e,t,r);break;default:cs(e,t,r)}}function Bv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Rj),t.forEach(function(n){var s=Bj.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function qr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,l=t,o=l;e:for(;o!==null;){switch(o.tag){case 5:Rt=o.stateNode,Zr=!1;break e;case 3:Rt=o.stateNode.containerInfo,Zr=!0;break e;case 4:Rt=o.stateNode.containerInfo,Zr=!0;break e}o=o.return}if(Rt===null)throw Error(ne(160));bb(i,l,s),Rt=null,Zr=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){lt(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)wb(t,e),t=t.sibling}function wb(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qr(t,e),fn(e),n&4){try{Ya(3,e,e.return),Zu(3,e)}catch(x){lt(e,e.return,x)}try{Ya(5,e,e.return)}catch(x){lt(e,e.return,x)}}break;case 1:qr(t,e),fn(e),n&512&&r!==null&&uo(r,r.return);break;case 5:if(qr(t,e),fn(e),n&512&&r!==null&&uo(r,r.return),e.flags&32){var s=e.stateNode;try{rl(s,"")}catch(x){lt(e,e.return,x)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,l=r!==null?r.memoizedProps:i,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&Wx(s,i),Hh(o,l);var u=Hh(o,i);for(l=0;l<c.length;l+=2){var g=c[l],d=c[l+1];g==="style"?Yx(s,d):g==="dangerouslySetInnerHTML"?Kx(s,d):g==="children"?rl(s,d):kp(s,g,d,u)}switch(o){case"input":Mh(s,i);break;case"textarea":Vx(s,i);break;case"select":var v=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var _=i.value;_!=null?po(s,!!i.multiple,_,!1):v!==!!i.multiple&&(i.defaultValue!=null?po(s,!!i.multiple,i.defaultValue,!0):po(s,!!i.multiple,i.multiple?[]:"",!1))}s[dl]=i}catch(x){lt(e,e.return,x)}}break;case 6:if(qr(t,e),fn(e),n&4){if(e.stateNode===null)throw Error(ne(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(x){lt(e,e.return,x)}}break;case 3:if(qr(t,e),fn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ol(t.containerInfo)}catch(x){lt(e,e.return,x)}break;case 4:qr(t,e),fn(e);break;case 13:qr(t,e),fn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(sm=ft())),n&4&&Bv(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Mt=(u=Mt)||g,qr(t,e),Mt=u):qr(t,e),fn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!g&&e.mode&1)for(fe=e,g=e.child;g!==null;){for(d=fe=g;fe!==null;){switch(v=fe,_=v.child,v.tag){case 0:case 11:case 14:case 15:Ya(4,v,v.return);break;case 1:uo(v,v.return);var b=v.stateNode;if(typeof b.componentWillUnmount=="function"){n=v,r=v.return;try{t=n,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(x){lt(n,r,x)}}break;case 5:uo(v,v.return);break;case 22:if(v.memoizedState!==null){$v(d);continue}}_!==null?(_.return=v,fe=_):$v(d)}g=g.sibling}e:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=d.stateNode,c=d.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=Gx("display",l))}catch(x){lt(e,e.return,x)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){lt(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:qr(t,e),fn(e),n&4&&Bv(e);break;case 21:break;default:qr(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(xb(r)){var n=r;break e}r=r.return}throw Error(ne(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(rl(s,""),n.flags&=-33);var i=Iv(e);_f(e,i,s);break;case 3:case 4:var l=n.stateNode.containerInfo,o=Iv(e);vf(e,o,l);break;default:throw Error(ne(161))}}catch(c){lt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pj(e,t,r){fe=e,Sb(e)}function Sb(e,t,r){for(var n=(e.mode&1)!==0;fe!==null;){var s=fe,i=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||hc;if(!l){var o=s.alternate,c=o!==null&&o.memoizedState!==null||Mt;o=hc;var u=Mt;if(hc=l,(Mt=c)&&!u)for(fe=s;fe!==null;)l=fe,c=l.child,l.tag===22&&l.memoizedState!==null?Hv(s):c!==null?(c.return=l,fe=c):Hv(s);for(;i!==null;)fe=i,Sb(i),i=i.sibling;fe=s,hc=o,Mt=u}Fv(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,fe=i):Fv(e)}}function Fv(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mt||Zu(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Mt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Yr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Sv(t,i,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Sv(t,l,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var g=u.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&ol(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}Mt||t.flags&512&&gf(t)}catch(v){lt(t,t.return,v)}}if(t===e){fe=null;break}if(r=t.sibling,r!==null){r.return=t.return,fe=r;break}fe=t.return}}function $v(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,fe=r;break}fe=t.return}}function Hv(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Zu(4,t)}catch(c){lt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){lt(t,s,c)}}var i=t.return;try{gf(t)}catch(c){lt(t,i,c)}break;case 5:var l=t.return;try{gf(t)}catch(c){lt(t,l,c)}}}catch(c){lt(t,t.return,c)}if(t===e){fe=null;break}var o=t.sibling;if(o!==null){o.return=t.return,fe=o;break}fe=t.return}}var Tj=Math.ceil,hu=ns.ReactCurrentDispatcher,rm=ns.ReactCurrentOwner,Ar=ns.ReactCurrentBatchConfig,Le=0,jt=null,yt=null,Pt=0,ur=0,ho=Xs(0),St=0,vl=null,Ri=0,Xu=0,nm=0,Qa=null,tr=null,sm=0,Wo=1/0,In=null,fu=!1,yf=null,Bs=null,fc=!1,Ps=null,pu=0,Za=0,xf=null,Fc=-1,$c=0;function Kt(){return Le&6?ft():Fc!==-1?Fc:Fc=ft()}function Fs(e){return e.mode&1?Le&2&&Pt!==0?Pt&-Pt:pj.transition!==null?($c===0&&($c=a0()),$c):(e=ze,e!==0||(e=window.event,e=e===void 0?16:p0(e.type)),e):1}function rn(e,t,r,n){if(50<Za)throw Za=0,xf=null,Error(ne(185));Dl(e,r,n),(!(Le&2)||e!==jt)&&(e===jt&&(!(Le&2)&&(Xu|=r),St===4&&ys(e,Pt)),ir(e,n),r===1&&Le===0&&!(t.mode&1)&&(Wo=ft()+500,Gu&&Js()))}function ir(e,t){var r=e.callbackNode;pE(e,t);var n=Zc(e,e===jt?Pt:0);if(n===0)r!==null&&Qg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Qg(r),t===1)e.tag===0?fj(zv.bind(null,e)):D0(zv.bind(null,e)),cj(function(){!(Le&6)&&Js()}),r=null;else{switch(l0(n)){case 1:r=Pp;break;case 4:r=i0;break;case 16:r=Qc;break;case 536870912:r=o0;break;default:r=Qc}r=Tb(r,Cb.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Cb(e,t){if(Fc=-1,$c=0,Le&6)throw Error(ne(327));var r=e.callbackNode;if(yo()&&e.callbackNode!==r)return null;var n=Zc(e,e===jt?Pt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=mu(e,n);else{t=n;var s=Le;Le|=2;var i=Eb();(jt!==e||Pt!==t)&&(In=null,Wo=ft()+500,wi(e,t));do try{Lj();break}catch(o){kb(e,o)}while(!0);Up(),hu.current=i,Le=s,yt!==null?t=0:(jt=null,Pt=0,t=St)}if(t!==0){if(t===2&&(s=qh(e),s!==0&&(n=s,t=bf(e,s))),t===1)throw r=vl,wi(e,0),ys(e,n),ir(e,ft()),r;if(t===6)ys(e,n);else{if(s=e.current.alternate,!(n&30)&&!Aj(s)&&(t=mu(e,n),t===2&&(i=qh(e),i!==0&&(n=i,t=bf(e,i))),t===1))throw r=vl,wi(e,0),ys(e,n),ir(e,ft()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(ne(345));case 2:ii(e,tr,In);break;case 3:if(ys(e,n),(n&130023424)===n&&(t=sm+500-ft(),10<t)){if(Zc(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Kt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=ef(ii.bind(null,e,tr,In),t);break}ii(e,tr,In);break;case 4:if(ys(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-tn(n);i=1<<l,l=t[l],l>s&&(s=l),n&=~i}if(n=s,n=ft()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Tj(n/1960))-n,10<n){e.timeoutHandle=ef(ii.bind(null,e,tr,In),n);break}ii(e,tr,In);break;case 5:ii(e,tr,In);break;default:throw Error(ne(329))}}}return ir(e,ft()),e.callbackNode===r?Cb.bind(null,e):null}function bf(e,t){var r=Qa;return e.current.memoizedState.isDehydrated&&(wi(e,t).flags|=256),e=mu(e,t),e!==2&&(t=tr,tr=r,t!==null&&wf(t)),e}function wf(e){tr===null?tr=e:tr.push.apply(tr,e)}function Aj(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!on(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 ys(e,t){for(t&=~nm,t&=~Xu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tn(t),n=1<<r;e[r]=-1,t&=~n}}function zv(e){if(Le&6)throw Error(ne(327));yo();var t=Zc(e,0);if(!(t&1))return ir(e,ft()),null;var r=mu(e,t);if(e.tag!==0&&r===2){var n=qh(e);n!==0&&(t=n,r=bf(e,n))}if(r===1)throw r=vl,wi(e,0),ys(e,t),ir(e,ft()),r;if(r===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ii(e,tr,In),ir(e,ft()),null}function im(e,t){var r=Le;Le|=1;try{return e(t)}finally{Le=r,Le===0&&(Wo=ft()+500,Gu&&Js())}}function Ni(e){Ps!==null&&Ps.tag===0&&!(Le&6)&&yo();var t=Le;Le|=1;var r=Ar.transition,n=ze;try{if(Ar.transition=null,ze=1,e)return e()}finally{ze=n,Ar.transition=r,Le=t,!(Le&6)&&Js()}}function om(){ur=ho.current,Qe(ho)}function wi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,lj(r)),yt!==null)for(r=yt.return;r!==null;){var n=r;switch($p(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&ru();break;case 3:zo(),Qe(nr),Qe($t),Yp();break;case 5:Gp(n);break;case 4:zo();break;case 13:Qe(Je);break;case 19:Qe(Je);break;case 10:Wp(n.type._context);break;case 22:case 23:om()}r=r.return}if(jt=e,yt=e=$s(e.current,null),Pt=ur=t,St=0,vl=null,nm=Xu=Ri=0,tr=Qa=null,ai!==null){for(t=0;t<ai.length;t++)if(r=ai[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var l=i.next;i.next=s,n.next=l}r.pending=n}ai=null}return e}function kb(e,t){do{var r=yt;try{if(Up(),Mc.current=du,uu){for(var n=st.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}uu=!1}if(ji=0,Et=bt=st=null,Ga=!1,pl=0,rm.current=null,r===null||r.return===null){St=1,vl=t,yt=null;break}e:{var i=e,l=r.return,o=r,c=t;if(t=Pt,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,g=o,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var v=g.alternate;v?(g.updateQueue=v.updateQueue,g.memoizedState=v.memoizedState,g.lanes=v.lanes):(g.updateQueue=null,g.memoizedState=null)}var _=Nv(l);if(_!==null){_.flags&=-257,Pv(_,l,o,i,t),_.mode&1&&Rv(i,u,t),t=_,c=u;var b=t.updateQueue;if(b===null){var x=new Set;x.add(c),t.updateQueue=x}else b.add(c);break e}else{if(!(t&1)){Rv(i,u,t),am();break e}c=Error(ne(426))}}else if(Xe&&o.mode&1){var f=Nv(l);if(f!==null){!(f.flags&65536)&&(f.flags|=256),Pv(f,l,o,i,t),Hp(Uo(c,o));break e}}i=c=Uo(c,o),St!==4&&(St=2),Qa===null?Qa=[i]:Qa.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=lb(i,c,t);wv(i,p);break e;case 1:o=c;var h=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Bs===null||!Bs.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var y=cb(i,o,t);wv(i,y);break e}}i=i.return}while(i!==null)}Rb(r)}catch(w){t=w,yt===r&&r!==null&&(yt=r=r.return);continue}break}while(!0)}function Eb(){var e=hu.current;return hu.current=du,e===null?du:e}function am(){(St===0||St===3||St===2)&&(St=4),jt===null||!(Ri&268435455)&&!(Xu&268435455)||ys(jt,Pt)}function mu(e,t){var r=Le;Le|=2;var n=Eb();(jt!==e||Pt!==t)&&(In=null,wi(e,t));do try{Dj();break}catch(s){kb(e,s)}while(!0);if(Up(),Le=r,hu.current=n,yt!==null)throw Error(ne(261));return jt=null,Pt=0,St}function Dj(){for(;yt!==null;)jb(yt)}function Lj(){for(;yt!==null&&!iE();)jb(yt)}function jb(e){var t=Pb(e.alternate,e,ur);e.memoizedProps=e.pendingProps,t===null?Rb(e):yt=t,rm.current=null}function Rb(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=jj(r,t),r!==null){r.flags&=32767,yt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{St=6,yt=null;return}}else if(r=Ej(r,t,ur),r!==null){yt=r;return}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);St===0&&(St=5)}function ii(e,t,r){var n=ze,s=Ar.transition;try{Ar.transition=null,ze=1,Oj(e,t,r,n)}finally{Ar.transition=s,ze=n}return null}function Oj(e,t,r,n){do yo();while(Ps!==null);if(Le&6)throw Error(ne(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ne(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(mE(e,i),e===jt&&(yt=jt=null,Pt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||fc||(fc=!0,Tb(Qc,function(){return yo(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Ar.transition,Ar.transition=null;var l=ze;ze=1;var o=Le;Le|=4,rm.current=null,Nj(e,r),wb(r,e),tj(Xh),Xc=!!Zh,Xh=Zh=null,e.current=r,Pj(r),oE(),Le=o,ze=l,Ar.transition=i}else e.current=r;if(fc&&(fc=!1,Ps=e,pu=s),i=e.pendingLanes,i===0&&(Bs=null),cE(r.stateNode),ir(e,ft()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(fu)throw fu=!1,e=yf,yf=null,e;return pu&1&&e.tag!==0&&yo(),i=e.pendingLanes,i&1?e===xf?Za++:(Za=0,xf=e):Za=0,Js(),null}function yo(){if(Ps!==null){var e=l0(pu),t=Ar.transition,r=ze;try{if(Ar.transition=null,ze=16>e?16:e,Ps===null)var n=!1;else{if(e=Ps,Ps=null,pu=0,Le&6)throw Error(ne(331));var s=Le;for(Le|=4,fe=e.current;fe!==null;){var i=fe,l=i.child;if(fe.flags&16){var o=i.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(fe=u;fe!==null;){var g=fe;switch(g.tag){case 0:case 11:case 15:Ya(8,g,i)}var d=g.child;if(d!==null)d.return=g,fe=d;else for(;fe!==null;){g=fe;var v=g.sibling,_=g.return;if(yb(g),g===u){fe=null;break}if(v!==null){v.return=_,fe=v;break}fe=_}}}var b=i.alternate;if(b!==null){var x=b.child;if(x!==null){b.child=null;do{var f=x.sibling;x.sibling=null,x=f}while(x!==null)}}fe=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,fe=l;else e:for(;fe!==null;){if(i=fe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ya(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,fe=p;break e}fe=i.return}}var h=e.current;for(fe=h;fe!==null;){l=fe;var m=l.child;if(l.subtreeFlags&2064&&m!==null)m.return=l,fe=m;else e:for(l=h;fe!==null;){if(o=fe,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Zu(9,o)}}catch(w){lt(o,o.return,w)}if(o===l){fe=null;break e}var y=o.sibling;if(y!==null){y.return=o.return,fe=y;break e}fe=o.return}}if(Le=s,Js(),bn&&typeof bn.onPostCommitFiberRoot=="function")try{bn.onPostCommitFiberRoot(Uu,e)}catch{}n=!0}return n}finally{ze=r,Ar.transition=t}}return!1}function Uv(e,t,r){t=Uo(r,t),t=lb(e,t,1),e=Is(e,t,1),t=Kt(),e!==null&&(Dl(e,1,t),ir(e,t))}function lt(e,t,r){if(e.tag===3)Uv(e,e,r);else for(;t!==null;){if(t.tag===3){Uv(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bs===null||!Bs.has(n))){e=Uo(r,e),e=cb(t,e,1),t=Is(t,e,1),e=Kt(),t!==null&&(Dl(t,1,e),ir(t,e));break}}t=t.return}}function Mj(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Kt(),e.pingedLanes|=e.suspendedLanes&r,jt===e&&(Pt&r)===r&&(St===4||St===3&&(Pt&130023424)===Pt&&500>ft()-sm?wi(e,0):nm|=r),ir(e,t)}function Nb(e,t){t===0&&(e.mode&1?(t=nc,nc<<=1,!(nc&130023424)&&(nc=4194304)):t=1);var r=Kt();e=Zn(e,t),e!==null&&(Dl(e,t,r),ir(e,r))}function Ij(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Nb(e,r)}function Bj(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ne(314))}n!==null&&n.delete(t),Nb(e,r)}var Pb;Pb=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||nr.current)rr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return rr=!1,kj(e,t,r);rr=!!(e.flags&131072)}else rr=!1,Xe&&t.flags&1048576&&L0(t,iu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Bc(e,t),e=t.pendingProps;var s=Fo(t,$t.current);_o(t,r),s=Zp(null,t,n,e,s,r);var i=Xp();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,sr(n)?(i=!0,nu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,qp(t),s.updater=Qu,t.stateNode=s,s._reactInternals=t,lf(t,n,e,r),t=df(null,t,n,!0,i,r)):(t.tag=0,Xe&&i&&Fp(t),Vt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Bc(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=$j(n),e=Yr(n,e),s){case 0:t=uf(null,t,n,e,r);break e;case 1:t=Dv(null,t,n,e,r);break e;case 11:t=Tv(null,t,n,e,r);break e;case 14:t=Av(null,t,n,Yr(n.type,e),r);break e}throw Error(ne(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Yr(n,s),uf(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Yr(n,s),Dv(e,t,n,s,r);case 3:e:{if(fb(t),e===null)throw Error(ne(387));n=t.pendingProps,i=t.memoizedState,s=i.element,$0(e,t),lu(t,n,null,r);var l=t.memoizedState;if(n=l.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Uo(Error(ne(423)),t),t=Lv(e,t,n,r,s);break e}else if(n!==s){s=Uo(Error(ne(424)),t),t=Lv(e,t,n,r,s);break e}else for(gr=Ms(t.stateNode.containerInfo.firstChild),vr=t,Xe=!0,Xr=null,r=B0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($o(),n===s){t=Xn(e,t,r);break e}Vt(e,t,n,r)}t=t.child}return t;case 5:return H0(t),e===null&&sf(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,l=s.children,Jh(n,s)?l=null:i!==null&&Jh(n,i)&&(t.flags|=32),hb(e,t),Vt(e,t,l,r),t.child;case 6:return e===null&&sf(t),null;case 13:return pb(e,t,r);case 4:return Kp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ho(t,null,n,r):Vt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Yr(n,s),Tv(e,t,n,s,r);case 7:return Vt(e,t,t.pendingProps,r),t.child;case 8:return Vt(e,t,t.pendingProps.children,r),t.child;case 12:return Vt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,l=s.value,Ve(ou,n._currentValue),n._currentValue=l,i!==null)if(on(i.value,l)){if(i.children===s.children&&!nr.current){t=Xn(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){l=i.child;for(var c=o.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=qn(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var g=u.pending;g===null?c.next=c:(c.next=g.next,g.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),of(i.return,r,t),o.lanes|=r;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(ne(341));l.lanes|=r,o=l.alternate,o!==null&&(o.lanes|=r),of(l,r,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Vt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,_o(t,r),s=Mr(s),n=n(s),t.flags|=1,Vt(e,t,n,r),t.child;case 14:return n=t.type,s=Yr(n,t.pendingProps),s=Yr(n.type,s),Av(e,t,n,s,r);case 15:return ub(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Yr(n,s),Bc(e,t),t.tag=1,sr(n)?(e=!0,nu(t)):e=!1,_o(t,r),ab(t,n,s),lf(t,n,s,r),df(null,t,n,!0,e,r);case 19:return mb(e,t,r);case 22:return db(e,t,r)}throw Error(ne(156,t.tag))};function Tb(e,t){return s0(e,t)}function Fj(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,r,n){return new Fj(e,t,r,n)}function lm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $j(e){if(typeof e=="function")return lm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jp)return 11;if(e===Rp)return 14}return 2}function $s(e,t){var r=e.alternate;return r===null?(r=Tr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Hc(e,t,r,n,s,i){var l=2;if(n=e,typeof e=="function")lm(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case to:return Si(r.children,s,i,t);case Ep:l=8,s|=8;break;case Th:return e=Tr(12,r,t,s|2),e.elementType=Th,e.lanes=i,e;case Ah:return e=Tr(13,r,t,s),e.elementType=Ah,e.lanes=i,e;case Dh:return e=Tr(19,r,t,s),e.elementType=Dh,e.lanes=i,e;case Hx:return Ju(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fx:l=10;break e;case $x:l=9;break e;case jp:l=11;break e;case Rp:l=14;break e;case ps:l=16,n=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Tr(l,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Si(e,t,r,n){return e=Tr(7,e,n,t),e.lanes=r,e}function Ju(e,t,r,n){return e=Tr(22,e,n,t),e.elementType=Hx,e.lanes=r,e.stateNode={isHidden:!1},e}function Jd(e,t,r){return e=Tr(6,e,null,t),e.lanes=r,e}function eh(e,t,r){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hj(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ld(0),this.expirationTimes=Ld(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ld(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function cm(e,t,r,n,s,i,l,o,c){return e=new Hj(e,t,r,o,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Tr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},qp(i),e}function zj(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:eo,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Ab(e){if(!e)return Vs;e=e._reactInternals;e:{if(Oi(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(sr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var r=e.type;if(sr(r))return A0(e,r,t)}return t}function Db(e,t,r,n,s,i,l,o,c){return e=cm(r,n,!0,e,s,i,l,o,c),e.context=Ab(null),r=e.current,n=Kt(),s=Fs(r),i=qn(n,s),i.callback=t??null,Is(r,i,s),e.current.lanes=s,Dl(e,s,n),ir(e,n),e}function ed(e,t,r,n){var s=t.current,i=Kt(),l=Fs(s);return r=Ab(r),t.context===null?t.context=r:t.pendingContext=r,t=qn(i,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Is(s,t,l),e!==null&&(rn(e,s,l,i),Oc(e,s,l)),l}function gu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Wv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function um(e,t){Wv(e,t),(e=e.alternate)&&Wv(e,t)}function Uj(){return null}var Lb=typeof reportError=="function"?reportError:function(e){console.error(e)};function dm(e){this._internalRoot=e}td.prototype.render=dm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));ed(e,t,null,null)};td.prototype.unmount=dm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ni(function(){ed(null,e,null,null)}),t[Qn]=null}};function td(e){this._internalRoot=e}td.prototype.unstable_scheduleHydration=function(e){if(e){var t=d0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<_s.length&&t!==0&&t<_s[r].priority;r++);_s.splice(r,0,e),r===0&&f0(e)}};function hm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vv(){}function Wj(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=gu(l);i.call(u)}}var l=Db(t,n,e,0,null,!1,!1,"",Vv);return e._reactRootContainer=l,e[Qn]=l.current,cl(e.nodeType===8?e.parentNode:e),Ni(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var o=n;n=function(){var u=gu(c);o.call(u)}}var c=cm(e,0,!1,null,null,!1,!1,"",Vv);return e._reactRootContainer=c,e[Qn]=c.current,cl(e.nodeType===8?e.parentNode:e),Ni(function(){ed(t,c,r,n)}),c}function nd(e,t,r,n,s){var i=r._reactRootContainer;if(i){var l=i;if(typeof s=="function"){var o=s;s=function(){var c=gu(l);o.call(c)}}ed(t,l,e,s)}else l=Wj(r,t,e,s,n);return gu(l)}c0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ia(t.pendingLanes);r!==0&&(Tp(t,r|1),ir(t,ft()),!(Le&6)&&(Wo=ft()+500,Js()))}break;case 13:Ni(function(){var n=Zn(e,1);if(n!==null){var s=Kt();rn(n,e,1,s)}}),um(e,1)}};Ap=function(e){if(e.tag===13){var t=Zn(e,134217728);if(t!==null){var r=Kt();rn(t,e,134217728,r)}um(e,134217728)}};u0=function(e){if(e.tag===13){var t=Fs(e),r=Zn(e,t);if(r!==null){var n=Kt();rn(r,e,t,n)}um(e,t)}};d0=function(){return ze};h0=function(e,t){var r=ze;try{return ze=e,t()}finally{ze=r}};Uh=function(e,t,r){switch(t){case"input":if(Mh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Ku(n);if(!s)throw Error(ne(90));Ux(n),Mh(n,s)}}}break;case"textarea":Vx(e,r);break;case"select":t=r.value,t!=null&&po(e,!!r.multiple,t,!1)}};Xx=im;Jx=Ni;var Vj={usingClientEntryPoint:!1,Events:[Ol,io,Ku,Qx,Zx,im]},ka={findFiberByHostInstance:oi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qj={bundleType:ka.bundleType,version:ka.version,rendererPackageName:ka.rendererPackageName,rendererConfig:ka.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ns.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=r0(e),e===null?null:e.stateNode},findFiberByHostInstance:ka.findFiberByHostInstance||Uj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pc.isDisabled&&pc.supportsFiber)try{Uu=pc.inject(qj),bn=pc}catch{}}wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vj;wr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hm(t))throw Error(ne(200));return zj(e,t,null,r)};wr.createRoot=function(e,t){if(!hm(e))throw Error(ne(299));var r=!1,n="",s=Lb;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=cm(e,1,!1,null,null,r,!1,n,s),e[Qn]=t.current,cl(e.nodeType===8?e.parentNode:e),new dm(t)};wr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=r0(t),e=e===null?null:e.stateNode,e};wr.flushSync=function(e){return Ni(e)};wr.hydrate=function(e,t,r){if(!rd(t))throw Error(ne(200));return nd(null,e,t,!0,r)};wr.hydrateRoot=function(e,t,r){if(!hm(e))throw Error(ne(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",l=Lb;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=Db(t,null,e,1,r??null,s,!1,i,l),e[Qn]=t.current,cl(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new td(t)};wr.render=function(e,t,r){if(!rd(t))throw Error(ne(200));return nd(null,e,t,!1,r)};wr.unmountComponentAtNode=function(e){if(!rd(e))throw Error(ne(40));return e._reactRootContainer?(Ni(function(){nd(null,null,e,!1,function(){e._reactRootContainer=null,e[Qn]=null})}),!0):!1};wr.unstable_batchedUpdates=im;wr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!rd(r))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return nd(e,t,r,!1,n)};wr.version="18.3.1-next-f1338f8080-20240426";function Ob(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ob)}catch(e){console.error(e)}}Ob(),Ox.exports=wr;var sd=Ox.exports;const Mb=Sx(sd);var qv=sd;Nh.createRoot=qv.createRoot,Nh.hydrateRoot=qv.hydrateRoot;var sa=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(){}},fi,xs,ko,hx,Kj=(hx=class extends sa{constructor(){super();_e(this,fi);_e(this,xs);_e(this,ko);ue(this,ko,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,xs)||this.setEventListener(F(this,ko))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,xs))==null||t.call(this),ue(this,xs,void 0))}setEventListener(t){var r;ue(this,ko,t),(r=F(this,xs))==null||r.call(this),ue(this,xs,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){F(this,fi)!==t&&(ue(this,fi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,fi)=="boolean"?F(this,fi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},fi=new WeakMap,xs=new WeakMap,ko=new WeakMap,hx),fm=new Kj,Gj={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bs,_p,fx,Yj=(fx=class{constructor(){_e(this,bs,Gj);_e(this,_p,!1)}setTimeoutProvider(e){ue(this,bs,e)}setTimeout(e,t){return F(this,bs).setTimeout(e,t)}clearTimeout(e){F(this,bs).clearTimeout(e)}setInterval(e,t){return F(this,bs).setInterval(e,t)}clearInterval(e){F(this,bs).clearInterval(e)}},bs=new WeakMap,_p=new WeakMap,fx),ci=new Yj;function Qj(e){setTimeout(e,0)}var Zj=typeof window>"u"||"Deno"in globalThis;function qt(){}function Xj(e,t){return typeof e=="function"?e(t):e}function Sf(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ib(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hs(e,t){return typeof e=="function"?e(t):e}function hr(e,t){return typeof e=="function"?e(t):e}function Kv(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:l,stale:o}=e;if(l){if(n){if(t.queryHash!==pm(l,t.options))return!1}else if(!_l(t.queryKey,l))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||s&&s!==t.state.fetchStatus||i&&!i(t))}function Gv(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Pi(t.options.mutationKey)!==Pi(i))return!1}else if(!_l(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function pm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pi)(e)}function Pi(e){return JSON.stringify(e,(t,r)=>Cf(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function _l(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>_l(e[r],t[r])):!1}var Jj=Object.prototype.hasOwnProperty;function Bb(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Yv(e)&&Yv(t);if(!n&&!(Cf(e)&&Cf(t)))return t;const i=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),o=l.length,c=n?new Array(o):{};let u=0;for(let g=0;g<o;g++){const d=n?g:l[g],v=e[d],_=t[d];if(v===_){c[d]=v,(n?g<i:Jj.call(e,d))&&u++;continue}if(v===null||_===null||typeof v!="object"||typeof _!="object"){c[d]=_;continue}const b=Bb(v,_,r+1);c[d]=b,b===v&&u++}return i===o&&u===i?e:c}function vu(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 Yv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Cf(e){if(!Qv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Qv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Qv(e){return Object.prototype.toString.call(e)==="[object Object]"}function eR(e){return new Promise(t=>{ci.setTimeout(t,e)})}function kf(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Bb(e,t):t}function tR(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function rR(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var mm=Symbol();function Fb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===mm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gm(e,t){return typeof e=="function"?e(...t):!!e}function nR(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 yl=(()=>{let e=()=>Zj;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ef(){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 sR=Qj;function iR(){let e=[],t=0,r=o=>{o()},n=o=>{o()},s=sR;const i=o=>{t?e.push(o):s(()=>{r(o)})},l=()=>{const o=e;e=[],o.length&&s(()=>{n(()=>{o.forEach(c=>{r(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||l()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{s=o}}}var wt=iR(),Eo,ws,jo,px,oR=(px=class extends sa{constructor(){super();_e(this,Eo,!0);_e(this,ws);_e(this,jo);ue(this,jo,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){F(this,ws)||this.setEventListener(F(this,jo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,ws))==null||t.call(this),ue(this,ws,void 0))}setEventListener(t){var r;ue(this,jo,t),(r=F(this,ws))==null||r.call(this),ue(this,ws,t(this.setOnline.bind(this)))}setOnline(t){F(this,Eo)!==t&&(ue(this,Eo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,Eo)}},Eo=new WeakMap,ws=new WeakMap,jo=new WeakMap,px),_u=new oR;function aR(e){return Math.min(1e3*2**e,3e4)}function $b(e){return(e??"online")==="online"?_u.isOnline():!0}var jf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Hb(e){let t=!1,r=0,n;const s=Ef(),i=()=>s.status!=="pending",l=x=>{var f;if(!i()){const p=new jf(x);v(p),(f=e.onCancel)==null||f.call(e,p)}},o=()=>{t=!0},c=()=>{t=!1},u=()=>fm.isFocused()&&(e.networkMode==="always"||_u.isOnline())&&e.canRun(),g=()=>$b(e.networkMode)&&e.canRun(),d=x=>{i()||(n==null||n(),s.resolve(x))},v=x=>{i()||(n==null||n(),s.reject(x))},_=()=>new Promise(x=>{var f;n=p=>{(i()||u())&&x(p)},(f=e.onPause)==null||f.call(e)}).then(()=>{var x;n=void 0,i()||(x=e.onContinue)==null||x.call(e)}),b=()=>{if(i())return;let x;const f=r===0?e.initialPromise:void 0;try{x=f??e.fn()}catch(p){x=Promise.reject(p)}Promise.resolve(x).then(d).catch(p=>{var k;if(i())return;const h=e.retry??(yl.isServer()?0:3),m=e.retryDelay??aR,y=typeof m=="function"?m(r,p):m,w=h===!0||typeof h=="number"&&r<h||typeof h=="function"&&h(r,p);if(t||!w){v(p);return}r++,(k=e.onFail)==null||k.call(e,r,p),eR(y).then(()=>u()?void 0:_()).then(()=>{t?v(p):b()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(n==null||n(),s),cancelRetry:o,continueRetry:c,canStart:g,start:()=>(g()?b():_().then(b),s)}}var pi,mx,zb=(mx=class{constructor(){_e(this,pi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sf(this.gcTime)&&ue(this,pi,ci.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){F(this,pi)!==void 0&&(ci.clearTimeout(F(this,pi)),ue(this,pi,void 0))}},pi=new WeakMap,mx);function lR(e){return{onFetch:(t,r)=>{var g,d,v,_,b;const n=t.options,s=(v=(d=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:d.fetchMore)==null?void 0:v.direction,i=((_=t.state.data)==null?void 0:_.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let x=!1;const f=m=>{nR(m,()=>t.signal,()=>x=!0)},p=Fb(t.options,t.fetchOptions),h=async(m,y,w)=>{if(x)return Promise.reject(t.signal.reason);if(y==null&&m.pages.length)return Promise.resolve(m);const j=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:y,direction:w?"backward":"forward",meta:t.options.meta};return f(O),O})(),S=await p(j),{maxPages:E}=t.options,N=w?rR:tR;return{pages:N(m.pages,S,E),pageParams:N(m.pageParams,y,E)}};if(s&&i.length){const m=s==="backward",y=m?cR:Zv,w={pages:i,pageParams:l},k=y(n,w);o=await h(w,k,m)}else{const m=e??i.length;do{const y=c===0?l[0]??n.initialPageParam:Zv(n,o);if(c>0&&y==null)break;o=await h(o,y),c++}while(c<m)}return o};t.options.persister?t.fetchFn=()=>{var x,f;return(f=(x=t.options).persister)==null?void 0:f.call(x,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Zv(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 cR(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ro,mi,No,Cr,gi,kt,jl,vi,dr,Ub,Mn,gx,uR=(gx=class extends zb{constructor(t){super();_e(this,dr);_e(this,Ro);_e(this,mi);_e(this,No);_e(this,Cr);_e(this,gi);_e(this,kt);_e(this,jl);_e(this,vi);ue(this,vi,!1),ue(this,jl,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,gi,t.client),ue(this,Cr,F(this,gi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,mi,Jv(this.options)),this.state=t.state??F(this,mi),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Ro)}get promise(){var t;return(t=F(this,kt))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,jl),...t},t!=null&&t._type&&ue(this,Ro,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Jv(this.options);r.data!==void 0&&(this.setState(Xv(r.data,r.dataUpdatedAt)),ue(this,mi,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Cr).remove(this)}setData(t,r){const n=kf(this.state.data,t,this.options);return Re(this,dr,Mn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Re(this,dr,Mn).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=F(this,kt))==null?void 0:n.promise;return(s=F(this,kt))==null||s.cancel(t),r?r.then(qt).catch(qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,mi)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>hr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Hs(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:!Ib(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,kt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,kt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,Cr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,kt)&&(F(this,vi)||Re(this,dr,Ub).call(this)?F(this,kt).cancel({revert:!0}):F(this,kt).cancelRetry()),this.scheduleGc()),F(this,Cr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Re(this,dr,Mn).call(this,{type:"invalidate"})}async fetch(t,r){var u,g,d,v,_,b,x,f,p,h,m;if(this.state.fetchStatus!=="idle"&&((u=F(this,kt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,kt))return F(this,kt).continueRetry(),F(this,kt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const y=this.observers.find(w=>w.options.queryFn);y&&this.setOptions(y.options)}const n=new AbortController,s=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(ue(this,vi,!0),n.signal)})},i=()=>{const y=Fb(this.options,r),k=(()=>{const j={client:F(this,gi),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return ue(this,vi,!1),this.options.persister?this.options.persister(y,k,this):y(k)},o=(()=>{const y={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,gi),state:this.state,fetchFn:i};return s(y),y})(),c=F(this,Ro)==="infinite"?lR(this.options.pages):this.options.behavior;c==null||c.onFetch(o,this),ue(this,No,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=o.fetchOptions)==null?void 0:g.meta))&&Re(this,dr,Mn).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta}),ue(this,kt,Hb({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:y=>{y instanceof jf&&y.revert&&this.setState({...F(this,No),fetchStatus:"idle"}),n.abort()},onFail:(y,w)=>{Re(this,dr,Mn).call(this,{type:"failed",failureCount:y,error:w})},onPause:()=>{Re(this,dr,Mn).call(this,{type:"pause"})},onContinue:()=>{Re(this,dr,Mn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const y=await F(this,kt).start();if(y===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(y),(_=(v=F(this,Cr).config).onSuccess)==null||_.call(v,y,this),(x=(b=F(this,Cr).config).onSettled)==null||x.call(b,y,this.state.error,this),y}catch(y){if(y instanceof jf){if(y.silent)return F(this,kt).promise;if(y.revert){if(this.state.data===void 0)throw y;return this.state.data}}throw Re(this,dr,Mn).call(this,{type:"error",error:y}),(p=(f=F(this,Cr).config).onError)==null||p.call(f,y,this),(m=(h=F(this,Cr).config).onSettled)==null||m.call(h,this.state.data,y,this),y}finally{this.scheduleGc()}}},Ro=new WeakMap,mi=new WeakMap,No=new WeakMap,Cr=new WeakMap,gi=new WeakMap,kt=new WeakMap,jl=new WeakMap,vi=new WeakMap,dr=new WeakSet,Ub=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Mn=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,...Wb(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Xv(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,No,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),wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),F(this,Cr).notify({query:this,type:"updated",action:t})})},gx);function Wb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$b(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jv(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 Xt,De,Rl,Wt,_i,Po,$n,Ss,Nl,To,Ao,yi,xi,Cs,Do,$e,Fa,Rf,Nf,Pf,Tf,Af,Df,Lf,Vb,vx,dR=(vx=class extends sa{constructor(t,r){super();_e(this,$e);_e(this,Xt);_e(this,De);_e(this,Rl);_e(this,Wt);_e(this,_i);_e(this,Po);_e(this,$n);_e(this,Ss);_e(this,Nl);_e(this,To);_e(this,Ao);_e(this,yi);_e(this,xi);_e(this,Cs);_e(this,Do,new Set);this.options=r,ue(this,Xt,t),ue(this,Ss,null),ue(this,$n,Ef()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,De).addObserver(this),e_(F(this,De),this.options)?Re(this,$e,Fa).call(this):this.updateResult(),Re(this,$e,Tf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Of(F(this,De),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Of(F(this,De),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,$e,Af).call(this),Re(this,$e,Df).call(this),F(this,De).removeObserver(this)}setOptions(t){const r=this.options,n=F(this,De);if(this.options=F(this,Xt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hr(this.options.enabled,F(this,De))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Re(this,$e,Lf).call(this),F(this,De).setOptions(this.options),r._defaulted&&!vu(this.options,r)&&F(this,Xt).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,De),observer:this});const s=this.hasListeners();s&&t_(F(this,De),n,this.options,r)&&Re(this,$e,Fa).call(this),this.updateResult(),s&&(F(this,De)!==n||hr(this.options.enabled,F(this,De))!==hr(r.enabled,F(this,De))||Hs(this.options.staleTime,F(this,De))!==Hs(r.staleTime,F(this,De)))&&Re(this,$e,Rf).call(this);const i=Re(this,$e,Nf).call(this);s&&(F(this,De)!==n||hr(this.options.enabled,F(this,De))!==hr(r.enabled,F(this,De))||i!==F(this,Cs))&&Re(this,$e,Pf).call(this,i)}getOptimisticResult(t){const r=F(this,Xt).getQueryCache().build(F(this,Xt),t),n=this.createResult(r,t);return fR(this,n)&&(ue(this,Wt,n),ue(this,Po,this.options),ue(this,_i,F(this,De).state)),n}getCurrentResult(){return F(this,Wt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,$n).status==="pending"&&F(this,$n).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){F(this,Do).add(t)}getCurrentQuery(){return F(this,De)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,Xt).defaultQueryOptions(t),n=F(this,Xt).getQueryCache().build(F(this,Xt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Re(this,$e,Fa).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,Wt)))}createResult(t,r){var E;const n=F(this,De),s=this.options,i=F(this,Wt),l=F(this,_i),o=F(this,Po),u=t!==n?t.state:F(this,Rl),{state:g}=t;let d={...g},v=!1,_;if(r._optimisticResults){const N=this.hasListeners(),O=!N&&e_(t,r),T=N&&t_(t,n,r,s);(O||T)&&(d={...d,...Wb(g.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:x,status:f}=d;_=d.data;let p=!1;if(r.placeholderData!==void 0&&_===void 0&&f==="pending"){let N;i!=null&&i.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData)?(N=i.data,p=!0):N=typeof r.placeholderData=="function"?r.placeholderData((E=F(this,Ao))==null?void 0:E.state.data,F(this,Ao)):r.placeholderData,N!==void 0&&(f="success",_=kf(i==null?void 0:i.data,N,r),v=!0)}if(r.select&&_!==void 0&&!p)if(i&&_===(l==null?void 0:l.data)&&r.select===F(this,Nl))_=F(this,To);else try{ue(this,Nl,r.select),_=r.select(_),_=kf(i==null?void 0:i.data,_,r),ue(this,To,_),ue(this,Ss,null)}catch(N){ue(this,Ss,N)}F(this,Ss)&&(b=F(this,Ss),_=F(this,To),x=Date.now(),f="error");const h=d.fetchStatus==="fetching",m=f==="pending",y=f==="error",w=m&&h,k=_!==void 0,S={status:f,fetchStatus:d.fetchStatus,isPending:m,isSuccess:f==="success",isError:y,isInitialLoading:w,isLoading:w,data:_,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:x,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:h,isRefetching:h&&!m,isLoadingError:y&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:y&&k,isStale:vm(t,r),refetch:this.refetch,promise:F(this,$n),isEnabled:hr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=S.data!==void 0,O=S.status==="error"&&!N,T=W=>{O?W.reject(S.error):N&&W.resolve(S.data)},L=()=>{const W=ue(this,$n,S.promise=Ef());T(W)},$=F(this,$n);switch($.status){case"pending":t.queryHash===n.queryHash&&T($);break;case"fulfilled":(O||S.data!==$.value)&&L();break;case"rejected":(!O||S.error!==$.reason)&&L();break}}return S}updateResult(){const t=F(this,Wt),r=this.createResult(F(this,De),this.options);if(ue(this,_i,F(this,De).state),ue(this,Po,this.options),F(this,_i).data!==void 0&&ue(this,Ao,F(this,De)),vu(r,t))return;ue(this,Wt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!F(this,Do).size)return!0;const l=new Set(i??F(this,Do));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,Wt)).some(o=>{const c=o;return F(this,Wt)[c]!==t[c]&&l.has(c)})};Re(this,$e,Vb).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,$e,Tf).call(this)}},Xt=new WeakMap,De=new WeakMap,Rl=new WeakMap,Wt=new WeakMap,_i=new WeakMap,Po=new WeakMap,$n=new WeakMap,Ss=new WeakMap,Nl=new WeakMap,To=new WeakMap,Ao=new WeakMap,yi=new WeakMap,xi=new WeakMap,Cs=new WeakMap,Do=new WeakMap,$e=new WeakSet,Fa=function(t){Re(this,$e,Lf).call(this);let r=F(this,De).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(qt)),r},Rf=function(){Re(this,$e,Af).call(this);const t=Hs(this.options.staleTime,F(this,De));if(yl.isServer()||F(this,Wt).isStale||!Sf(t))return;const n=Ib(F(this,Wt).dataUpdatedAt,t)+1;ue(this,yi,ci.setTimeout(()=>{F(this,Wt).isStale||this.updateResult()},n))},Nf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,De)):this.options.refetchInterval)??!1},Pf=function(t){Re(this,$e,Df).call(this),ue(this,Cs,t),!(yl.isServer()||hr(this.options.enabled,F(this,De))===!1||!Sf(F(this,Cs))||F(this,Cs)===0)&&ue(this,xi,ci.setInterval(()=>{(this.options.refetchIntervalInBackground||fm.isFocused())&&Re(this,$e,Fa).call(this)},F(this,Cs)))},Tf=function(){Re(this,$e,Rf).call(this),Re(this,$e,Pf).call(this,Re(this,$e,Nf).call(this))},Af=function(){F(this,yi)!==void 0&&(ci.clearTimeout(F(this,yi)),ue(this,yi,void 0))},Df=function(){F(this,xi)!==void 0&&(ci.clearInterval(F(this,xi)),ue(this,xi,void 0))},Lf=function(){const t=F(this,Xt).getQueryCache().build(F(this,Xt),this.options);if(t===F(this,De))return;const r=F(this,De);ue(this,De,t),ue(this,Rl,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Vb=function(t){wt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,Wt))}),F(this,Xt).getQueryCache().notify({query:F(this,De),type:"observerResultsUpdated"})})},vx);function hR(e,t){return hr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&hr(t.retryOnMount,e)===!1)}function e_(e,t){return hR(e,t)||e.state.data!==void 0&&Of(e,t,t.refetchOnMount)}function Of(e,t,r){if(hr(t.enabled,e)!==!1&&Hs(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&vm(e,t)}return!1}function t_(e,t,r,n){return(e!==t||hr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&vm(e,r)}function vm(e,t){return hr(t.enabled,e)!==!1&&e.isStaleByTime(Hs(t.staleTime,e))}function fR(e,t){return!vu(e.getCurrentResult(),t)}var Pl,mn,Lt,bi,gn,hs,_x,pR=(_x=class extends zb{constructor(t){super();_e(this,gn);_e(this,Pl);_e(this,mn);_e(this,Lt);_e(this,bi);ue(this,Pl,t.client),this.mutationId=t.mutationId,ue(this,Lt,t.mutationCache),ue(this,mn,[]),this.state=t.state||qb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,mn).includes(t)||(F(this,mn).push(t),this.clearGcTimeout(),F(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,mn,F(this,mn).filter(r=>r!==t)),this.scheduleGc(),F(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,mn).length||(this.state.status==="pending"?this.scheduleGc():F(this,Lt).remove(this))}continue(){var t;return((t=F(this,bi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,o,c,u,g,d,v,_,b,x,f,p,h,m,y,w,k,j;const r=()=>{Re(this,gn,hs).call(this,{type:"continue"})},n={client:F(this,Pl),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,bi,Hb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(S,E)=>{Re(this,gn,hs).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{Re(this,gn,hs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Lt).canRun(this)}));const s=this.state.status==="pending",i=!F(this,bi).canStart();try{if(s)r();else{Re(this,gn,hs).call(this,{type:"pending",variables:t,isPaused:i}),F(this,Lt).config.onMutate&&await F(this,Lt).config.onMutate(t,this,n);const E=await((o=(l=this.options).onMutate)==null?void 0:o.call(l,t,n));E!==this.state.context&&Re(this,gn,hs).call(this,{type:"pending",context:E,variables:t,isPaused:i})}const S=await F(this,bi).start();return await((u=(c=F(this,Lt).config).onSuccess)==null?void 0:u.call(c,S,t,this.state.context,this,n)),await((d=(g=this.options).onSuccess)==null?void 0:d.call(g,S,t,this.state.context,n)),await((_=(v=F(this,Lt).config).onSettled)==null?void 0:_.call(v,S,null,this.state.variables,this.state.context,this,n)),await((x=(b=this.options).onSettled)==null?void 0:x.call(b,S,null,t,this.state.context,n)),Re(this,gn,hs).call(this,{type:"success",data:S}),S}catch(S){try{await((p=(f=F(this,Lt).config).onError)==null?void 0:p.call(f,S,t,this.state.context,this,n))}catch(E){Promise.reject(E)}try{await((m=(h=this.options).onError)==null?void 0:m.call(h,S,t,this.state.context,n))}catch(E){Promise.reject(E)}try{await((w=(y=F(this,Lt).config).onSettled)==null?void 0:w.call(y,void 0,S,this.state.variables,this.state.context,this,n))}catch(E){Promise.reject(E)}try{await((j=(k=this.options).onSettled)==null?void 0:j.call(k,void 0,S,t,this.state.context,n))}catch(E){Promise.reject(E)}throw Re(this,gn,hs).call(this,{type:"error",error:S}),S}finally{F(this,Lt).runNext(this)}}},Pl=new WeakMap,mn=new WeakMap,Lt=new WeakMap,bi=new WeakMap,gn=new WeakSet,hs=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),wt.batch(()=>{F(this,mn).forEach(n=>{n.onMutationUpdate(t)}),F(this,Lt).notify({mutation:this,type:"updated",action:t})})},_x);function qb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hn,Qr,Tl,yx,mR=(yx=class extends sa{constructor(t={}){super();_e(this,Hn);_e(this,Qr);_e(this,Tl);this.config=t,ue(this,Hn,new Set),ue(this,Qr,new Map),ue(this,Tl,0)}build(t,r,n){const s=new pR({client:t,mutationCache:this,mutationId:++Zl(this,Tl)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){F(this,Hn).add(t);const r=mc(t);if(typeof r=="string"){const n=F(this,Qr).get(r);n?n.push(t):F(this,Qr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,Hn).delete(t)){const r=mc(t);if(typeof r=="string"){const n=F(this,Qr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&F(this,Qr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=mc(t);if(typeof r=="string"){const n=F(this,Qr).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=mc(t);if(typeof r=="string"){const s=(n=F(this,Qr).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(){wt.batch(()=>{F(this,Hn).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,Hn).clear(),F(this,Qr).clear()})}getAll(){return Array.from(F(this,Hn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Gv(r,n))}findAll(t={}){return this.getAll().filter(r=>Gv(t,r))}notify(t){wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return wt.batch(()=>Promise.all(t.map(r=>r.continue().catch(qt))))}},Hn=new WeakMap,Qr=new WeakMap,Tl=new WeakMap,yx);function mc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var zn,ks,Jt,Un,Gn,zc,Mf,xx,gR=(xx=class extends sa{constructor(r,n){super();_e(this,Gn);_e(this,zn);_e(this,ks);_e(this,Jt);_e(this,Un);ue(this,zn,r),this.setOptions(n),this.bindMethods(),Re(this,Gn,zc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=F(this,zn).defaultMutationOptions(r),vu(this.options,n)||F(this,zn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Jt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Pi(n.mutationKey)!==Pi(this.options.mutationKey)?this.reset():((s=F(this,Jt))==null?void 0:s.state.status)==="pending"&&F(this,Jt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=F(this,Jt))==null||r.removeObserver(this)}onMutationUpdate(r){Re(this,Gn,zc).call(this),Re(this,Gn,Mf).call(this,r)}getCurrentResult(){return F(this,ks)}reset(){var r;(r=F(this,Jt))==null||r.removeObserver(this),ue(this,Jt,void 0),Re(this,Gn,zc).call(this),Re(this,Gn,Mf).call(this)}mutate(r,n){var s;return ue(this,Un,n),(s=F(this,Jt))==null||s.removeObserver(this),ue(this,Jt,F(this,zn).getMutationCache().build(F(this,zn),this.options)),F(this,Jt).addObserver(this),F(this,Jt).execute(r)}},zn=new WeakMap,ks=new WeakMap,Jt=new WeakMap,Un=new WeakMap,Gn=new WeakSet,zc=function(){var n;const r=((n=F(this,Jt))==null?void 0:n.state)??qb();ue(this,ks,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Mf=function(r){wt.batch(()=>{var n,s,i,l,o,c,u,g;if(F(this,Un)&&this.hasListeners()){const d=F(this,ks).variables,v=F(this,ks).context,_={client:F(this,zn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(n=F(this,Un)).onSuccess)==null||s.call(n,r.data,d,v,_)}catch(b){Promise.reject(b)}try{(l=(i=F(this,Un)).onSettled)==null||l.call(i,r.data,null,d,v,_)}catch(b){Promise.reject(b)}}else if((r==null?void 0:r.type)==="error"){try{(c=(o=F(this,Un)).onError)==null||c.call(o,r.error,d,v,_)}catch(b){Promise.reject(b)}try{(g=(u=F(this,Un)).onSettled)==null||g.call(u,void 0,r.error,d,v,_)}catch(b){Promise.reject(b)}}}this.listeners.forEach(d=>{d(F(this,ks))})})},xx),vn,bx,vR=(bx=class extends sa{constructor(t={}){super();_e(this,vn);this.config=t,ue(this,vn,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??pm(s,r);let l=this.get(i);return l||(l=new uR({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){F(this,vn).has(t.queryHash)||(F(this,vn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,vn).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,vn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){wt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,vn).get(t)}getAll(){return[...F(this,vn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Kv(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Kv(t,n)):r}notify(t){wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},vn=new WeakMap,bx),at,Es,js,Lo,Oo,Rs,Mo,Io,wx,_R=(wx=class{constructor(e={}){_e(this,at);_e(this,Es);_e(this,js);_e(this,Lo);_e(this,Oo);_e(this,Rs);_e(this,Mo);_e(this,Io);ue(this,at,e.queryCache||new vR),ue(this,Es,e.mutationCache||new mR),ue(this,js,e.defaultOptions||{}),ue(this,Lo,new Map),ue(this,Oo,new Map),ue(this,Rs,0)}mount(){Zl(this,Rs)._++,F(this,Rs)===1&&(ue(this,Mo,fm.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,at).onFocus())})),ue(this,Io,_u.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,at).onOnline())})))}unmount(){var e,t;Zl(this,Rs)._--,F(this,Rs)===0&&((e=F(this,Mo))==null||e.call(this),ue(this,Mo,void 0),(t=F(this,Io))==null||t.call(this),ue(this,Io,void 0))}isFetching(e){return F(this,at).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Es).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,at).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=F(this,at).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Hs(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return F(this,at).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=F(this,at).get(n.queryHash),i=s==null?void 0:s.state.data,l=Xj(t,i);if(l!==void 0)return F(this,at).build(this,n).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return wt.batch(()=>F(this,at).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,at).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,at);wt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,at);return wt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=wt.batch(()=>F(this,at).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(qt).catch(qt)}invalidateQueries(e,t={}){return wt.batch(()=>(F(this,at).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=wt.batch(()=>F(this,at).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(qt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(qt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,at).build(this,t);return r.isStaleByTime(Hs(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qt).catch(qt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qt).catch(qt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return _u.isOnline()?F(this,Es).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,at)}getMutationCache(){return F(this,Es)}getDefaultOptions(){return F(this,js)}setDefaultOptions(e){ue(this,js,e)}setQueryDefaults(e,t){F(this,Lo).set(Pi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Lo).values()],r={};return t.forEach(n=>{_l(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){F(this,Oo).set(Pi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Oo).values()],r={};return t.forEach(n=>{_l(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,js).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pm(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===mm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,js).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,at).clear(),F(this,Es).clear()}},at=new WeakMap,Es=new WeakMap,js=new WeakMap,Lo=new WeakMap,Oo=new WeakMap,Rs=new WeakMap,Mo=new WeakMap,Io=new WeakMap,wx),Kb=C.createContext(void 0),ei=e=>{const t=C.useContext(Kb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},yR=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(Kb.Provider,{value:e,children:t})),Gb=C.createContext(!1),xR=()=>C.useContext(Gb);Gb.Provider;function bR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var wR=C.createContext(bR()),SR=()=>C.useContext(wR),CR=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?gm(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},kR=e=>{C.useEffect(()=>{e.clearReset()},[e])},ER=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||gm(r,[e.error,n])),jR=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))}},RR=(e,t)=>e.isLoading&&e.isFetching&&!t,NR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,r_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function PR(e,t,r){var v,_,b,x;const n=xR(),s=SR(),i=ei(),l=i.defaultQueryOptions(e);(_=(v=i.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||_.call(v,l);const o=i.getQueryCache().get(l.queryHash);l._optimisticResults=n?"isRestoring":"optimistic",jR(l),CR(l,s,o),kR(s);const c=!i.getQueryCache().get(l.queryHash),[u]=C.useState(()=>new t(i,l)),g=u.getOptimisticResult(l),d=!n&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(f=>{const p=d?u.subscribe(wt.batchCalls(f)):qt;return u.updateResult(),p},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setOptions(l)},[l,u]),NR(l,g))throw r_(l,u,s);if(ER({result:g,errorResetBoundary:s,throwOnError:l.throwOnError,query:o,suspense:l.suspense}))throw g.error;if((x=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||x.call(b,l,g),l.experimental_prefetchInRender&&!yl.isServer()&&RR(g,n)){const f=c?r_(l,u,s):o==null?void 0:o.promise;f==null||f.catch(qt).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?g:u.trackResult(g)}function Oe(e,t){return PR(e,dR)}function Kn(e,t){const r=ei(),[n]=C.useState(()=>new gR(r,e));C.useEffect(()=>{n.setOptions(e)},[n,e]);const s=C.useSyncExternalStore(C.useCallback(l=>n.subscribe(wt.batchCalls(l)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=C.useCallback((l,o)=>{n.mutate(l,o).catch(qt)},[n]);if(s.error&&gm(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function TR(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,i,l=[],o="",c=e.split("/");for(c[0]||c.shift();s=c.shift();)r=s[0],r==="*"?(l.push(r),o+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),i=s.indexOf(".",1),l.push(s.substring(1,~n?n:~i?i:s.length)),o+=~n&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(o+=(~n?"?":"")+"\\"+s.substring(i))):o+="/"+s;return{keys:l,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var Yb={exports:{}},Qb={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Vo=C;function AR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var DR=typeof Object.is=="function"?Object.is:AR,LR=Vo.useState,OR=Vo.useEffect,MR=Vo.useLayoutEffect,IR=Vo.useDebugValue;function BR(e,t){var r=t(),n=LR({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return MR(function(){s.value=r,s.getSnapshot=t,th(s)&&i({inst:s})},[e,r,t]),OR(function(){return th(s)&&i({inst:s}),e(function(){th(s)&&i({inst:s})})},[e]),IR(r),r}function th(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!DR(e,r)}catch{return!0}}function FR(e,t){return t()}var $R=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?FR:BR;Qb.useSyncExternalStore=Vo.useSyncExternalStore!==void 0?Vo.useSyncExternalStore:$R;Yb.exports=Qb;var HR=Yb.exports;const zR=zu.useInsertionEffect,UR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zb=UR?C.useLayoutEffect:C.useEffect,WR=zR||Zb,_m=e=>{const t=C.useRef([e,(...r)=>t[0](...r)]).current;return WR(()=>{t[0]=e}),t[1]},VR="popstate",ym="pushState",xm="replaceState",qR="hashchange",n_=[VR,ym,xm,qR],KR=e=>{for(const t of n_)addEventListener(t,e);return()=>{for(const t of n_)removeEventListener(t,e)}},Xb=(e,t)=>HR.useSyncExternalStore(KR,e,t),s_=()=>location.search,GR=({ssrSearch:e}={})=>Xb(s_,e!=null?()=>e:s_),i_=()=>location.pathname,YR=({ssrPath:e}={})=>Xb(i_,e!=null?()=>e:i_),QR=(e,{replace:t=!1,state:r=null}={})=>history[t?xm:ym](r,"",e),ZR=(e={})=>[YR(e),QR],o_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[o_]>"u"){for(const e of[ym,xm]){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,o_,{value:!0})}const XR=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Jb=(e="")=>e==="/"?"":e,JR=(e,t)=>e[0]==="~"?e.slice(1):Jb(t)+e,eN=(e="",t)=>XR(a_(Jb(e)),a_(t)),a_=e=>{try{return decodeURI(e)}catch{return e}},ew={hook:ZR,searchHook:GR,parser:TR,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},tw=C.createContext(ew),Mi=()=>C.useContext(tw),rw={},nw=C.createContext(rw),bm=()=>C.useContext(nw),Il=e=>{const[t,r]=e.hook(e);return[eN(e.base,t),_m((n,s)=>e.aroundNav(r,JR(n,e.base),s))]},En=()=>Il(Mi()),wm=(e,t,r,n)=>{const{pattern:s,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),l=s.exec(r)||[],[o,...c]=l;return o!==void 0?[!0,(()=>{const u=i!==!1?Object.fromEntries(i.map((d,v)=>[d,c[v]])):l.groups;let g={...c};return u&&Object.assign(g,u),g})(),...n?[o]:[]]:[!1,null]},tN=e=>wm(Mi().parser,e,En()[0]),sw=({children:e,...t})=>{var g,d,v;const r=Mi(),n=t.hook?ew:r;let s=n;const[i,l=t.ssrSearch??""]=((g=t.ssrPath)==null?void 0:g.split("?"))??[];i&&(t.ssrSearch=l,t.ssrPath=i),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs),t.searchHook=t.searchHook??((v=t.hook)==null?void 0:v.searchHook);let o=C.useRef({}),c=o.current,u=c;for(let _ in n){const b=_==="base"?n[_]+(t[_]??""):t[_]??n[_];c===u&&b!==u[_]&&(o.current=u={...u}),u[_]=b,(b!==n[_]||b!==s[_])&&(s=u)}return C.createElement(tw.Provider,{value:s,children:e})},l_=({children:e,component:t},r)=>t?C.createElement(t,{params:r}):typeof e=="function"?e(r):e,rN=e=>{let t=C.useRef(rw);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},Ut=({path:e,nest:t,match:r,...n})=>{const s=Mi(),[i]=Il(s),[l,o,c]=r??wm(s.parser,e,i,t),u=rN({...bm(),...o});if(!l)return null;const g=c?C.createElement(sw,{base:c},l_(n,u)):l_(n,u);return C.createElement(nw.Provider,{value:u,children:g})},jn=C.forwardRef((e,t)=>{const r=Mi(),[n,s]=Il(r),{to:i="",href:l=i,onClick:o,asChild:c,children:u,className:g,replace:d,state:v,transition:_,...b}=e,x=_m(p=>{p.ctrlKey||p.metaKey||p.altKey||p.shiftKey||p.button!==0||(o==null||o(p),p.defaultPrevented||(p.preventDefault(),s(l,e)))}),f=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return c&&C.isValidElement(u)?C.cloneElement(u,{onClick:x,href:f}):C.createElement("a",{...b,onClick:x,href:f,className:g!=null&&g.call?g(n===l):g,children:u,ref:t})}),iw=e=>Array.isArray(e)?e.flatMap(t=>iw(t&&t.type===C.Fragment?t.props.children:t)):[e],nN=({children:e,location:t})=>{const r=Mi(),[n]=Il(r);for(const s of iw(e)){let i=0;if(C.isValidElement(s)&&(i=wm(r.parser,s.props.path,t||n,s.props.nest))[0])return C.cloneElement(s,{match:i})}return null},$a=e=>{const{to:t,href:r=t}=e,n=Mi(),[,s]=Il(n),i=_m(()=>s(t||r,e)),{ssrContext:l}=n;return Zb(()=>{i()},[]),l&&(l.redirectTo=t),null};async function sN(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 sN(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 ge={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()}`)},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)}),restake:e=>xe(`/v1/setup/restake/${encodeURIComponent(String(e))}`,{method:"POST"}),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"),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})})},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()}`)}}};async function iN(){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())}}/**
|
|
49
|
+
* @license lucide-react v0.454.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const oN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ow=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
54
|
+
* @license lucide-react v0.454.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var aN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
59
|
+
* @license lucide-react v0.454.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const lN=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:l,...o},c)=>C.createElement("svg",{ref:c,...aN,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ow("lucide",s),...o},[...l.map(([u,g])=>C.createElement(u,g)),...Array.isArray(i)?i:[i]]));/**
|
|
64
|
+
* @license lucide-react v0.454.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const xt=(e,t)=>{const r=C.forwardRef(({className:n,...s},i)=>C.createElement(lN,{ref:i,iconNode:t,className:ow(`lucide-${oN(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
69
|
+
* @license lucide-react v0.454.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const cN=xt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
74
|
+
* @license lucide-react v0.454.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const uN=xt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
79
|
+
* @license lucide-react v0.454.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const Sm=xt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
84
|
+
* @license lucide-react v0.454.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const dN=xt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
89
|
+
* @license lucide-react v0.454.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const aw=xt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
94
|
+
* @license lucide-react v0.454.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const hN=xt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
99
|
+
* @license lucide-react v0.454.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const fN=xt("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"}]]);/**
|
|
104
|
+
* @license lucide-react v0.454.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const pN=xt("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"}]]);/**
|
|
109
|
+
* @license lucide-react v0.454.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const Xa=xt("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"}]]);/**
|
|
114
|
+
* @license lucide-react v0.454.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const mN=xt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
119
|
+
* @license lucide-react v0.454.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const gN=xt("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"}]]);/**
|
|
124
|
+
* @license lucide-react v0.454.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const vN=xt("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"}]]);/**
|
|
129
|
+
* @license lucide-react v0.454.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const _N=xt("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"}]]);/**
|
|
134
|
+
* @license lucide-react v0.454.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const yN=xt("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"}]]);/**
|
|
139
|
+
* @license lucide-react v0.454.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const xN=xt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
144
|
+
* @license lucide-react v0.454.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const bN=xt("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"}]]);/**
|
|
149
|
+
* @license lucide-react v0.454.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const wN=xt("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"}]]);/**
|
|
154
|
+
* @license lucide-react v0.454.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const SN=xt("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"}]]);/**
|
|
159
|
+
* @license lucide-react v0.454.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const Cm=xt("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"}]]);/**
|
|
164
|
+
* @license lucide-react v0.454.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const yu=xt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function CN(e){const[t,r]=C.useState([]),[n,s]=C.useState(!1);return C.useEffect(()=>{const i="",l=new EventSource(`/v1/events${i}`,{withCredentials:!0});return l.onopen=()=>s(!0),l.onerror=()=>s(!1),l.onmessage=o=>{try{const c=JSON.parse(o.data);r(u=>[...u.slice(-499),c])}catch{}},()=>{l.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function c_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ss(...e){return t=>{let r=!1;const n=e.map(s=>{const i=c_(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():c_(e[s],null)}}}}function Be(...e){return C.useCallback(ss(...e),e)}var kN=Symbol.for("react.lazy"),xu=zu[" use ".trim().toString()];function EN(e){return typeof e=="object"&&e!==null&&"then"in e}function lw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===kN&&"_payload"in e&&EN(e._payload)}function km(e){const t=jN(e),r=C.forwardRef((n,s)=>{let{children:i,...l}=n;lw(i)&&typeof xu=="function"&&(i=xu(i._payload));const o=C.Children.toArray(i),c=o.find(NN);if(c){const u=c.props.children,g=o.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return a.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var cw=km("Slot");function jN(e){const t=C.forwardRef((r,n)=>{let{children:s,...i}=r;if(lw(s)&&typeof xu=="function"&&(s=xu(s._payload)),C.isValidElement(s)){const l=TN(s),o=PN(i,s.props);return s.type!==C.Fragment&&(o.ref=n?ss(n,l):l),C.cloneElement(s,o)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RN=Symbol("radix.slottable");function NN(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RN}function PN(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function TN(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 uw(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=uw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function dw(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=uw(e))&&(n&&(n+=" "),n+=t);return n}const u_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,d_=dw,id=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return d_(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(u=>{const g=r==null?void 0:r[u],d=i==null?void 0:i[u];if(g===null)return null;const v=u_(g)||u_(d);return s[u][v]}),o=r&&Object.entries(r).reduce((u,g)=>{let[d,v]=g;return v===void 0||(u[d]=v),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,g)=>{let{class:d,className:v,..._}=g;return Object.entries(_).every(b=>{let[x,f]=b;return Array.isArray(f)?f.includes({...i,...o}[x]):{...i,...o}[x]===f})?[...u,d,v]:u},[]);return d_(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Em="-",AN=e=>{const t=LN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const o=l.split(Em);return o[0]===""&&o.length!==1&&o.shift(),hw(o,t)||DN(l)},getConflictingClassGroupIds:(l,o)=>{const c=r[l]||[];return o&&n[l]?[...c,...n[l]]:c}}},hw=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?hw(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Em);return(l=t.validators.find(({validator:o})=>o(i)))==null?void 0:l.classGroupId},h_=/^\[(.+)\]$/,DN=e=>{if(h_.test(e)){const t=h_.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},LN=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return MN(Object.entries(e.classGroups),r).forEach(([i,l])=>{If(l,n,i,t)}),n},If=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:f_(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(ON(s)){If(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{If(l,f_(t,i),r,n)})})},f_=(e,t)=>{let r=e;return t.split(Em).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},ON=e=>e.isThemeGetter,MN=(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,o])=>[t+l,o])):i);return[r,s]}):e,IN=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)}}},fw="!",BN=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,l=o=>{const c=[];let u=0,g=0,d;for(let f=0;f<o.length;f++){let p=o[f];if(u===0){if(p===s&&(n||o.slice(f,f+i)===t)){c.push(o.slice(g,f)),g=f+i;continue}if(p==="/"){d=f;continue}}p==="["?u++:p==="]"&&u--}const v=c.length===0?o:o.substring(g),_=v.startsWith(fw),b=_?v.substring(1):v,x=d&&d>g?d-g:void 0;return{modifiers:c,hasImportantModifier:_,baseClassName:b,maybePostfixModifierPosition:x}};return r?o=>r({className:o,parseClassName:l}):l},FN=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},$N=e=>({cache:IN(e.cacheSize),parseClassName:BN(e),...AN(e)}),HN=/\s+/,zN=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(HN);let o="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{modifiers:g,hasImportantModifier:d,baseClassName:v,maybePostfixModifierPosition:_}=r(u);let b=!!_,x=n(b?v.substring(0,_):v);if(!x){if(!b){o=u+(o.length>0?" "+o:o);continue}if(x=n(v),!x){o=u+(o.length>0?" "+o:o);continue}b=!1}const f=FN(g).join(":"),p=d?f+fw:f,h=p+x;if(i.includes(h))continue;i.push(h);const m=s(x,b);for(let y=0;y<m.length;++y){const w=m[y];i.push(p+w)}o=u+(o.length>0?" "+o:o)}return o};function UN(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=pw(t))&&(n&&(n+=" "),n+=r);return n}const pw=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=pw(e[n]))&&(r&&(r+=" "),r+=t);return r};function WN(e,...t){let r,n,s,i=l;function l(c){const u=t.reduce((g,d)=>d(g),e());return r=$N(u),n=r.cache.get,s=r.cache.set,i=o,o(c)}function o(c){const u=n(c);if(u)return u;const g=zN(c,r);return s(c,g),g}return function(){return i(UN.apply(null,arguments))}}const Ke=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},mw=/^\[(?:([a-z-]+):)?(.+)\]$/i,VN=/^\d+\/\d+$/,qN=new Set(["px","full","screen"]),KN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GN=/\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$/,YN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,QN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ln=e=>xo(e)||qN.has(e)||VN.test(e),us=e=>ia(e,"length",i2),xo=e=>!!e&&!Number.isNaN(Number(e)),rh=e=>ia(e,"number",xo),Ea=e=>!!e&&Number.isInteger(Number(e)),XN=e=>e.endsWith("%")&&xo(e.slice(0,-1)),Ne=e=>mw.test(e),ds=e=>KN.test(e),JN=new Set(["length","size","percentage"]),e2=e=>ia(e,JN,gw),t2=e=>ia(e,"position",gw),r2=new Set(["image","url"]),n2=e=>ia(e,r2,a2),s2=e=>ia(e,"",o2),ja=()=>!0,ia=(e,t,r)=>{const n=mw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},i2=e=>GN.test(e)&&!YN.test(e),gw=()=>!1,o2=e=>QN.test(e),a2=e=>ZN.test(e),l2=()=>{const e=Ke("colors"),t=Ke("spacing"),r=Ke("blur"),n=Ke("brightness"),s=Ke("borderColor"),i=Ke("borderRadius"),l=Ke("borderSpacing"),o=Ke("borderWidth"),c=Ke("contrast"),u=Ke("grayscale"),g=Ke("hueRotate"),d=Ke("invert"),v=Ke("gap"),_=Ke("gradientColorStops"),b=Ke("gradientColorStopPositions"),x=Ke("inset"),f=Ke("margin"),p=Ke("opacity"),h=Ke("padding"),m=Ke("saturate"),y=Ke("scale"),w=Ke("sepia"),k=Ke("skew"),j=Ke("space"),S=Ke("translate"),E=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Ne,t],T=()=>[Ne,t],L=()=>["",Ln,us],$=()=>["auto",xo,Ne],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",Ne],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[xo,Ne];return{cacheSize:500,separator:":",theme:{colors:[ja],spacing:[Ln,us],blur:["none","",ds,Ne],brightness:M(),borderColor:[e],borderRadius:["none","","full",ds,Ne],borderSpacing:T(),borderWidth:L(),contrast:M(),grayscale:P(),hueRotate:M(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[XN,us],inset:O(),margin:O(),opacity:M(),padding:T(),saturate:M(),scale:M(),sepia:P(),skew:M(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ne]}],container:["container"],columns:[{columns:[ds]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...W(),Ne]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ea,Ne]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ne]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ea,Ne]}],"grid-cols":[{"grid-cols":[ja]}],"col-start-end":[{col:["auto",{span:["full",Ea,Ne]},Ne]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[ja]}],"row-start-end":[{row:["auto",{span:[Ea,Ne]},Ne]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ne]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ne,t]}],"min-w":[{"min-w":[Ne,t,"min","max","fit"]}],"max-w":[{"max-w":[Ne,t,"none","full","min","max","fit","prose",{screen:[ds]},ds]}],h:[{h:[Ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ds,us]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",rh]}],"font-family":[{font:[ja]}],"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",Ne]}],"line-clamp":[{"line-clamp":["none",xo,rh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ln,Ne]}],"list-image":[{"list-image":["none",Ne]}],"list-style-type":[{list:["none","disc","decimal",Ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ln,us]}],"underline-offset":[{"underline-offset":["auto",Ln,Ne]}],"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",Ne]}],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",Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),t2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",e2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},n2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"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:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:U()}],"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:["",...U()]}],"outline-offset":[{"outline-offset":[Ln,Ne]}],"outline-w":[{outline:[Ln,us]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Ln,us]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ds,s2]}],"shadow-color":[{shadow:[ja]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ds,Ne]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[d]}],saturate:[{saturate:[m]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ne]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Ne]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Ea,Ne]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ne]}],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",Ne]}],"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",Ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ln,us,rh]}],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"]}}},c2=WN(l2);function X(...e){return c2(dw(e))}const jm=id("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"}}),ce=C.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const l=n?cw:"button";return a.jsx(l,{className:X(jm({variant:t,size:r,className:e})),ref:i,...s})});ce.displayName="Button";const ke=C.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:X("rounded-lg border border-border bg-card text-card-foreground",e),...t}));ke.displayName="Card";const Rn=C.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:X("flex flex-col gap-1.5 p-6 pb-3",e),...t}));Rn.displayName="CardHeader";const oa=C.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:X("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",e),...t}));oa.displayName="CardTitle";const od=C.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:X("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));od.displayName="CardDescription";const et=C.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:X("px-6 pb-6",e),...t}));et.displayName="CardContent";const u2=C.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:X("flex items-center px-6 pb-6 pt-0",e),...t}));u2.displayName="CardFooter";function d2(e){const t=h2(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,o=C.Children.toArray(i),c=o.find(p2);if(c){const u=c.props.children,g=o.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return a.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function h2(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=g2(s),o=m2(i,s.props);return s.type!==C.Fragment&&(o.ref=n?ss(n,l):l),C.cloneElement(s,o)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var f2=Symbol("radix.slottable");function p2(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===f2}function m2(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function g2(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 v2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fe=v2.reduce((e,t)=>{const r=d2(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...o}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vw(e,t){e&&sd.flushSync(()=>e.dispatchEvent(t))}var Jn=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function _2(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Ht=e=>{const{present:t,children:r}=e,n=y2(t),s=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),i=Be(n.ref,x2(s));return typeof r=="function"||n.isPresent?C.cloneElement(s,{ref:i}):null};Ht.displayName="Presence";function y2(e){const[t,r]=C.useState(),n=C.useRef(null),s=C.useRef(e),i=C.useRef("none"),l=e?"mounted":"unmounted",[o,c]=_2(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=gc(n.current);i.current=o==="mounted"?u:"none"},[o]),Jn(()=>{const u=n.current,g=s.current;if(g!==e){const v=i.current,_=gc(u);e?c("MOUNT"):_==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(g&&v!==_?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Jn(()=>{if(t){let u;const g=t.ownerDocument.defaultView??window,d=_=>{const x=gc(n.current).includes(CSS.escape(_.animationName));if(_.target===t&&x&&(c("ANIMATION_END"),!s.current)){const f=t.style.animationFillMode;t.style.animationFillMode="forwards",u=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=f)})}},v=_=>{_.target===t&&(i.current=gc(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{g.clearTimeout(u),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function gc(e){return(e==null?void 0:e.animationName)||"none"}function x2(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 b2(e,t){const r=C.createContext(t),n=i=>{const{children:l,...o}=i,c=C.useMemo(()=>o,Object.values(o));return a.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 un(e,t=[]){let r=[];function n(i,l){const o=C.createContext(l),c=r.length;r=[...r,l];const u=d=>{var p;const{scope:v,children:_,...b}=d,x=((p=v==null?void 0:v[e])==null?void 0:p[c])||o,f=C.useMemo(()=>b,Object.values(b));return a.jsx(x.Provider,{value:f,children:_})};u.displayName=i+"Provider";function g(d,v){var x;const _=((x=v==null?void 0:v[e])==null?void 0:x[c])||o,b=C.useContext(_);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,g]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(o){const c=(o==null?void 0:o[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return s.scopeName=e,[n,w2(s,...t)]}function w2(...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((o,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...o,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function Bt(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 S2=C.createContext(void 0);function Rm(e){const t=C.useContext(S2);return e||t||"ltr"}function C2(e,[t,r]){return Math.min(r,Math.max(t,e))}function ve(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 k2(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Nm="ScrollArea",[_w]=un(Nm),[E2,Fr]=_w(Nm),yw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...l}=e,[o,c]=C.useState(null),[u,g]=C.useState(null),[d,v]=C.useState(null),[_,b]=C.useState(null),[x,f]=C.useState(null),[p,h]=C.useState(0),[m,y]=C.useState(0),[w,k]=C.useState(!1),[j,S]=C.useState(!1),E=Be(t,O=>c(O)),N=Rm(s);return a.jsx(E2,{scope:r,type:n,dir:N,scrollHideDelay:i,scrollArea:o,viewport:u,onViewportChange:g,content:d,onContentChange:v,scrollbarX:_,onScrollbarXChange:b,scrollbarXEnabled:w,onScrollbarXEnabledChange:k,scrollbarY:x,onScrollbarYChange:f,scrollbarYEnabled:j,onScrollbarYEnabledChange:S,onCornerWidthChange:h,onCornerHeightChange:y,children:a.jsx(Fe.div,{dir:N,...l,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":m+"px",...e.style}})})});yw.displayName=Nm;var xw="ScrollAreaViewport",bw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,l=Fr(xw,r),o=C.useRef(null),c=Be(t,o,l.onViewportChange);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Fe.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});bw.displayName=xw;var Nn="ScrollAreaScrollbar",Pm=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Fr(Nn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,o=e.orientation==="horizontal";return C.useEffect(()=>(o?i(!0):l(!0),()=>{o?i(!1):l(!1)}),[o,i,l]),s.type==="hover"?a.jsx(j2,{...n,ref:t,forceMount:r}):s.type==="scroll"?a.jsx(R2,{...n,ref:t,forceMount:r}):s.type==="auto"?a.jsx(ww,{...n,ref:t,forceMount:r}):s.type==="always"?a.jsx(Tm,{...n,ref:t}):null});Pm.displayName=Nn;var j2=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Fr(Nn,e.__scopeScrollArea),[i,l]=C.useState(!1);return C.useEffect(()=>{const o=s.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),l(!0)},g=()=>{c=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",g)}}},[s.scrollArea,s.scrollHideDelay]),a.jsx(Ht,{present:r||i,children:a.jsx(ww,{"data-state":i?"visible":"hidden",...n,ref:t})})}),R2=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Fr(Nn,e.__scopeScrollArea),i=e.orientation==="horizontal",l=ld(()=>c("SCROLL_END"),100),[o,c]=k2("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(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,s.scrollHideDelay,c]),C.useEffect(()=>{const u=s.viewport,g=i?"scrollLeft":"scrollTop";if(u){let d=u[g];const v=()=>{const _=u[g];d!==_&&(c("SCROLL"),l()),d=_};return u.addEventListener("scroll",v),()=>u.removeEventListener("scroll",v)}},[s.viewport,i,c,l]),a.jsx(Ht,{present:r||o!=="hidden",children:a.jsx(Tm,{"data-state":o==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ve(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ve(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),ww=C.forwardRef((e,t)=>{const r=Fr(Nn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,l]=C.useState(!1),o=e.orientation==="horizontal",c=ld(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;l(o?u:g)}},10);return qo(r.viewport,c),qo(r.content,c),a.jsx(Ht,{present:n||i,children:a.jsx(Tm,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Tm=C.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=Fr(Nn,e.__scopeScrollArea),i=C.useRef(null),l=C.useRef(0),[o,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=jw(o.viewport,o.content),g={...n,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:v=>i.current=v,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:v=>l.current=v};function d(v,_){return L2(v,l.current,o,_)}return r==="horizontal"?a.jsx(N2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const v=s.viewport.scrollLeft,_=p_(v,o,s.dir);i.current.style.transform=`translate3d(${_}px, 0, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollLeft=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollLeft=d(v,s.dir))}}):r==="vertical"?a.jsx(P2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const v=s.viewport.scrollTop,_=p_(v,o);i.current.style.transform=`translate3d(0, ${_}px, 0)`}},onWheelScroll:v=>{s.viewport&&(s.viewport.scrollTop=v)},onDragScroll:v=>{s.viewport&&(s.viewport.scrollTop=d(v))}}):null}),N2=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Fr(Nn,e.__scopeScrollArea),[l,o]=C.useState(),c=C.useRef(null),u=Be(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),a.jsx(Cw,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ad(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,d)=>{if(i.viewport){const v=i.viewport.scrollLeft+g.deltaX;e.onWheelScroll(v),Nw(v,d)&&g.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:wu(l.paddingLeft),paddingEnd:wu(l.paddingRight)}})}})}),P2=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Fr(Nn,e.__scopeScrollArea),[l,o]=C.useState(),c=C.useRef(null),u=Be(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),a.jsx(Cw,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ad(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,d)=>{if(i.viewport){const v=i.viewport.scrollTop+g.deltaY;e.onWheelScroll(v),Nw(v,d)&&g.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:wu(l.paddingTop),paddingEnd:wu(l.paddingBottom)}})}})}),[T2,Sw]=_w(Nn),Cw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:g,onResize:d,...v}=e,_=Fr(Nn,r),[b,x]=C.useState(null),f=Be(t,E=>x(E)),p=C.useRef(null),h=C.useRef(""),m=_.viewport,y=n.content-n.viewport,w=Bt(g),k=Bt(c),j=ld(d,10);function S(E){if(p.current){const N=E.clientX-p.current.left,O=E.clientY-p.current.top;u({x:N,y:O})}}return C.useEffect(()=>{const E=N=>{const O=N.target;(b==null?void 0:b.contains(O))&&w(N,y)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[m,b,y,w]),C.useEffect(k,[n,k]),qo(b,j),qo(_.content,j),a.jsx(T2,{scope:r,scrollbar:b,hasThumb:s,onThumbChange:Bt(i),onThumbPointerUp:Bt(l),onThumbPositionChange:k,onThumbPointerDown:Bt(o),children:a.jsx(Fe.div,{...v,ref:f,style:{position:"absolute",...v.style},onPointerDown:ve(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),p.current=b.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",_.viewport&&(_.viewport.style.scrollBehavior="auto"),S(E))}),onPointerMove:ve(e.onPointerMove,S),onPointerUp:ve(e.onPointerUp,E=>{const N=E.target;N.hasPointerCapture(E.pointerId)&&N.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=h.current,_.viewport&&(_.viewport.style.scrollBehavior=""),p.current=null})})})}),bu="ScrollAreaThumb",kw=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Sw(bu,e.__scopeScrollArea);return a.jsx(Ht,{present:r||s.hasThumb,children:a.jsx(A2,{ref:t,...n})})}),A2=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=Fr(bu,r),l=Sw(bu,r),{onThumbPositionChange:o}=l,c=Be(t,d=>l.onThumbChange(d)),u=C.useRef(void 0),g=ld(()=>{u.current&&(u.current(),u.current=void 0)},100);return C.useEffect(()=>{const d=i.viewport;if(d){const v=()=>{if(g(),!u.current){const _=O2(d,o);u.current=_,o()}};return o(),d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,g,o]),a.jsx(Fe.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:ve(e.onPointerDownCapture,d=>{const _=d.target.getBoundingClientRect(),b=d.clientX-_.left,x=d.clientY-_.top;l.onThumbPointerDown({x:b,y:x})}),onPointerUp:ve(e.onPointerUp,l.onThumbPointerUp)})});kw.displayName=bu;var Am="ScrollAreaCorner",Ew=C.forwardRef((e,t)=>{const r=Fr(Am,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?a.jsx(D2,{...e,ref:t}):null});Ew.displayName=Am;var D2=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=Fr(Am,r),[i,l]=C.useState(0),[o,c]=C.useState(0),u=!!(i&&o);return qo(s.scrollbarX,()=>{var d;const g=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(g),c(g)}),qo(s.scrollbarY,()=>{var d;const g=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(g),l(g)}),u?a.jsx(Fe.div,{...n,ref:t,style:{width:i,height:o,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function wu(e){return e?parseInt(e,10):0}function jw(e,t){const r=e/t;return isNaN(r)?0:r}function ad(e){const t=jw(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function L2(e,t,r,n="ltr"){const s=ad(r),i=s/2,l=t||i,o=s-l,c=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-o,g=r.content-r.viewport,d=n==="ltr"?[0,g]:[g*-1,0];return Rw([c,u],d)(e)}function p_(e,t,r="ltr"){const n=ad(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,l=t.content-t.viewport,o=i-n,c=r==="ltr"?[0,l]:[l*-1,0],u=C2(e,c);return Rw([0,l],[0,o])(u)}function Rw(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 Nw(e,t){return e>0&&e<t}var O2=(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,o=r.top!==i.top;(l||o)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function ld(e,t){const r=Bt(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 qo(e,t){const r=Bt(t);Jn(()=>{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 Pw=yw,M2=bw,I2=Ew;const Bl=C.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Pw,{ref:n,className:X("relative overflow-hidden",e),...r,children:[a.jsx(M2,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(Tw,{}),a.jsx(I2,{})]}));Bl.displayName=Pw.displayName;const Tw=C.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(Pm,{ref:n,orientation:t,className:X("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:a.jsx(kw,{className:"relative flex-1 rounded-full bg-[var(--border-strong)]"})}));Tw.displayName=Pm.displayName;const B2="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",F2="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function $2({headline:e}){const[t,r]=C.useState(!1),{events:n}=CN(),s=n.length>0?n[n.length-1]:null;return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground",children:a.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[a.jsx("span",{className:B2,children:"Jinn · starting up"}),a.jsxs("h1",{className:F2,children:[e,"."]}),a.jsx("p",{className:"min-h-[1.5em] font-mono text-sm text-[var(--fg-muted)]",children:s?H2(s):"The daemon is booting. This usually takes a second."}),a.jsxs(ce,{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?a.jsx(aw,{}):a.jsx(Sm,{}),t?"Hide details":"Show details"]}),t&&a.jsx(ke,{className:"bg-[var(--bg-elevated)]",children:a.jsx(et,{className:"p-0",children:a.jsx(Bl,{className:"h-64",children:a.jsxs("div",{className:"px-3 py-2 font-mono text-xs",children:[n.length===0&&a.jsx("div",{className:"text-[var(--fg-dim)]",children:"no events yet"}),n.slice().reverse().map(i=>a.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[a.jsx("span",{className:"text-[var(--fg-dim)]",children:i.ts.slice(11,19)}),a.jsx("span",{className:X(i.kind==="error"?"text-[var(--break-red)]":i.kind==="system"?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]"),children:i.kind}),a.jsx("span",{className:"text-foreground",children:i.message})]},i.id))]})})})})]})})}function H2(e){return e.kind==="error"?`Error: ${e.message}`:e.message}const z2=id("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"}}),ut=C.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:X(z2({variant:t}),e),...r}));ut.displayName="Alert";const or=C.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:X("mb-0.5 font-mono text-[11px] uppercase tracking-[0.14em]",e),...t}));or.displayName="AlertTitle";const mt=C.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:X("text-[12px] [&_p]:leading-relaxed",e),...t}));mt.displayName="AlertDescription";function U2(e,t=[]){let r=[];function n(i,l){const o=C.createContext(l);o.displayName=i+"Context";const c=r.length;r=[...r,l];const u=d=>{var p;const{scope:v,children:_,...b}=d,x=((p=v==null?void 0:v[e])==null?void 0:p[c])||o,f=C.useMemo(()=>b,Object.values(b));return a.jsx(x.Provider,{value:f,children:_})};u.displayName=i+"Provider";function g(d,v){var x;const _=((x=v==null?void 0:v[e])==null?void 0:x[c])||o,b=C.useContext(_);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,g]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(o){const c=(o==null?void 0:o[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return s.scopeName=e,[n,W2(s,...t)]}function W2(...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((o,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...o,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var V2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Aw=V2.reduce((e,t)=>{const r=km(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...o}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Dm="Progress",Lm=100,[q2]=U2(Dm),[K2,G2]=q2(Dm),Dw=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:i=Y2,...l}=e;(s||s===0)&&!m_(s)&&console.error(Q2(`${s}`,"Progress"));const o=m_(s)?s:Lm;n!==null&&!g_(n,o)&&console.error(Z2(`${n}`,"Progress"));const c=g_(n,o)?n:null,u=Su(c)?i(c,o):void 0;return a.jsx(K2,{scope:r,value:c,max:o,children:a.jsx(Aw.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":Su(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Mw(c,o),"data-value":c??void 0,"data-max":o,...l,ref:t})})});Dw.displayName=Dm;var Lw="ProgressIndicator",Ow=C.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=G2(Lw,r);return a.jsx(Aw.div,{"data-state":Mw(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});Ow.displayName=Lw;function Y2(e,t){return`${Math.round(e/t*100)}%`}function Mw(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Su(e){return typeof e=="number"}function m_(e){return Su(e)&&!isNaN(e)&&e>0}function g_(e,t){return Su(e)&&!isNaN(e)&&e<=t&&e>=0}function Q2(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Lm}\`.`}function Z2(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
169
|
+
- a positive number
|
|
170
|
+
- less than the value passed to \`max\` (or ${Lm} if no \`max\` prop is set)
|
|
171
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
172
|
+
|
|
173
|
+
Defaulting to \`null\`.`}var Iw=Dw,X2=Ow;const Om=C.forwardRef(({className:e,value:t,...r},n)=>a.jsx(Iw,{ref:n,className:X("relative h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-sunken)]",e),...r,children:a.jsx(X2,{className:"h-full w-full flex-1 bg-[var(--accent-sky)] transition-all",style:{transform:`translateX(-${100-(t??0)}%)`}})}));Om.displayName=Iw.displayName;const J2={base:"Base","base-sepolia":"Base Sepolia"},eP="font-mono text-[11px] font-medium uppercase tracking-[0.14em]";function tP({address:e,minimumWei:t,chainExplorerBase:r,chain:n,onSharedDefaultRpc:s=!1}){var j;const[i,l]=C.useState(!1),[o,c]=C.useState(null),[u,g]=C.useState(0),d=C.useRef(!1),[v,_]=C.useState({state:"idle"});C.useEffect(()=>{if(o===null)return;g(Math.max(0,Math.floor((Date.now()-o)/1e3)));const S=window.setInterval(()=>{g(Math.max(0,Math.floor((Date.now()-o)/1e3)))},1e3);return()=>window.clearInterval(S)},[o]);const b=async()=>{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)},x=async()=>{var S;d.current=!0,c(Date.now()),g(0),_({state:"requesting"});try{const E=await ge.triggerDrip();c(null),E.ok?_({state:"sent",txHash:E.txHash??((S=E.txHashes)==null?void 0:S.at(-1)),txHashes:E.txHashes,attempts:E.attempts,balanceWei:E.balanceWei,targetWei:E.targetWei}):E.rateLimited||E.reason&&/rate|claimed|429/i.test(E.reason)?_({state:"rate_limited",reason:E.reason??"faucet rate-limited"}):_({state:"failed",reason:E.reason??"faucet funding failed"})}catch(E){c(null),_({state:"failed",reason:E instanceof Error?E.message:"drip failed"})}},f=C.useRef(t);C.useEffect(()=>{f.current!==t&&(f.current=t,_({state:"idle"}),d.current&&x())},[t]);const p=S=>{if(!S)return"unknown";try{const E=Number(BigInt(S))/1e18;return`${E.toFixed(E<.001?4:3)} ETH`}catch{return`${S} wei`}},h=p(t),m=C.useMemo(()=>v.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(u/60*92))),[v.state,u]),y=v.state==="sent"?((j=v.txHashes)==null?void 0:j.length)??v.attempts??(v.txHash?1:0):0,w=v.state==="sent"&&v.balanceWei!==void 0&&v.targetWei!==void 0&&(()=>{try{return BigInt(v.balanceWei)>=BigInt(v.targetWei)}catch{return!1}})(),k=v.state==="sent"&&!w;return a.jsxs(ut,{variant:"warning",className:"flex flex-col gap-4 border-l-2 px-6 py-5",children:[a.jsxs("div",{className:"flex items-baseline justify-between",children:[a.jsx(or,{className:X(eP,"text-[var(--accent-gold)]"),children:"Action needed · fund the master EOA"}),a.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:"auto-detected on chain"})]}),a.jsxs(mt,{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"break-all font-mono text-xs text-foreground",children:e}),a.jsxs("span",{className:"font-mono text-xs text-[var(--fg-muted)]",children:["send at least ",h," on ",J2[n??""]??"this chain"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ce,{type:"button",onClick:x,disabled:v.state==="requesting"||w,className:"bg-[var(--accent-gold)] text-[var(--bg)] hover:bg-[var(--accent-gold-hover)]",children:v.state==="requesting"?"Funding...":w?"Faucet funded":k?"Fund more":"Fund from faucet"}),a.jsx(ce,{type:"button",variant:"secondary",onClick:b,children:i?"Copied":"Copy address"}),a.jsx(ce,{asChild:!0,variant:"ghost",children:a.jsxs("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(Xa,{}),"View on explorer"]})})]}),v.state==="sent"&&a.jsxs("p",{className:X("font-mono text-[11px]",w?"text-[var(--vow-green)]":"text-[var(--accent-gold)]"),children:[w?"Faucet funding complete":"Faucet funding partial",y>0?` (${y} drip${y===1?"":"s"})`:"",".",v.balanceWei&&v.targetWei?` Balance ${p(v.balanceWei)} / target ${p(v.targetWei)}.`:"",k?' Click "Fund more" to top up.':"",v.txHash&&a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{href:`${r}/tx/${v.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent-sky)] hover:underline",children:"view latest tx"})]})]}),v.state==="requesting"&&a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx(Om,{value:m,className:"h-1.5 rounded-full [&>div]:bg-[var(--accent-gold)]"}),a.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:["Requesting faucet drips for ",rP(e),". Elapsed ",u,"s; this can take about a minute on a fresh wallet."]})]}),v.state==="rate_limited"&&a.jsx("p",{className:"font-mono text-[11px] text-[var(--wane)]",children:"Faucet rate-limited. Send manually or wait before trying again."}),v.state==="failed"&&a.jsx("p",{className:"font-mono text-[11px] text-[var(--break-red)]",children:v.reason}),s&&a.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 rP=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var Bw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(l,o,c){var u=this&&this.__decorate||function(m,y,w,k){var j,S=arguments.length,E=S<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,y,w,k);else for(var N=m.length-1;N>=0;N--)(j=m[N])&&(E=(S<3?j(E):S>3?j(y,w,E):j(y,w))||E);return S>3&&E&&Object.defineProperty(y,w,E),E},g=this&&this.__param||function(m,y){return function(w,k){y(w,k,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),v=c(6114),_=c(9924),b=c(844),x=c(5596),f=c(4725),p=c(3656);let h=o.AccessibilityManager=class extends b.Disposable{constructor(m,y){super(),this._terminal=m,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(w=>this._handleResize(w.rows))),this.register(this._terminal.onRender(w=>this._refreshRows(w.start,w.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(w=>this._handleChar(w))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
174
|
+
`))),this.register(this._terminal.onA11yTab(w=>this._handleTab(w))),this.register(this._terminal.onKey(w=>this._handleKey(w.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new x.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,p.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,b.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(m){for(let y=0;y<m;y++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
|
|
175
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),v.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,v.isMac&&this._liveRegion.remove()}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,y){this._liveRegionDebouncer.refresh(m,y,this._terminal.rows)}_renderRows(m,y){const w=this._terminal.buffer,k=w.lines.length.toString();for(let j=m;j<=y;j++){const S=w.translateBufferLineToString(w.ydisp+j,!0),E=(w.ydisp+j+1).toString(),N=this._rowElements[j];N&&(S.length===0?N.innerText=" ":N.textContent=S,N.setAttribute("aria-posinset",E),N.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,y){const w=m.target,k=this._rowElements[y===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==k)return;let j,S;if(y===0?(j=w,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(j=this._rowElements.shift(),S=w,this._rowContainer.removeChild(j)),j.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let 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>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=document.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=h=u([g(1,f.IRenderService)],h)},3614:(l,o)=>{function c(v){return v.replace(/\r?\n/g,"\r")}function u(v,_){return _?"\x1B[200~"+v+"\x1B[201~":v}function g(v,_,b,x){v=u(v=c(v),b.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(v,!0),_.value=""}function d(v,_,b){const x=b.getBoundingClientRect(),f=v.clientX-x.left-10,p=v.clientY-x.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${f}px`,_.style.top=`${p}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=u,o.copyHandler=function(v,_){v.clipboardData&&v.clipboardData.setData("text/plain",_.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,_,b,x){v.stopPropagation(),v.clipboardData&&g(v.clipboardData.getData("text/plain"),_,b,x)},o.paste=g,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(v,_,b,x,f){d(v,_,b),f&&x.rightClickSelect(v),_.value=x.selectionText,_.select()}},7239:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(g,d,v){this._css.set(g,d,v)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,v){this._color.set(g,d,v)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,g,d){c.addEventListener(u,g,d);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(u,g,d))}}}},6465:function(l,o,c){var u=this&&this.__decorate||function(f,p,h,m){var y,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(y=f[j])&&(k=(w<3?y(k):w>3?y(p,h,k):y(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier2=void 0;const d=c(3656),v=c(8460),_=c(844),b=c(2585);let x=o.Linkifier2=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(f){super(),this._bufferService=f,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(f){return this._linkProviders.push(f),{dispose:()=>{const p=this._linkProviders.indexOf(f);p!==-1&&this._linkProviders.splice(p,1)}}}attachToDom(f,p,h){this._element=f,this._mouseService=p,this._renderService=h,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){if(this._lastMouseEvent=f,!this._element||!this._mouseService)return;const p=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const h=f.composedPath();for(let m=0;m<h.length;m++){const y=h[m];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(f){if(this._activeLine!==f.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(f,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,f)||(this._clearCurrentLink(),this._askForLink(f,!0))}_askForLink(f,p){var h,m;this._activeProviderReplies&&p||((h=this._activeProviderReplies)===null||h===void 0||h.forEach(w=>{w==null||w.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=f.y);let y=!1;for(const[w,k]of this._linkProviders.entries())p?!((m=this._activeProviderReplies)===null||m===void 0)&&m.get(w)&&(y=this._checkLinkProviderResult(w,f,y)):k.provideLinks(f.y,j=>{var S,E;if(this._isMouseOut)return;const N=j==null?void 0:j.map(O=>({link:O}));(S=this._activeProviderReplies)===null||S===void 0||S.set(w,N),y=this._checkLinkProviderResult(w,f,y),((E=this._activeProviderReplies)===null||E===void 0?void 0:E.size)===this._linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)})}_removeIntersectingLinks(f,p){const h=new Set;for(let m=0;m<p.size;m++){const y=p.get(m);if(y)for(let w=0;w<y.length;w++){const k=y[w],j=k.link.range.start.y<f?0:k.link.range.start.x,S=k.link.range.end.y>f?this._bufferService.cols:k.link.range.end.x;for(let E=j;E<=S;E++){if(h.has(E)){y.splice(w--,1);break}h.add(E)}}}}_checkLinkProviderResult(f,p,h){var m;if(!this._activeProviderReplies)return h;const y=this._activeProviderReplies.get(f);let w=!1;for(let k=0;k<f;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&y){const k=y.find(j=>this._linkAtPosition(j.link,p));k&&(h=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviders.length&&!h)for(let k=0;k<this._activeProviderReplies.size;k++){const j=(m=this._activeProviderReplies.get(k))===null||m===void 0?void 0:m.find(S=>this._linkAtPosition(S.link,p));if(j){h=!0,this._handleNewLink(j);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._element||!this._mouseService||!this._currentLink)return;const p=this._positionFromMouseEvent(f,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,p){this._element&&this._currentLink&&this._lastMouseEvent&&(!f||!p||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(f.link,p)&&(this._currentLink=f,this._currentLink.state={decorations:{underline:f.link.decorations===void 0||f.link.decorations.underline,pointerCursor:f.link.decorations===void 0||f.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,f.link,this._lastMouseEvent),f.link.decorations={},Object.defineProperties(f.link.decorations,{pointerCursor:{get:()=>{var h,m;return(m=(h=this._currentLink)===null||h===void 0?void 0:h.state)===null||m===void 0?void 0:m.decorations.pointerCursor},set:h=>{var m,y;!((m=this._currentLink)===null||m===void 0)&&m.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&((y=this._element)===null||y===void 0||y.classList.toggle("xterm-cursor-pointer",h)))}},underline:{get:()=>{var h,m;return(m=(h=this._currentLink)===null||h===void 0?void 0:h.state)===null||m===void 0?void 0:m.decorations.underline},set:h=>{var m,y,w;!((m=this._currentLink)===null||m===void 0)&&m.state&&((w=(y=this._currentLink)===null||y===void 0?void 0:y.state)===null||w===void 0?void 0:w.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,h))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(h=>{if(!this._currentLink)return;const m=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=y&&(this._clearCurrentLink(m,y),this._lastMouseEvent&&this._element)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}})))}_linkHover(f,p,h){var m;!((m=this._currentLink)===null||m===void 0)&&m.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(h,p.text)}_fireUnderlineEvent(f,p){const h=f.range,m=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-m-1,h.end.x,h.end.y-m-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)}_linkLeave(f,p,h){var m;!((m=this._currentLink)===null||m===void 0)&&m.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(h,p.text)}_linkAtPosition(f,p){const h=f.range.start.y*this._bufferService.cols+f.range.start.x,m=f.range.end.y*this._bufferService.cols+f.range.end.x,y=p.y*this._bufferService.cols+p.x;return h<=y&&y<=m}_positionFromMouseEvent(f,p,h){const m=h.getCoords(f,p,this._bufferService.cols,this._bufferService.rows);if(m)return{x:m[0],y:m[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,p,h,m,y){return{x1:f,y1:p,x2:h,y2:m,cols:this._bufferService.cols,fg:y}}};o.Linkifier2=x=u([g(0,b.IBufferService)],x)},9042:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,o,c){var u=this&&this.__decorate||function(x,f,p,h){var m,y=arguments.length,w=y<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(x,f,p,h);else for(var k=x.length-1;k>=0;k--)(m=x[k])&&(w=(y<3?m(w):y>3?m(f,p,w):m(f,p))||w);return y>3&&w&&Object.defineProperty(f,p,w),w},g=this&&this.__param||function(x,f){return function(p,h){f(p,h,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),v=c(2585);let _=o.OscLinkProvider=class{constructor(x,f,p){this._bufferService=x,this._optionsService=f,this._oscLinkService=p}provideLinks(x,f){var p;const h=this._bufferService.buffer.lines.get(x-1);if(!h)return void f(void 0);const m=[],y=this._optionsService.rawOptions.linkHandler,w=new d.CellData,k=h.getTrimmedLength();let j=-1,S=-1,E=!1;for(let N=0;N<k;N++)if(S!==-1||h.hasContent(N)){if(h.loadCell(N,w),w.hasExtendedAttrs()&&w.extended.urlId){if(S===-1){S=N,j=w.extended.urlId;continue}E=w.extended.urlId!==j}else S!==-1&&(E=!0);if(E||S!==-1&&N===k-1){const O=(p=this._oscLinkService.getLinkData(j))===null||p===void 0?void 0:p.uri;if(O){const T={start:{x:S+1,y:x},end:{x:N+(E||N!==k-1?0:1),y:x}};let L=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const $=new URL(O);["http:","https:"].includes($.protocol)||(L=!0)}catch{L=!0}L||m.push({text:O,range:T,activate:($,W)=>y?y.activate($,W,T):b(0,W),hover:($,W)=>{var U;return(U=y==null?void 0:y.hover)===null||U===void 0?void 0:U.call(y,$,W,T)},leave:($,W)=>{var U;return(U=y==null?void 0:y.leave)===null||U===void 0?void 0:U.call(y,$,W,T)}})}E=!1,w.hasExtendedAttrs()&&w.extended.urlId?(S=N,j=w.extended.urlId):(S=-1,j=-1)}}f(m)}};function b(x,f){if(confirm(`Do you want to navigate to ${f}?
|
|
176
|
+
|
|
177
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=_=u([g(0,v.IBufferService),g(1,v.IOptionsService),g(2,v.IOscLinkService)],_)},6193:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,u){this._parentWindow=c,this._renderCallback=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,u,g){this._rowCount=g,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},5596:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ScreenDprMonitor=void 0;const u=c(844);class g extends u.Disposable{constructor(v){super(),this._parentWindow=v,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,u.toDisposable)(()=>{this.clearListener()}))}setListener(v){this._listener&&this.clearListener(),this._listener=v,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}o.ScreenDprMonitor=g},3236:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=c(3614),g=c(3656),d=c(6465),v=c(9042),_=c(3730),b=c(1680),x=c(3107),f=c(5744),p=c(2950),h=c(1296),m=c(428),y=c(4269),w=c(5114),k=c(8934),j=c(3230),S=c(9312),E=c(4725),N=c(6731),O=c(8055),T=c(8969),L=c(8460),$=c(844),W=c(6114),U=c(8437),K=c(2584),R=c(7399),P=c(5941),D=c(9074),M=c(2585),B=c(5435),q=c(4567),Z=typeof window<"u"?window.document:null;class ee 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=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((z,G)=>this.refresh(z,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(z=>this._reportWindowsOptions(z))),this.register(this._inputHandler.onColor(z=>this._handleColorEvent(z))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(z=>this._afterResize(z.cols,z.rows))),this.register((0,$.toDisposable)(()=>{var z,G;this._customKeyEventHandler=void 0,(G=(z=this.element)===null||z===void 0?void 0:z.parentNode)===null||G===void 0||G.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const z of A){let G,Y="";switch(z.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;"+z.index}switch(z.type){case 0:const ye=O.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${Y};${(0,P.toRgbString)(ye)}${K.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(ae=>ae.ansi[z.index]=O.rgba.toColor(...z.color));else{const ae=G;this._themeService.modifyColors(je=>je[ae]=O.rgba.toColor(...z.color))}break;case 2:this._themeService.restoreColor(z.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(K.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(K.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,z=this.buffer.lines.get(A);if(!z)return;const G=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,ye=z.getWidth(G),ae=this._renderService.dimensions.css.cell.width*ye,je=this.buffer.y*this._renderService.dimensions.css.cell.height,We=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=We+"px",this.textarea.style.top=je+"px",this.textarea.style.width=ae+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",z=>{this.hasSelection()&&(0,u.copyHandler)(z,this._selectionService)}));const A=z=>(0,u.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,g.addDisposableDomListener)(this.element,"paste",A)),W.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",z=>{z.button===2&&(0,u.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",z=>{(0,u.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",z=>{z.button===1&&(0,u.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){var z;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=Z.createDocumentFragment();this._viewportElement=Z.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=Z.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=Z.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=Z.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=Z.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,(z=this._document.defaultView)!==null&&z!==void 0?z:window),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",Y=>this._handleTextAreaFocus(Y))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(y.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.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=Z.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(b.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(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.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,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,g.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(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",Y=>{!this._overviewRulerRenderer&&Y&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(h.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const A=this,z=this.element;function G(ae){const je=A._mouseService.getMouseReportCoords(ae,A.screenElement);if(!je)return!1;let We,ot;switch(ae.overrideType||ae.type){case"mousemove":ot=32,ae.buttons===void 0?(We=3,ae.button!==void 0&&(We=ae.button<3?ae.button:3)):We=1&ae.buttons?0:4&ae.buttons?1:2&ae.buttons?2:3;break;case"mouseup":ot=0,We=ae.button<3?ae.button:3;break;case"mousedown":ot=1,We=ae.button<3?ae.button:3;break;case"wheel":if(A.viewport.getLinesScrolled(ae)===0)return!1;ot=ae.deltaY<0?0:1,We=4;break;default:return!1}return!(ot===void 0||We===void 0||We>4)&&A.coreMouseService.triggerMouseEvent({col:je.col,row:je.row,x:je.x,y:je.y,button:We,action:ot,ctrl:ae.ctrlKey,alt:ae.altKey,shift:ae.shiftKey})}const Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ye={mouseup:ae=>(G(ae),ae.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(ae)),wheel:ae=>(G(ae),this.cancel(ae,!0)),mousedrag:ae=>{ae.buttons&&G(ae)},mousemove:ae=>{ae.buttons||G(ae)}};this.register(this.coreMouseService.onProtocolChange(ae=>{ae?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ae)),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&ae?Y.mousemove||(z.addEventListener("mousemove",ye.mousemove),Y.mousemove=ye.mousemove):(z.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&ae?Y.wheel||(z.addEventListener("wheel",ye.wheel,{passive:!1}),Y.wheel=ye.wheel):(z.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&ae?Y.mouseup||(z.addEventListener("mouseup",ye.mouseup),Y.mouseup=ye.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),z.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&ae?Y.mousedrag||(Y.mousedrag=ye.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(z,"mousedown",ae=>{if(ae.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ae))return G(ae),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(ae)})),this.register((0,g.addDisposableDomListener)(z,"wheel",ae=>{if(!Y.wheel){if(!this.buffer.hasScrollback){const je=this.viewport.getLinesScrolled(ae);if(je===0)return;const We=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ae.deltaY<0?"A":"B");let ot="";for(let ar=0;ar<Math.abs(je);ar++)ot+=We;return this.coreService.triggerDataEvent(ot,!0),this.cancel(ae,!0)}return this.viewport.handleWheel(ae)?this.cancel(ae):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(z,"touchstart",ae=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ae),this.cancel(ae)},{passive:!0})),this.register((0,g.addDisposableDomListener)(z,"touchmove",ae=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ae)?void 0:this.cancel(ae)},{passive:!1}))}refresh(A,z){var G;(G=this._renderService)===null||G===void 0||G.refreshRows(A,z)}updateCursorStyle(A){var z;!((z=this._selectionService)===null||z===void 0)&&z.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,z,G=0){var Y;G===1?(super.scrollLines(A,z,G),this.refresh(0,this.rows-1)):(Y=this.viewport)===null||Y===void 0||Y.scrollLines(A)}paste(A){(0,u.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}registerLinkProvider(A){return this.linkifier2.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),z}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,z,G){this._selectionService.setSelection(A,z,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,z){var G;(G=this._selectionService)===null||G===void 0||G.selectLines(A,z)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!z&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,R.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!==K.C0.ETX&&G.key!==K.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,z){const G=A.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||A.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||A.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?G:G&&(!z.keyCode||z.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)z=A.charCode;else if(A.which===null||A.which===void 0)z=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;z=A.which}return!(!z||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(z,!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 z=A.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(A),!0}return!1}resize(A,z){A!==this.cols||z!==this.rows?super.resize(A,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,z){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 z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(U.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,z;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(),(z=this.viewport)===null||z===void 0||z.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(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(A){if(this._renderService)switch(A){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${G};${z}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Y=this._renderService.dimensions.css.cell.width.toFixed(0),ye=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ye};${Y}t`)}}cancel(A,z){if(this.options.cancelEvents||z)return A.preventDefault(),A.stopPropagation(),!1}}o.Terminal=ee},9924:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,g){this._rowCount=g,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=d-this._lastRefreshMs,_=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(l,o,c){var u=this&&this.__decorate||function(p,h,m,y){var w,k=arguments.length,j=k<3?h:y===null?y=Object.getOwnPropertyDescriptor(h,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,h,m,y);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(j=(k<3?w(j):k>3?w(h,m,j):w(h,m))||j);return k>3&&j&&Object.defineProperty(h,m,j),j},g=this&&this.__param||function(p,h){return function(m,y){h(m,y,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),v=c(4725),_=c(8460),b=c(844),x=c(2585);let f=o.Viewport=class extends b.Disposable{constructor(p,h,m,y,w,k,j,S){super(),this._viewportElement=p,this._scrollArea=h,this._bufferService=m,this._optionsService=y,this._charSizeService=w,this._renderService=k,this._coreBrowserService=j,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,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(p){if(p)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(p,h){const m=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&m<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const h=this._getPixelsScrolled(p);return h!==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+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(p,h){var m;let y,w="";const k=[],j=h??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let E=p;E<j;E++){const N=S.get(E);if(!N)continue;const O=(m=S.get(E+1))===null||m===void 0?void 0:m.isWrapped;if(w+=N.translateToString(!O),!O||E===S.length-1){const T=document.createElement("div");T.textContent=w,k.push(T),w.length>0&&(y=T),w=""}}return{bufferElements:k,cursorElement:y}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let h=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(p,h){const m=this._optionsService.rawOptions.fastScrollModifier;return m==="alt"&&h.altKey||m==="ctrl"&&h.ctrlKey||m==="shift"&&h.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const h=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(p,h))}};o.Viewport=f=u([g(2,x.IBufferService),g(3,x.IOptionsService),g(4,v.ICharSizeService),g(5,v.IRenderService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],f)},3107:function(l,o,c){var u=this&&this.__decorate||function(f,p,h,m){var y,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(y=f[j])&&(k=(w<3?y(k):w>3?y(p,h,k):y(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(3656),v=c(4725),_=c(844),b=c(2585);let x=o.BufferDecorationRenderer=class extends _.Disposable{constructor(f,p,h,m){super(),this._screenElement=f,this._bufferService=p,this._decorationService=h,this._renderService=m,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(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 f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var p,h;const m=document.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((p=f==null?void 0:f.options)===null||p===void 0?void 0:p.layer)==="top"),m.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=(h=f.options.x)!==null&&h!==void 0?h:0;return y&&y>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(f,m),m}_refreshStyle(f){const p=f.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let h=this._decorationElements.get(f);h||(h=this._createElement(f),f.element=h,this._decorationElements.set(f,h),this._container.appendChild(h),f.onDispose(()=>{this._decorationElements.delete(f),h.remove()})),h.style.top=p*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(h)}}_refreshXPosition(f,p=f.element){var h;if(!p)return;const m=(h=f.options.x)!==null&&h!==void 0?h:0;(f.options.anchor||"left")==="right"?p.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var p;(p=this._decorationElements.get(f))===null||p===void 0||p.remove(),this._decorationElements.delete(f),f.dispose()}};o.BufferDecorationRenderer=x=u([g(1,b.IBufferService),g(2,b.IDecorationService),g(3,v.IRenderService)],x)},5871:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,u){return u>=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,g){return u>=c.startBufferLine-this._linePadding[g||"full"]&&u<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(l,o,c){var u=this&&this.__decorate||function(y,w,k,j){var S,E=arguments.length,N=E<3?w:j===null?j=Object.getOwnPropertyDescriptor(w,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,w,k,j);else for(var O=y.length-1;O>=0;O--)(S=y[O])&&(N=(E<3?S(N):E>3?S(w,k,N):S(w,k))||N);return E>3&&N&&Object.defineProperty(w,k,N),N},g=this&&this.__param||function(y,w){return function(k,j){w(k,j,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),v=c(3656),_=c(4725),b=c(844),x=c(2585),f={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let m=o.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,w,k,j,S,E,N){var O;super(),this._viewportElement=y,this._screenElement=w,this._bufferService=k,this._decorationService=j,this._renderService=S,this._optionsService=E,this._coreBrowseService=N,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)===null||O===void 0||O.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,b.toDisposable)(()=>{var L;(L=this._canvas)===null||L===void 0||L.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,v.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=y,p.center=w,p.right=y,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=p.left,h.right=p.left+p.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowseService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowseService.dpr);f.left=w,f.center=w,f.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const w of y)w.position!=="full"&&this._renderColorZone(w);for(const w of y)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(h[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-f[y.position||"full"]/2),p[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[y.position||"full"]))}_queueRefresh(y,w){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=m=u([g(2,x.IBufferService),g(3,x.IDecorationService),g(4,_.IRenderService),g(5,x.IOptionsService),g(6,_.ICoreBrowserService)],m)},2950:function(l,o,c){var u=this&&this.__decorate||function(x,f,p,h){var m,y=arguments.length,w=y<3?f:h===null?h=Object.getOwnPropertyDescriptor(f,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(x,f,p,h);else for(var k=x.length-1;k>=0;k--)(m=x[k])&&(w=(y<3?m(w):y>3?m(f,p,w):m(f,p))||w);return y>3&&w&&Object.defineProperty(f,p,w),w},g=this&&this.__param||function(x,f){return function(p,h){f(p,h,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),v=c(2585),_=c(2584);let b=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,f,p,h,m,y){this._textarea=x,this._compositionView=f,this._bufferService=p,this._optionsService=h,this._coreService=m,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}},0)}else{this._isSendingComposition=!1;const f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const f=this._textarea.value,p=f.replace(x,"");this._dataAlreadySent=p,f.length>x.length?this._coreService.triggerDataEvent(p,!0):f.length<x.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):f.length===x.length&&f!==x&&this._coreService.triggerDataEvent(f,!0)}},0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,m=f*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=m+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=m+"px",this._textarea.style.top=h+"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"}x||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=b=u([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,v.ICoreService),g(5,d.IRenderService)],b)},9806:(l,o)=>{function c(u,g,d){const v=d.getBoundingClientRect(),_=u.getComputedStyle(d),b=parseInt(_.getPropertyValue("padding-left")),x=parseInt(_.getPropertyValue("padding-top"));return[g.clientX-v.left-b,g.clientY-v.top-x]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(u,g,d,v,_,b,x,f,p){if(!b)return;const h=c(u,g,d);return h?(h[0]=Math.ceil((h[0]+(p?x/2:0))/x),h[1]=Math.ceil(h[1]/f),h[0]=Math.min(Math.max(h[0],1),v+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),_),h):void 0}},9504:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=c(2584);function g(f,p,h,m){const y=f-d(f,h),w=p-d(p,h),k=Math.abs(y-w)-function(j,S,E){let N=0;const O=j-d(j,E),T=S-d(S,E);for(let L=0;L<Math.abs(O-T);L++){const $=v(j,S)==="A"?-1:1,W=E.buffer.lines.get(O+$*L);W!=null&&W.isWrapped&&N++}return N}(f,p,h);return x(k,b(v(f,p),m))}function d(f,p){let h=0,m=p.buffer.lines.get(f),y=m==null?void 0:m.isWrapped;for(;y&&f>=0&&f<p.rows;)h++,m=p.buffer.lines.get(--f),y=m==null?void 0:m.isWrapped;return h}function v(f,p){return f>p?"A":"B"}function _(f,p,h,m,y,w){let k=f,j=p,S="";for(;k!==h||j!==m;)k+=y?1:-1,y&&k>w.cols-1?(S+=w.buffer.translateBufferLineToString(j,!1,f,k),k=0,f=0,j++):!y&&k<0&&(S+=w.buffer.translateBufferLineToString(j,!1,0,f+1),k=w.cols-1,f=k,j--);return S+w.buffer.translateBufferLineToString(j,!1,f,k)}function b(f,p){const h=p?"O":"[";return u.C0.ESC+h+f}function x(f,p){f=Math.floor(f);let h="";for(let m=0;m<f;m++)h+=p;return h}o.moveToCellSequence=function(f,p,h,m){const y=h.buffer.x,w=h.buffer.y;if(!h.buffer.hasScrollback)return function(S,E,N,O,T,L){return g(E,O,T,L).length===0?"":x(_(S,E,S,E-d(E,T),!1,T).length,b("D",L))}(y,w,0,p,h,m)+g(w,p,h,m)+function(S,E,N,O,T,L){let $;$=g(E,O,T,L).length>0?O-d(O,T):E;const W=O,U=function(K,R,P,D,M,B){let q;return q=g(P,D,M,B).length>0?D-d(D,M):R,K<P&&q<=D||K>=P&&q<D?"C":"D"}(S,E,N,O,T,L);return x(_(S,$,N,W,U==="C",T).length,b(U,L))}(y,w,f,p,h,m);let k;if(w===p)return k=y>f?"D":"C",x(Math.abs(y-f),b(k,m));k=w>p?"D":"C";const j=Math.abs(w-p);return x(function(S,E){return E.cols-S}(w>p?f:y,h)+(j-1)*h.cols+1+((w>p?y:f)-1),b(k,m))}},1296:function(l,o,c){var u=this&&this.__decorate||function(T,L,$,W){var U,K=arguments.length,R=K<3?L:W===null?W=Object.getOwnPropertyDescriptor(L,$):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(T,L,$,W);else for(var P=T.length-1;P>=0;P--)(U=T[P])&&(R=(K<3?U(R):K>3?U(L,$,R):U(L,$))||R);return K>3&&R&&Object.defineProperty(L,$,R),R},g=this&&this.__param||function(T,L){return function($,W){L($,W,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),v=c(2550),_=c(2223),b=c(6171),x=c(4725),f=c(8055),p=c(8460),h=c(844),m=c(2585),y="xterm-dom-renderer-owner-",w="xterm-rows",k="xterm-fg-",j="xterm-bg-",S="xterm-focus",E="xterm-selection";let N=1,O=o.DomRenderer=class extends h.Disposable{constructor(T,L,$,W,U,K,R,P,D,M){super(),this._element=T,this._screenElement=L,this._viewportElement=$,this._linkifier2=W,this._charSizeService=K,this._optionsService=R,this._bufferService=P,this._coreBrowserService=D,this._themeService=M,this._terminalClass=N++,this._rowElements=[],this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(w),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(B=>this._injectCss(B))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(B=>this._handleLinkHover(B))),this.register(this._linkifier2.onHideLinkUnderline(B=>this._handleLinkLeave(B))),this.register((0,h.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 v.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${w} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${w} .xterm-dim { color: ${f.color.multiplyOpacity(T.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,L+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",L+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,L+=`${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[$,W]of T.ansi.entries())L+=`${this._terminalSelector} .${k}${$} { color: ${W.css}; }${this._terminalSelector} .${k}${$}.xterm-dim { color: ${f.color.multiplyOpacity(W,.5).css}; }${this._terminalSelector} .${j}${$} { background-color: ${W.css}; }`;L+=`${this._terminalSelector} .${k}${_.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(T.background).css}; }${this._terminalSelector} .${k}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${j}${_.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,L){for(let $=this._rowElements.length;$<=L;$++){const W=document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,L){this._refreshRowElements(T,L),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,L,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,L,$),this.renderRows(0,this._bufferService.rows-1),!T||!L)return;const W=T[1]-this._bufferService.buffer.ydisp,U=L[1]-this._bufferService.buffer.ydisp,K=Math.max(W,0),R=Math.min(U,this._bufferService.rows-1);if(K>=this._bufferService.rows||R<0)return;const P=document.createDocumentFragment();if($){const D=T[0]>L[0];P.appendChild(this._createSelectionElement(K,D?L[0]:T[0],D?T[0]:L[0],R-K+1))}else{const D=W===K?T[0]:0,M=K===U?L[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(K,D,M));const B=R-K-1;if(P.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,B)),K!==R){const q=U===R?L[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(R,0,q))}}this._selectionContainer.appendChild(P)}_createSelectionElement(T,L,$,W=1){const U=document.createElement("div");return U.style.height=W*this.dimensions.css.cell.height+"px",U.style.top=T*this.dimensions.css.cell.height+"px",U.style.left=L*this.dimensions.css.cell.width+"px",U.style.width=this.dimensions.css.cell.width*($-L)+"px",U}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const T of this._rowElements)T.replaceChildren()}renderRows(T,L){const $=this._bufferService.buffer,W=$.ybase+$.y,U=Math.min($.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=T;D<=L;D++){const M=D+$.ydisp,B=this._rowElements[D],q=$.lines.get(M);if(!B||!q)break;B.replaceChildren(...this._rowFactory.createRow(q,M,M===W,R,P,U,K,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,L,$,W,U,K){$<0&&(T=0),W<0&&(L=0);const R=this._bufferService.rows-1;$=Math.max(Math.min($,R),0),W=Math.max(Math.min(W,R),0),U=Math.min(U,this._bufferService.cols);const P=this._bufferService.buffer,D=P.ybase+P.y,M=Math.min(P.x,U-1),B=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=$;ee<=W;++ee){const J=ee+P.ydisp,A=this._rowElements[ee],z=P.lines.get(J);if(!A||!z)break;A.replaceChildren(...this._rowFactory.createRow(z,J,J===D,q,Z,M,B,this.dimensions.css.cell.width,this._widthCache,K?ee===$?T:0:-1,K?(ee===W?L:U)-1:-1))}}};o.DomRenderer=O=u([g(4,m.IInstantiationService),g(5,x.ICharSizeService),g(6,m.IOptionsService),g(7,m.IBufferService),g(8,x.ICoreBrowserService),g(9,x.IThemeService)],O)},3787:function(l,o,c){var u=this&&this.__decorate||function(k,j,S,E){var N,O=arguments.length,T=O<3?j:E===null?E=Object.getOwnPropertyDescriptor(j,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,j,S,E);else for(var L=k.length-1;L>=0;L--)(N=k[L])&&(T=(O<3?N(T):O>3?N(j,S,T):N(j,S))||T);return O>3&&T&&Object.defineProperty(j,S,T),T},g=this&&this.__param||function(k,j){return function(S,E){j(S,E,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),v=c(643),_=c(511),b=c(2585),x=c(8055),f=c(4725),p=c(4269),h=c(6171),m=c(3734);let y=o.DomRendererRowFactory=class{constructor(k,j,S,E,N,O,T){this._document=k,this._characterJoinerService=j,this._optionsService=S,this._coreBrowserService=E,this._coreService=N,this._decorationService=O,this._themeService=T,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,j,S){this._selectionStart=k,this._selectionEnd=j,this._columnSelectMode=S}createRow(k,j,S,E,N,O,T,L,$,W,U){const K=[],R=this._characterJoinerService.getJoinedCharacters(j),P=this._themeService.colors;let D,M=k.getNoBgTrimmedLength();S&&M<O+1&&(M=O+1);let B=0,q="",Z=0,ee=0,J=0,A=!1,z=0,G=!1,Y=0;const ye=[],ae=W!==-1&&U!==-1;for(let je=0;je<M;je++){k.loadCell(je,this._workCell);let We=this._workCell.getWidth();if(We===0)continue;let ot=!1,ar=je,be=this._workCell;if(R.length>0&&je===R[0][0]){ot=!0;const he=R.shift();be=new p.JoinedCellData(this._workCell,k.translateToString(!0,he[0],he[1]),he[1]-he[0]),ar=he[1]-1,We=be.getWidth()}const lr=this._isCellInSelection(je,j),cr=S&&je===O,Tn=ae&&je>=W&&je<=U;let Hr=!1;this._decorationService.forEachDecorationAtCell(je,j,void 0,he=>{Hr=!0});let An=be.getChars()||v.WHITESPACE_CELL_CHAR;if(An===" "&&(be.isUnderline()||be.isOverline())&&(An=" "),Y=We*L-$.get(An,be.isBold(),be.isItalic()),D){if(B&&(lr&&G||!lr&&!G&&be.bg===Z)&&(lr&&G&&P.selectionForeground||be.fg===ee)&&be.extended.ext===J&&Tn===A&&Y===z&&!cr&&!ot&&!Hr){q+=An,B++;continue}B&&(D.textContent=q),D=this._document.createElement("span"),B=0,q=""}else D=this._document.createElement("span");if(Z=be.bg,ee=be.fg,J=be.extended.ext,A=Tn,z=Y,G=lr,ot&&O>=je&&O<=ar&&(O=je),!this._coreService.isCursorHidden&&cr){if(ye.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&ye.push("xterm-cursor-blink"),ye.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(N)switch(N){case"outline":ye.push("xterm-cursor-outline");break;case"block":ye.push("xterm-cursor-block");break;case"bar":ye.push("xterm-cursor-bar");break;case"underline":ye.push("xterm-cursor-underline")}}if(be.isBold()&&ye.push("xterm-bold"),be.isItalic()&&ye.push("xterm-italic"),be.isDim()&&ye.push("xterm-dim"),q=be.isInvisible()?v.WHITESPACE_CELL_CHAR:be.getChars()||v.WHITESPACE_CELL_CHAR,be.isUnderline()&&(ye.push(`xterm-underline-${be.extended.underlineStyle}`),q===" "&&(q=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${m.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let he=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&he<8&&(he+=8),D.style.textDecorationColor=P.ansi[he].css}be.isOverline()&&(ye.push("xterm-overline"),q===" "&&(q=" ")),be.isStrikethrough()&&ye.push("xterm-strikethrough"),Tn&&(D.style.textDecoration="underline");let dt=be.getFgColor(),hn=be.getFgColorMode(),I=be.getBgColor(),H=be.getBgColorMode();const V=!!be.isInverse();if(V){const he=dt;dt=I,I=he;const Ee=hn;hn=H,H=Ee}let re,se,te,le=!1;switch(this._decorationService.forEachDecorationAtCell(je,j,void 0,he=>{he.options.layer!=="top"&&le||(he.backgroundColorRGB&&(H=50331648,I=he.backgroundColorRGB.rgba>>8&16777215,re=he.backgroundColorRGB),he.foregroundColorRGB&&(hn=50331648,dt=he.foregroundColorRGB.rgba>>8&16777215,se=he.foregroundColorRGB),le=he.options.layer==="top")}),!le&&lr&&(re=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,I=re.rgba>>8&16777215,H=50331648,le=!0,P.selectionForeground&&(hn=50331648,dt=P.selectionForeground.rgba>>8&16777215,se=P.selectionForeground)),le&&ye.push("xterm-decoration-top"),H){case 16777216:case 33554432:te=P.ansi[I],ye.push(`xterm-bg-${I}`);break;case 50331648:te=x.rgba.toColor(I>>16,I>>8&255,255&I),this._addStyle(D,`background-color:#${w((I>>>0).toString(16),"0",6)}`);break;default:V?(te=P.foreground,ye.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):te=P.background}switch(re||be.isDim()&&(re=x.color.multiplyOpacity(te,.5)),hn){case 16777216:case 33554432:be.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(D,te,P.ansi[dt],be,re,void 0)||ye.push(`xterm-fg-${dt}`);break;case 50331648:const he=x.rgba.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(D,te,he,be,re,se)||this._addStyle(D,`color:#${w(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,te,P.foreground,be,re,void 0)||V&&ye.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ye.length&&(D.className=ye.join(" "),ye.length=0),cr||ot||Hr?D.textContent=q:B++,Y!==this.defaultSpacing&&(D.style.letterSpacing=`${Y}px`),K.push(D),je=ar}return D&&B&&(D.textContent=q),K}_applyMinimumContrast(k,j,S,E,N,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.excludeFromContrastRatioDemands)(E.getCode()))return!1;const T=this._getContrastCache(E);let L;if(N||O||(L=T.getColor(j.rgba,S.rgba)),L===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);L=x.color.ensureContrastRatio(N||j,O||S,$),T.setColor((N||j).rgba,(O||S).rgba,L??null)}return!!L&&(this._addStyle(k,`color:${L.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,j){k.setAttribute("style",`${k.getAttribute("style")||""}${j};`)}_isCellInSelection(k,j){const S=this._selectionStart,E=this._selectionEnd;return!(!S||!E)&&(this._columnSelectMode?S[0]<=E[0]?k>=S[0]&&j>=S[1]&&k<E[0]&&j<=E[1]:k<S[0]&&j>=S[1]&&k>=E[0]&&j<=E[1]:j>S[1]&&j<E[1]||S[1]===E[1]&&j===S[1]&&k>=S[0]&&k<E[0]||S[1]<E[1]&&j===E[1]&&k<E[0]||S[1]<E[1]&&j===S[1]&&k>=S[0])}};function w(k,j,S){for(;k.length<S;)k=j+k;return k}o.DomRendererRowFactory=y=u([g(1,f.ICharacterJoinerService),g(2,b.IOptionsService),g(3,f.ICoreBrowserService),g(4,b.ICoreService),g(5,b.IDecorationService),g(6,f.IThemeService)],y)},2550:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const u=c.createElement("span"),g=c.createElement("span");g.style.fontWeight="bold";const d=c.createElement("span");d.style.fontStyle="italic";const v=c.createElement("span");v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[u,g,d,v],this._container.appendChild(u),this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(v),c.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,u,g,d){c===this._font&&u===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=u,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,u,g){let d=0;if(!u&&!g&&c.length===1&&(d=c.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(c,0);let v=c;u&&(v+="B"),g&&(v+="I");let _=this._holey.get(v);if(_===void 0){let b=0;u&&(b|=1),g&&(b|=2),_=this._measure(c,b),this._holey.set(v,_)}return _}_measure(c,u){const g=this._measureElements[u];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(l,o)=>{function c(u){return 57508<=u&&u<=57558}Object.defineProperty(o,"__esModule",{value:!0}),o.createRenderDimensions=o.excludeFromContrastRatioDemands=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},o.excludeFromContrastRatioDemands=function(u){return c(u)||function(g){return 9472<=g&&g<=9631}(u)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,o,c){var u=this&&this.__decorate||function(f,p,h,m){var y,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(y=f[j])&&(k=(w<3?y(k):w>3?y(p,h,k):y(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),v=c(8460),_=c(844);let b=o.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,p,h){super(),this._optionsService=h,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new x(f,p,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};o.CharSizeService=b=u([g(2,d.IOptionsService)],b);class x{constructor(p,h,m){this._document=p,this._parentElement=h,this._optionsService=m,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const p={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return p.width!==0&&p.height!==0&&(this._result.width=p.width/32,this._result.height=Math.ceil(p.height)),this._result}}},4269:function(l,o,c){var u=this&&this.__decorate||function(p,h,m,y){var w,k=arguments.length,j=k<3?h:y===null?y=Object.getOwnPropertyDescriptor(h,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,h,m,y);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(j=(k<3?w(j):k>3?w(h,m,j):w(h,m))||j);return k>3&&j&&Object.defineProperty(h,m,j),j},g=this&&this.__param||function(p,h){return function(m,y){h(m,y,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),v=c(643),_=c(511),b=c(2585);class x extends d.AttributeData{constructor(h,m,y){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=m,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=x;let f=o.CharacterJoinerService=class Fw{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(h){const m={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(m),m.id}deregister(h){for(let m=0;m<this._characterJoiners.length;m++)if(this._characterJoiners[m].id===h)return this._characterJoiners.splice(m,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const m=this._bufferService.buffer.lines.get(h);if(!m||m.length===0)return[];const y=[],w=m.translateToString(!0);let k=0,j=0,S=0,E=m.getFg(0),N=m.getBg(0);for(let O=0;O<m.getTrimmedLength();O++)if(m.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==N){if(O-k>1){const T=this._getJoinedRanges(w,S,j,m,k);for(let L=0;L<T.length;L++)y.push(T[L])}k=O,S=j,E=this._workCell.fg,N=this._workCell.bg}j+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const O=this._getJoinedRanges(w,S,j,m,k);for(let T=0;T<O.length;T++)y.push(O[T])}return y}_getJoinedRanges(h,m,y,w,k){const j=h.substring(m,y);let S=[];try{S=this._characterJoiners[0].handler(j)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const N=this._characterJoiners[E].handler(j);for(let O=0;O<N.length;O++)Fw._mergeRanges(S,N[O])}catch(N){console.error(N)}return this._stringRangesToCellRanges(S,w,k),S}_stringRangesToCellRanges(h,m,y){let w=0,k=!1,j=0,S=h[w];if(S){for(let E=y;E<this._bufferService.cols;E++){const N=m.getWidth(E),O=m.getString(E).length||v.WHITESPACE_CELL_CHAR.length;if(N!==0){if(!k&&S[0]<=j&&(S[0]=E,k=!0),S[1]<=j){if(S[1]=E,S=h[++w],!S)break;S[0]<=j?(S[0]=E,k=!0):k=!1}j+=O}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(h,m){let y=!1;for(let w=0;w<h.length;w++){const k=h[w];if(y){if(m[1]<=k[0])return h[w-1][1]=m[1],h;if(m[1]<=k[1])return h[w-1][1]=Math.max(m[1],k[1]),h.splice(w,1),h;h.splice(w,1),w--}else{if(m[1]<=k[0])return h.splice(w,0,m),h;if(m[1]<=k[1])return k[0]=Math.min(m[0],k[0]),h;m[0]<k[1]&&(k[0]=Math.min(m[0],k[0]),y=!0)}}return y?h[h.length-1][1]=m[1]:h.push(m),h}};o.CharacterJoinerService=f=u([g(0,b.IBufferService)],f)},5114:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0,o.CoreBrowserService=class{constructor(c,u){this._textarea=c,this.window=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(l,o,c){var u=this&&this.__decorate||function(b,x,f,p){var h,m=arguments.length,y=m<3?x:p===null?p=Object.getOwnPropertyDescriptor(x,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,x,f,p);else for(var w=b.length-1;w>=0;w--)(h=b[w])&&(y=(m<3?h(y):m>3?h(x,f,y):h(x,f))||y);return m>3&&y&&Object.defineProperty(x,f,y),y},g=this&&this.__param||function(b,x){return function(f,p){x(f,p,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),v=c(9806);let _=o.MouseService=class{constructor(b,x){this._renderService=b,this._charSizeService=x}getCoords(b,x,f,p,h){return(0,v.getCoords)(window,b,x,f,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(b,x){const f=(0,v.getCoordsRelativeToElement)(window,b,x);if(this._charSizeService.hasValidSize)return f[0]=Math.min(Math.max(f[0],0),this._renderService.dimensions.css.canvas.width-1),f[1]=Math.min(Math.max(f[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(f[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(f[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(f[0]),y:Math.floor(f[1])}}};o.MouseService=_=u([g(0,d.IRenderService),g(1,d.ICharSizeService)],_)},3230:function(l,o,c){var u=this&&this.__decorate||function(y,w,k,j){var S,E=arguments.length,N=E<3?w:j===null?j=Object.getOwnPropertyDescriptor(w,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,w,k,j);else for(var O=y.length-1;O>=0;O--)(S=y[O])&&(N=(E<3?S(N):E>3?S(w,k,N):S(w,k))||N);return E>3&&N&&Object.defineProperty(w,k,N),N},g=this&&this.__param||function(y,w){return function(k,j){w(k,j,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(3656),v=c(6193),_=c(5596),b=c(4725),x=c(8460),f=c(844),p=c(7226),h=c(2585);let m=o.RenderService=class extends f.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(y,w,k,j,S,E,N,O){if(super(),this._rowCount=y,this._charSizeService=j,this._renderer=this.register(new f.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v.RenderDebouncer(N.window,(T,L)=>this._renderRows(T,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new _.ScreenDprMonitor(N.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)===null||T===void 0?void 0:T.clear()})),this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register((0,d.addDisposableDomListener)(N.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(O.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in N.window){const T=new N.window.IntersectionObserver(L=>this._handleIntersectionChange(L[L.length-1]),{threshold:0});T.observe(w),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,w,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(y,w,this._rowCount))}_renderRows(y,w){this._renderer.value&&(y=Math.min(y,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(y,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:y,end:w}),this._onRender.fire({start:y,end:w}),this._isNextRenderRedrawOnly=!0)}resize(y,w){this._rowCount=w,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(y){this._renderer.value=y,this._renderer.value.onRequestRedraw(w=>this.refreshRows(w.start,w.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,w;this._renderer.value&&((w=(y=this._renderer.value).clearTextureAtlas)===null||w===void 0||w.call(y),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(y,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(y,w)):this._renderer.value.handleResize(y,w),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,w,k){var j;this._selectionState.start=y,this._selectionState.end=w,this._selectionState.columnSelectMode=k,(j=this._renderer.value)===null||j===void 0||j.handleSelectionChanged(y,w,k)}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()}};o.RenderService=m=u([g(2,h.IOptionsService),g(3,b.ICharSizeService),g(4,h.IDecorationService),g(5,h.IBufferService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],m)},9312:function(l,o,c){var u=this&&this.__decorate||function(S,E,N,O){var T,L=arguments.length,$=L<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,N):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(S,E,N,O);else for(var W=S.length-1;W>=0;W--)(T=S[W])&&($=(L<3?T($):L>3?T(E,N,$):T(E,N))||$);return L>3&&$&&Object.defineProperty(E,N,$),$},g=this&&this.__param||function(S,E){return function(N,O){E(N,O,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),v=c(9504),_=c(456),b=c(4725),x=c(8460),f=c(844),p=c(6114),h=c(4841),m=c(511),y=c(2585),w=" ",k=new RegExp(w,"g");let j=o.SelectionService=class extends f.Disposable{constructor(S,E,N,O,T,L,$,W,U){super(),this._element=S,this._screenElement=E,this._linkifier=N,this._bufferService=O,this._coreService=T,this._mouseService=L,this._optionsService=$,this._renderService=W,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new m.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(K=>this._handleTrim(K)),this.register(this._bufferService.buffers.onBufferActivate(K=>this._handleBufferActivate(K))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,f.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!S||!E||S[0]===E[0]&&S[1]===E[1])}get selectionText(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!S||!E)return"";const N=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(S[0]===E[0])return"";const T=S[0]<E[0]?S[0]:E[0],L=S[0]<E[0]?E[0]:S[0];for(let $=S[1];$<=E[1];$++){const W=N.translateBufferLineToString($,!0,T,L);O.push(W)}}else{const T=S[1]===E[1]?E[0]:void 0;O.push(N.translateBufferLineToString(S[1],!0,S[0],T));for(let L=S[1]+1;L<=E[1]-1;L++){const $=N.lines.get(L),W=N.translateBufferLineToString(L,!0);$!=null&&$.isWrapped?O[O.length-1]+=W:O.push(W)}if(S[1]!==E[1]){const L=N.lines.get(E[1]),$=N.translateBufferLineToString(E[1],!0,0,E[0]);L&&L.isWrapped?O[O.length-1]+=$:O.push($)}}return O.map(T=>T.replace(k," ")).join(p.isWindows?`\r
|
|
178
|
+
`:`
|
|
179
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),p.isLinux&&S&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(S){const E=this._getMouseBufferCoords(S),N=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(N&&O&&E)&&this._areCoordsInSelection(E,N,O)}isCellInSelection(S,E){const N=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!N||!O)&&this._areCoordsInSelection([S,E],N,O)}_areCoordsInSelection(S,E,N){return S[1]>E[1]&&S[1]<N[1]||E[1]===N[1]&&S[1]===E[1]&&S[0]>=E[0]&&S[0]<N[0]||E[1]<N[1]&&S[1]===N[1]&&S[0]<N[0]||E[1]<N[1]&&S[1]===E[1]&&S[0]>=E[0]}_selectWordAtCursor(S,E){var N,O;const T=(O=(N=this._linkifier.currentLink)===null||N===void 0?void 0:N.link)===null||O===void 0?void 0:O.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(S);return!!L&&(this._selectWordAt(L,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,E){this._model.clearSelection(),S=Math.max(S,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const E=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(S){let E=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=N?0:(E>N&&(E-=N),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(S){return p.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const E=this._getMouseBufferCoords(S);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(S){return S.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const N=this._bufferService.buffer;if(this._model.selectionEnd[1]<N.lines.length){const O=N.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const E=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const O=(0,v.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,N=!(!S||!E||S[0]===E[0]&&S[1]===E[1]);N?S&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,E,N)):this._oldHasSelection&&this._fireOnSelectionChange(S,E,N)}_fireOnSelectionChange(S,E,N){this._oldSelectionStart=S,this._oldSelectionEnd=E,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(S,E){let N=E;for(let O=0;E>=O;O++){const T=S.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:T>1&&E!==O&&(N+=T-1)}return N}setSelection(S,E,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,E],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,E,N=!0,O=!0){if(S[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,L=T.lines.get(S[1]);if(!L)return;const $=T.translateBufferLineToString(S[1],!1);let W=this._convertViewportColToCharacterIndex(L,S[0]),U=W;const K=S[0]-W;let R=0,P=0,D=0,M=0;if($.charAt(W)===" "){for(;W>0&&$.charAt(W-1)===" ";)W--;for(;U<$.length&&$.charAt(U+1)===" ";)U++}else{let Z=S[0],ee=S[0];L.getWidth(Z)===0&&(R++,Z--),L.getWidth(ee)===2&&(P++,ee++);const J=L.getString(ee).length;for(J>1&&(M+=J-1,U+=J-1);Z>0&&W>0&&!this._isCharWordSeparator(L.loadCell(Z-1,this._workCell));){L.loadCell(Z-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(R++,Z--):A>1&&(D+=A-1,W-=A-1),W--,Z--}for(;ee<L.length&&U+1<$.length&&!this._isCharWordSeparator(L.loadCell(ee+1,this._workCell));){L.loadCell(ee+1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,ee++):A>1&&(M+=A-1,U+=A-1),U++,ee++}}U++;let B=W+K-R+D,q=Math.min(this._bufferService.cols,U-W+R+P-D-M);if(E||$.slice(W,U).trim()!==""){if(N&&B===0&&L.getCodePoint(0)!==32){const Z=T.lines.get(S[1]-1);if(Z&&L.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(ee){const J=this._bufferService.cols-ee.start;B-=J,q+=J}}}if(O&&B+q===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const Z=T.lines.get(S[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const ee=this._getWordAt([0,S[1]+1],!1,!1,!0);ee&&(q+=ee.length)}}return{start:B,length:q}}}_selectWordAt(S,E){const N=this._getWordAt(S,E);if(N){for(;N.start<0;)N.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[N.start,S[1]],this._model.selectionStartLength=N.length}}_selectToWordAt(S){const E=this._getWordAt(S,!0);if(E){let N=S[1];for(;E.start<0;)E.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,N]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const E=this._bufferService.buffer.getWrappedRangeForLine(S),N={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(N,this._bufferService.cols)}};o.SelectionService=j=u([g(3,y.IBufferService),g(4,y.ICoreService),g(5,b.IMouseService),g(6,y.IOptionsService),g(7,b.IRenderService),g(8,b.ICoreBrowserService)],j)},4725:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService")},6731:function(l,o,c){var u=this&&this.__decorate||function(j,S,E,N){var O,T=arguments.length,L=T<3?S:N===null?N=Object.getOwnPropertyDescriptor(S,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(j,S,E,N);else for(var $=j.length-1;$>=0;$--)(O=j[$])&&(L=(T<3?O(L):T>3?O(S,E,L):O(S,E))||L);return T>3&&L&&Object.defineProperty(S,E,L),L},g=this&&this.__param||function(j,S){return function(E,N){S(E,N,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),v=c(8055),_=c(8460),b=c(844),x=c(2585),f=v.css.toColor("#ffffff"),p=v.css.toColor("#000000"),h=v.css.toColor("#ffffff"),m=v.css.toColor("#000000"),y={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let E=0;E<216;E++){const N=S[E/36%6|0],O=S[E/6%6|0],T=S[E%6];j.push({css:v.channels.toCss(N,O,T),rgba:v.channels.toRgba(N,O,T)})}for(let E=0;E<24;E++){const N=8+10*E;j.push({css:v.channels.toCss(N,N,N),rgba:v.channels.toRgba(N,N,N)})}return j})());let w=o.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:f,background:p,cursor:h,cursorAccent:m,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:v.color.blend(p,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:v.color.blend(p,y),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(j={}){const S=this._colors;if(S.foreground=k(j.foreground,f),S.background=k(j.background,p),S.cursor=k(j.cursor,h),S.cursorAccent=k(j.cursorAccent,m),S.selectionBackgroundTransparent=k(j.selectionBackground,y),S.selectionBackgroundOpaque=v.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=k(j.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=v.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=j.selectionForeground?k(j.selectionForeground,v.NULL_COLOR):void 0,S.selectionForeground===v.NULL_COLOR&&(S.selectionForeground=void 0),v.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=v.color.opacity(S.selectionBackgroundTransparent,.3)),v.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=v.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=o.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=k(j.black,o.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=k(j.red,o.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=k(j.green,o.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=k(j.yellow,o.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=k(j.blue,o.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=k(j.magenta,o.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=k(j.cyan,o.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=k(j.white,o.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=k(j.brightBlack,o.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=k(j.brightRed,o.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=k(j.brightGreen,o.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=k(j.brightYellow,o.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=k(j.brightBlue,o.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=k(j.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=k(j.brightCyan,o.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=k(j.brightWhite,o.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const E=Math.min(S.ansi.length-16,j.extendedAnsi.length);for(let N=0;N<E;N++)S.ansi[N+16]=k(j.extendedAnsi[N],o.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(j){this._restoreColor(j),this._onChangeColors.fire(this.colors)}_restoreColor(j){if(j!==void 0)switch(j){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[j]=this._restoreColors.ansi[j]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(j){j(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function k(j,S){if(j!==void 0)try{return v.css.toColor(j)}catch{}return S}o.ThemeService=w=u([g(0,x.IOptionsService)],w)},6349:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),g=c(844);class d extends g.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const b=new Array(_);for(let x=0;x<Math.min(_,this.length);x++)b[x]=this._array[this._getCyclicIndex(x)];this._array=b,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let b=this._length;b<_;b++)this._array[b]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,b){this._array[this._getCyclicIndex(_)]=b}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(_,b,...x){if(b){for(let f=_;f<this._length-b;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+b)];this._length-=b,this.onDeleteEmitter.fire({index:_,amount:b})}for(let f=this._length-1;f>=_;f--)this._array[this._getCyclicIndex(f+x.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<x.length;f++)this._array[this._getCyclicIndex(_+f)]=x[f];if(x.length&&this.onInsertEmitter.fire({index:_,amount:x.length}),this._length+x.length>this._maxLength){const f=this._length+x.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}else this._length+=x.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,b,x){if(!(b<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let p=b-1;p>=0;p--)this.set(_+p+x,this.get(_+p));const f=_+b+x-this._length;if(f>0)for(this._length+=f;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let f=0;f<b;f++)this.set(_+f+x,this.get(_+f))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}o.CircularList=d},1439:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,g=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const v in u)d[v]=g<=1?u[v]:u[v]&&c(u[v],g-1);return d}},8055:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;const u=c(6114);let g=0,d=0,v=0,_=0;var b,x,f,p,h;function m(w){const k=w.toString(16);return k.length<2?"0"+k:k}function y(w,k){return w<k?(k+.05)/(w+.05):(w+.05)/(k+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(w){w.toCss=function(k,j,S,E){return E!==void 0?`#${m(k)}${m(j)}${m(S)}${m(E)}`:`#${m(k)}${m(j)}${m(S)}`},w.toRgba=function(k,j,S,E=255){return(k<<24|j<<16|S<<8|E)>>>0}}(b||(o.channels=b={})),function(w){function k(j,S){return _=Math.round(255*S),[g,d,v]=h.toChannels(j.rgba),{css:b.toCss(g,d,v,_),rgba:b.toRgba(g,d,v,_)}}w.blend=function(j,S){if(_=(255&S.rgba)/255,_===1)return{css:S.css,rgba:S.rgba};const E=S.rgba>>24&255,N=S.rgba>>16&255,O=S.rgba>>8&255,T=j.rgba>>24&255,L=j.rgba>>16&255,$=j.rgba>>8&255;return g=T+Math.round((E-T)*_),d=L+Math.round((N-L)*_),v=$+Math.round((O-$)*_),{css:b.toCss(g,d,v),rgba:b.toRgba(g,d,v)}},w.isOpaque=function(j){return(255&j.rgba)==255},w.ensureContrastRatio=function(j,S,E){const N=h.ensureContrastRatio(j.rgba,S.rgba,E);if(N)return h.toColor(N>>24&255,N>>16&255,N>>8&255)},w.opaque=function(j){const S=(255|j.rgba)>>>0;return[g,d,v]=h.toChannels(S),{css:b.toCss(g,d,v),rgba:S}},w.opacity=k,w.multiplyOpacity=function(j,S){return _=255&j.rgba,k(j,_*S/255)},w.toColorRGB=function(j){return[j.rgba>>24&255,j.rgba>>16&255,j.rgba>>8&255]}}(x||(o.color=x={})),function(w){let k,j;if(!u.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const E=S.getContext("2d",{willReadFrequently:!0});E&&(k=E,k.globalCompositeOperation="copy",j=k.createLinearGradient(0,0,1,1))}w.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return g=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),h.toColor(g,d,v);case 5:return g=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),v=parseInt(S.slice(3,4).repeat(2),16),_=parseInt(S.slice(4,5).repeat(2),16),h.toColor(g,d,v,_);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const E=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return g=parseInt(E[1]),d=parseInt(E[2]),v=parseInt(E[3]),_=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),h.toColor(g,d,v,_);if(!k||!j)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=j,k.fillStyle=S,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[g,d,v,_]=k.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(g,d,v,_),css:S}}}(f||(o.css=f={})),function(w){function k(j,S,E){const N=j/255,O=S/255,T=E/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}w.relativeLuminance=function(j){return k(j>>16&255,j>>8&255,255&j)},w.relativeLuminance2=k}(p||(o.rgb=p={})),function(w){function k(S,E,N){const O=S>>24&255,T=S>>16&255,L=S>>8&255;let $=E>>24&255,W=E>>16&255,U=E>>8&255,K=y(p.relativeLuminance2($,W,U),p.relativeLuminance2(O,T,L));for(;K<N&&($>0||W>0||U>0);)$-=Math.max(0,Math.ceil(.1*$)),W-=Math.max(0,Math.ceil(.1*W)),U-=Math.max(0,Math.ceil(.1*U)),K=y(p.relativeLuminance2($,W,U),p.relativeLuminance2(O,T,L));return($<<24|W<<16|U<<8|255)>>>0}function j(S,E,N){const O=S>>24&255,T=S>>16&255,L=S>>8&255;let $=E>>24&255,W=E>>16&255,U=E>>8&255,K=y(p.relativeLuminance2($,W,U),p.relativeLuminance2(O,T,L));for(;K<N&&($<255||W<255||U<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),W=Math.min(255,W+Math.ceil(.1*(255-W))),U=Math.min(255,U+Math.ceil(.1*(255-U))),K=y(p.relativeLuminance2($,W,U),p.relativeLuminance2(O,T,L));return($<<24|W<<16|U<<8|255)>>>0}w.ensureContrastRatio=function(S,E,N){const O=p.relativeLuminance(S>>8),T=p.relativeLuminance(E>>8);if(y(O,T)<N){if(T<O){const W=k(S,E,N),U=y(O,p.relativeLuminance(W>>8));if(U<N){const K=j(S,E,N);return U>y(O,p.relativeLuminance(K>>8))?W:K}return W}const L=j(S,E,N),$=y(O,p.relativeLuminance(L>>8));if($<N){const W=k(S,E,N);return $>y(O,p.relativeLuminance(W>>8))?L:W}return L}},w.reduceLuminance=k,w.increaseLuminance=j,w.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},w.toColor=function(S,E,N,O){return{css:b.toCss(S,E,N,O),rgba:b.toRgba(S,E,N,O)}}}(h||(o.rgba=h={})),o.toPaddedHex=m,o.contrastRatio=y},8969:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),g=c(2585),d=c(4348),v=c(7866),_=c(744),b=c(7302),x=c(6975),f=c(8460),p=c(1753),h=c(1480),m=c(7994),y=c(9282),w=c(5435),k=c(5981),j=c(2660);let S=!1;class E extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new f.EventEmitter),this._onScroll.event(O=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(O.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(O){for(const T in O)this.optionsService.options[T]=O[T]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new f.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new b.OptionsService(O)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(m.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,f.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,f.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,f.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,f.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new k.WriteBuffer((T,L)=>this._inputHandler.parse(T,L))),this.register((0,f.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,T){this._writeBuffer.write(O,T)}writeSync(O,T){this._logService.logLevel<=g.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(O,T)}resize(O,T){isNaN(O)||isNaN(T)||(O=Math.max(O,_.MINIMUM_COLS),T=Math.max(T,_.MINIMUM_ROWS),this._bufferService.resize(O,T))}scroll(O,T=!1){this._bufferService.scroll(O,T)}scrollLines(O,T,L){this._bufferService.scrollLines(O,T,L)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const T=O-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(O,T){return this._inputHandler.registerEscHandler(O,T)}registerDcsHandler(O,T){return this._inputHandler.registerDcsHandler(O,T)}registerCsiHandler(O,T){return this._inputHandler.registerCsiHandler(O,T)}registerOscHandler(O,T){return this._inputHandler.registerOscHandler(O,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?O=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)(()=>{for(const T of O)T.dispose()})}}}o.CoreTerminal=E},8460:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,u){return c(g=>u.fire(g))}},5435:function(l,o,c){var u=this&&this.__decorate||function(K,R,P,D){var M,B=arguments.length,q=B<3?R:D===null?D=Object.getOwnPropertyDescriptor(R,P):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(K,R,P,D);else for(var Z=K.length-1;Z>=0;Z--)(M=K[Z])&&(q=(B<3?M(q):B>3?M(R,P,q):M(R,P))||q);return B>3&&q&&Object.defineProperty(R,P,q),q},g=this&&this.__param||function(K,R){return function(P,D){R(P,D,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),v=c(7116),_=c(2015),b=c(844),x=c(482),f=c(8437),p=c(8460),h=c(643),m=c(511),y=c(3734),w=c(2585),k=c(6242),j=c(6351),S=c(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},N=131072;function O(K,R){if(K>24)return R.setWinLines||!1;switch(K){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var T;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(o.WindowsOptionsReportType=T={}));let L=0;class $ extends b.Disposable{getAttrData(){return this._curAttrData}constructor(R,P,D,M,B,q,Z,ee,J=new _.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=P,this._coreService=D,this._logService=M,this._optionsService=B,this._oscLinkService=q,this._coreMouseService=Z,this._unicodeService=ee,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new m.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(A=>this._activeBuffer=A.activeBuffer)),this._parser.setCsiHandlerFallback((A,z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:z.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,z,G)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:z,data:G})}),this._parser.setDcsHandlerFallback((A,z,G)=>{z==="HOOK"&&(G=G.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:z,payload:G})}),this._parser.setPrintHandler((A,z,G)=>this.print(A,z,G)),this._parser.registerCsiHandler({final:"@"},A=>this.insertChars(A)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},A=>this.scrollLeft(A)),this._parser.registerCsiHandler({final:"A"},A=>this.cursorUp(A)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},A=>this.scrollRight(A)),this._parser.registerCsiHandler({final:"B"},A=>this.cursorDown(A)),this._parser.registerCsiHandler({final:"C"},A=>this.cursorForward(A)),this._parser.registerCsiHandler({final:"D"},A=>this.cursorBackward(A)),this._parser.registerCsiHandler({final:"E"},A=>this.cursorNextLine(A)),this._parser.registerCsiHandler({final:"F"},A=>this.cursorPrecedingLine(A)),this._parser.registerCsiHandler({final:"G"},A=>this.cursorCharAbsolute(A)),this._parser.registerCsiHandler({final:"H"},A=>this.cursorPosition(A)),this._parser.registerCsiHandler({final:"I"},A=>this.cursorForwardTab(A)),this._parser.registerCsiHandler({final:"J"},A=>this.eraseInDisplay(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},A=>this.eraseInDisplay(A,!0)),this._parser.registerCsiHandler({final:"K"},A=>this.eraseInLine(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},A=>this.eraseInLine(A,!0)),this._parser.registerCsiHandler({final:"L"},A=>this.insertLines(A)),this._parser.registerCsiHandler({final:"M"},A=>this.deleteLines(A)),this._parser.registerCsiHandler({final:"P"},A=>this.deleteChars(A)),this._parser.registerCsiHandler({final:"S"},A=>this.scrollUp(A)),this._parser.registerCsiHandler({final:"T"},A=>this.scrollDown(A)),this._parser.registerCsiHandler({final:"X"},A=>this.eraseChars(A)),this._parser.registerCsiHandler({final:"Z"},A=>this.cursorBackwardTab(A)),this._parser.registerCsiHandler({final:"`"},A=>this.charPosAbsolute(A)),this._parser.registerCsiHandler({final:"a"},A=>this.hPositionRelative(A)),this._parser.registerCsiHandler({final:"b"},A=>this.repeatPrecedingCharacter(A)),this._parser.registerCsiHandler({final:"c"},A=>this.sendDeviceAttributesPrimary(A)),this._parser.registerCsiHandler({prefix:">",final:"c"},A=>this.sendDeviceAttributesSecondary(A)),this._parser.registerCsiHandler({final:"d"},A=>this.linePosAbsolute(A)),this._parser.registerCsiHandler({final:"e"},A=>this.vPositionRelative(A)),this._parser.registerCsiHandler({final:"f"},A=>this.hVPosition(A)),this._parser.registerCsiHandler({final:"g"},A=>this.tabClear(A)),this._parser.registerCsiHandler({final:"h"},A=>this.setMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"h"},A=>this.setModePrivate(A)),this._parser.registerCsiHandler({final:"l"},A=>this.resetMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"l"},A=>this.resetModePrivate(A)),this._parser.registerCsiHandler({final:"m"},A=>this.charAttributes(A)),this._parser.registerCsiHandler({final:"n"},A=>this.deviceStatus(A)),this._parser.registerCsiHandler({prefix:"?",final:"n"},A=>this.deviceStatusPrivate(A)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},A=>this.softReset(A)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},A=>this.setCursorStyle(A)),this._parser.registerCsiHandler({final:"r"},A=>this.setScrollRegion(A)),this._parser.registerCsiHandler({final:"s"},A=>this.saveCursor(A)),this._parser.registerCsiHandler({final:"t"},A=>this.windowOptions(A)),this._parser.registerCsiHandler({final:"u"},A=>this.restoreCursor(A)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},A=>this.insertColumns(A)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},A=>this.deleteColumns(A)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},A=>this.selectProtected(A)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},A=>this.requestMode(A,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},A=>this.requestMode(A,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(A=>(this.setTitle(A),this.setIconName(A),!0))),this._parser.registerOscHandler(1,new k.OscHandler(A=>this.setIconName(A))),this._parser.registerOscHandler(2,new k.OscHandler(A=>this.setTitle(A))),this._parser.registerOscHandler(4,new k.OscHandler(A=>this.setOrReportIndexedColor(A))),this._parser.registerOscHandler(8,new k.OscHandler(A=>this.setHyperlink(A))),this._parser.registerOscHandler(10,new k.OscHandler(A=>this.setOrReportFgColor(A))),this._parser.registerOscHandler(11,new k.OscHandler(A=>this.setOrReportBgColor(A))),this._parser.registerOscHandler(12,new k.OscHandler(A=>this.setOrReportCursorColor(A))),this._parser.registerOscHandler(104,new k.OscHandler(A=>this.restoreIndexedColor(A))),this._parser.registerOscHandler(110,new k.OscHandler(A=>this.restoreFgColor(A))),this._parser.registerOscHandler(111,new k.OscHandler(A=>this.restoreBgColor(A))),this._parser.registerOscHandler(112,new k.OscHandler(A=>this.restoreCursorColor(A))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const A in v.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 j.DcsHandler((A,z)=>this.requestStatusString(A,z)))}_preserveStack(R,P,D,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=D,this._parseStack.position=M}_logSlowResolvingAsync(R){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([R,new Promise((P,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,P){let D,M=this._activeBuffer.x,B=this._activeBuffer.y,q=0;const Z=this._parseStack.paused;if(Z){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(D),D;M=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>N&&(q=this._parseStack.position+N)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,ee=>String.fromCharCode(ee)).join("")}"`),typeof R=="string"?R.split("").map(ee=>ee.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<N&&(this._parseBuffer=new Uint32Array(Math.min(R.length,N))),Z||this._dirtyRowTracker.clearRange(),R.length>N)for(let ee=q;ee<R.length;ee+=N){const J=ee+N<R.length?ee+N:R.length,A=typeof R=="string"?this._stringDecoder.decode(R.substring(ee,J),this._parseBuffer):this._utf8Decoder.decode(R.subarray(ee,J),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,A))return this._preserveStack(M,B,A,ee),this._logSlowResolvingAsync(D),D}else if(!Z){const ee=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(M,B,ee,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===M&&this._activeBuffer.y===B||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(R,P,D){let M,B;const q=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,z=this._curAttrData;let G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-P>0&&G.getWidth(this._activeBuffer.x-1)===2&&G.setCellFromCodePoint(this._activeBuffer.x-1,0,1,z.fg,z.bg,z.extended);for(let Y=P;Y<D;++Y){if(M=R[Y],B=this._unicodeService.wcwidth(M),M<127&&q){const ye=q[String.fromCharCode(M)];ye&&(M=ye.charCodeAt(0))}if(Z&&this._onA11yChar.fire((0,x.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),B||!this._activeBuffer.x){if(this._activeBuffer.x+B-1>=ee){if(J){for(;this._activeBuffer.x<ee;)G.setCellFromCodePoint(this._activeBuffer.x++,0,1,z.fg,z.bg,z.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=ee-1,B===2)continue}if(A&&(G.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(z),z),G.getWidth(ee-1)===2&&G.setCellFromCodePoint(ee-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,z.fg,z.bg,z.extended)),G.setCellFromCodePoint(this._activeBuffer.x++,M,B,z.fg,z.bg,z.extended),B>0)for(;--B;)G.setCellFromCodePoint(this._activeBuffer.x++,0,0,z.fg,z.bg,z.extended)}else G.getWidth(this._activeBuffer.x-1)?G.addCodepointToCell(this._activeBuffer.x-1,M):G.addCodepointToCell(this._activeBuffer.x-2,M)}D-P>0&&(G.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<ee&&D-P>0&&G.getWidth(this._activeBuffer.x)===0&&!G.hasContent(this._activeBuffer.x)&&G.setCellFromCodePoint(this._activeBuffer.x,0,1,z.fg,z.bg,z.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,P){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,P):this._parser.registerCsiHandler(R,D=>!O(D.params[0],this._optionsService.rawOptions.windowOptions)||P(D))}registerDcsHandler(R,P){return this._parser.registerDcsHandler(R,new j.DcsHandler(P))}registerEscHandler(R,P){return this._parser.registerEscHandler(R,P)}registerOscHandler(R,P){return this._parser.registerOscHandler(R,new k.OscHandler(P))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||R===void 0)&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(R,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=R,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+P)}cursorUp(R){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const P=R.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const P=R.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,P,D,M=!1,B=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);q.replaceCells(P,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),B),M&&(q.isWrapped=!1)}_resetBufferLine(R,P=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),D.isWrapped=!1)}eraseInDisplay(R,P=!1){let D;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);D<this._bufferService.rows;D++)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(R,P=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;P--;)this._activeBuffer.lines.splice(B-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;P--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(f.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){if(!this._parser.precedingCodepoint)return!0;const P=R.params[0]||1,D=new Uint32Array(P);for(let M=0;M<P;++M)D[M]=this._parser.precedingCodepoint;return this.print(D,0,D.length),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[P]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,P){const D=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:B}=this._coreMouseService,q=this._coreService,{buffers:Z,cols:ee}=this._bufferService,{active:J,alt:A}=Z,z=this._optionsService.rawOptions,G=je=>je?1:2,Y=R.params[0];return ye=Y,ae=P?Y===2?4:Y===4?G(q.modes.insertMode):Y===12?3:Y===20?G(z.convertEol):0:Y===1?G(D.applicationCursorKeys):Y===3?z.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:Y===6?G(D.origin):Y===7?G(D.wraparound):Y===8?3:Y===9?G(M==="X10"):Y===12?G(z.cursorBlink):Y===25?G(!q.isCursorHidden):Y===45?G(D.reverseWraparound):Y===66?G(D.applicationKeypad):Y===67?4:Y===1e3?G(M==="VT200"):Y===1002?G(M==="DRAG"):Y===1003?G(M==="ANY"):Y===1004?G(D.sendFocus):Y===1005?4:Y===1006?G(B==="SGR"):Y===1015?4:Y===1016?G(B==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?G(J===A):Y===2004?G(D.bracketedPasteMode):0,q.triggerDataEvent(`${d.C0.ESC}[${P?"":"?"}${ye};${ae}$y`),!0;var ye,ae}_updateAttrColor(R,P,D,M,B){return P===2?(R|=50331648,R&=-16777216,R|=y.AttributeData.fromColorRGB([D,M,B])):P===5&&(R&=-50331904,R|=33554432|255&D),R}_extractColor(R,P,D){const M=[0,0,-1,0,0,0];let B=0,q=0;do{if(M[q+B]=R.params[P+q],R.hasSubParams(P+q)){const Z=R.getSubParams(P+q);let ee=0;do M[1]===5&&(B=1),M[q+ee+1+B]=Z[ee];while(++ee<Z.length&&ee+q+1+B<M.length);break}if(M[1]===5&&q+B>=2||M[1]===2&&q+B>=5)break;M[1]&&(B=1)}while(++q+P<R.length&&q+B<M.length);for(let Z=2;Z<M.length;++Z)M[Z]===-1&&(M[Z]=0);switch(M[0]){case 38:D.fg=this._updateAttrColor(D.fg,M[1],M[3],M[4],M[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,M[1],M[3],M[4],M[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,M[1],M[3],M[4],M[5])}return q}_processUnderline(R,P){P.extended=P.extended.clone(),(!~R||R>5)&&(R=1),P.extended.underlineStyle=R,P.fg|=268435456,R===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(R){R.fg=f.DEFAULT_ATTR_DATA.fg,R.bg=f.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=R.length;let D;const M=this._curAttrData;for(let B=0;B<P;B++)D=R.params[B],D>=30&&D<=37?(M.fg&=-50331904,M.fg|=16777216|D-30):D>=40&&D<=47?(M.bg&=-50331904,M.bg|=16777216|D-40):D>=90&&D<=97?(M.fg&=-50331904,M.fg|=16777224|D-90):D>=100&&D<=107?(M.bg&=-50331904,M.bg|=16777224|D-100):D===0?this._processSGR0(M):D===1?M.fg|=134217728:D===3?M.bg|=67108864:D===4?(M.fg|=268435456,this._processUnderline(R.hasSubParams(B)?R.getSubParams(B)[0]:1,M)):D===5?M.fg|=536870912:D===7?M.fg|=67108864:D===8?M.fg|=1073741824:D===9?M.fg|=2147483648:D===2?M.bg|=134217728:D===21?this._processUnderline(2,M):D===22?(M.fg&=-134217729,M.bg&=-134217729):D===23?M.bg&=-67108865:D===24?(M.fg&=-268435457,this._processUnderline(0,M)):D===25?M.fg&=-536870913:D===27?M.fg&=-67108865:D===28?M.fg&=-1073741825:D===29?M.fg&=2147483647:D===39?(M.fg&=-67108864,M.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):D===49?(M.bg&=-67108864,M.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?B+=this._extractColor(R,B,M):D===53?M.bg|=1073741824:D===55?M.bg&=-1073741825:D===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):D===100?(M.fg&=-67108864,M.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${P};${D}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${P};${D}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const P=R.params[0]||1;switch(P){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const D=P%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(R){const P=R.params[0]||1;let D;return(R.length<2||(D=R.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(R){if(!O(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:P!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(R){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const P=[],D=R.split(";");for(;D.length>1;){const M=D.shift(),B=D.shift();if(/^\d+$/.exec(M)){const q=parseInt(M);if(U(q))if(B==="?")P.push({type:0,index:q});else{const Z=(0,S.parseColor)(B);Z&&P.push({type:1,index:q,color:Z})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(R){const P=R.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(R,P){this._getCurrentLinkId()&&this._finishHyperlink();const D=R.split(":");let M;const B=D.findIndex(q=>q.startsWith("id="));return B!==-1&&(M=D[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,P){const D=R.split(";");for(let M=0;M<D.length&&!(P>=this._specialColors.length);++M,++P)if(D[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const B=(0,S.parseColor)(D[M]);B&&this._onColor.fire([{type:1,index:this._specialColors[P],color:B}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const P=[],D=R.split(";");for(let M=0;M<D.length;++M)if(/^\d+$/.exec(D[M])){const B=parseInt(D[M]);U(B)&&P.push({type:2,index:B})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(E[R[0]],v.CHARSETS[R[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new m.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const D=this._activeBuffer.ybase+this._activeBuffer.y+P,M=this._activeBuffer.lines.get(D);M&&(M.fill(R),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,P){const D=this._bufferService.buffer,M=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${B}${d.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,P){this._dirtyRowTracker.markRangeDirty(R,P)}}o.InputHandler=$;let W=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,R){K>R&&(L=K,K=R,R=L),K<this.start&&(this.start=K),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(K){return 0<=K&&K<256}W=u([g(0,w.IBufferService)],W)},844:(l,o)=>{function c(u){for(const g of u)g.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const g=this._disposables.indexOf(u);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var g;this._isDisposed||u===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)===null||u===void 0||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,v){this._data[g]||(this._data[g]={}),this._data[g][d]=v}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,g,d,v,_){this._data.get(u,g)||this._data.set(u,g,new c),this._data.get(u,g).set(d,v,_)}get(u,g,d,v){var _;return(_=this._data.get(u,g))===null||_===void 0?void 0:_.get(d,v)}clear(){this._data.clear()}}},6114:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof navigator>"u";const c=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const g=this._getKey(u);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,g){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let g=0,d=this._array.length-1;for(;d>=g;){let v=g+d>>1;const _=this._getKey(this._array[v]);if(_>u)d=v-1;else{if(!(_<u)){for(;v>0&&this._getKey(this._array[v-1])===u;)v--;return v}g=v+1}}return g}}},7226:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class g{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 b=0,x=0,f=_.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),x=Math.max(b,x),p=_.timeRemaining(),1.5*x>p)return f-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-b))}ms`),void this._start();f=p}this.clear()}}class d extends g{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const b=Date.now()+_;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),v=d==null?void 0:d.get(g.cols-1),_=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);_&&v&&(_.isWrapped=v[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&v[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}o.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,v=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=v}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),g=c(7226),d=c(3734),v=c(8437),_=c(4634),b=c(511),x=c(643),f=c(4863),p=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(h,m,y){this._hasScrollback=h,this._optionsService=m,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=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,m){return new v.BufferLine(this._bufferService.cols,this.getNullCell(h),m)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const m=h+this._optionsService.rawOptions.scrollback;return m>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:m}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=v.DEFAULT_ATTR_DATA);let m=this._rows;for(;m--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,m){const y=this.getNullCell(v.DEFAULT_ATTR_DATA);let w=0;const k=this._getCorrectBufferLength(m);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<h)for(let S=0;S<this.lines.length;S++)w+=+this.lines.get(S).resize(h,y);let j=0;if(this._rows<m)for(let S=this._rows;S<m;S++)this.lines.length<m+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(h,y)):this.ybase>0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(h,y)));else for(let S=this._rows;S>m;S--)this.lines.length>m+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const S=this.lines.length-k;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=k}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,m-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=m-1,this._isReflowEnabled&&(this._reflow(h,m),this._cols>h))for(let j=0;j<this.lines.length;j++)w+=+this.lines.get(j).resize(h,y);this._cols=h,this._rows=m,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let m=0;for(;this._memoryCleanupPosition<this.lines.length;)if(m+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),m>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,m){this._cols!==h&&(h>this._cols?this._reflowLarger(h,m):this._reflowSmaller(h,m))}_reflowLarger(h,m){const y=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(y.length>0){const w=(0,_.reflowLargerCreateNewLayout)(this.lines,y);(0,_.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(h,m,w.countRemoved)}}_reflowLargerAdjustViewport(h,m,y){const w=this.getNullCell(v.DEFAULT_ATTR_DATA);let k=y;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<m&&this.lines.push(new v.BufferLine(h,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(h,m){const y=this.getNullCell(v.DEFAULT_ATTR_DATA),w=[];let k=0;for(let j=this.lines.length-1;j>=0;j--){let S=this.lines.get(j);if(!S||!S.isWrapped&&S.getTrimmedLength()<=h)continue;const E=[S];for(;S.isWrapped&&j>0;)S=this.lines.get(--j),E.unshift(S);const N=this.ybase+this.y;if(N>=j&&N<j+E.length)continue;const O=E[E.length-1].getTrimmedLength(),T=(0,_.reflowSmallerGetNewLineLengths)(E,this._cols,h),L=T.length-E.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const W=[];for(let M=0;M<L;M++){const B=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);W.push(B)}W.length>0&&(w.push({start:j+E.length+k,newLines:W}),k+=W.length),E.push(...W);let U=T.length-1,K=T[U];K===0&&(U--,K=T[U]);let R=E.length-L-1,P=O;for(;R>=0;){const M=Math.min(P,K);if(E[U]===void 0)break;if(E[U].copyCellsFrom(E[R],P-M,K-M,M,!0),K-=M,K===0&&(U--,K=T[U]),P-=M,P===0){R--;const B=Math.max(R,0);P=(0,_.getWrappedLineTrimmedLength)(E,B,this._cols)}}for(let M=0;M<E.length;M++)T[M]<h&&E[M].setCell(T[M],y);let D=L-$;for(;D-- >0;)this.ybase===0?this.y<m-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-m&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+m-1)}if(w.length>0){const j=[],S=[];for(let U=0;U<this.lines.length;U++)S.push(this.lines.get(U));const E=this.lines.length;let N=E-1,O=0,T=w[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let L=0;for(let U=Math.min(this.lines.maxLength-1,E+k-1);U>=0;U--)if(T&&T.start>N+L){for(let K=T.newLines.length-1;K>=0;K--)this.lines.set(U--,T.newLines[K]);U++,j.push({index:N+1,amount:T.newLines.length}),L+=T.newLines.length,T=w[++O]}else this.lines.set(U,S[N--]);let $=0;for(let U=j.length-1;U>=0;U--)j[U].index+=$,this.lines.onInsertEmitter.fire(j[U]),$+=j[U].amount;const W=Math.max(0,E+k-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(h,m,y=0,w){const k=this.lines.get(h);return k?k.translateToString(m,y,w):""}getWrappedRangeForLine(h){let m=h,y=h;for(;m>0&&this.lines.get(m).isWrapped;)m--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:m,last:y}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].line===h&&(this.markers[m].dispose(),this.markers.splice(m--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const m=new f.Marker(h);return this.markers.push(m),m.register(this.lines.onTrim(y=>{m.line-=y,m.line<0&&m.dispose()})),m.register(this.lines.onInsert(y=>{m.line>=y.index&&(m.line+=y.amount)})),m.register(this.lines.onDelete(y=>{m.line>=y.index&&m.line<y.index+y.amount&&m.dispose(),m.line>y.index&&(m.line-=y.amount)})),m.register(m.onDispose(()=>this._removeMarker(m))),m}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),g=c(511),d=c(643),v=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let _=0;class b{constructor(f,p,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const m=p||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let y=0;y<f;++y)this.setCell(y,m);this.length=f}get(f){const p=this._data[3*f+0],h=2097151&p;return[this._data[3*f+1],2097152&p?this._combined[f]:h?(0,v.stringFromCodePoint)(h):"",p>>22,2097152&p?this._combined[f].charCodeAt(this._combined[f].length-1):h]}set(f,p){this._data[3*f+1]=p[d.CHAR_DATA_ATTR_INDEX],p[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=p[1],this._data[3*f+0]=2097152|f|p[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=p[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(f){return this._data[3*f+0]>>22}hasWidth(f){return 12582912&this._data[3*f+0]}getFg(f){return this._data[3*f+1]}getBg(f){return this._data[3*f+2]}hasContent(f){return 4194303&this._data[3*f+0]}getCodePoint(f){const p=this._data[3*f+0];return 2097152&p?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&p}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const p=this._data[3*f+0];return 2097152&p?this._combined[f]:2097151&p?(0,v.stringFromCodePoint)(2097151&p):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,p){return _=3*f,p.content=this._data[_+0],p.fg=this._data[_+1],p.bg=this._data[_+2],2097152&p.content&&(p.combinedData=this._combined[f]),268435456&p.bg&&(p.extended=this._extendedAttrs[f]),p}setCell(f,p){2097152&p.content&&(this._combined[f]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[f]=p.extended),this._data[3*f+0]=p.content,this._data[3*f+1]=p.fg,this._data[3*f+2]=p.bg}setCellFromCodePoint(f,p,h,m,y,w){268435456&y&&(this._extendedAttrs[f]=w),this._data[3*f+0]=p|h<<22,this._data[3*f+1]=m,this._data[3*f+2]=y}addCodepointToCell(f,p){let h=this._data[3*f+0];2097152&h?this._combined[f]+=(0,v.stringFromCodePoint)(p):(2097151&h?(this._combined[f]=(0,v.stringFromCodePoint)(2097151&h)+(0,v.stringFromCodePoint)(p),h&=-2097152,h|=2097152):h=p|4194304,this._data[3*f+0]=h)}insertCells(f,p,h,m){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length-f){const y=new g.CellData;for(let w=this.length-f-p-1;w>=0;--w)this.setCell(f+p+w,this.loadCell(f+w,y));for(let w=0;w<p;++w)this.setCell(f+w,h)}else for(let y=f;y<this.length;++y)this.setCell(y,h);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs)}deleteCells(f,p,h,m){if(f%=this.length,p<this.length-f){const y=new g.CellData;for(let w=0;w<this.length-f-p;++w)this.setCell(f+w,this.loadCell(f+p+w,y));for(let w=this.length-p;w<this.length;++w)this.setCell(w,h)}else for(let y=f;y<this.length;++y)this.setCell(y,h);f&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),this.getWidth(f)!==0||this.hasContent(f)||this.setCellFromCodePoint(f,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs)}replaceCells(f,p,h,m,y=!1){if(y)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodePoint(p,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs);f<p&&f<this.length;)this.isProtected(f)||this.setCell(f,h),f++;else for(f&&this.getWidth(f-1)===2&&this.setCellFromCodePoint(f-1,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p,0,1,(m==null?void 0:m.fg)||0,(m==null?void 0:m.bg)||0,(m==null?void 0:m.extended)||new u.ExtendedAttrs);f<p&&f<this.length;)this.setCell(f++,h)}resize(f,p){if(f===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*f;if(f>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const m=new Uint32Array(h);m.set(this._data),this._data=m}for(let m=this.length;m<f;++m)this.setCell(m,p)}else{this._data=this._data.subarray(0,h);const m=Object.keys(this._combined);for(let w=0;w<m.length;w++){const k=parseInt(m[w],10);k>=f&&delete this._combined[k]}const y=Object.keys(this._extendedAttrs);for(let w=0;w<y.length;w++){const k=parseInt(y[w],10);k>=f&&delete this._extendedAttrs[k]}}return this.length=f,4*h*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const f=new Uint32Array(this._data.length);return f.set(this._data),this._data=f,1}return 0}fill(f,p=!1){if(p)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,f);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,f)}}copyFrom(f){this.length!==f.length?this._data=new Uint32Array(f._data):this._data.set(f._data),this.length=f.length,this._combined={};for(const p in f._combined)this._combined[p]=f._combined[p];this._extendedAttrs={};for(const p in f._extendedAttrs)this._extendedAttrs[p]=f._extendedAttrs[p];this.isWrapped=f.isWrapped}clone(){const f=new b(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const p in this._combined)f._combined[p]=this._combined[p];for(const p in this._extendedAttrs)f._extendedAttrs[p]=this._extendedAttrs[p];return f.isWrapped=this.isWrapped,f}getTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0])return f+(this._data[3*f+0]>>22);return 0}getNoBgTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0]||50331648&this._data[3*f+2])return f+(this._data[3*f+0]>>22);return 0}copyCellsFrom(f,p,h,m,y){const w=f._data;if(y)for(let j=m-1;j>=0;j--){for(let S=0;S<3;S++)this._data[3*(h+j)+S]=w[3*(p+j)+S];268435456&w[3*(p+j)+2]&&(this._extendedAttrs[h+j]=f._extendedAttrs[p+j])}else for(let j=0;j<m;j++){for(let S=0;S<3;S++)this._data[3*(h+j)+S]=w[3*(p+j)+S];268435456&w[3*(p+j)+2]&&(this._extendedAttrs[h+j]=f._extendedAttrs[p+j])}const k=Object.keys(f._combined);for(let j=0;j<k.length;j++){const S=parseInt(k[j],10);S>=p&&(this._combined[S-p+h]=f._combined[S])}}translateToString(f=!1,p=0,h=this.length){f&&(h=Math.min(h,this.getTrimmedLength()));let m="";for(;p<h;){const y=this._data[3*p+0],w=2097151&y;m+=2097152&y?this._combined[p]:w?(0,v.stringFromCodePoint)(w):d.WHITESPACE_CELL_CHAR,p+=y>>22||1}return m}}o.BufferLine=b},4841:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,o)=>{function c(u,g,d){if(g===u.length-1)return u[g].getTrimmedLength();const v=!u[g].hasContent(d-1)&&u[g].getWidth(d-1)===1,_=u[g+1].getWidth(0)===2;return v&&_?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,g,d,v,_){const b=[];for(let x=0;x<u.length-1;x++){let f=x,p=u.get(++f);if(!p.isWrapped)continue;const h=[u.get(x)];for(;f<u.length&&p.isWrapped;)h.push(p),p=u.get(++f);if(v>=x&&v<f){x+=h.length-1;continue}let m=0,y=c(h,m,g),w=1,k=0;for(;w<h.length;){const S=c(h,w,g),E=S-k,N=d-y,O=Math.min(E,N);h[m].copyCellsFrom(h[w],k,y,O,!1),y+=O,y===d&&(m++,y=0),k+=O,k===S&&(w++,k=0),y===0&&m!==0&&h[m-1].getWidth(d-1)===2&&(h[m].copyCellsFrom(h[m-1],d-1,y++,1,!1),h[m-1].setCell(d-1,_))}h[m].replaceCells(y,d,_);let j=0;for(let S=h.length-1;S>0&&(S>m||h[S].getTrimmedLength()===0);S--)j++;j>0&&(b.push(x+h.length-j),b.push(j)),x+=h.length-1}return b},o.reflowLargerCreateNewLayout=function(u,g){const d=[];let v=0,_=g[v],b=0;for(let x=0;x<u.length;x++)if(_===x){const f=g[++v];u.onDeleteEmitter.fire({index:x-b,amount:f}),x+=f-1,b+=f,_=g[++v]}else d.push(x);return{layout:d,countRemoved:b}},o.reflowLargerApplyNewLayout=function(u,g){const d=[];for(let v=0;v<g.length;v++)d.push(u.get(g[v]));for(let v=0;v<d.length;v++)u.set(v,d[v]);u.length=g.length},o.reflowSmallerGetNewLineLengths=function(u,g,d){const v=[],_=u.map((p,h)=>c(u,h,g)).reduce((p,h)=>p+h);let b=0,x=0,f=0;for(;f<_;){if(_-f<d){v.push(_-f);break}b+=d;const p=c(u,x,g);b>p&&(b-=p,x++);const h=u[x].getWidth(b-1)===2;h&&b--;const m=h?d-1:d;v.push(m),f+=m}return v},o.getWrappedLineTrimmedLength=c},5295:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),g=c(844),d=c(9092);class v extends g.Disposable{constructor(b,x){super(),this._optionsService=b,this._bufferService=x,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(b,x){this._normal.resize(b,x),this._alt.resize(b,x),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}o.BufferSet=v},511:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),g=c(643),d=c(3734);class v extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const x=new v;return x.setFromCharData(b),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(b[g.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(b[g.CHAR_DATA_CHAR_INDEX].length===2){const f=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=f&&f<=56319){const p=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(f-55296)+p-56320+65536|b[g.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=b[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[g.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=b[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=c(8460),g=c(844);class d{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}o.Marker=d,d._nextId=1},7116:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,o)=>{var c,u,g;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
180
|
+
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(o.C0=c={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(u||(o.C1=u={})),function(d){d.ST=`${c.ESC}\\`}(g||(o.C1_ESCAPED=g={}))},7399:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,v,_,b){const x={type:0,cancel:!1,key:void 0},f=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?x.key=v?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?x.key=v?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?x.key=v?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(x.key=v?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:if(d.altKey){x.key=u.C0.ESC+u.C0.DEL;break}x.key=u.C0.DEL;break;case 9:if(d.shiftKey){x.key=u.C0.ESC+"[Z";break}x.key=u.C0.HT,x.cancel=!0;break;case 13:x.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,x.cancel=!0;break;case 27:x.key=u.C0.ESC,d.altKey&&(x.key=u.C0.ESC+u.C0.ESC),x.cancel=!0;break;case 37:if(d.metaKey)break;f?(x.key=u.C0.ESC+"[1;"+(f+1)+"D",x.key===u.C0.ESC+"[1;3D"&&(x.key=u.C0.ESC+(_?"b":"[1;5D"))):x.key=v?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;f?(x.key=u.C0.ESC+"[1;"+(f+1)+"C",x.key===u.C0.ESC+"[1;3C"&&(x.key=u.C0.ESC+(_?"f":"[1;5C"))):x.key=v?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;f?(x.key=u.C0.ESC+"[1;"+(f+1)+"A",_||x.key!==u.C0.ESC+"[1;3A"||(x.key=u.C0.ESC+"[1;5A")):x.key=v?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;f?(x.key=u.C0.ESC+"[1;"+(f+1)+"B",_||x.key!==u.C0.ESC+"[1;3B"||(x.key=u.C0.ESC+"[1;5B")):x.key=v?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(x.key=u.C0.ESC+"[2~");break;case 46:x.key=f?u.C0.ESC+"[3;"+(f+1)+"~":u.C0.ESC+"[3~";break;case 36:x.key=f?u.C0.ESC+"[1;"+(f+1)+"H":v?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:x.key=f?u.C0.ESC+"[1;"+(f+1)+"F":v?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?x.type=2:d.ctrlKey?x.key=u.C0.ESC+"[5;"+(f+1)+"~":x.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?x.type=3:d.ctrlKey?x.key=u.C0.ESC+"[6;"+(f+1)+"~":x.key=u.C0.ESC+"[6~";break;case 112:x.key=f?u.C0.ESC+"[1;"+(f+1)+"P":u.C0.ESC+"OP";break;case 113:x.key=f?u.C0.ESC+"[1;"+(f+1)+"Q":u.C0.ESC+"OQ";break;case 114:x.key=f?u.C0.ESC+"[1;"+(f+1)+"R":u.C0.ESC+"OR";break;case 115:x.key=f?u.C0.ESC+"[1;"+(f+1)+"S":u.C0.ESC+"OS";break;case 116:x.key=f?u.C0.ESC+"[15;"+(f+1)+"~":u.C0.ESC+"[15~";break;case 117:x.key=f?u.C0.ESC+"[17;"+(f+1)+"~":u.C0.ESC+"[17~";break;case 118:x.key=f?u.C0.ESC+"[18;"+(f+1)+"~":u.C0.ESC+"[18~";break;case 119:x.key=f?u.C0.ESC+"[19;"+(f+1)+"~":u.C0.ESC+"[19~";break;case 120:x.key=f?u.C0.ESC+"[20;"+(f+1)+"~":u.C0.ESC+"[20~";break;case 121:x.key=f?u.C0.ESC+"[21;"+(f+1)+"~":u.C0.ESC+"[21~";break;case 122:x.key=f?u.C0.ESC+"[23;"+(f+1)+"~":u.C0.ESC+"[23~";break;case 123:x.key=f?u.C0.ESC+"[24;"+(f+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(_&&!b||!d.altKey||d.metaKey)!_||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?x.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(x.key=u.C0.US),d.key==="@"&&(x.key=u.C0.NUL)):d.keyCode===65&&(x.type=1);else{const p=g[d.keyCode],h=p==null?void 0:p[d.shiftKey?1:0];if(h)x.key=u.C0.ESC+h;else if(d.keyCode>=65&&d.keyCode<=90){const m=d.ctrlKey?d.keyCode-64:d.keyCode+32;let y=String.fromCharCode(m);d.shiftKey&&(y=y.toUpperCase()),x.key=u.C0.ESC+y}else if(d.keyCode===32)x.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let m=d.code.slice(3,4);d.shiftKey||(m=m.toLowerCase()),x.key=u.C0.ESC+m,x.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?x.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?x.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?x.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?x.key=u.C0.DEL:d.keyCode===219?x.key=u.C0.ESC:d.keyCode===220?x.key=u.C0.FS:d.keyCode===221&&(x.key=u.C0.GS)}return x}},482:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,u=0,g=c.length){let d="";for(let v=u;v<g;++v){let _=c[v];_>65535?(_-=65536,d+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):d+=String.fromCharCode(_)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const g=c.length;if(!g)return 0;let d=0,v=0;if(this._interim){const _=c.charCodeAt(v++);56320<=_&&_<=57343?u[d++]=1024*(this._interim-55296)+_-56320+65536:(u[d++]=this._interim,u[d++]=_),this._interim=0}for(let _=v;_<g;++_){const b=c.charCodeAt(_);if(55296<=b&&b<=56319){if(++_>=g)return this._interim=b,d;const x=c.charCodeAt(_);56320<=x&&x<=57343?u[d++]=1024*(b-55296)+x-56320+65536:(u[d++]=b,u[d++]=x)}else b!==65279&&(u[d++]=b)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const g=c.length;if(!g)return 0;let d,v,_,b,x=0,f=0,p=0;if(this.interim[0]){let y=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let k,j=0;for(;(k=63&this.interim[++j])&&j<4;)w<<=6,w|=k;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=S-j;for(;p<E;){if(p>=g)return 0;if(k=c[p++],(192&k)!=128){p--,y=!0;break}this.interim[j++]=k,w<<=6,w|=63&k}y||(S===2?w<128?p--:u[x++]=w:S===3?w<2048||w>=55296&&w<=57343||w===65279||(u[x++]=w):w<65536||w>1114111||(u[x++]=w)),this.interim.fill(0)}const h=g-4;let m=p;for(;m<g;){for(;!(!(m<h)||128&(d=c[m])||128&(v=c[m+1])||128&(_=c[m+2])||128&(b=c[m+3]));)u[x++]=d,u[x++]=v,u[x++]=_,u[x++]=b,m+=4;if(d=c[m++],d<128)u[x++]=d;else if((224&d)==192){if(m>=g)return this.interim[0]=d,x;if(v=c[m++],(192&v)!=128){m--;continue}if(f=(31&d)<<6|63&v,f<128){m--;continue}u[x++]=f}else if((240&d)==224){if(m>=g)return this.interim[0]=d,x;if(v=c[m++],(192&v)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=v,x;if(_=c[m++],(192&_)!=128){m--;continue}if(f=(15&d)<<12|(63&v)<<6|63&_,f<2048||f>=55296&&f<=57343||f===65279)continue;u[x++]=f}else if((248&d)==240){if(m>=g)return this.interim[0]=d,x;if(v=c[m++],(192&v)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=v,x;if(_=c[m++],(192&_)!=128){m--;continue}if(m>=g)return this.interim[0]=d,this.interim[1]=v,this.interim[2]=_,x;if(b=c[m++],(192&b)!=128){m--;continue}if(f=(7&d)<<18|(63&v)<<12|(63&_)<<6|63&b,f<65536||f>1114111)continue;u[x++]=f}}return x}}},225:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const c=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;o.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let d=0;d<c.length;++d)g.fill(0,c[d][0],c[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?g[d]:function(v,_){let b,x=0,f=_.length-1;if(v<_[0][0]||v>_[f][1])return!1;for(;f>=x;)if(b=x+f>>1,v>_[b][1])x=b+1;else{if(!(v<_[b][0]))return!0;f=b-1}return!1}(d,u)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),g=c(844);class d extends g.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 u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,b){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(b)}_innerWrite(_=0,b=!0){const x=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],p=this._action(f,b);if(p){const m=y=>Date.now()-x>=12?setTimeout(()=>this._innerWrite(0,y)):this._innerWrite(x,y);return void p.catch(y=>(queueMicrotask(()=>{throw y}),Promise.resolve(!1))).then(m)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=f.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function g(d,v){const _=d.toString(16),b=_.length<2?"0"+_:_;switch(v){case 4:return _[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}o.parseColor=function(d){if(!d)return;let v=d.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const _=c.exec(v);if(_){const b=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/b*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/b*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/b*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),u.exec(v)&&[3,6,9,12].includes(v.length))){const _=v.length/3,b=[0,0,0];for(let x=0;x<3;++x){const f=parseInt(v.slice(_*x,_*x+_),16);b[x]=_===1?f<<4:_===2?f:_===3?f>>4:f>>8}return b}},o.toRgbString=function(d,v=16){const[_,b,x]=d;return`rgb:${g(_,v)}/${g(b,v)}/${g(x,v)}`}},5770:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=c(482),g=c(8742),d=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(b,x){this._handlers[b]===void 0&&(this._handlers[b]=[]);const f=this._handlers[b];return f.push(x),{dispose:()=>{const p=f.indexOf(x);p!==-1&&f.splice(p,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(b,x){if(this.reset(),this._ident=b,this._active=this._handlers[b]||v,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(b,x,f){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(b,x,f);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(b,x,f))}unhook(b,x=!0){if(this._active.length){let f=!1,p=this._active.length-1,h=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,f=x,h=this._stack.fallThrough,this._stack.paused=!1),!h&&f===!1){for(;p>=0&&(f=this._active[p].unhook(b),f!==!0);p--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,f;p--}for(;p>=0;p--)if(f=this._active[p].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",b);this._active=v,this._ident=0}};const _=new g.Params;_.addParam(0),o.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=_,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():_,this._data="",this._hitLimit=!1}put(b,x,f){this._hitLimit||(this._data+=(0,u.utf32ToString)(b,x,f),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let x=!1;if(this._hitLimit)x=!1;else if(b&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then(f=>(this._params=_,this._data="",this._hitLimit=!1,f));return this._params=_,this._data="",this._hitLimit=!1,x}}},2015:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),g=c(8742),d=c(6242),v=c(6351);class _{constructor(p){this.table=new Uint8Array(p)}setDefault(p,h){this.table.fill(p<<4|h)}add(p,h,m,y){this.table[h<<8|p]=m<<4|y}addMany(p,h,m,y){for(let w=0;w<p.length;w++)this.table[h<<8|p[w]]=m<<4|y}}o.TransitionTable=_;const b=160;o.VT500_TRANSITION_TABLE=function(){const f=new _(4095),p=Array.apply(null,Array(256)).map((j,S)=>S),h=(j,S)=>p.slice(j,S),m=h(32,127),y=h(0,24);y.push(25),y.push.apply(y,h(28,32));const w=h(0,14);let k;for(k in f.setDefault(1,0),f.addMany(m,0,2,0),w)f.addMany([24,26,153,154],k,3,0),f.addMany(h(128,144),k,3,0),f.addMany(h(144,152),k,3,0),f.add(156,k,0,0),f.add(27,k,11,1),f.add(157,k,4,8),f.addMany([152,158,159],k,0,7),f.add(155,k,11,3),f.add(144,k,11,9);return f.addMany(y,0,3,0),f.addMany(y,1,3,1),f.add(127,1,0,1),f.addMany(y,8,0,8),f.addMany(y,3,3,3),f.add(127,3,0,3),f.addMany(y,4,3,4),f.add(127,4,0,4),f.addMany(y,6,3,6),f.addMany(y,5,3,5),f.add(127,5,0,5),f.addMany(y,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(m,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(h(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(m,7,0,7),f.addMany(y,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(h(64,127),3,7,0),f.addMany(h(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(h(48,60),4,8,4),f.addMany(h(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(h(32,64),6,0,6),f.add(127,6,0,6),f.addMany(h(64,127),6,0,0),f.addMany(h(32,48),3,9,5),f.addMany(h(32,48),5,9,5),f.addMany(h(48,64),5,0,6),f.addMany(h(64,127),5,7,0),f.addMany(h(32,48),4,9,5),f.addMany(h(32,48),1,9,2),f.addMany(h(32,48),2,9,2),f.addMany(h(48,127),2,10,0),f.addMany(h(48,80),1,10,0),f.addMany(h(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(h(96,127),1,10,0),f.add(80,1,11,9),f.addMany(y,9,0,9),f.add(127,9,0,9),f.addMany(h(28,32),9,0,9),f.addMany(h(32,48),9,9,12),f.addMany(h(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(y,11,0,11),f.addMany(h(32,128),11,0,11),f.addMany(h(28,32),11,0,11),f.addMany(y,10,0,10),f.add(127,10,0,10),f.addMany(h(28,32),10,0,10),f.addMany(h(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(h(32,48),10,9,12),f.addMany(y,12,0,12),f.add(127,12,0,12),f.addMany(h(28,32),12,0,12),f.addMany(h(32,48),12,9,12),f.addMany(h(48,64),12,0,11),f.addMany(h(64,127),12,12,13),f.addMany(h(64,127),10,12,13),f.addMany(h(64,127),9,12,13),f.addMany(y,13,13,13),f.addMany(m,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(b,0,2,0),f.add(b,8,5,8),f.add(b,6,0,6),f.add(b,11,0,11),f.add(b,13,13,13),f}();class x extends u.Disposable{constructor(p=o.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(h,m,y)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,m)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(p,h=[64,126]){let m=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(m=p.prefix.charCodeAt(0),m&&60>m||m>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<p.intermediates.length;++w){const k=p.intermediates.charCodeAt(w);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");m<<=8,m|=k}}if(p.final.length!==1)throw new Error("final must be a single byte");const y=p.final.charCodeAt(0);if(h[0]>y||y>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return m<<=8,m|=y,m}identToString(p){const h=[];for(;p;)h.push(String.fromCharCode(255&p)),p>>=8;return h.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,h){const m=this._identifier(p,[48,126]);this._escHandlers[m]===void 0&&(this._escHandlers[m]=[]);const y=this._escHandlers[m];return y.push(h),{dispose:()=>{const w=y.indexOf(h);w!==-1&&y.splice(w,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,h){this._executeHandlers[p.charCodeAt(0)]=h}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,h){const m=this._identifier(p);this._csiHandlers[m]===void 0&&(this._csiHandlers[m]=[]);const y=this._csiHandlers[m];return y.push(h),{dispose:()=>{const w=y.indexOf(h);w!==-1&&y.splice(w,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,h){return this._dcsParser.registerHandler(this._identifier(p),h)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,h){return this._oscParser.registerHandler(p,h)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(p,h,m,y,w){this._parseStack.state=p,this._parseStack.handlers=h,this._parseStack.handlerPos=m,this._parseStack.transition=y,this._parseStack.chunkPos=w}parse(p,h,m){let y,w=0,k=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(m===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(m===!1&&E>-1){for(;E>=0&&(y=S[E](this._params),y!==!0);E--)if(y instanceof Promise)return this._parseStack.handlerPos=E,y}this._parseStack.handlers=[];break;case 4:if(m===!1&&E>-1){for(;E>=0&&(y=S[E](),y!==!0);E--)if(y instanceof Promise)return this._parseStack.handlerPos=E,y}this._parseStack.handlers=[];break;case 6:if(w=p[this._parseStack.chunkPos],y=this._dcsParser.unhook(w!==24&&w!==26,m),y)return y;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=p[this._parseStack.chunkPos],y=this._oscParser.end(w!==24&&w!==26,m),y)return y;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=j;S<h;++S){switch(w=p[S],k=this._transitions.table[this.currentState<<8|(w<160?w:b)],k>>4){case 2:for(let L=S+1;;++L){if(L>=h||(w=p[L])<32||w>126&&w<b){this._printHandler(p,S,L),S=L-1;break}if(++L>=h||(w=p[L])<32||w>126&&w<b){this._printHandler(p,S,L),S=L-1;break}if(++L>=h||(w=p[L])<32||w>126&&w<b){this._printHandler(p,S,L),S=L-1;break}if(++L>=h||(w=p[L])<32||w>126&&w<b){this._printHandler(p,S,L),S=L-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|w];let N=E?E.length-1:-1;for(;N>=0&&(y=E[N](this._params),y!==!0);N--)if(y instanceof Promise)return this._preserveStack(3,E,N,k,S),y;N<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingCodepoint=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++S<h&&(w=p[S])>47&&w<60);S--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const O=this._escHandlers[this._collect<<8|w];let T=O?O.length-1:-1;for(;T>=0&&(y=O[T](),y!==!0);T--)if(y instanceof Promise)return this._preserveStack(4,O,T,k,S),y;T<0&&this._escHandlerFb(this._collect<<8|w),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|w,this._params);break;case 13:for(let L=S+1;;++L)if(L>=h||(w=p[L])===24||w===26||w===27||w>127&&w<b){this._dcsParser.put(p,S,L),S=L-1;break}break;case 14:if(y=this._dcsParser.unhook(w!==24&&w!==26),y)return this._preserveStack(6,[],0,k,S),y;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let L=S+1;;L++)if(L>=h||(w=p[L])<32||w>127&&w<b){this._oscParser.put(p,S,L),S=L-1;break}break;case 6:if(y=this._oscParser.end(w!==24&&w!==26),y)return this._preserveStack(5,[],0,k,S),y;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&k}}}o.EscapeSequenceParser=x},6242:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),g=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,_){this._handlers[v]===void 0&&(this._handlers[v]=[]);const b=this._handlers[v];return b.push(_),{dispose:()=>{const x=b.indexOf(_);x!==-1&&b.splice(x,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,_,b){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(v,_,b);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(v,_,b))}start(){this.reset(),this._state=1}put(v,_,b){if(this._state!==3){if(this._state===1)for(;_<b;){const x=v[_++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&b-_>0&&this._put(v,_,b)}}end(v,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,x=this._active.length-1,f=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,b=_,f=this._stack.fallThrough,this._stack.paused=!1),!f&&b===!1){for(;x>=0&&(b=this._active[x].end(v),b!==!0);x--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,b;x--}for(;x>=0;x--)if(b=this._active[x].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",v);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,_,b){this._hitLimit||(this._data+=(0,g.utf32ToString)(v,_,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let _=!1;if(this._hitLimit)_=!1;else if(v&&(_=this._handler(this._data),_ instanceof Promise))return _.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,_}}},8742:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class u{static fromArray(d){const v=new u;if(!d.length)return v;for(let _=Array.isArray(d[0])?1:0;_<d.length;++_){const b=d[_];if(Array.isArray(b))for(let x=0;x<b.length;++x)v.addSubParam(b[x]);else v.addParam(b)}return v}constructor(d=32,v=32){if(this.maxLength=d,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let v=0;v<this.length;++v){d.push(this.params[v]);const _=this._subParamsIdx[v]>>8,b=255&this._subParamsIdx[v];b-_>0&&d.push(Array.prototype.slice.call(this._subParams,_,b))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const v=this._subParamsIdx[d]>>8,_=255&this._subParamsIdx[d];return _-v>0?this._subParams.subarray(v,_):null}getSubParamsAll(){const d={};for(let v=0;v<this.length;++v){const _=this._subParamsIdx[v]>>8,b=255&this._subParamsIdx[v];b-_>0&&(d[v]=this._subParams.slice(_,b))}return d}addDigit(d){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,b=_[v-1];_[v-1]=~b?Math.min(10*b+d,c):d}}o.Params=u},5741:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const g={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(g),u.dispose=()=>this._wrappedAddonDispose(g),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){u=g;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),g=c(511);o.BufferApiView=class{constructor(d,v){this._buffer=d,this.type=v}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const v=this._buffer.lines.get(d);if(v)return new u.BufferLineApiView(v)}getNullCell(){return new g.CellData}}},3785:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new u.CellData)}translateToString(g,d,v){return this._line.translateToString(g,d,v)}}},8285:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),g=c(8460),d=c(844);class v extends d.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,g=>u(g.toArray()))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,(g,d)=>u(g,d.toArray()))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,c){var u=this&&this.__decorate||function(f,p,h,m){var y,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(y=f[j])&&(k=(w<3?y(k):w>3?y(p,h,k):y(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),v=c(844),_=c(5295),b=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let x=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(f){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(f.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(f.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(f,this))}resize(f,p){this.cols=f,this.rows=p,this.buffers.resize(f,p),this._onResize.fire({cols:f,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,p=!1){const h=this.buffer;let m;m=this._cachedBlankLine,m&&m.length===this.cols&&m.getFg(0)===f.fg&&m.getBg(0)===f.bg||(m=h.getBlankLine(f,p),this._cachedBlankLine=m),m.isWrapped=p;const y=h.ybase+h.scrollTop,w=h.ybase+h.scrollBottom;if(h.scrollTop===0){const k=h.lines.isFull;w===h.lines.length-1?k?h.lines.recycle().copyFrom(m):h.lines.push(m.clone()):h.lines.splice(w+1,0,m.clone()),k?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const k=w-y+1;h.lines.shiftElements(y+1,k-1,-1),h.lines.set(w,m.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(f,p,h){const m=this.buffer;if(f<0){if(m.ydisp===0)return;this.isUserScrolling=!0}else f+m.ydisp>=m.ybase&&(this.isUserScrolling=!1);const y=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+f,m.ybase),0),y!==m.ydisp&&(p||this._onScroll.fire(m.ydisp))}};o.BufferService=x=u([g(0,b.IOptionsService)],x)},7994:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(l,o,c){var u=this&&this.__decorate||function(m,y,w,k){var j,S=arguments.length,E=S<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,y,w,k);else for(var N=m.length-1;N>=0;N--)(j=m[N])&&(E=(S<3?j(E):S>3?j(y,w,E):j(y,w))||E);return S>3&&E&&Object.defineProperty(y,w,E),E},g=this&&this.__param||function(m,y){return function(w,k){y(w,k,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),v=c(8460),_=c(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:m=>m.button!==4&&m.action===1&&(m.ctrl=!1,m.alt=!1,m.shift=!1,!0)},VT200:{events:19,restrict:m=>m.action!==32},DRAG:{events:23,restrict:m=>m.action!==32||m.button!==3},ANY:{events:31,restrict:m=>!0}};function x(m,y){let w=(m.ctrl?16:0)|(m.shift?4:0)|(m.alt?8:0);return m.button===4?(w|=64,w|=m.action):(w|=3&m.button,4&m.button&&(w|=64),8&m.button&&(w|=128),m.action===32?w|=32:m.action!==0||y||(w|=3)),w}const f=String.fromCharCode,p={DEFAULT:m=>{const y=[x(m,!1)+32,m.col+32,m.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${f(y[0])}${f(y[1])}${f(y[2])}`},SGR:m=>{const y=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${x(m,!0)};${m.col};${m.row}${y}`},SGR_PIXELS:m=>{const y=m.action===0&&m.button!==4?"m":"M";return`\x1B[<${x(m,!0)};${m.x};${m.y}${y}`}};let h=o.CoreMouseService=class extends _.Disposable{constructor(m,y){super(),this._bufferService=m,this._coreService=y,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(b))this.addProtocol(w,b[w]);for(const w of Object.keys(p))this.addEncoding(w,p[w]);this.reset()}addProtocol(m,y){this._protocols[m]=y}addEncoding(m,y){this._encodings[m]=y}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(m){if(!this._protocols[m])throw new Error(`unknown protocol "${m}"`);this._activeProtocol=m,this._onProtocolChange.fire(this._protocols[m].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(m){if(!this._encodings[m])throw new Error(`unknown encoding "${m}"`);this._activeEncoding=m}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(m){if(m.col<0||m.col>=this._bufferService.cols||m.row<0||m.row>=this._bufferService.rows||m.button===4&&m.action===32||m.button===3&&m.action!==32||m.button!==4&&(m.action===2||m.action===3)||(m.col++,m.row++,m.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,m,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(m))return!1;const y=this._encodings[this._activeEncoding](m);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!0)),this._lastEvent=m,!0}explainEvents(m){return{down:!!(1&m),up:!!(2&m),drag:!!(4&m),move:!!(8&m),wheel:!!(16&m)}}_equalEvents(m,y,w){if(w){if(m.x!==y.x||m.y!==y.y)return!1}else if(m.col!==y.col||m.row!==y.row)return!1;return m.button===y.button&&m.action===y.action&&m.ctrl===y.ctrl&&m.alt===y.alt&&m.shift===y.shift}};o.CoreMouseService=h=u([g(0,d.IBufferService),g(1,d.ICoreService)],h)},6975:function(l,o,c){var u=this&&this.__decorate||function(h,m,y,w){var k,j=arguments.length,S=j<3?m:w===null?w=Object.getOwnPropertyDescriptor(m,y):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,m,y,w);else for(var E=h.length-1;E>=0;E--)(k=h[E])&&(S=(j<3?k(S):j>3?k(m,y,S):k(m,y))||S);return j>3&&S&&Object.defineProperty(m,y,S),S},g=this&&this.__param||function(h,m){return function(y,w){m(y,w,h)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),v=c(8460),_=c(844),b=c(2585),x=Object.freeze({insertMode:!1}),f=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=o.CoreService=class extends _.Disposable{constructor(h,m,y){super(),this._bufferService=h,this._logService=m,this._optionsService=y,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(f)}reset(){this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(f)}triggerDataEvent(h,m=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;m&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),m&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,()=>h.split("").map(w=>w.charCodeAt(0))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,()=>h.split("").map(m=>m.charCodeAt(0))),this._onBinary.fire(h))}};o.CoreService=p=u([g(0,b.IBufferService),g(1,b.ILogService),g(2,b.IOptionsService)],p)},9074:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),g=c(8460),d=c(844),v=c(6106);let _=0,b=0;class x extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(h=>h==null?void 0:h.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(h){if(h.marker.isDisposed)return;const m=new f(h);if(m){const y=m.marker.onDispose(()=>m.dispose());m.onDispose(()=>{m&&(this._decorations.delete(m)&&this._onDecorationRemoved.fire(m),y.dispose())}),this._decorations.insert(m),this._onDecorationRegistered.fire(m)}return m}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,m,y){var w,k,j;let S=0,E=0;for(const N of this._decorations.getKeyIterator(m))S=(w=N.options.x)!==null&&w!==void 0?w:0,E=S+((k=N.options.width)!==null&&k!==void 0?k:1),h>=S&&h<E&&(!y||((j=N.options.layer)!==null&&j!==void 0?j:"bottom")===y)&&(yield N)}forEachDecorationAtCell(h,m,y,w){this._decorations.forEachByKey(m,k=>{var j,S,E;_=(j=k.options.x)!==null&&j!==void 0?j:0,b=_+((S=k.options.width)!==null&&S!==void 0?S:1),h>=_&&h<b&&(!y||((E=k.options.layer)!==null&&E!==void 0?E:"bottom")===y)&&w(k)})}}o.DecorationService=x;class f extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=c(2585),g=c(8343);class d{constructor(..._){this._entries=new Map;for(const[b,x]of _)this.set(b,x)}set(_,b){const x=this._entries.get(_);return this._entries.set(_,b),x}forEach(_){for(const[b,x]of this._entries.entries())_(b,x)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(v,_){this._services.set(v,_)}getService(v){return this._services.get(v)}createInstance(v,..._){const b=(0,g.getServiceDependencies)(v).sort((p,h)=>p.index-h.index),x=[];for(const p of b){const h=this._services.get(p.id);if(!h)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${p.id}.`);x.push(h)}const f=b.length>0?b[0].index:_.length;if(_.length!==f)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${f+1} conflicts with ${_.length} static arguments`);return new v(..._,...x)}}},7866:function(l,o,c){var u=this&&this.__decorate||function(f,p,h,m){var y,w=arguments.length,k=w<3?p:m===null?m=Object.getOwnPropertyDescriptor(p,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,p,h,m);else for(var j=f.length-1;j>=0;j--)(y=f[j])&&(k=(w<3?y(k):w>3?y(p,h,k):y(p,h))||k);return w>3&&k&&Object.defineProperty(p,h,k),k},g=this&&this.__param||function(f,p){return function(h,m){p(h,m,f)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),v=c(2585),_={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let b,x=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(f){super(),this._optionsService=f,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let p=0;p<f.length;p++)typeof f[p]=="function"&&(f[p]=f[p]())}_log(f,p,h){this._evalLazyOptionalParams(h),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...h)}trace(f,...p){var h,m;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.trace.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.log,f,p)}debug(f,...p){var h,m;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.debug.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.log,f,p)}info(f,...p){var h,m;this._logLevel<=v.LogLevelEnum.INFO&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.info.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.info,f,p)}warn(f,...p){var h,m;this._logLevel<=v.LogLevelEnum.WARN&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.warn.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.warn,f,p)}error(f,...p){var h,m;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((m=(h=this._optionsService.options.logger)===null||h===void 0?void 0:h.error.bind(this._optionsService.options.logger))!==null&&m!==void 0?m:console.error,f,p)}};o.LogService=x=u([g(0,v.IOptionsService)],x),o.setTraceLogger=function(f){b=f},o.traceCall=function(f,p,h){if(typeof h.value!="function")throw new Error("not supported");const m=h.value;h.value=function(...y){if(b.logLevel!==v.LogLevelEnum.TRACE)return m.apply(this,y);b.trace(`GlyphRenderer#${m.name}(${y.map(k=>JSON.stringify(k)).join(", ")})`);const w=m.apply(this,y);return b.trace(`GlyphRenderer#${m.name} return`,w),w}}},7302:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),g=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends g.Disposable{constructor(x){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const f=Object.assign({},o.DEFAULT_OPTIONS);for(const p in x)if(p in f)try{const h=x[p];f[p]=this._sanitizeAndValidateOption(p,h)}catch(h){console.error(h)}this.rawOptions=f,this.options=Object.assign({},f),this._setupOptions()}onSpecificOptionChange(x,f){return this.onOptionChange(p=>{p===x&&f(this.rawOptions[x])})}onMultipleOptionChange(x,f){return this.onOptionChange(p=>{x.indexOf(p)!==-1&&f()})}_setupOptions(){const x=p=>{if(!(p in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},f=(p,h)=>{if(!(p in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);h=this._sanitizeAndValidateOption(p,h),this.rawOptions[p]!==h&&(this.rawOptions[p]=h,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const h={get:x.bind(this,p),set:f.bind(this,p)};Object.defineProperty(this.options,p,h)}}_sanitizeAndValidateOption(x,f){switch(x){case"cursorStyle":if(f||(f=o.DEFAULT_OPTIONS[x]),!function(p){return p==="block"||p==="underline"||p==="bar"}(f))throw new Error(`"${f}" is not a valid value for ${x}`);break;case"wordSeparator":f||(f=o.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=v.includes(f)?f:o.DEFAULT_OPTIONS[x];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${x} cannot be less than 1, value: ${f}`);break;case"minimumContrastRatio":f=Math.max(1,Math.min(21,Math.round(10*f)/10));break;case"scrollback":if((f=Math.min(f,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${x} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}o.OptionsService=_},2660:function(l,o,c){var u=this&&this.__decorate||function(_,b,x,f){var p,h=arguments.length,m=h<3?b:f===null?f=Object.getOwnPropertyDescriptor(b,x):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(_,b,x,f);else for(var y=_.length-1;y>=0;y--)(p=_[y])&&(m=(h<3?p(m):h>3?p(b,x,m):p(b,x))||m);return h>3&&m&&Object.defineProperty(b,x,m),m},g=this&&this.__param||function(_,b){return function(x,f){b(x,f,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let v=o.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const b=this._bufferService.buffer;if(_.id===void 0){const y=b.addMarker(b.ybase+b.y),w={data:_,id:this._nextId++,lines:[y]};return y.onDispose(()=>this._removeMarkerFromLink(w,y)),this._dataByLinkId.set(w.id,w),w.id}const x=_,f=this._getEntryIdKey(x),p=this._entriesWithId.get(f);if(p)return this.addLineToLink(p.id,b.ybase+b.y),p.id;const h=b.addMarker(b.ybase+b.y),m={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(m,h)),this._entriesWithId.set(m.key,m),this._dataByLinkId.set(m.id,m),m.id}addLineToLink(_,b){const x=this._dataByLinkId.get(_);if(x&&x.lines.every(f=>f.line!==b)){const f=this._bufferService.buffer.addMarker(b);x.lines.push(f),f.onDispose(()=>this._removeMarkerFromLink(x,f))}}getLinkData(_){var b;return(b=this._dataByLinkId.get(_))===null||b===void 0?void 0:b.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,b){const x=_.lines.indexOf(b);x!==-1&&(_.lines.splice(x,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};o.OscLinkService=v=u([g(0,d.IBufferService)],v)},8343:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[u]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const d=function(v,_,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,f,p){f[c]===f?f[u].push({id:x,index:p}):(f[u]=[{id:x,index:p}],f[c]=f)})(d,v,b)};return d.toString=()=>g,o.serviceRegistry.set(g,d),d}},2585:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=c(8343);var g;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(g||(o.LogLevelEnum=g={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),g=c(225);o.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const d=new g.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let v=0;const _=d.length;for(let b=0;b<_;++b){let x=d.charCodeAt(b);if(55296<=x&&x<=56319){if(++b>=_)return v+this.wcwidth(x);const f=d.charCodeAt(b);56320<=f&&f<=57343?x=1024*(x-55296)+f-56320+65536:v+=this.wcwidth(f)}v+=this.wcwidth(x)}return v}}}},n={};function s(l){var o=n[l];if(o!==void 0)return o.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 o=s(9042),c=s(3236),u=s(844),g=s(5741),d=s(8285),v=s(7975),_=s(7090),b=["cols","rows"];class x extends u.Disposable{constructor(p){super(),this._core=this.register(new c.Terminal(p)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const h=y=>this._core.options[y],m=(y,w)=>{this._checkReadonlyOptions(y),this._core.options[y]=w};for(const y in this._core.options){const w={get:h.bind(this,y),set:m.bind(this,y)};Object.defineProperty(this._publicOptions,y,w)}}_checkReadonlyOptions(p){if(b.includes(p))throw new Error(`Option "${p}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const h in p)this._publicOptions[h]=p[h]}blur(){this._core.blur()}focus(){this._core.focus()}resize(p,h){this._verifyIntegers(p,h),this._core.resize(p,h)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){var h,m,y;return this._checkProposedApi(),this._verifyPositiveIntegers((h=p.x)!==null&&h!==void 0?h:0,(m=p.width)!==null&&m!==void 0?m:0,(y=p.height)!==null&&y!==void 0?y:0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,h,m){this._verifyIntegers(p,h,m),this._core.select(p,h,m)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,h){this._verifyIntegers(p,h),this._core.selectLines(p,h)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,h){this._core.write(p,h)}writeln(p,h){this._core.write(p),this._core.write(`\r
|
|
181
|
+
`,h)}paste(p){this._core.paste(p)}refresh(p,h){this._verifyIntegers(p,h),this._core.refresh(p,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return o}_verifyIntegers(...p){for(const h of p)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const h of p)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}l.Terminal=x})(),i})())})(Bw);var nP=Bw.exports,$w={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,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),v=u-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(v/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),r})())})($w);var sP=$w.exports,Hw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(u,g,d,v={}){this._terminal=u,this._regex=g,this._handler=d,this._options=v}provideLinks(u,g){const d=c.computeLink(u,this._regex,this._terminal,this._handler);g(this._addCallbacks(d))}_addCallbacks(u){return u.map(g=>(g.leave=this._options.leave,g.hover=(d,v)=>{if(this._options.hover){const{range:_}=g;this._options.hover(d,v,_)}},g))}};class c{static computeLink(g,d,v,_){const b=new RegExp(d.source,(d.flags||"")+"g"),[x,f]=c._getWindowedLineStrings(g-1,v),p=x.join("");let h;const m=[];for(;h=b.exec(p);){const y=h[0];try{const N=new URL(y),O=decodeURI(N.toString());if(y!==O&&y+"/"!==O)continue}catch{continue}const[w,k]=c._mapStrIdx(v,f,0,h.index),[j,S]=c._mapStrIdx(v,w,k,y.length);if(w===-1||k===-1||j===-1||S===-1)continue;const E={start:{x:k+1,y:w+1},end:{x:S,y:j+1}};m.push({range:E,text:y,activate:_})}return m}static _getWindowedLineStrings(g,d){let v,_=g,b=g,x=0,f="";const p=[];if(v=d.buffer.active.getLine(g)){const h=v.translateToString(!0);if(v.isWrapped&&h[0]!==" "){for(x=0;(v=d.buffer.active.getLine(--_))&&x<2048&&(f=v.translateToString(!0),x+=f.length,p.push(f),v.isWrapped&&f.indexOf(" ")===-1););p.reverse()}for(p.push(h),x=0;(v=d.buffer.active.getLine(++b))&&v.isWrapped&&x<2048&&(f=v.translateToString(!0),x+=f.length,p.push(f),f.indexOf(" ")===-1););}return[p,_]}static _mapStrIdx(g,d,v,_){const b=g.buffer.active,x=b.getNullCell();let f=v;for(;_;){const p=b.getLine(d);if(!p)return[-1,-1];for(let h=f;h<p.length;++h){p.getCell(h,x);const m=x.getChars();if(x.getWidth()&&(_-=m.length||1,h===p.length-1&&m==="")){const y=b.getLine(d+1);y&&y.isWrapped&&(y.getCell(0,x),x.getWidth()===2&&(_+=1))}if(_<0)return[d,h]}d++,f=0}return[d,f]}}o.LinkComputer=c}},n={};function s(l){var o=n[l];if(o!==void 0)return o.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 o=s(6),c=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(g,d){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(g=u,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,v=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,v,this._handler,d))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),i})())})(Hw);var iP=Hw.exports;const oP=id("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(--vow-green)]/60 bg-transparent text-[var(--vow-green)]",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 Pe({className:e,variant:t,...r}){return a.jsx("span",{className:X(oP({variant:t}),e),...r})}function zw({agentGated:e=!1}={}){const t=C.useRef(null),[r,n]=C.useState(null),[s,i]=C.useState(!1),[l,o]=C.useState(!1),[c,u]=C.useState(null);C.useEffect(()=>{if(!t.current)return;let d=!1,v=null,_=null,b=null;const x=window.location.protocol==="https:"?"wss":"ws",f=new WebSocket(`${x}://${window.location.host}/api/agent/ws`),p=()=>{if(_||!t.current)return _;const h=new nP.Terminal({fontFamily:'"JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:13,lineHeight:1.3,letterSpacing:0,theme:{background:"#070d18",foreground:"#f2f7fc",cursor:"#dcb866",selectionBackground:"#1f3a66",black:"#0c1628",red:"#a85a5a",green:"#6a9b8f",yellow:"#dcb866",blue:"#7aa7dc",magenta:"#7a6db0",cyan:"#a8c8ea",white:"#a4b0c2",brightBlack:"#33394a",brightRed:"#c87a7a",brightGreen:"#8abbaf",brightYellow:"#ead08e",brightBlue:"#a8c8ea",brightMagenta:"#9a8dd0",brightCyan:"#cbdef3",brightWhite:"#f2f7fc"},convertEol:!0,scrollback:5e3,allowProposedApi:!0}),m=new sP.FitAddon;h.loadAddon(m),h.loadAddon(new iP.WebLinksAddon),h.open(t.current);const y=()=>{if(!(d||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{m.fit()}catch{}};return v=window.requestAnimationFrame(y),b=new ResizeObserver(()=>{y()}),b.observe(t.current),h.onData(w=>{f.readyState===WebSocket.OPEN&&f.send(JSON.stringify({kind:"input",data:w}))}),h.onResize(({cols:w,rows:k})=>{f.readyState===WebSocket.OPEN&&f.send(JSON.stringify({kind:"resize",cols:w,rows:k}))}),_=h,h};return f.onopen=()=>{i(!0),p()},f.onclose=()=>i(!1),f.onerror=()=>i(!1),f.onmessage=h=>{try{const m=JSON.parse(h.data);m.kind==="data"&&typeof m.data=="string"?_==null||_.write(m.data):m.kind==="meta"?(n({active:!!m.autoMode,reason:m.reason??""}),typeof m.agentReady=="boolean"&&o(m.agentReady)):m.kind==="auth_url"&&typeof m.url=="string"||(m.kind==="error"?m.recoverable&&m.remediation?u({message:m.message??"agent failed to start",remediation:m.remediation}):_==null||_.write(`\r
|
|
182
|
+
\x1B[31m[error] ${m.message??"unknown error"}\x1B[0m\r
|
|
183
|
+
`):m.kind==="exit"&&(_==null||_.write(`\r
|
|
184
|
+
\x1B[33m[claude session exited]\x1B[0m\r
|
|
185
|
+
`)))}catch{}},()=>{d=!0,v!==null&&window.cancelAnimationFrame(v),f.close(),b==null||b.disconnect(),_==null||_.dispose()}},[]);const g=e&&!l;return a.jsxs("div",{className:"flex h-full w-full flex-col bg-[var(--bg-sunken)]",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-[var(--bg-elevated)] px-4 py-2",children:[a.jsx("span",{className:X("font-mono text-[11px] tracking-[0.05em]",s?"text-[var(--vow-green)]":"text-[var(--fg-dim)]"),children:s?"● connected":"○ disconnected"}),r&&a.jsx(Pe,{variant:r.active?"warning":"secondary",title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),c&&a.jsxs(ut,{variant:"blocking",className:"m-3 flex flex-col gap-2",children:[a.jsx(or,{className:"text-[var(--break-red)]",children:"Agent panel unavailable"}),a.jsx(mt,{className:"font-mono text-xs text-[var(--fg-muted)]",children:c.message}),c.remediation&&a.jsxs("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:[a.jsx("span",{className:"text-[var(--fg-muted)]",children:"Fix · "}),c.remediation]})]}),a.jsx("div",{ref:t,className:X("w-full flex-1 bg-[var(--bg-sunken)] p-3","min-h-[400px]",g&&"invisible hidden")}),g&&!c&&a.jsx(aP,{})]})}function aP(){return a.jsx("div",{className:"flex w-full flex-1 items-center justify-center bg-[var(--bg-sunken)] px-6",children:a.jsxs("div",{className:"flex max-w-[34ch] flex-col items-center gap-4 text-center",children:[a.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-2 w-2 rounded-full bg-[var(--seer-violet)]"}),a.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:"The agent will come online once harness setup is complete."})]})})}const lP={pluginBuilderUi:!1,embeddedAgent:!1};function Mm(){const e=typeof window>"u"?void 0:window.__JINN_FEATURES__;return!e||typeof e!="object"?lP:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}function cP({envelope:e,chainExplorerBase:t}){const r=uP(e),n=dP(e.generatedAt),[s,i]=C.useState("idle"),[l,o]=C.useState(null),c=e.details,g=(typeof(c==null?void 0:c.category)=="string"?c.category:void 0)==="insufficient_funds",d=typeof(c==null?void 0:c.address)=="string"?c.address:null,v=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,x=(typeof(c==null?void 0:c.txHash)=="string"?c.txHash:null)??r,f=C.useCallback(async()=>{i("retrying"),o(null);try{await ge.retryBootstrap(),i("success")}catch(p){i("error"),o(p instanceof Error?p.message:String(p))}},[]);return a.jsxs(ut,{variant:"blocking",className:"flex flex-col gap-3 px-5 py-4",children:[a.jsxs("div",{className:"flex items-baseline justify-between",children:[a.jsxs(or,{className:"text-[var(--break-red)]",children:["Bootstrap halted · ",e.code]}),n&&a.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:n})]}),a.jsx(mt,{className:"break-words font-mono text-xs text-foreground",children:e.message}),g&&d&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(vc,{label:"Send ETH to",children:d}),v&&a.jsx(vc,{label:"Required",children:nh(v)}),_&&a.jsx(vc,{label:"Currently have",children:nh(_)}),v&&_&&a.jsx(vc,{label:"Shortfall",children:nh((BigInt(v)-BigInt(_)).toString())})]}),!g&&e.hint&&a.jsxs("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:[a.jsx("span",{className:"text-[var(--fg-dim)]",children:"Fix · "}),e.hint]}),x&&a.jsx(ce,{asChild:!0,variant:"link",size:"sm",className:"self-start px-0",children:a.jsxs("a",{href:`${t}/tx/${x}`,target:"_blank",rel:"noopener noreferrer",children:["view failed tx",a.jsx(Xa,{})]})}),a.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[a.jsx(ce,{variant:"destructive",size:"sm",type:"button",onClick:()=>{f()},disabled:s==="retrying",children:s==="retrying"?"Retrying…":s==="success"?"Resuming…":"Retry"}),s==="success"&&a.jsx("span",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:"Daemon resumed — waiting for bootstrap to complete"}),s==="error"&&l&&a.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:l})]}),s==="idle"&&a.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Once you've addressed the cause above, click Retry or"," ",a.jsx("code",{className:"text-[var(--fg-muted)]",children:"jinn run"})," to resume from the persisted state."]})]})}function vc({label:e,children:t}){return a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:"min-w-[100px] shrink-0 font-mono text-[11px] text-[var(--fg-dim)]",children:e}),a.jsx("span",{className:"break-all font-mono text-[11px] text-foreground",children:t})]})}function nh(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 uP(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 dP(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 hP(e,t=globalThis==null?void 0:globalThis.document){const r=Bt(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 fP="DismissableLayer",Bf="dismissableLayer.update",pP="dismissableLayer.pointerDownOutside",mP="dismissableLayer.focusOutside",v_,Uw=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fl=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:o,...c}=e,u=C.useContext(Uw),[g,d]=C.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=C.useState({}),b=Be(t,j=>d(j)),x=Array.from(u.layers),[f]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=x.indexOf(f),h=g?x.indexOf(g):-1,m=u.layersWithOutsidePointerEventsDisabled.size>0,y=h>=p,w=_P(j=>{const S=j.target,E=[...u.branches].some(N=>N.contains(S));!y||E||(s==null||s(j),l==null||l(j),j.defaultPrevented||o==null||o())},v),k=yP(j=>{const S=j.target;[...u.branches].some(N=>N.contains(S))||(i==null||i(j),l==null||l(j),j.defaultPrevented||o==null||o())},v);return hP(j=>{h===u.layers.size-1&&(n==null||n(j),!j.defaultPrevented&&o&&(j.preventDefault(),o()))},v),C.useEffect(()=>{if(g)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(v_=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(g)),u.layers.add(g),__(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=v_)}},[g,v,r,u]),C.useEffect(()=>()=>{g&&(u.layers.delete(g),u.layersWithOutsidePointerEventsDisabled.delete(g),__())},[g,u]),C.useEffect(()=>{const j=()=>_({});return document.addEventListener(Bf,j),()=>document.removeEventListener(Bf,j)},[]),a.jsx(Fe.div,{...c,ref:b,style:{pointerEvents:m?y?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,w.onPointerDownCapture)})});Fl.displayName=fP;var gP="DismissableLayerBranch",vP=C.forwardRef((e,t)=>{const r=C.useContext(Uw),n=C.useRef(null),s=Be(t,n);return C.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(Fe.div,{...e,ref:s})});vP.displayName=gP;function _P(e,t=globalThis==null?void 0:globalThis.document){const r=Bt(e),n=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=o=>{if(o.target&&!n.current){let c=function(){Ww(pP,r,u,{discrete:!0})};const u={originalEvent:o};o.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 yP(e,t=globalThis==null?void 0:globalThis.document){const r=Bt(e),n=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!n.current&&Ww(mP,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 __(){const e=new CustomEvent(Bf);document.dispatchEvent(e)}function Ww(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?vw(s,i):s.dispatchEvent(i)}var xP=zu[" useId ".trim().toString()]||(()=>{}),bP=0;function zs(e){const[t,r]=C.useState(xP());return Jn(()=>{r(n=>n??String(bP++))},[e]),t?`radix-${t}`:""}const wP=["top","right","bottom","left"],qs=Math.min,mr=Math.max,Cu=Math.round,_c=Math.floor,Sn=e=>({x:e,y:e}),SP={left:"right",right:"left",bottom:"top",top:"bottom"};function Ff(e,t,r){return mr(e,qs(t,r))}function es(e,t){return typeof e=="function"?e(t):e}function ts(e){return e.split("-")[0]}function aa(e){return e.split("-")[1]}function Im(e){return e==="x"?"y":"x"}function Bm(e){return e==="y"?"height":"width"}function xn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Fm(e){return Im(xn(e))}function CP(e,t,r){r===void 0&&(r=!1);const n=aa(e),s=Fm(e),i=Bm(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ku(l)),[l,ku(l)]}function kP(e){const t=ku(e);return[$f(e),t,$f(t)]}function $f(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const y_=["left","right"],x_=["right","left"],EP=["top","bottom"],jP=["bottom","top"];function RP(e,t,r){switch(e){case"top":case"bottom":return r?t?x_:y_:t?y_:x_;case"left":case"right":return t?EP:jP;default:return[]}}function NP(e,t,r,n){const s=aa(e);let i=RP(ts(e),r==="start",n);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map($f)))),i}function ku(e){const t=ts(e);return SP[t]+e.slice(t.length)}function PP(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vw(e){return typeof e!="number"?PP(e):{top:e,right:e,bottom:e,left:e}}function Eu(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 b_(e,t,r){let{reference:n,floating:s}=e;const i=xn(t),l=Fm(t),o=Bm(l),c=ts(t),u=i==="y",g=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,v=n[o]/2-s[o]/2;let _;switch(c){case"top":_={x:g,y:n.y-s.height};break;case"bottom":_={x:g,y:n.y+n.height};break;case"right":_={x:n.x+n.width,y:d};break;case"left":_={x:n.x-s.width,y:d};break;default:_={x:n.x,y:n.y}}switch(aa(t)){case"start":_[l]-=v*(r&&u?-1:1);break;case"end":_[l]+=v*(r&&u?-1:1);break}return _}async function TP(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:l,elements:o,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:g="viewport",elementContext:d="floating",altBoundary:v=!1,padding:_=0}=es(t,e),b=Vw(_),f=o[v?d==="floating"?"reference":"floating":d],p=Eu(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(f)))==null||r?f:f.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:u,rootBoundary:g,strategy:c})),h=d==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Eu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:h,offsetParent:m,strategy:c}):h);return{top:(p.top-w.top+b.top)/y.y,bottom:(w.bottom-p.bottom+b.bottom)/y.y,left:(p.left-w.left+b.left)/y.x,right:(w.right-p.right+b.right)/y.x}}const AP=50,DP=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:l}=r,o=l.detectOverflow?l:{...l,detectOverflow:TP},c=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:d}=b_(u,n,c),v=n,_=0;const b={};for(let x=0;x<i.length;x++){const f=i[x];if(!f)continue;const{name:p,fn:h}=f,{x:m,y,data:w,reset:k}=await h({x:g,y:d,initialPlacement:n,placement:v,strategy:s,middlewareData:b,rects:u,platform:o,elements:{reference:e,floating:t}});g=m??g,d=y??d,b[p]={...b[p],...w},k&&_<AP&&(_++,typeof k=="object"&&(k.placement&&(v=k.placement),k.rects&&(u=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:g,y:d}=b_(u,v,c)),x=-1)}return{x:g,y:d,placement:v,strategy:s,middlewareData:b}},LP=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:l,elements:o,middlewareData:c}=t,{element:u,padding:g=0}=es(e,t)||{};if(u==null)return{};const d=Vw(g),v={x:r,y:n},_=Fm(s),b=Bm(_),x=await l.getDimensions(u),f=_==="y",p=f?"top":"left",h=f?"bottom":"right",m=f?"clientHeight":"clientWidth",y=i.reference[b]+i.reference[_]-v[_]-i.floating[b],w=v[_]-i.reference[_],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=k?k[m]:0;(!j||!await(l.isElement==null?void 0:l.isElement(k)))&&(j=o.floating[m]||i.floating[b]);const S=y/2-w/2,E=j/2-x[b]/2-1,N=qs(d[p],E),O=qs(d[h],E),T=N,L=j-x[b]-O,$=j/2-x[b]/2+S,W=Ff(T,$,L),U=!c.arrow&&aa(s)!=null&&$!==W&&i.reference[b]/2-($<T?N:O)-x[b]/2<0,K=U?$<T?$-T:$-L:0;return{[_]:v[_]+K,data:{[_]:W,centerOffset:$-W-K,...U&&{alignmentOffset:K}},reset:U}}}),OP=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:o,platform:c,elements:u}=t,{mainAxis:g=!0,crossAxis:d=!0,fallbackPlacements:v,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,...f}=es(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const p=ts(s),h=xn(o),m=ts(o)===o,y=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=v||(m||!x?[ku(o)]:kP(o)),k=b!=="none";!v&&k&&w.push(...NP(o,x,b,y));const j=[o,...w],S=await c.detectOverflow(t,f),E=[];let N=((n=i.flip)==null?void 0:n.overflows)||[];if(g&&E.push(S[p]),d){const $=CP(s,l,y);E.push(S[$[0]],S[$[1]])}if(N=[...N,{placement:s,overflows:E}],!E.every($=>$<=0)){var O,T;const $=(((O=i.flip)==null?void 0:O.index)||0)+1,W=j[$];if(W&&(!(d==="alignment"?h!==xn(W):!1)||N.every(R=>xn(R.placement)===h?R.overflows[0]>0:!0)))return{data:{index:$,overflows:N},reset:{placement:W}};let U=(T=N.filter(K=>K.overflows[0]<=0).sort((K,R)=>K.overflows[1]-R.overflows[1])[0])==null?void 0:T.placement;if(!U)switch(_){case"bestFit":{var L;const K=(L=N.filter(R=>{if(k){const P=xn(R.placement);return P===h||P==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(P=>P>0).reduce((P,D)=>P+D,0)]).sort((R,P)=>R[1]-P[1])[0])==null?void 0:L[0];K&&(U=K);break}case"initialPlacement":U=o;break}if(s!==U)return{reset:{placement:U}}}return{}}}};function w_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function S_(e){return wP.some(t=>e[t]>=0)}const MP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...i}=es(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...i,elementContext:"reference"}),o=w_(l,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:S_(o)}}}case"escaped":{const l=await n.detectOverflow(t,{...i,altBoundary:!0}),o=w_(l,r.floating);return{data:{escapedOffsets:o,escaped:S_(o)}}}default:return{}}}}},qw=new Set(["left","top"]);async function IP(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=ts(r),o=aa(r),c=xn(r)==="y",u=qw.has(l)?-1:1,g=i&&c?-1:1,d=es(t,e);let{mainAxis:v,crossAxis:_,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof b=="number"&&(_=o==="end"?b*-1:b),c?{x:_*g,y:v*u}:{x:v*u,y:_*g}}const BP=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:o}=t,c=await IP(t,e);return l===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:l}}}}},FP=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:o=!1,limiter:c={fn:p=>{let{x:h,y:m}=p;return{x:h,y:m}}},...u}=es(e,t),g={x:r,y:n},d=await i.detectOverflow(t,u),v=xn(ts(s)),_=Im(v);let b=g[_],x=g[v];if(l){const p=_==="y"?"top":"left",h=_==="y"?"bottom":"right",m=b+d[p],y=b-d[h];b=Ff(m,b,y)}if(o){const p=v==="y"?"top":"left",h=v==="y"?"bottom":"right",m=x+d[p],y=x-d[h];x=Ff(m,x,y)}const f=c.fn({...t,[_]:b,[v]:x});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[_]:l,[v]:o}}}}}},$P=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:l}=t,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=es(e,t),g={x:r,y:n},d=xn(s),v=Im(d);let _=g[v],b=g[d];const x=es(o,t),f=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const m=v==="y"?"height":"width",y=i.reference[v]-i.floating[m]+f.mainAxis,w=i.reference[v]+i.reference[m]-f.mainAxis;_<y?_=y:_>w&&(_=w)}if(u){var p,h;const m=v==="y"?"width":"height",y=qw.has(ts(s)),w=i.reference[d]-i.floating[m]+(y&&((p=l.offset)==null?void 0:p[d])||0)+(y?0:f.crossAxis),k=i.reference[d]+i.reference[m]+(y?0:((h=l.offset)==null?void 0:h[d])||0)-(y?f.crossAxis:0);b<w?b=w:b>k&&(b=k)}return{[v]:_,[d]:b}}}},HP=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:o}=t,{apply:c=()=>{},...u}=es(e,t),g=await l.detectOverflow(t,u),d=ts(s),v=aa(s),_=xn(s)==="y",{width:b,height:x}=i.floating;let f,p;d==="top"||d==="bottom"?(f=d,p=v===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(p=d,f=v==="end"?"top":"bottom");const h=x-g.top-g.bottom,m=b-g.left-g.right,y=qs(x-g[f],h),w=qs(b-g[p],m),k=!t.middlewareData.shift;let j=y,S=w;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=m),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(j=h),k&&!v){const N=mr(g.left,0),O=mr(g.right,0),T=mr(g.top,0),L=mr(g.bottom,0);_?S=b-2*(N!==0||O!==0?N+O:mr(g.left,g.right)):j=x-2*(T!==0||L!==0?T+L:mr(g.top,g.bottom))}await c({...t,availableWidth:S,availableHeight:j});const E=await l.getDimensions(o.floating);return b!==E.width||x!==E.height?{reset:{rects:!0}}:{}}}};function cd(){return typeof window<"u"}function la(e){return Kw(e)?(e.nodeName||"").toLowerCase():"#document"}function _r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pn(e){var t;return(t=(Kw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Kw(e){return cd()?e instanceof Node||e instanceof _r(e).Node:!1}function an(e){return cd()?e instanceof Element||e instanceof _r(e).Element:!1}function is(e){return cd()?e instanceof HTMLElement||e instanceof _r(e).HTMLElement:!1}function C_(e){return!cd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _r(e).ShadowRoot}function $l(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function zP(e){return/^(table|td|th)$/.test(la(e))}function ud(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const UP=/transform|translate|scale|rotate|perspective|filter/,WP=/paint|layout|strict|content/,ni=e=>!!e&&e!=="none";let sh;function $m(e){const t=an(e)?ln(e):e;return ni(t.transform)||ni(t.translate)||ni(t.scale)||ni(t.rotate)||ni(t.perspective)||!Hm()&&(ni(t.backdropFilter)||ni(t.filter))||UP.test(t.willChange||"")||WP.test(t.contain||"")}function VP(e){let t=Ks(e);for(;is(t)&&!Ko(t);){if($m(t))return t;if(ud(t))return null;t=Ks(t)}return null}function Hm(){return sh==null&&(sh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),sh}function Ko(e){return/^(html|body|#document)$/.test(la(e))}function ln(e){return _r(e).getComputedStyle(e)}function dd(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ks(e){if(la(e)==="html")return e;const t=e.assignedSlot||e.parentNode||C_(e)&&e.host||Pn(e);return C_(t)?t.host:t}function Gw(e){const t=Ks(e);return Ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:is(t)&&$l(t)?t:Gw(t)}function xl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Gw(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),l=_r(s);if(i){const o=Hf(l);return t.concat(l,l.visualViewport||[],$l(s)?s:[],o&&r?xl(o):[])}else return t.concat(s,xl(s,[],r))}function Hf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yw(e){const t=ln(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=is(e),i=s?e.offsetWidth:r,l=s?e.offsetHeight:n,o=Cu(r)!==i||Cu(n)!==l;return o&&(r=i,n=l),{width:r,height:n,$:o}}function zm(e){return an(e)?e:e.contextElement}function bo(e){const t=zm(e);if(!is(t))return Sn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=Yw(t);let l=(i?Cu(r.width):r.width)/n,o=(i?Cu(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const qP=Sn(0);function Qw(e){const t=_r(e);return!Hm()||!t.visualViewport?qP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KP(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==_r(e)?!1:t}function Ti(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=zm(e);let l=Sn(1);t&&(n?an(n)&&(l=bo(n)):l=bo(e));const o=KP(i,r,n)?Qw(i):Sn(0);let c=(s.left+o.x)/l.x,u=(s.top+o.y)/l.y,g=s.width/l.x,d=s.height/l.y;if(i){const v=_r(i),_=n&&an(n)?_r(n):n;let b=v,x=Hf(b);for(;x&&n&&_!==b;){const f=bo(x),p=x.getBoundingClientRect(),h=ln(x),m=p.left+(x.clientLeft+parseFloat(h.paddingLeft))*f.x,y=p.top+(x.clientTop+parseFloat(h.paddingTop))*f.y;c*=f.x,u*=f.y,g*=f.x,d*=f.y,c+=m,u+=y,b=_r(x),x=Hf(b)}}return Eu({width:g,height:d,x:c,y:u})}function hd(e,t){const r=dd(e).scrollLeft;return t?t.left+r:Ti(Pn(e)).left+r}function Zw(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-hd(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function GP(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",l=Pn(n),o=t?ud(t.floating):!1;if(n===l||o&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Sn(1);const g=Sn(0),d=is(n);if((d||!d&&!i)&&((la(n)!=="body"||$l(l))&&(c=dd(n)),d)){const _=Ti(n);u=bo(n),g.x=_.x+n.clientLeft,g.y=_.y+n.clientTop}const v=l&&!d&&!i?Zw(l,c):Sn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+g.x+v.x,y:r.y*u.y-c.scrollTop*u.y+g.y+v.y}}function YP(e){return Array.from(e.getClientRects())}function QP(e){const t=Pn(e),r=dd(e),n=e.ownerDocument.body,s=mr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=mr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+hd(e);const o=-r.scrollTop;return ln(n).direction==="rtl"&&(l+=mr(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:l,y:o}}const k_=25;function ZP(e,t){const r=_r(e),n=Pn(e),s=r.visualViewport;let i=n.clientWidth,l=n.clientHeight,o=0,c=0;if(s){i=s.width,l=s.height;const g=Hm();(!g||g&&t==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}const u=hd(n);if(u<=0){const g=n.ownerDocument,d=g.body,v=getComputedStyle(d),_=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(n.clientWidth-d.clientWidth-_);b<=k_&&(i-=b)}else u<=k_&&(i+=u);return{width:i,height:l,x:o,y:c}}function XP(e,t){const r=Ti(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=is(e)?bo(e):Sn(1),l=e.clientWidth*i.x,o=e.clientHeight*i.y,c=s*i.x,u=n*i.y;return{width:l,height:o,x:c,y:u}}function E_(e,t,r){let n;if(t==="viewport")n=ZP(e,r);else if(t==="document")n=QP(Pn(e));else if(an(t))n=XP(t,r);else{const s=Qw(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Eu(n)}function Xw(e,t){const r=Ks(e);return r===t||!an(r)||Ko(r)?!1:ln(r).position==="fixed"||Xw(r,t)}function JP(e,t){const r=t.get(e);if(r)return r;let n=xl(e,[],!1).filter(o=>an(o)&&la(o)!=="body"),s=null;const i=ln(e).position==="fixed";let l=i?Ks(e):e;for(;an(l)&&!Ko(l);){const o=ln(l),c=$m(l);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||$l(l)&&!c&&Xw(e,l))?n=n.filter(g=>g!==l):s=o,l=Ks(l)}return t.set(e,n),n}function eT(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?ud(t)?[]:JP(t,this._c):[].concat(r),n],o=E_(t,l[0],s);let c=o.top,u=o.right,g=o.bottom,d=o.left;for(let v=1;v<l.length;v++){const _=E_(t,l[v],s);c=mr(_.top,c),u=qs(_.right,u),g=qs(_.bottom,g),d=mr(_.left,d)}return{width:u-d,height:g-c,x:d,y:c}}function tT(e){const{width:t,height:r}=Yw(e);return{width:t,height:r}}function rT(e,t,r){const n=is(t),s=Pn(t),i=r==="fixed",l=Ti(e,!0,i,t);let o={scrollLeft:0,scrollTop:0};const c=Sn(0);function u(){c.x=hd(s)}if(n||!n&&!i)if((la(t)!=="body"||$l(s))&&(o=dd(t)),n){const _=Ti(t,!0,i,t);c.x=_.x+t.clientLeft,c.y=_.y+t.clientTop}else s&&u();i&&!n&&s&&u();const g=s&&!n&&!i?Zw(s,o):Sn(0),d=l.left+o.scrollLeft-c.x-g.x,v=l.top+o.scrollTop-c.y-g.y;return{x:d,y:v,width:l.width,height:l.height}}function ih(e){return ln(e).position==="static"}function j_(e,t){if(!is(e)||ln(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Pn(e)===r&&(r=r.ownerDocument.body),r}function Jw(e,t){const r=_r(e);if(ud(e))return r;if(!is(e)){let s=Ks(e);for(;s&&!Ko(s);){if(an(s)&&!ih(s))return s;s=Ks(s)}return r}let n=j_(e,t);for(;n&&zP(n)&&ih(n);)n=j_(n,t);return n&&Ko(n)&&ih(n)&&!$m(n)?r:n||VP(e)||r}const nT=async function(e){const t=this.getOffsetParent||Jw,r=this.getDimensions,n=await r(e.floating);return{reference:rT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sT(e){return ln(e).direction==="rtl"}const iT={convertOffsetParentRelativeRectToViewportRelativeRect:GP,getDocumentElement:Pn,getClippingRect:eT,getOffsetParent:Jw,getElementRects:nT,getClientRects:YP,getDimensions:tT,getScale:bo,isElement:an,isRTL:sT};function eS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oT(e,t){let r=null,n;const s=Pn(e);function i(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function l(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:g,top:d,width:v,height:_}=u;if(o||t(),!v||!_)return;const b=_c(d),x=_c(s.clientWidth-(g+v)),f=_c(s.clientHeight-(d+_)),p=_c(g),m={rootMargin:-b+"px "+-x+"px "+-f+"px "+-p+"px",threshold:mr(0,qs(1,c))||1};let y=!0;function w(k){const j=k[0].intersectionRatio;if(j!==c){if(!y)return l();j?l(!1,j):n=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!eS(u,e.getBoundingClientRect())&&l(),y=!1}try{r=new IntersectionObserver(w,{...m,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,m)}r.observe(e)}return l(!0),i}function aT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=zm(e),g=s||i?[...u?xl(u):[],...t?xl(t):[]]:[];g.forEach(p=>{s&&p.addEventListener("scroll",r,{passive:!0}),i&&p.addEventListener("resize",r)});const d=u&&o?oT(u,r):null;let v=-1,_=null;l&&(_=new ResizeObserver(p=>{let[h]=p;h&&h.target===u&&_&&t&&(_.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var m;(m=_)==null||m.observe(t)})),r()}),u&&!c&&_.observe(u),t&&_.observe(t));let b,x=c?Ti(e):null;c&&f();function f(){const p=Ti(e);x&&!eS(x,p)&&r(),x=p,b=requestAnimationFrame(f)}return r(),()=>{var p;g.forEach(h=>{s&&h.removeEventListener("scroll",r),i&&h.removeEventListener("resize",r)}),d==null||d(),(p=_)==null||p.disconnect(),_=null,c&&cancelAnimationFrame(b)}}const lT=BP,cT=FP,uT=OP,dT=HP,hT=MP,R_=LP,fT=$P,pT=(e,t,r)=>{const n=new Map,s={platform:iT,...r},i={...s.platform,_c:n};return DP(e,t,{...s,platform:i})};var mT=typeof document<"u",gT=function(){},Uc=mT?C.useLayoutEffect:gT;function ju(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(!ju(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)&&!ju(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function tS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function N_(e,t){const r=tS(e);return Math.round(t*r)/r}function oh(e){const t=C.useRef(e);return Uc(()=>{t.current=e}),t}function vT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:o=!0,whileElementsMounted:c,open:u}=e,[g,d]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,_]=C.useState(n);ju(v,n)||_(n);const[b,x]=C.useState(null),[f,p]=C.useState(null),h=C.useCallback(R=>{R!==k.current&&(k.current=R,x(R))},[]),m=C.useCallback(R=>{R!==j.current&&(j.current=R,p(R))},[]),y=i||b,w=l||f,k=C.useRef(null),j=C.useRef(null),S=C.useRef(g),E=c!=null,N=oh(c),O=oh(s),T=oh(u),L=C.useCallback(()=>{if(!k.current||!j.current)return;const R={placement:t,strategy:r,middleware:v};O.current&&(R.platform=O.current),pT(k.current,j.current,R).then(P=>{const D={...P,isPositioned:T.current!==!1};$.current&&!ju(S.current,D)&&(S.current=D,sd.flushSync(()=>{d(D)}))})},[v,t,r,O,T]);Uc(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const $=C.useRef(!1);Uc(()=>($.current=!0,()=>{$.current=!1}),[]),Uc(()=>{if(y&&(k.current=y),w&&(j.current=w),y&&w){if(N.current)return N.current(y,w,L);L()}},[y,w,L,N,E]);const W=C.useMemo(()=>({reference:k,floating:j,setReference:h,setFloating:m}),[h,m]),U=C.useMemo(()=>({reference:y,floating:w}),[y,w]),K=C.useMemo(()=>{const R={position:r,left:0,top:0};if(!U.floating)return R;const P=N_(U.floating,g.x),D=N_(U.floating,g.y);return o?{...R,transform:"translate("+P+"px, "+D+"px)",...tS(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:D}},[r,o,U.floating,g.x,g.y]);return C.useMemo(()=>({...g,update:L,refs:W,elements:U,floatingStyles:K}),[g,L,W,U,K])}const _T=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?R_({element:n.current,padding:s}).fn(r):{}:n?R_({element:n,padding:s}).fn(r):{}}}},yT=(e,t)=>{const r=lT(e);return{name:r.name,fn:r.fn,options:[e,t]}},xT=(e,t)=>{const r=cT(e);return{name:r.name,fn:r.fn,options:[e,t]}},bT=(e,t)=>({fn:fT(e).fn,options:[e,t]}),wT=(e,t)=>{const r=uT(e);return{name:r.name,fn:r.fn,options:[e,t]}},ST=(e,t)=>{const r=dT(e);return{name:r.name,fn:r.fn,options:[e,t]}},CT=(e,t)=>{const r=hT(e);return{name:r.name,fn:r.fn,options:[e,t]}},kT=(e,t)=>{const r=_T(e);return{name:r.name,fn:r.fn,options:[e,t]}};var ET="Arrow",rS=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return a.jsx(Fe.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});rS.displayName=ET;var jT=rS;function nS(e){const[t,r]=C.useState(void 0);return Jn(()=>{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,o;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;l=u.inlineSize,o=u.blockSize}else l=e.offsetWidth,o=e.offsetHeight;r({width:l,height:o})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Um="Popper",[sS,ca]=un(Um),[RT,iS]=sS(Um),oS=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return a.jsx(RT,{scope:t,anchor:n,onAnchorChange:s,children:r})};oS.displayName=Um;var aS="PopperAnchor",lS=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=iS(aS,r),l=C.useRef(null),o=Be(t,l),c=C.useRef(null);return C.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||l.current,u!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(Fe.div,{...s,ref:o})});lS.displayName=aS;var Wm="PopperContent",[NT,PT]=sS(Wm),cS=C.forwardRef((e,t)=>{var A,z,G,Y,ye,ae;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:g=0,sticky:d="partial",hideWhenDetached:v=!1,updatePositionStrategy:_="optimized",onPlaced:b,...x}=e,f=iS(Wm,r),[p,h]=C.useState(null),m=Be(t,je=>h(je)),[y,w]=C.useState(null),k=nS(y),j=(k==null?void 0:k.width)??0,S=(k==null?void 0:k.height)??0,E=n+(i!=="center"?"-"+i:""),N=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},O=Array.isArray(u)?u:[u],T=O.length>0,L={padding:N,boundary:O.filter(AT),altBoundary:T},{refs:$,floatingStyles:W,placement:U,isPositioned:K,middlewareData:R}=vT({strategy:"fixed",placement:E,whileElementsMounted:(...je)=>aT(...je,{animationFrame:_==="always"}),elements:{reference:f.anchor},middleware:[yT({mainAxis:s+S,alignmentAxis:l}),c&&xT({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?bT():void 0,...L}),c&&wT({...L}),ST({...L,apply:({elements:je,rects:We,availableWidth:ot,availableHeight:ar})=>{const{width:be,height:lr}=We.reference,cr=je.floating.style;cr.setProperty("--radix-popper-available-width",`${ot}px`),cr.setProperty("--radix-popper-available-height",`${ar}px`),cr.setProperty("--radix-popper-anchor-width",`${be}px`),cr.setProperty("--radix-popper-anchor-height",`${lr}px`)}}),y&&kT({element:y,padding:o}),DT({arrowWidth:j,arrowHeight:S}),v&&CT({strategy:"referenceHidden",...L})]}),[P,D]=hS(U),M=Bt(b);Jn(()=>{K&&(M==null||M())},[K,M]);const B=(A=R.arrow)==null?void 0:A.x,q=(z=R.arrow)==null?void 0:z.y,Z=((G=R.arrow)==null?void 0:G.centerOffset)!==0,[ee,J]=C.useState();return Jn(()=>{p&&J(window.getComputedStyle(p).zIndex)},[p]),a.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:K?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(Y=R.transformOrigin)==null?void 0:Y.x,(ye=R.transformOrigin)==null?void 0:ye.y].join(" "),...((ae=R.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(NT,{scope:r,placedSide:P,onArrowChange:w,arrowX:B,arrowY:q,shouldHideArrow:Z,children:a.jsx(Fe.div,{"data-side":P,"data-align":D,...x,ref:m,style:{...x.style,animation:K?void 0:"none"}})})})});cS.displayName=Wm;var uS="PopperArrow",TT={top:"bottom",right:"left",bottom:"top",left:"right"},dS=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=PT(uS,n),l=TT[i.placedSide];return a.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:a.jsx(jT,{...s,ref:r,style:{...s.style,display:"block"}})})});dS.displayName=uS;function AT(e){return e!==null}var DT=e=>({name:"transformOrigin",options:e,fn(t){var f,p,h;const{placement:r,rects:n,middlewareData:s}=t,l=((f=s.arrow)==null?void 0:f.centerOffset)!==0,o=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[u,g]=hS(r),d={start:"0%",center:"50%",end:"100%"}[g],v=(((p=s.arrow)==null?void 0:p.x)??0)+o/2,_=(((h=s.arrow)==null?void 0:h.y)??0)+c/2;let b="",x="";return u==="bottom"?(b=l?d:`${v}px`,x=`${-c}px`):u==="top"?(b=l?d:`${v}px`,x=`${n.floating.height+c}px`):u==="right"?(b=`${-c}px`,x=l?d:`${_}px`):u==="left"&&(b=`${n.floating.width+c}px`,x=l?d:`${_}px`),{data:{x:b,y:x}}}});function hS(e){const[t,r="center"]=e.split("-");return[t,r]}var Vm=oS,fd=lS,qm=cS,Km=dS,LT="Portal",Hl=C.forwardRef((e,t)=>{var o;const{container:r,...n}=e,[s,i]=C.useState(!1);Jn(()=>i(!0),[]);const l=r||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return l?Mb.createPortal(a.jsx(Fe.div,{...n,ref:t}),l):null});Hl.displayName=LT;var OT=Symbol("radix.slottable");function MT(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=OT,t}var IT=zu[" useInsertionEffect ".trim().toString()]||Jn;function ua({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,l]=BT({defaultProp:t,onChange:r}),o=e!==void 0,c=o?e:s;{const g=C.useRef(e!==void 0);C.useEffect(()=>{const d=g.current;d!==o&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=o},[o,n])}const u=C.useCallback(g=>{var d;if(o){const v=FT(g)?g(e):g;v!==e&&((d=l.current)==null||d.call(l,v))}else i(g)},[o,e,i,l]);return[c,u]}function BT({defaultProp:e,onChange:t}){const[r,n]=C.useState(e),s=C.useRef(r),i=C.useRef(t);return IT(()=>{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 FT(e){return typeof e=="function"}var $T=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"}),HT="VisuallyHidden",fS=C.forwardRef((e,t)=>a.jsx(Fe.span,{...e,ref:t,style:{...$T,...e.style}}));fS.displayName=HT;var zT=fS,[pd]=un("Tooltip",[ca]),md=ca(),pS="TooltipProvider",UT=700,zf="tooltip.open",[WT,Gm]=pd(pS),mS=e=>{const{__scopeTooltip:t,delayDuration:r=UT,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,l=C.useRef(!0),o=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),a.jsx(WT,{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:o,onPointerInTransitChange:C.useCallback(u=>{o.current=u},[]),disableHoverableContent:s,children:i})};mS.displayName=pS;var bl="Tooltip",[VT,zl]=pd(bl),gS=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:o}=e,c=Gm(bl,e.__scopeTooltip),u=md(t),[g,d]=C.useState(null),v=zs(),_=C.useRef(0),b=l??c.disableHoverableContent,x=o??c.delayDuration,f=C.useRef(!1),[p,h]=ua({prop:n,defaultProp:s??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(zf))):c.onClose(),i==null||i(j)},caller:bl}),m=C.useMemo(()=>p?f.current?"delayed-open":"instant-open":"closed",[p]),y=C.useCallback(()=>{window.clearTimeout(_.current),_.current=0,f.current=!1,h(!0)},[h]),w=C.useCallback(()=>{window.clearTimeout(_.current),_.current=0,h(!1)},[h]),k=C.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{f.current=!0,h(!0),_.current=0},x)},[x,h]);return C.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),a.jsx(Vm,{...u,children:a.jsx(VT,{scope:t,contentId:v,open:p,stateAttribute:m,trigger:g,onTriggerChange:d,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?k():y()},[c.isOpenDelayedRef,k,y]),onTriggerLeave:C.useCallback(()=>{b?w():(window.clearTimeout(_.current),_.current=0)},[w,b]),onOpen:y,onClose:w,disableHoverableContent:b,children:r})})};gS.displayName=bl;var Uf="TooltipTrigger",vS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=zl(Uf,r),i=Gm(Uf,r),l=md(r),o=C.useRef(null),c=Be(t,o,s.onTriggerChange),u=C.useRef(!1),g=C.useRef(!1),d=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),a.jsx(fd,{asChild:!0,...l,children:a.jsx(Fe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ve(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:ve(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:ve(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ve(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ve(e.onBlur,s.onClose),onClick:ve(e.onClick,s.onClose)})})});vS.displayName=Uf;var Ym="TooltipPortal",[qT,KT]=pd(Ym,{forceMount:void 0}),_S=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,i=zl(Ym,t);return a.jsx(qT,{scope:t,forceMount:r,children:a.jsx(Ht,{present:r||i.open,children:a.jsx(Hl,{asChild:!0,container:s,children:n})})})};_S.displayName=Ym;var Go="TooltipContent",yS=C.forwardRef((e,t)=>{const r=KT(Go,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,l=zl(Go,e.__scopeTooltip);return a.jsx(Ht,{present:n||l.open,children:l.disableHoverableContent?a.jsx(xS,{side:s,...i,ref:t}):a.jsx(GT,{side:s,...i,ref:t})})}),GT=C.forwardRef((e,t)=>{const r=zl(Go,e.__scopeTooltip),n=Gm(Go,e.__scopeTooltip),s=C.useRef(null),i=Be(t,s),[l,o]=C.useState(null),{trigger:c,onClose:u}=r,g=s.current,{onPointerInTransitChange:d}=n,v=C.useCallback(()=>{o(null),d(!1)},[d]),_=C.useCallback((b,x)=>{const f=b.currentTarget,p={x:b.clientX,y:b.clientY},h=JT(p,f.getBoundingClientRect()),m=eA(p,h),y=tA(x.getBoundingClientRect()),w=nA([...m,...y]);o(w),d(!0)},[d]);return C.useEffect(()=>()=>v(),[v]),C.useEffect(()=>{if(c&&g){const b=f=>_(f,g),x=f=>_(f,c);return c.addEventListener("pointerleave",b),g.addEventListener("pointerleave",x),()=>{c.removeEventListener("pointerleave",b),g.removeEventListener("pointerleave",x)}}},[c,g,_,v]),C.useEffect(()=>{if(l){const b=x=>{const f=x.target,p={x:x.clientX,y:x.clientY},h=(c==null?void 0:c.contains(f))||(g==null?void 0:g.contains(f)),m=!rA(p,l);h?v():m&&(v(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,g,l,u,v]),a.jsx(xS,{...e,ref:i})}),[YT,QT]=pd(bl,{isInside:!1}),ZT=MT("TooltipContent"),xS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...o}=e,c=zl(Go,r),u=md(r),{onClose:g}=c;return C.useEffect(()=>(document.addEventListener(zf,g),()=>document.removeEventListener(zf,g)),[g]),C.useEffect(()=>{if(c.trigger){const d=v=>{const _=v.target;_!=null&&_.contains(c.trigger)&&g()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,g]),a.jsx(Fl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d=>d.preventDefault(),onDismiss:g,children:a.jsxs(qm,{"data-state":c.stateAttribute,...u,...o,ref:t,style:{...o.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:[a.jsx(ZT,{children:n}),a.jsx(YT,{scope:r,isInside:!0,children:a.jsx(zT,{id:c.contentId,role:"tooltip",children:s||n})})]})})});yS.displayName=Go;var bS="TooltipArrow",XT=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=md(r);return QT(bS,r).isInside?null:a.jsx(Km,{...s,...n,ref:t})});XT.displayName=bS;function JT(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 eA(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 tA(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 rA(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 o=t[i],c=t[l],u=o.x,g=o.y,d=c.x,v=c.y;g>n!=v>n&&r<(d-u)*(n-g)/(v-g)+u&&(s=!s)}return s}function nA(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),sA(t)}function sA(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 iA=mS,oA=gS,aA=vS,lA=_S,wS=yS;const Cn=iA,nn=oA,sn=aA,Dr=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(lA,{children:a.jsx(wS,{ref:n,sideOffset:t,className:X("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})}));Dr.displayName=wS.displayName;function cA({chain:e}){const t=e==="base";return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Pe,{variant:t?"secondary":"outline",children:"Testnet"}),a.jsx(Cn,{delayDuration:120,children:a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("span",{children:a.jsx(Pe,{variant:"secondary",className:"border-dashed border-border opacity-60",children:"Mainnet · soon"})})}),a.jsx(Dr,{children:"Mainnet support is coming. v1 supports testnet only."})]})})]})}function uA({status:e}){return e==="done"?a.jsxs(Pe,{variant:"success",className:"gap-1.5",children:[a.jsx(hN,{className:"h-3 w-3"}),"Done"]}):e==="error"?a.jsxs(Pe,{variant:"destructive",className:"gap-1.5",children:[a.jsx(Cm,{className:"h-3 w-3"}),"Failed"]}):e==="active"?a.jsxs(Pe,{variant:"warning",className:"gap-2",children:[a.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-1.5 w-1.5 rounded-full bg-[var(--accent-gold)]"}),"Active"]}):a.jsx(Pe,{variant:"secondary",children:"Queued"})}const dA={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function hA({phase:e,status:t,children:r}){const n=t==="active",s=t==="error",i=t==="done",l=n||s,o=s?"text-[var(--break-red)]":n?"text-[var(--accent-gold)]":i?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]",c=s||n?"text-foreground":i?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]",u=l?"font-serif text-[28px] leading-[1.2]":"font-mono text-[14px] leading-[1.2]";return a.jsxs("li",{className:"phase-row border-t border-border","data-status":t,"data-testid":`onboarding-phase-${e}`,children:[a.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[a.jsx("span",{className:X("font-mono text-xs tabular-nums tracking-[0.05em] transition-colors duration-200",o),children:String(e).padStart(2,"0")}),a.jsx("span",{className:X(u,c,"transition-colors duration-200"),children:dA[e]}),a.jsx(uA,{status:t})]}),l&&r&&a.jsx("div",{className:"jinn-anim-fade-slide ml-12 pb-5 pr-2",children:r})]})}function fA({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:s,explorer:i,contractRevertReason:l}){const o=!!l;return a.jsxs("div",{className:X("flex flex-col gap-3 rounded-md border bg-[var(--bg-elevated)] px-4 py-3",o?"border-[var(--break-red)]":"border-border"),children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{"aria-hidden":"true",className:X("jinn-anim-pulse h-1.5 w-1.5 rounded-full",o?"bg-[var(--break-red)]":"bg-[var(--accent-sky)]")}),a.jsx("span",{className:"font-mono text-sm text-foreground",children:e}),a.jsx("span",{className:X("ml-auto font-mono text-[10px]",o?"text-[var(--break-red)]":"text-[var(--fg-dim)]"),children:o?"binding failed · will retry":"running · no action needed"})]}),a.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:[a.jsx("span",{className:"text-[var(--fg-dim)]",children:"Current step"}),a.jsx("span",{children:pA(t)}),r!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[var(--fg-dim)]",children:"Service"}),a.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),s&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[var(--fg-dim)]",children:"Safe"}),a.jsx("a",{href:`${i}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"break-all text-[var(--accent-sky)] hover:underline",children:s})]}),l&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[var(--fg-dim)]",children:"Contract revert reason"}),a.jsx("code",{className:"break-words text-xs text-[var(--break-red)]",children:l})]})]})]})}function pA(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const mA={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 gA(e){return mA[e]??{phase:1,subState:null}}function vA(e,t,r){return e<t?e===2&&r===!1?"active":"done":e===t?"active":"queued"}const _A="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]";function yA(){var g;const{data:e,isLoading:t}=Oe({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:2e3});if(t||!e)return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.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}=gA(e.currentStep),l=e.error,o=e.services.find(d=>d.step===e.currentStep)??e.services[0],c=(g=e.funding)==null?void 0:g.targetMet,u=Mm().embeddedAgent;return a.jsx("div",{className:"min-h-screen w-full bg-background text-foreground",children:a.jsxs("div",{className:"mx-auto grid max-w-[1280px] grid-cols-12 gap-10 px-10 py-10",children:[a.jsxs("section",{className:X("col-span-12 flex flex-col gap-8",u&&"lg:col-span-7"),children:[a.jsxs("header",{className:"flex items-baseline justify-between",children:[a.jsx("span",{className:_A,children:"Jinn · Onboarding"}),a.jsx(cA,{chain:e.chain})]}),a.jsx("h1",{className:"font-serif text-[76px] leading-[1.05] text-foreground",children:"Welcome to Jinn."}),a.jsxs("div",{className:"flex flex-col gap-1.5","data-testid":"onboarding-progress","aria-label":"Onboarding progress",children:[a.jsx(Om,{value:Math.min(100,(s-1)/2*100+(s===3?33:0))}),a.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:["Phase ",s," of 3"]})]}),a.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(d=>{var b;const v=vA(d,s,c),_=l&&d===s;return a.jsxs(hA,{phase:d,status:_?"error":v,children:[_&&a.jsx(cP,{envelope:l,chainExplorerBase:r}),!_&&d===2&&v==="active"&&n&&a.jsx(tP,{address:n,minimumWei:((b=e.funding)==null?void 0:b.targetWei)??"10000000000000000",chainExplorerBase:r,chain:e.chain,onSharedDefaultRpc:e.rpcUrl===e.defaultRpcUrl}),!_&&d===3&&v==="active"&&a.jsx(fA,{label:i??"Working",step:e.currentStep,serviceIndex:o==null?void 0:o.index,serviceId:o==null?void 0:o.service_id,safeAddress:o==null?void 0:o.safe_address,explorer:r,contractRevertReason:(o==null?void 0:o.error_revert_reason)??null})]},d)})})]}),u&&a.jsxs("aside",{className:"col-span-12 flex flex-col gap-3 lg:col-span-5",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Ask Claude"}),a.jsx(ke,{className:"h-[calc(100vh-220px)] min-h-[520px] overflow-hidden p-0",children:a.jsx(zw,{agentGated:!1})})]})]})})}const xA={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)]"},bA={blocking:"text-[var(--severity-blocking-fg)]",warning:"text-[var(--severity-warning-fg)]",info:"text-[var(--severity-info-fg)]"};function wA({notice:e}){return a.jsxs("li",{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,className:X("flex items-baseline gap-3 border-l-2 px-4 py-2 font-mono text-[12px] text-foreground",xA[e.severity]),children:[a.jsx("span",{"aria-hidden":"true",className:X("min-w-[64px] font-mono text-[11px] font-medium uppercase tracking-[0.14em]",bA[e.severity]),children:e.severity}),a.jsx("span",{className:"flex-1",children:e.message}),e.jumpTo?a.jsx(jn,{href:e.jumpTo,className:"font-mono text-[var(--accent-sky)] no-underline hover:text-[var(--accent-sky-hover)]",children:"resolve →"}):null]})}function SA({notices:e}){return e.length===0?null:a.jsx("section",{"aria-label":"Notifications",role:"region",children:a.jsx("ul",{className:"m-0 list-none p-0",children:e.map((t,r)=>a.jsx(wA,{notice:t},`${t.kind}-${r}`))})})}async function CA(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 kA(e={}){const{pollIntervalMs:t=2e3,failureThreshold:r=2,maxBackoffMs:n=3e4,probeTimeoutMs:s=3500,probeUrl:i="/v1/status"}=e,[l,o]=C.useState({status:"connected",lastConnectedAt:Date.now()}),c=C.useRef(0),u=C.useRef(t),g=C.useRef(!1);return C.useEffect(()=>{g.current=!1;let d=null;const v=b=>{g.current||(d=setTimeout(_,b))},_=async()=>{const b=await CA(i,s);if(g.current)return;if(b.ok){c.current=0,u.current=t,o(f=>f.status==="connected"?f:{status:"connected",lastConnectedAt:Date.now()}),v(t);return}c.current+=1,c.current>=r?(o(f=>f.status==="disconnected"?{...f,attempts:f.attempts+1,lastError:b.error}:{status:"disconnected",since:Date.now(),lastError:b.error,attempts:1}),u.current=Math.min(Math.max(u.current*2,t*2),n),v(u.current)):v(t)};return _(),()=>{g.current=!0,d!==null&&clearTimeout(d)}},[t,r,n,s,i]),l}const SS=C.createContext({restartPending:!1,setRestartPending:()=>{}});function EA(){return C.useContext(SS)}const jA=3,RA=1e3*60*60*24*90;function NA(e){const t=[],r=e.status;return e.bootstrap.mode!=="running"&&t.push({kind:"bootstrap_blocked",severity:"blocking",message:e.bootstrap.blockingReason??"Bootstrap incomplete",jumpTo:"/"}),r.funds.runwayDays<jA&&t.push({kind:"funding_low",severity:"warning",message:`Runway is ${r.funds.runwayDays} day(s). Top up gas to keep claiming work.`,jumpTo:"/overview"}),r.harness.ready||t.push({kind:"harness_not_ready",severity:"blocking",message:`Harness ${r.harness.name} is not ready${r.harness.reason?`: ${r.harness.reason}`:""}.`,jumpTo:"/operator/memberships"}),r.rpc.reachable||t.push({kind:"rpc_unreachable",severity:"blocking",message:"RPC endpoint is unreachable.",jumpTo:"/operator/network"}),Object.keys(r.joinedSolverNets).length===0&&e.bootstrap.mode==="running"&&t.push({kind:"no_solvernets_joined",severity:"info",message:"No SolverNets joined. Browse the registry to start earning.",jumpTo:"/operator/registry"}),r.services.some(n=>n.evicted)&&t.push({kind:"service_evicted",severity:"blocking",message:"A service has been evicted from staking. Re-stake to resume.",jumpTo:"/overview"}),r.services.some(n=>!n.safeBound)&&t.push({kind:"safe_binding_pending",severity:"warning",message:"Safe wallet binding is pending.",jumpTo:"/overview"}),r.restartPending&&t.push({kind:"restart_required",severity:"warning",message:"A configuration change is pending — restart to apply.",jumpTo:"/overview"}),r.latestVersion&&r.latestVersion!==r.daemonVersion&&t.push({kind:"update_available",severity:"info",message:`Daemon ${r.latestVersion} available (running ${r.daemonVersion}).`}),r.passwordRotatedAt&&(e.now??Date.now())-new Date(r.passwordRotatedAt).getTime()>RA&&t.push({kind:"password_rotation_due",severity:"info",message:"Keystore password is over 90 days old.",jumpTo:"/operator/security"}),t}const P_={blocking:0,warning:1,info:2};function PA(e,t,r){var g,d;const n=e??{},s=t??{},i=String(((g=n.masterGas)==null?void 0:g.balanceWei)??"0");let l="0",o=Number.POSITIVE_INFINITY;try{const v=BigInt(i);l=v.toString(),o=v>0n?Number.POSITIVE_INFINITY:0}catch{}const c=Array.isArray((d=n.fleet)==null?void 0:d.services)?n.fleet.services:[],u=s.joinedSolverNets&&typeof s.joinedSolverNets=="object"?s.joinedSolverNets:{};return{funds:{eth:l,runwayDays:o},harness:{ready:!0,name:"unknown"},rpc:{reachable:!0},restartPending:r,daemonVersion:String(n.version??"0.0.0"),latestVersion:void 0,services:c.map(v=>({evicted:!!(v!=null&&v.evicted),safeBound:(v==null?void 0:v.safeBoundToAgent)!==!1})),joinedSolverNets:u,passwordRotatedAt:void 0}}function TA(){const e=kA(),{restartPending:t}=EA(),r=Oe({queryKey:["status"],queryFn:()=>ge.getStatus()}),n=Oe({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap()});return C.useMemo(()=>e.status==="disconnected"?[{kind:"rpc_unreachable",severity:"blocking",message:"Daemon offline. What you see may be stale. Reconnecting automatically…"}]:!r.data||!n.data?[]:[...NA({bootstrap:n.data,status:PA(r.data,n.data,t)})].sort((i,l)=>P_[i.severity]-P_[l.severity]),[e.status,t,r.data,n.data])}function AA({header:e,tabs:t,rail:r,children:n}){const s=r!=null,i=TA(),l=i.length>0?"grid-rows-[auto_auto_auto_minmax(0,1fr)]":"grid-rows-[auto_auto_minmax(0,1fr)]";return a.jsxs("div",{className:X("grid h-screen w-full overflow-hidden bg-background text-foreground",s?"grid-cols-[1fr_320px]":"grid-cols-1",l),children:[a.jsx("div",{className:"col-span-full border-b border-border",children:e}),a.jsx("div",{className:"col-span-full border-b border-border",children:t}),i.length>0&&a.jsx("div",{className:"col-span-full border-b border-border",children:a.jsx(SA,{notices:i})}),a.jsx("main",{className:"min-h-0 overflow-y-auto",children:n}),s&&a.jsx("aside",{className:"h-full min-h-0 overflow-y-auto border-l border-border",children:r})]})}function DA({network:e}){return a.jsxs("header",{className:"flex items-center justify-between px-6 py-3.5",children:[a.jsx(jn,{href:"/overview",className:"font-serif text-[26px] text-foreground no-underline",children:"jinn operator"}),a.jsx(Pe,{variant:"outline",children:e})]})}const T_=[{path:"/overview",label:"Dashboard"},{path:"/operator",label:"Settings"}];function LA(){const[e]=En(),t=e==="/launcher"||e.startsWith("/launcher/"),{data:r}=Oe({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>ge.solvernets.listLaunched(),refetchInterval:3e4,enabled:!t}),n=Mm().pluginBuilderUi?[...T_,{path:"/build",label:"Build"}]:T_,i=t||((r==null?void 0:r.records.length)??0)>0?[...n,{path:"/launcher",label:"Launcher"}]:n;return a.jsx("nav",{className:"-mb-px flex px-6",children:i.map(l=>{const o=e===l.path||e.startsWith(`${l.path}/`);return a.jsx(jn,{href:l.path,"data-active":o?"true":"false",className:X("border-b px-4 py-3.5 font-mono text-[11px] font-medium uppercase tracking-[0.14em] no-underline transition-colors",o?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:l.label},l.path)})})}function OA({agentGated:e}){return a.jsxs("div",{className:"agent-rail flex h-full min-w-0 flex-col gap-3 overflow-hidden p-4",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground [overflow-wrap:anywhere]",children:"Claude"}),a.jsx(zw,{agentGated:e})]})}var MA=e=>{switch(e){case"success":return FA;case"info":return HA;case"warning":return $A;case"error":return zA;default:return null}},IA=Array(12).fill(0),BA=({visible:e,className:t})=>Q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Q.createElement("div",{className:"sonner-spinner"},IA.map((r,n)=>Q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),FA=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),$A=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Q.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"})),HA=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),zA=Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Q.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"})),UA=Q.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"},Q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),WA=()=>{let[e,t]=Q.useState(document.hidden);return Q.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Wf=1,VA=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Wf++,i=this.toasts.find(o=>o.id===s),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(o=>o.id===s?(this.publish({...o,...e,id:s,title:r}),{...o,...e,id:s,dismissible:l,title:r}):o):this.addToast({title:r,...n,dismissible:l,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,l=n.then(async c=>{if(i=["resolve",c],Q.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(KA(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,g=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:g})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,g=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:g})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,g=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:g})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),o=()=>new Promise((c,u)=>l.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:o}:Object.assign(r,{unwrap:o})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Wf++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},er=new VA,qA=(e,t)=>{let r=(t==null?void 0:t.id)||Wf++;return er.addToast({title:e,...t,id:r}),r},KA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",GA=qA,YA=()=>er.toasts,QA=()=>er.getActiveToasts(),Gs=Object.assign(GA,{success:er.success,info:er.info,warning:er.warning,error:er.error,custom:er.custom,message:er.message,promise:er.promise,dismiss:er.dismiss,loading:er.loading},{getHistory:YA,getToasts:QA});function ZA(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}ZA(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
186
|
+
`);function yc(e){return e.label!==void 0}var XA=3,JA="32px",eD="16px",A_=4e3,tD=356,rD=14,nD=20,sD=200;function Kr(...e){return e.filter(Boolean).join(" ")}function iD(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var oD=e=>{var t,r,n,s,i,l,o,c,u,g,d;let{invert:v,toast:_,unstyled:b,interacting:x,setHeights:f,visibleToasts:p,heights:h,index:m,toasts:y,expanded:w,removeToast:k,defaultRichColors:j,closeButton:S,style:E,cancelButtonStyle:N,actionButtonStyle:O,className:T="",descriptionClassName:L="",duration:$,position:W,gap:U,loadingIcon:K,expandByDefault:R,classNames:P,icons:D,closeButtonAriaLabel:M="Close toast",pauseWhenPageIsHidden:B}=e,[q,Z]=Q.useState(null),[ee,J]=Q.useState(null),[A,z]=Q.useState(!1),[G,Y]=Q.useState(!1),[ye,ae]=Q.useState(!1),[je,We]=Q.useState(!1),[ot,ar]=Q.useState(!1),[be,lr]=Q.useState(0),[cr,Tn]=Q.useState(0),Hr=Q.useRef(_.duration||$||A_),An=Q.useRef(null),dt=Q.useRef(null),hn=m===0,I=m+1<=p,H=_.type,V=_.dismissible!==!1,re=_.className||"",se=_.descriptionClassName||"",te=Q.useMemo(()=>h.findIndex(Ce=>Ce.toastId===_.id)||0,[h,_.id]),le=Q.useMemo(()=>{var Ce;return(Ce=_.closeButton)!=null?Ce:S},[_.closeButton,S]),he=Q.useMemo(()=>_.duration||$||A_,[_.duration,$]),Ee=Q.useRef(0),qe=Q.useRef(0),zt=Q.useRef(0),Ct=Q.useRef(null),[Dn,ga]=W.split("-"),Hi=Q.useMemo(()=>h.reduce((Ce,Ue,Ze)=>Ze>=te?Ce:Ce+Ue.height,0),[h,te]),Yl=WA(),Ql=_.invert||v,va=H==="loading";qe.current=Q.useMemo(()=>te*U+Hi,[te,Hi]),Q.useEffect(()=>{Hr.current=he},[he]),Q.useEffect(()=>{z(!0)},[]),Q.useEffect(()=>{let Ce=dt.current;if(Ce){let Ue=Ce.getBoundingClientRect().height;return Tn(Ue),f(Ze=>[{toastId:_.id,height:Ue,position:_.position},...Ze]),()=>f(Ze=>Ze.filter(Ur=>Ur.toastId!==_.id))}},[f,_.id]),Q.useLayoutEffect(()=>{if(!A)return;let Ce=dt.current,Ue=Ce.style.height;Ce.style.height="auto";let Ze=Ce.getBoundingClientRect().height;Ce.style.height=Ue,Tn(Ze),f(Ur=>Ur.find(Wr=>Wr.toastId===_.id)?Ur.map(Wr=>Wr.toastId===_.id?{...Wr,height:Ze}:Wr):[{toastId:_.id,height:Ze,position:_.position},...Ur])},[A,_.title,_.description,f,_.id]);let zr=Q.useCallback(()=>{Y(!0),lr(qe.current),f(Ce=>Ce.filter(Ue=>Ue.toastId!==_.id)),setTimeout(()=>{k(_)},sD)},[_,k,f,qe]);Q.useEffect(()=>{if(_.promise&&H==="loading"||_.duration===1/0||_.type==="loading")return;let Ce;return w||x||B&&Yl?(()=>{if(zt.current<Ee.current){let Ue=new Date().getTime()-Ee.current;Hr.current=Hr.current-Ue}zt.current=new Date().getTime()})():Hr.current!==1/0&&(Ee.current=new Date().getTime(),Ce=setTimeout(()=>{var Ue;(Ue=_.onAutoClose)==null||Ue.call(_,_),zr()},Hr.current)),()=>clearTimeout(Ce)},[w,x,_,H,B,Yl,zr]),Q.useEffect(()=>{_.delete&&zr()},[zr,_.delete]);function xk(){var Ce,Ue,Ze;return D!=null&&D.loading?Q.createElement("div",{className:Kr(P==null?void 0:P.loader,(Ce=_==null?void 0:_.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":H==="loading"},D.loading):K?Q.createElement("div",{className:Kr(P==null?void 0:P.loader,(Ue=_==null?void 0:_.classNames)==null?void 0:Ue.loader,"sonner-loader"),"data-visible":H==="loading"},K):Q.createElement(BA,{className:Kr(P==null?void 0:P.loader,(Ze=_==null?void 0:_.classNames)==null?void 0:Ze.loader),visible:H==="loading"})}return Q.createElement("li",{tabIndex:0,ref:dt,className:Kr(T,re,P==null?void 0:P.toast,(t=_==null?void 0:_.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[H],(r=_==null?void 0:_.classNames)==null?void 0:r[H]),"data-sonner-toast":"","data-rich-colors":(n=_.richColors)!=null?n:j,"data-styled":!(_.jsx||_.unstyled||b),"data-mounted":A,"data-promise":!!_.promise,"data-swiped":ot,"data-removed":G,"data-visible":I,"data-y-position":Dn,"data-x-position":ga,"data-index":m,"data-front":hn,"data-swiping":ye,"data-dismissible":V,"data-type":H,"data-invert":Ql,"data-swipe-out":je,"data-swipe-direction":ee,"data-expanded":!!(w||R&&A),style:{"--index":m,"--toasts-before":m,"--z-index":y.length-m,"--offset":`${G?be:qe.current}px`,"--initial-height":R?"auto":`${cr}px`,...E,..._.style},onDragEnd:()=>{ae(!1),Z(null),Ct.current=null},onPointerDown:Ce=>{va||!V||(An.current=new Date,lr(qe.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(ae(!0),Ct.current={x:Ce.clientX,y:Ce.clientY}))},onPointerUp:()=>{var Ce,Ue,Ze,Ur;if(je||!V)return;Ct.current=null;let Wr=Number(((Ce=dt.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),as=Number(((Ue=dt.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ri=new Date().getTime()-((Ze=An.current)==null?void 0:Ze.getTime()),Vr=q==="x"?Wr:as,ls=Math.abs(Vr)/ri;if(Math.abs(Vr)>=nD||ls>.11){lr(qe.current),(Ur=_.onDismiss)==null||Ur.call(_,_),J(q==="x"?Wr>0?"right":"left":as>0?"down":"up"),zr(),We(!0),ar(!1);return}ae(!1),Z(null)},onPointerMove:Ce=>{var Ue,Ze,Ur,Wr;if(!Ct.current||!V||((Ue=window.getSelection())==null?void 0:Ue.toString().length)>0)return;let as=Ce.clientY-Ct.current.y,ri=Ce.clientX-Ct.current.x,Vr=(Ze=e.swipeDirections)!=null?Ze:iD(W);!q&&(Math.abs(ri)>1||Math.abs(as)>1)&&Z(Math.abs(ri)>Math.abs(as)?"x":"y");let ls={x:0,y:0};q==="y"?(Vr.includes("top")||Vr.includes("bottom"))&&(Vr.includes("top")&&as<0||Vr.includes("bottom")&&as>0)&&(ls.y=as):q==="x"&&(Vr.includes("left")||Vr.includes("right"))&&(Vr.includes("left")&&ri<0||Vr.includes("right")&&ri>0)&&(ls.x=ri),(Math.abs(ls.x)>0||Math.abs(ls.y)>0)&&ar(!0),(Ur=dt.current)==null||Ur.style.setProperty("--swipe-amount-x",`${ls.x}px`),(Wr=dt.current)==null||Wr.style.setProperty("--swipe-amount-y",`${ls.y}px`)}},le&&!_.jsx?Q.createElement("button",{"aria-label":M,"data-disabled":va,"data-close-button":!0,onClick:va||!V?()=>{}:()=>{var Ce;zr(),(Ce=_.onDismiss)==null||Ce.call(_,_)},className:Kr(P==null?void 0:P.closeButton,(s=_==null?void 0:_.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:UA):null,_.jsx||C.isValidElement(_.title)?_.jsx?_.jsx:typeof _.title=="function"?_.title():_.title:Q.createElement(Q.Fragment,null,H||_.icon||_.promise?Q.createElement("div",{"data-icon":"",className:Kr(P==null?void 0:P.icon,(l=_==null?void 0:_.classNames)==null?void 0:l.icon)},_.promise||_.type==="loading"&&!_.icon?_.icon||xk():null,_.type!=="loading"?_.icon||(D==null?void 0:D[H])||MA(H):null):null,Q.createElement("div",{"data-content":"",className:Kr(P==null?void 0:P.content,(o=_==null?void 0:_.classNames)==null?void 0:o.content)},Q.createElement("div",{"data-title":"",className:Kr(P==null?void 0:P.title,(c=_==null?void 0:_.classNames)==null?void 0:c.title)},typeof _.title=="function"?_.title():_.title),_.description?Q.createElement("div",{"data-description":"",className:Kr(L,se,P==null?void 0:P.description,(u=_==null?void 0:_.classNames)==null?void 0:u.description)},typeof _.description=="function"?_.description():_.description):null),C.isValidElement(_.cancel)?_.cancel:_.cancel&&yc(_.cancel)?Q.createElement("button",{"data-button":!0,"data-cancel":!0,style:_.cancelButtonStyle||N,onClick:Ce=>{var Ue,Ze;yc(_.cancel)&&V&&((Ze=(Ue=_.cancel).onClick)==null||Ze.call(Ue,Ce),zr())},className:Kr(P==null?void 0:P.cancelButton,(g=_==null?void 0:_.classNames)==null?void 0:g.cancelButton)},_.cancel.label):null,C.isValidElement(_.action)?_.action:_.action&&yc(_.action)?Q.createElement("button",{"data-button":!0,"data-action":!0,style:_.actionButtonStyle||O,onClick:Ce=>{var Ue,Ze;yc(_.action)&&((Ze=(Ue=_.action).onClick)==null||Ze.call(Ue,Ce),!Ce.defaultPrevented&&zr())},className:Kr(P==null?void 0:P.actionButton,(d=_==null?void 0:_.classNames)==null?void 0:d.actionButton)},_.action.label):null))};function D_(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function aD(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,l=i?"--mobile-offset":"--offset",o=i?eD:JA;function c(u){["top","right","bottom","left"].forEach(g=>{r[`${l}-${g}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${l}-${u}`]=o:r[`${l}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(o)}),r}var lD=C.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:o,offset:c,mobileOffset:u,theme:g="light",richColors:d,duration:v,style:_,visibleToasts:b=XA,toastOptions:x,dir:f=D_(),gap:p=rD,loadingIcon:h,icons:m,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:w}=e,[k,j]=Q.useState([]),S=Q.useMemo(()=>Array.from(new Set([n].concat(k.filter(B=>B.position).map(B=>B.position)))),[k,n]),[E,N]=Q.useState([]),[O,T]=Q.useState(!1),[L,$]=Q.useState(!1),[W,U]=Q.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Q.useRef(null),R=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Q.useRef(null),D=Q.useRef(!1),M=Q.useCallback(B=>{j(q=>{var Z;return(Z=q.find(ee=>ee.id===B.id))!=null&&Z.delete||er.dismiss(B.id),q.filter(({id:ee})=>ee!==B.id)})},[]);return Q.useEffect(()=>er.subscribe(B=>{if(B.dismiss){j(q=>q.map(Z=>Z.id===B.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Mb.flushSync(()=>{j(q=>{let Z=q.findIndex(ee=>ee.id===B.id);return Z!==-1?[...q.slice(0,Z),{...q[Z],...B},...q.slice(Z+1)]:[B,...q]})})})}),[]),Q.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;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:q})=>{U(q?"dark":"light")})}catch{B.addListener(({matches:Z})=>{try{U(Z?"dark":"light")}catch(ee){console.error(ee)}})}},[g]),Q.useEffect(()=>{k.length<=1&&T(!1)},[k]),Q.useEffect(()=>{let B=q=>{var Z,ee;s.every(J=>q[J]||q.code===J)&&(T(!0),(Z=K.current)==null||Z.focus()),q.code==="Escape"&&(document.activeElement===K.current||(ee=K.current)!=null&&ee.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[s]),Q.useEffect(()=>{if(K.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,D.current=!1)}},[K.current]),Q.createElement("section",{ref:t,"aria-label":`${y} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((B,q)=>{var Z;let[ee,J]=B.split("-");return k.length?Q.createElement("ol",{key:B,dir:f==="auto"?D_():f,tabIndex:-1,ref:K,className:o,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":ee,"data-lifted":O&&k.length>1&&!i,"data-x-position":J,style:{"--front-toast-height":`${((Z=E[0])==null?void 0:Z.height)||0}px`,"--width":`${tD}px`,"--gap":`${p}px`,..._,...aD(c,u)},onBlur:A=>{D.current&&!A.currentTarget.contains(A.relatedTarget)&&(D.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||D.current||(D.current=!0,P.current=A.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{L||T(!1)},onDragEnd:()=>T(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},k.filter(A=>!A.position&&q===0||A.position===B).map((A,z)=>{var G,Y;return Q.createElement(oD,{key:A.id,icons:m,index:z,toast:A,defaultRichColors:d,duration:(G=x==null?void 0:x.duration)!=null?G:v,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:r,visibleToasts:b,closeButton:(Y=x==null?void 0:x.closeButton)!=null?Y:l,interacting:L,position:B,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:M,toasts:k.filter(ye=>ye.position==A.position),heights:E.filter(ye=>ye.position==A.position),setHeights:N,expandByDefault:i,gap:p,loadingIcon:h,expanded:O,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const pt=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx("div",{ref:s,role:r?"none":"separator","aria-orientation":t,className:X("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));pt.displayName="Separator";const cD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",On="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",L_="font-mono text-[24px] font-medium tracking-[-0.01em] text-foreground",ah="font-mono text-[12px] font-medium text-[var(--fg-muted)]",xc="font-mono text-[12px] text-[var(--fg-dim)]";function O_(e){return!e||e.length<10?e??"—":`${e.slice(0,6)}…${e.slice(-4)}`}function uD(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 dD({totalEth:e,runwayDays:t,tjinnEarned:r,tjinnClaimedLifetime:n,tjinnState:s,tjinnError:i,agentId:l,masterAddress:o,safeAddress:c,services:u=[],bindingError:g,lastPasswordRotationAt:d,onTopUp:v,actionsDisabled:_=!1}){var T;const[,b]=En(),{value:x,copy:f}=uD(s,r,i),p=u.find(L=>L.agentId!==null&&!L.safeBoundToAgent),h=((T=u.find(L=>L.serviceId!==null))==null?void 0:T.serviceId)??null,[m,y]=C.useState(!1),[w,k]=C.useState(!1),[j,S]=C.useState(null),[E,N]=C.useState(g??null),O=async()=>{if(p){k(!0),S(null),N(null);try{const $=(await ge.retryAgentBinding({serviceIndex:p.index})).attempts[0];($==null?void 0:$.status)==="success"?(S("success"),y(!1)):(S("reverted"),N(($==null?void 0:$.detail)??"Bind reverted on chain."))}catch(L){S("reverted"),N(L instanceof Error?L.message:String(L))}finally{k(!1)}}};return a.jsx(Cn,{delayDuration:150,children:a.jsxs(ke,{role:"region","aria-label":"Wallet","data-testid":"wallet-card",className:"flex flex-col gap-6 p-6",children:[a.jsx("span",{className:cD,children:"Wallet"}),a.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-gas",children:[a.jsx("span",{className:On,children:"Gas"}),a.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[a.jsx("span",{className:L_,children:e}),a.jsx("span",{className:ah,children:"ETH"}),a.jsx("span",{className:xc,children:"·"}),a.jsxs("span",{className:xc,children:[t,"d runway"]})]}),a.jsx(ce,{variant:"outline",size:"sm","aria-label":"Top up from faucet",onClick:v,disabled:_,"data-testid":"wallet-topup",className:"self-start",children:"Top up from faucet (free)"})]}),a.jsx(pt,{}),a.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-rewards",children:[a.jsx("span",{className:On,children:"Rewards"}),a.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-region","aria-live":"polite","aria-atomic":"true",children:[a.jsx("span",{className:On,children:"Testnet JINN earned"}),a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsx("span",{className:L_,"data-testid":"tjinn-earned-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:x}),s==="ready"&&a.jsx("span",{className:ah,children:"tJINN"})]}),f&&a.jsx("span",{className:xc,"data-testid":"tjinn-earned-state",children:f})]}),a.jsxs("div",{className:"flex items-baseline gap-2","data-testid":"tjinn-claimed-lifetime-region","aria-live":"polite","aria-atomic":"true",children:[a.jsx("span",{className:xc,children:"Lifetime claimed"}),a.jsx("span",{className:"font-mono text-[14px] text-foreground","data-testid":"tjinn-claimed-lifetime-value",children:n??(s==="error"?"unavailable":"pending")}),n!==null&&a.jsx("span",{className:ah,children:"tJINN"})]})]}),a.jsx(pt,{}),a.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-identity",children:[a.jsx("span",{className:On,children:"Identity"}),a.jsxs("div",{className:"flex flex-wrap gap-8",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:On,children:"Service"}),a.jsx("span",{"data-testid":"wallet-service-id",className:"font-mono text-[14px] text-foreground",children:h!==null?`#${h}`:"—"})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:On,children:"Agent"}),a.jsxs("span",{className:"flex items-center gap-2 font-mono text-[14px] text-foreground",children:[l!==null?`#${l}`:"—",p&&a.jsx("button",{type:"button",onClick:()=>y(L=>!L),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"}),j==="success"&&a.jsx(Pe,{variant:"success",className:"rounded-full normal-case tracking-[0.12em]",children:"bound"})]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:On,children:"Master"}),a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("span",{"data-testid":"wallet-master-address",tabIndex:0,className:"cursor-help font-mono text-[14px] text-foreground",children:O_(o)})}),a.jsx(Dr,{children:o??"No master address yet"})]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:On,children:"Safe"}),a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("span",{tabIndex:0,className:"cursor-help font-mono text-[14px] text-foreground",children:O_(c)})}),a.jsx(Dr,{children:c??"No safe address yet"})]})]})]}),m&&p&&a.jsxs(ut,{variant:"warning",className:"mt-2 flex flex-col gap-2",children:[a.jsxs(mt,{children:["Service #",p.index," Safe is not yet bound to agent #",p.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),E&&a.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:E}),a.jsx(ce,{variant:"default",size:"sm",onClick:()=>{O()},disabled:w,className:"self-start",children:w?"Retrying…":"Retry binding"})]})]}),a.jsx(pt,{}),a.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-password",children:[a.jsx("span",{className:On,children:"Password"}),a.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-dim)]",children:["last rotated:"," ",d?a.jsx("time",{dateTime:d,className:"text-[var(--fg-muted)]",children:d}):a.jsx("span",{className:"text-[var(--fg-muted)]",children:"never"})]}),a.jsx(ce,{variant:"secondary",size:"sm","aria-label":"Change password",onClick:()=>b("/operator/security"),"data-testid":"wallet-change-password",className:"self-start",children:"Change password"})]})]})})}const lh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",M_="flex items-center gap-2 font-mono text-[17px] font-medium text-foreground";function I_({tone:e}){const t=e==="good"?"bg-[var(--vow-green)]":e==="bad"?"bg-[var(--break-red)]":"bg-[var(--fg-muted)]";return a.jsx("span",{"aria-hidden":"true",className:X("inline-block h-2 w-2 rounded-full",t)})}function hD({daemonStatus:e,daemonStateMessage:t,rpcStatus:r,onRestart:n}){const[,s]=En(),[i,l]=C.useState(null),o=e==="running",c=r==="healthy";function u(){i||!n||(l("restart"),Promise.resolve().then(n).catch(g=>console.error("[node-health] restart failed:",g)).finally(()=>l(null)))}return a.jsx(Cn,{delayDuration:150,children:a.jsxs(ke,{"data-testid":"node-health-card","aria-labelledby":"node-health-heading",className:"flex flex-col gap-4 p-6",children:[a.jsx("h2",{id:"node-health-heading",className:X(lh,"m-0 text-[var(--fg-dim)]"),children:"Node health"}),a.jsxs("div",{"data-testid":"node-health-daemon-row","data-status":e,className:"flex flex-col gap-2",children:[a.jsx("span",{className:lh,children:"Daemon"}),a.jsxs("span",{className:M_,children:[a.jsx(I_,{tone:o?"good":"bad"}),o?"Running":"Stopped"]}),t&&a.jsx("span",{"data-testid":"node-health-daemon-state",className:"font-mono text-[12px] leading-snug text-[var(--fg-muted)]",children:t}),a.jsx("div",{className:"mt-2 flex gap-2",children:a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("span",{tabIndex:o?-1:0,children:a.jsx(ce,{variant:"outline",size:"sm",disabled:!o||i!==null,"data-testid":"node-health-restart",onClick:u,children:i==="restart"?"Restarting...":"Restart"})})}),a.jsx(Dr,{children:o?"Restart the daemon. The dashboard reconnects when it comes back.":"Daemon is stopped — re-run jinn from your terminal to start it."})]})})]}),a.jsxs("div",{"data-testid":"node-health-rpc-row","data-status":r,className:"flex flex-col gap-2",children:[a.jsx("span",{className:lh,children:"RPC"}),a.jsxs("span",{className:M_,children:[a.jsx(I_,{tone:c?"good":"bad"}),c?"Healthy":"Unreachable"]}),a.jsx("div",{className:"mt-2 flex gap-2",children:a.jsx(ce,{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)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:r,className:X("w-full caption-bottom font-mono text-[12px]",e),...t})}));da.displayName="Table";const ha=C.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:X("[&_tr]:border-b [&_tr]:border-border",e),...t}));ha.displayName="TableHeader";const fa=C.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:X("[&_tr:last-child]:border-0",e),...t}));fa.displayName="TableBody";const fD=C.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:X("border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));fD.displayName="TableFooter";const cn=C.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:X("border-b border-border transition-colors hover:bg-[var(--bg-sunken)]/50 data-[state=selected]:bg-[var(--bg-sunken)]",e),...t}));cn.displayName="TableRow";const tt=C.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:X("h-8 px-2 text-left align-middle font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",e),...t}));tt.displayName="TableHead";const rt=C.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:X("px-2 py-2 align-middle",e),...t}));rt.displayName="TableCell";const pD=C.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:X("mt-4 text-[12px] text-[var(--fg-muted)]",e),...t}));pD.displayName="TableCaption";const mD=new Set(["DISCOVERED","CLAIMED","WAITING","PRE_SNAPSHOT","RUNNING","POST_SNAPSHOT","PACKAGING","DELIVERING"]);function gD(e,t=6,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}…${e.slice(-r)}`}function vD(e){return e==="restoration"?"solve":e==="evaluation"?"evaluate":"—"}function _D(e){return e==="COMPLETE"?{label:"succeeded",detail:"COMPLETE",tone:"good"}:e==="FAILED"?{label:"failed",detail:"FAILED",tone:"bad"}:mD.has(e)?{label:"active",detail:e.toLowerCase().replace(/_/g," "),tone:"active"}:{label:e.toLowerCase().replace(/_/g," "),detail:e,tone:"neutral"}}function yD(e){return e==="bad"?"destructive":e==="good"?"success":e==="active"?"default":"outline"}function xD(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 bD(e){return e==="solving"||e==="solver"?"solver":e==="evaluating"||e==="evaluator"?"evaluator":e}const wD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground m-0";function Vf({children:e,className:t}){return a.jsx("h3",{className:X(wD,t),children:e})}function bc({label:e,children:t}){return a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsx(Vf,{children:e}),a.jsx("div",{className:"font-mono text-[12px] text-foreground",children:t})]})}function SD({joined:e,tasks:t}){var o,c;const[,r]=En(),[n,s]=C.useState(((o=e[0])==null?void 0:o.manifestCid)??((c=e[0])==null?void 0:c.name)??null),i=C.useMemo(()=>e.find(u=>(u.manifestCid??u.name)===n)??e[0]??null,[e,n]),l=C.useMemo(()=>i?t.filter(u=>{if(u.state==="FAILED"){if(u.runStartedAt===null)return!1;const g=(u.failureReason??"").toLowerCase();if(g.includes("not ready")||g.includes("not enabled"))return!1}return e.length<=1?!0:u.manifestCid&&i.manifestCid?u.manifestCid===i.manifestCid:!0}):[],[t,i,e.length,n]);return a.jsx(Cn,{delayDuration:150,children:a.jsxs(ke,{role:"region","aria-label":"Activity","data-testid":"activity-card",children:[a.jsxs(Rn,{className:"flex flex-row items-center gap-2 pb-3",children:[a.jsx(cN,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),a.jsx(oa,{children:"Activity"})]}),a.jsx(et,{children:a.jsxs("div",{className:"grid items-start gap-6 [grid-template-columns:minmax(160px,200px)_minmax(0,1fr)_minmax(180px,220px)]",children:[a.jsxs("div",{"data-testid":"activity-joined",className:"flex min-w-0 flex-col gap-3",children:[a.jsx(Vf,{children:"Joined"}),e.length===0?a.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNets joined."}):a.jsx(Bl,{className:"max-h-[280px]",children:a.jsx("div",{className:"flex flex-col gap-1 pr-2",children:e.map(u=>{const g=u.manifestCid??u.name,d=g===((i==null?void 0:i.manifestCid)??(i==null?void 0:i.name));return a.jsx(ce,{variant:"ghost",size:"sm","data-testid":`activity-joined-row-${g}`,"data-state":d?"active":void 0,"aria-current":d?"true":void 0,onClick:()=>s(g),className:X("h-auto w-full justify-start gap-0 rounded-sm border-l-2 px-2.5 py-1.5 font-mono text-[12px] normal-case tracking-normal",d?"border-l-primary bg-accent text-foreground":"border-l-transparent text-muted-foreground hover:bg-accent hover:text-foreground"),children:a.jsx("span",{className:"truncate",children:u.name})},g)})})}),a.jsxs(ce,{variant:"outline",size:"sm","data-testid":"activity-join-more",onClick:()=>r("/operator/registry"),className:"self-start",children:[a.jsx(xN,{className:"h-3 w-3","aria-hidden":"true"}),"Join more SolverNets"]})]}),a.jsxs("div",{"data-testid":"activity-tasks",className:"flex min-w-0 flex-col gap-3",children:[i&&a.jsx("h2",{className:"m-0 font-serif text-[20px] font-normal leading-tight text-foreground",children:i.name}),l.length===0?a.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No task runs recorded yet."}):a.jsx("div",{"data-testid":"activity-tasks-table",children:a.jsxs(da,{children:[a.jsx(ha,{children:a.jsxs(cn,{className:"hover:bg-transparent",children:[a.jsx(tt,{children:"Run"}),a.jsx(tt,{children:"Task"}),a.jsx(tt,{children:"State"}),a.jsx(tt,{children:"Started"})]})}),a.jsx(fa,{children:l.map(u=>{const g=_D(u.state),d=g.tone==="active";return a.jsxs(cn,{"data-active":d?"true":void 0,"data-testid":`activity-task-row-${u.requestId}`,className:X("border-l-2",d?"border-l-primary bg-primary/[0.06]":"border-l-transparent"),children:[a.jsx(rt,{className:"text-muted-foreground",children:vD(u.taskRole)}),a.jsx(rt,{children:a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("button",{type:"button",className:"cursor-help bg-transparent p-0 font-mono text-[12px] text-foreground",children:gD(u.requestId)})}),a.jsx(Dr,{children:u.requestId})]})}),a.jsx(rt,{children:a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("button",{type:"button",className:"cursor-help bg-transparent p-0",children:a.jsx(Pe,{variant:yD(g.tone),children:g.label})})}),a.jsx(Dr,{children:g.detail})]})}),a.jsx(rt,{className:"text-muted-foreground",children:xD(u.runStartedAt??u.stateUpdatedAt)})]},u.requestId)})})]})})]}),a.jsxs("div",{"data-testid":"activity-settings",className:"flex min-w-0 flex-col gap-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between",children:[a.jsx(Vf,{children:"Settings"}),a.jsxs(ce,{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:[a.jsx(yN,{className:"h-3 w-3","aria-hidden":"true"}),"Edit"]})]}),i?a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx(bc,{label:"Roles",children:i.roles.length===0?a.jsx("span",{className:"text-muted-foreground",children:"None"}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.roles.map(u=>a.jsx(Pe,{variant:"outline",children:bD(u)},u))})}),a.jsx(pt,{}),a.jsx(bc,{label:"Harness",children:i.harness??"—"}),a.jsx(pt,{}),a.jsx(bc,{label:"Model",children:a.jsx("span",{className:X(!i.model&&"text-muted-foreground"),children:i.model??"—"})}),a.jsx(pt,{}),a.jsx(bc,{label:"Plugins",children:!i.plugins||i.plugins.length===0?a.jsx("span",{className:"text-muted-foreground",children:"None"}):a.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:i.plugins.map(u=>a.jsxs("li",{"data-testid":`activity-plugin-${u.name}`,className:"flex items-center gap-2 overflow-hidden",children:[a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("button",{type:"button",className:"cursor-help truncate bg-transparent p-0 text-left font-mono text-[12px] text-foreground",children:u.displayName})}),a.jsx(Dr,{children:u.name})]}),u.defaultIncluded&&a.jsx(Pe,{variant:"secondary",className:"shrink-0",children:"default"})]},u.name))})})]}):a.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNet selected."})]})]})})]})})}const Qm="claude-code",Zm="codex",Yo="hermes-agent",CD={"claude-code-learner":Qm,"codex-code-learner":Zm},kD={[Qm]:"Claude Code",[Zm]:"Codex",[Yo]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function Br(e){return e?CD[e]??e:""}function Ci(e){const t=Br(e);return kD[t]??t}function CS(e,t){const r=Ci(e);return t?`${r} ${t}`:r}function ED(e,t){return Br(e)===Br(t)}const jD=[{name:"network-tools",version:"0.1.0",defaultIncluded:!0},{name:"claude-code-learner",version:"0.1.0",defaultIncluded:!0}],RD=new Set(["swe-rebench-v2-runtime"]),ND={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},qf="bundled:";function Kf(e){return ND[e]??e}function wc(e){return e.startsWith(qf)?e.slice(qf.length):e}function PD(e){const t=Br(e)===Yo;return jD.filter(r=>!(t&&r.name==="claude-code-learner")).map(r=>({name:r.name,displayName:Kf(r.name),source:"bundled",version:r.version,defaultIncluded:!0}))}function B_({harness:e,explicit:t,disabledDefaults:r,catalogCompatible:n=[]}){const s=new Set(r.map(wc)),i=new Set(t.map(wc));new Map(t.map(c=>[wc(c),c]));const l=[],o=new Set;for(const c of PD(e))o.has(c.name)||(o.add(c.name),!s.has(c.name)&&l.push(c));for(const c of n){if(o.has(c.name))continue;o.add(c.name);const u=RD.has(c.name),g=i.has(c.name);!u&&!g||u&&s.has(c.name)||l.push({name:c.name,displayName:Kf(c.name),source:"catalog",version:c.version,defaultIncluded:u})}for(const c of t){const u=wc(c);o.has(u)||(o.add(u),l.push({name:u,displayName:Kf(u),source:c.startsWith(qf)?"bundled":"custom",version:"configured",defaultIncluded:!1}))}return l}function Sc(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function TD(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/1e18).toFixed(6)} ETH`}catch{return null}}function AD(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function DD({serviceId:e,onRestake:t}){const[r,n]=C.useState(!1);return a.jsxs(ut,{variant:"blocking","data-testid":"overview-eviction-banner","aria-live":"polite",className:"flex flex-col gap-2",children:[a.jsx(Cm,{className:"h-4 w-4 text-[var(--break-red)]"}),a.jsx(or,{className:"text-[var(--break-red)]",children:"Service evicted"}),a.jsx(mt,{className:"text-base text-foreground",children:"A service has been evicted from staking. Re-stake to resume earning."}),e!=null&&a.jsx(ce,{variant:"destructive",size:"sm",type:"button","data-testid":"overview-eviction-restake",disabled:r,onClick:async()=>{if(!r){n(!0);try{await t(e)}finally{n(!1)}}},className:"mt-2 self-start",children:r?"Working…":"Re-stake now"})]})}function LD(){var j,S,E,N,O,T,L,$,W,U,K,R;const[e,t]=C.useState(null),r=ei(),{data:n,isError:s}=Oe({queryKey:["status"],queryFn:()=>ge.getStatus(),refetchInterval:5e3}),{data:i}=Oe({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:3e4}),{data:l}=Oe({queryKey:["solvernets","catalog"],queryFn:()=>ge.getSolverNets(),refetchInterval:5*6e4}),o=(((j=n==null?void 0:n.fleet)==null?void 0:j.services)??[]).map(P=>({index:P.index,serviceId:P.serviceId??null,safeAddress:P.safeAddress??"",agentId:P.agentId??null,safeBoundToAgent:P.safeBoundToAgent??!1})),c=(((S=n==null?void 0:n.fleet)==null?void 0:S.services)??[]).find(P=>P.evicted===!0),u=c!=null,g=(c==null?void 0:c.serviceId)??null,d=((E=n==null?void 0:n.tJinn)==null?void 0:E.state)??"pending",v=((N=n==null?void 0:n.tJinn)==null?void 0:N.state)==="ready"?Sc(n.tJinn.safeBalanceWei??"0"):Sc(((O=n==null?void 0:n.tJinn)==null?void 0:O.safeBalanceWei)??void 0),_=((T=n==null?void 0:n.tJinn)==null?void 0:T.operatorClaimedWei)!=null?Sc(n.tJinn.operatorClaimedWei):null,b=((L=n==null?void 0:n.tJinn)==null?void 0:L.error)??null,x=Sc(($=n==null?void 0:n.masterGas)==null?void 0:$.balanceWei),f=((W=n==null?void 0:n.masterGas)==null?void 0:W.runwayDaysExcess)??"—",p=C.useMemo(()=>{const P=[],D=i==null?void 0:i.joinedSolverNets;if(D)for(const[B,q]of Object.entries(D)){if(!q)continue;const Z=q.contract?l==null?void 0:l.nets.find(J=>{var A,z;return J.contract.id===((A=q.contract)==null?void 0:A.id)&&J.contract.version===((z=q.contract)==null?void 0:z.version)}):void 0,ee=B_({harness:q.harness,explicit:Array.isArray(q.plugins)?q.plugins:[],disabledDefaults:Array.isArray(q.disabledDefaultPlugins)?q.disabledDefaultPlugins:[],catalogCompatible:Z==null?void 0:Z.compatiblePlugins});P.push({name:q.name??q.manifestCid??B,manifestCid:q.manifestCid??B,roles:Array.isArray(q.roles)?q.roles:[],harness:q.harness,model:q.model,plugins:ee})}if(P.length>0)return P;const M=i==null?void 0:i.solverNets;if(M)for(const[B,q]of Object.entries(M)){if(!q)continue;const Z=Array.isArray(q.roles)?q.roles:[];if(q.enabled!==!0&&Z.length===0)continue;const ee=B_({harness:q.harness,explicit:[],disabledDefaults:[]});P.push({name:q.name??B,manifestCid:q.manifestCid??B,roles:Z,harness:q.harness,plugins:ee})}return P},[i,l]),h=C.useMemo(()=>{var M,B,q;const P=new Map,D=Z=>{if(Z)for(const ee of Z)ee.requestId&&(P.has(ee.requestId)||P.set(ee.requestId,{requestId:ee.requestId,manifestCid:ee.manifestCid??null,taskRole:ee.taskRole,state:ee.state,implName:ee.implName??null,windowStartTs:ee.windowStartTs??0,runStartedAt:ee.runStartedAt??null,stateUpdatedAt:ee.stateUpdatedAt,deliveryTxHash:ee.deliveryTxHash??null,failureReason:ee.failureReason??null}))};return D((M=n==null?void 0:n.taskRuns)==null?void 0:M.recentTasks),D((B=n==null?void 0:n.taskRuns)==null?void 0:B.inFlight),D((q=n==null?void 0:n.predictionV1)==null?void 0:q.recentTasks),Array.from(P.values()).sort((Z,ee)=>ee.stateUpdatedAt-Z.stateUpdatedAt)},[n]),m=s&&n===void 0?"stopped":"running",y="healthy",w=void 0,k=(P,D,M)=>{t(P),Promise.resolve().then(D).then(B=>{Gs.success(P,{description:B==null?void 0:B.message,duration:M==null?void 0:M.autoClearMs})}).catch(B=>{Gs.error(`${P} failed`,{description:B instanceof Error?B.message:String(B),duration:1/0})}).finally(()=>t(null))};return a.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:[a.jsxs("div",{className:"flex min-w-0 flex-col gap-6",children:[u&&a.jsx(DD,{serviceId:g,onRestake:async P=>{const D=await ge.restake(P);if(!D.ok)throw new Error(D.error??"Re-stake failed.");await r.invalidateQueries({queryKey:["status"]})}}),a.jsx(SD,{joined:p,tasks:h})]}),a.jsxs("aside",{className:"flex flex-col gap-6",children:[a.jsx(hD,{daemonStatus:m,daemonStateMessage:w,rpcStatus:y,onStop:async()=>{if(!(await ge.stopDaemon()).ok)throw new Error("Stop request failed.")},onRestart:async()=>{if(!(await ge.restartDaemon({forceRespawn:!0})).ok)throw new Error("Restart request failed.")}}),a.jsx(dD,{totalEth:x,runwayDays:f,actionsDisabled:e!==null,perRole:{master:x,agent:"—",safe:"—"},tjinnEarned:v,tjinnClaimedLifetime:_,tjinnState:d,tjinnError:b,agentId:((U=o[0])==null?void 0:U.agentId)??null,masterAddress:(i==null?void 0:i.master_address)??null,safeAddress:((K=o[0])==null?void 0:K.safeAddress)??null,services:o,lastPasswordRotationAt:((R=n==null?void 0:n.security)==null?void 0:R.lastPasswordRotationAt)??null,onTopUp:()=>k("Top up gas",async()=>{var q;const P=await ge.triggerDrip({singleDrip:!0});if(!P.ok)throw new Error(P.reason??"Gas top-up failed.");const D=P.txHash??((q=P.txHashes)==null?void 0:q.at(-1));if(!D)return{message:"Gas top-up checked; the faucet sent no funds."};const M=TD(P.deltaWei),B=AD(D);return{message:M?`Gas topped up: +${M} · tx ${B}`:`Gas top-up sent · tx ${B}`}},{autoClearMs:5e3})})]})]})}function pa(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function ui(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?`${F_(t,18,t>=r?4:6)} ETH`:t>=s?`${F_(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function F_(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const o=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return o?`${s}.${o}`:s.toString()}function $_(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 H_={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 OD(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function MD(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 ID({status:e}){const t=H_[e]??H_.launching;return a.jsx(Pe,{variant:t.variant,className:"whitespace-nowrap",children:t.label})}function BD({label:e}){return a.jsx(Pe,{"data-testid":"launcher-owned-row-role",variant:"outline",className:"normal-case tracking-[0.12em] text-[var(--fg-muted)]",children:e})}function FD({record:e}){const[,t]=En(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,n=e.summary,s=(n==null?void 0:n.name)??e.solverNetId,i=n!==void 0?`${n.contractId}.${n.contractVersion}`:null;return a.jsx("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":n!==void 0?"true":"false",onClick:l=>{l.preventDefault(),t(r)},className:"block text-inherit no-underline",children:a.jsxs(ke,{className:X("grid grid-cols-[1fr_auto] items-center gap-4 p-4","transition-colors hover:bg-[var(--bg-sunken)]/40 cursor-pointer"),children:[a.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[a.jsx("div",{"data-testid":"launcher-owned-row-primary",className:X("truncate text-foreground",n!==void 0?"font-serif text-[18px] font-normal tracking-[-0.01em]":"font-mono text-[14px] font-medium"),children:s}),i!==null&&a.jsx("div",{"data-testid":"launcher-owned-row-contract",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:i}),n!==void 0&&a.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:[a.jsxs("span",{children:["solution ",ui(n.solutionPriceWei)]}),a.jsxs("span",{children:["verdict ",ui(n.verdictPriceWei)]})]}),n!==void 0&&n.openRoles.length>0&&a.jsx("div",{"data-testid":"launcher-owned-row-roles",className:"flex flex-wrap gap-1.5",children:n.openRoles.map(l=>a.jsx(BD,{label:l},l))}),a.jsxs("div",{className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[a.jsxs("span",{children:["cid ",OD(e.manifestCid)]}),a.jsxs("span",{children:["launched ",MD(e.launchedAt)]})]})]}),a.jsx(ID,{status:e.status})]})})}function $D(){return a.jsxs(ke,{"data-testid":"launcher-empty-state",className:"flex flex-col gap-3.5 p-8",children:[a.jsx("h2",{className:"m-0 font-mono text-[18px] font-medium tracking-[-0.01em] text-foreground",children:"No SolverNets created yet."}),a.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."}),a.jsx("div",{children:a.jsx(ce,{asChild:!0,variant:"default",size:"lg",children:a.jsx(jn,{href:"/launcher/create",children:"Create SolverNet"})})})]})}function HD(){const{data:e,isLoading:t,isError:r,error:n,refetch:s}=Oe({queryKey:["solvernets","launched","owned"],queryFn:()=>ge.solvernets.listLaunched(),refetchInterval:3e4});return a.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[a.jsxs("div",{className:"flex items-end justify-between",children:[a.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&&a.jsx(ce,{asChild:!0,variant:"default","data-testid":"launcher-create-cta",children:a.jsx(jn,{href:"/launcher/create",children:"Create SolverNet"})})]}),t&&a.jsx("p",{"data-testid":"launcher-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"}),r&&a.jsxs(ut,{"data-testid":"launcher-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(or,{className:"font-mono text-[13px] font-medium text-destructive",children:"Failed to load your SolverNets."}),a.jsx(mt,{className:"text-[12px] text-[var(--fg-muted)]",children:n instanceof Error?n.message:"Unknown error"})]}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm",onClick:()=>{s()},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&a.jsx($D,{}),!t&&!r&&e&&e.records.length>0&&a.jsx("div",{className:"flex flex-col gap-2",children:e.records.map(i=>a.jsx(FD,{record:i},i.solverNetId))})]})}const ct=C.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,ref:n,className:X("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}));ct.displayName="Input";var zD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],UD=zD.reduce((e,t)=>{const r=km(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...o}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...o,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),WD="Label",kS=C.forwardRef((e,t)=>a.jsx(UD.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())}}));kS.displayName=WD;var ES=kS;const yr=C.forwardRef(({className:e,...t},r)=>a.jsx(ES,{ref:r,className:X("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}));yr.displayName=ES.displayName;function VD({current:e,total:t=5}){return a.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:[a.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),a.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 a.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":i?"true":"false",className:X("h-[3px] flex-1 rounded-sm",i?"bg-accent-sky":"bg-border")},s)})})]})}function Ii({step:e,total:t=5,title:r,blurb:n,children:s,footer:i,error:l}){return a.jsxs("main",{"data-testid":`launcher-create-step-${e}`,className:"mx-auto flex max-w-[720px] flex-col gap-5 p-6",children:[a.jsx(VD,{current:e,total:t}),a.jsxs("header",{className:"flex flex-col gap-1.5",children:[a.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight tracking-[-0.01em] text-foreground",children:r}),n&&a.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-fg-muted",children:n})]}),l&&a.jsx(ut,{variant:"blocking","data-testid":"launcher-create-error",className:"font-mono text-[13px]",children:a.jsx(mt,{children:l})}),a.jsx("div",{className:"flex flex-col gap-4",children:s}),a.jsx(pt,{}),a.jsx("div",{className:"flex items-center justify-between gap-3",children:i})]})}function Bi({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:s=!1,right:i}){return a.jsxs(a.Fragment,{children:[a.jsx("div",{children:e&&a.jsx(ce,{type:"button",variant:"secondary",size:"lg","data-testid":"launcher-create-back",onClick:e,disabled:s,children:"Back"})}),a.jsxs("div",{className:"flex items-center gap-4",children:[i,t&&a.jsx(ce,{type:"button",size:"lg","data-testid":"launcher-create-next",onClick:t,disabled:n||s,children:r})]})]})}function _t({label:e,helperText:t,error:r,children:n,asLabel:s=!0}){const i=a.jsxs(a.Fragment,{children:[a.jsx(yr,{children:e}),n,r?a.jsx("span",{className:"font-mono text-[12px] text-break-red",children:r}):t&&a.jsx("span",{className:"font-mono text-[11px] text-fg-dim",children:t})]});return s?a.jsx("label",{className:"flex flex-col gap-1.5",children:i}):a.jsx("div",{className:"flex flex-col gap-1.5",children:i})}const qD="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 z_({draft:e,onAdvance:t,busy:r,error:n}){const[s,i]=C.useState(e.name??""),[l,o]=C.useState(e.description??""),[c,u]=C.useState(!1),g=c&&s.trim().length===0?"Name is required.":null,d=c&&l.trim().length===0?"Description is required.":null,v=async _=>{_==null||_.preventDefault(),u(!0),!(s.trim().length===0||l.trim().length===0)&&await t({name:s.trim(),description:l.trim(),completedSteps:pa(e.completedSteps,"define")})};return a.jsx(Ii,{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:a.jsx(Bi,{onNext:()=>{v()},nextDisabled:s.trim().length===0||l.trim().length===0,busy:r}),children:a.jsxs("form",{onSubmit:_=>{v(_)},className:"flex flex-col gap-4",children:[a.jsx(_t,{label:"Name",error:g,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:a.jsx(ct,{"data-testid":"launcher-create-name",type:"text",value:s,onChange:_=>i(_.target.value),placeholder:"e.g. Polymarket forecasts",className:X(g&&"border-break-red"),disabled:r})}),a.jsx(_t,{label:"Description",error:d,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:a.jsx("textarea",{"data-testid":"launcher-create-description",value:l,onChange:_=>o(_.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",className:X(qD,"min-h-[96px] resize-y",d&&"border-break-red"),disabled:r})}),a.jsx(ce,{type:"submit",className:"hidden","aria-hidden":!0,tabIndex:-1})]})})}const ma={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}},jS={id:"swe-rebench-v2",version:"v1",name:"SWE-rebench v2",description:"Code-issue benchmark sourced from the nebius/SWE-rebench-leaderboard HuggingFace dataset. Solvers submit a patch; evaluators run the upstream eval.py harness inside the per-instance Docker image and emit a 0/1 Verdict against the FAIL_TO_PASS / PASS_TO_PASS tests.",schemas:{task:{name:"swe-rebench-v2.v1 Task",description:"A reference to a HuggingFace dataset row by (hf_dataset, hf_split, instance_id), plus repo + base_commit + language + problem statement."},solution:{name:"swe-rebench-v2.v1 Solution",description:"A unified diff patch (git-format), with optional self-reported cost. The trajectory blob is pinned daemon-side and referenced via the envelope, not the payload."},verdict:{name:"swe-rebench-v2.v1 Verdict",description:"Score 0 or 1 based on whether the patch passes the per-instance Docker test suite, plus passed_match flag and evaluator cost. The test log is pinned daemon-side and surfaced via the verdict-artifact metadata."}},evaluationFunction:{id:"swe-rebench-v2.docker-test-suite.v1",deterministic:!0,inputs:["swe-rebench-v2.v1 Task","swe-rebench-v2.v1 Solution","per-instance Docker image"],output:"swe-rebench-v2.v1 Verdict"},aggregationFunction:{id:"swe-rebench-v2.multi-winrate.v1",deterministic:!0,inputs:["SCORED swe-rebench-v2.v1 Verdicts"],output:"mean / complexityWeighted / byLanguage / frontierResolved / parityTripRate",windowDays:30},claimPolicyDefaults:{mode:"parallel",maxClaims:5,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60},credentialRequirements:{creator:[{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read public HuggingFace dataset rows from the nebius/SWE-rebench-leaderboard splits."}],solver:[],evaluator:[{id:"docker.local.run",kind:"local-runtime",required:!0,description:"Run per-instance Docker images that ship with the upstream eval.py harness."},{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read the HF dataset row referenced by the Task to recover test_patch + FAIL_TO_PASS / PASS_TO_PASS."}]},generatorDefaults:{N_target_successes:5,N_max_postings_per_task:10,posting_window_ms:24*60*60*1e3,post_batch_size:25,claimLeaseTtlSeconds:60*60}},Gf={"prediction.v1":ma,"swe-rebench-v2.v1":jS},KD="prediction.v1",GD="font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim";function YD({draft:e,template:t=ma,onAdvance:r,onBack:n,busy:s,error:i}){const l=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:pa(e.completedSteps,"reviewContract")})};return a.jsx(Ii,{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:a.jsx(Bi,{onBack:n,onNext:l,busy:s}),children:a.jsx(ke,{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,children:a.jsxs(et,{className:"flex flex-col gap-4 p-6",children:[a.jsxs("header",{className:"flex flex-col gap-1",children:[a.jsxs("span",{className:GD,children:[t.id,".",t.version]}),a.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:t.name}),a.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:t.description})]}),a.jsxs(Ra,{title:"Schemas",children:[a.jsx(Zt,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),a.jsx(Zt,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),a.jsx(Zt,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),a.jsxs(Ra,{title:"Evaluation function",children:[a.jsx(Zt,{label:"Id",value:t.evaluationFunction.id,mono:!0}),a.jsx(Zt,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),a.jsx(Zt,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),a.jsx(Zt,{label:"Output",value:t.evaluationFunction.output})]}),a.jsxs(Ra,{title:"Aggregation function",children:[a.jsx(Zt,{label:"Id",value:t.aggregationFunction.id,mono:!0}),a.jsx(Zt,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),a.jsx(Zt,{label:"Output",value:t.aggregationFunction.output})]}),a.jsxs(Ra,{title:"Claim policy defaults",children:[a.jsx(Zt,{label:"Mode",value:t.claimPolicyDefaults.mode}),a.jsx(Zt,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),a.jsx(Zt,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),a.jsx(Zt,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),a.jsxs(Ra,{title:"Credential requirements",children:[a.jsx(ch,{role:"creator",creds:t.credentialRequirements.creator}),a.jsx(ch,{role:"solver",creds:t.credentialRequirements.solver}),a.jsx(ch,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})})}function Ra({title:e,children:t}){return a.jsxs("section",{className:"flex flex-col gap-2",children:[a.jsx(pt,{}),a.jsx("h3",{className:X("m-0 pt-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted"),children:e}),a.jsx("div",{className:"flex flex-col gap-1.5",children:t})]})}function Zt({label:e,value:t,hint:r,mono:n}){return a.jsxs("div",{className:"grid grid-cols-[140px_1fr] items-baseline gap-3",children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),a.jsxs("span",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:X("text-[13px] text-foreground",n?"font-mono":"font-sans"),children:t}),r&&a.jsx("span",{className:"font-mono text-[12px] leading-relaxed text-fg-muted",children:r})]})]})}function ch({role:e,creds:t}){return a.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,className:"flex flex-col gap-1.5",children:[a.jsx("div",{className:"font-mono text-[11px] capitalize tracking-[0.06em] text-fg-dim",children:e}),t.length===0?a.jsx("div",{className:"text-[12px] text-fg-muted",children:"None."}):t.map(r=>a.jsxs("div",{className:"flex flex-col gap-0.5 font-mono text-[12px] leading-relaxed",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-accent-sky",children:r.id}),a.jsx(Pe,{variant:"secondary",children:r.kind}),r.required&&a.jsx(Pe,{variant:"warning",children:"required"})]}),a.jsx("div",{className:"text-fg-muted",children:r.description})]},r.id))]})}const U_="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 QD(e){const t=e.template??ma;switch(t.id){case"prediction":return a.jsx(XD,{...e,template:t});case"swe-rebench-v2":return a.jsx(eL,{...e,template:t});default:return a.jsx(Ii,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:a.jsx(Bi,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:a.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const W_=6e4;function jr(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function V_(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function ZD(e){const t=ma.generatorDefaults,r=60*60*1e3;return{cadenceMs:jr(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:jr((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:jr(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:jr(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:jr(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:jr(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:V_(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:V_(e==null?void 0:e.blocklistConditionIds)}}function q_(e){const t={},r=Rr(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<W_&&(t.cadenceMs=`Cadence must be at least ${W_/1e3}s.`);const n=Rr(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const s=Rr(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const i=Rr(e.maxNewRoundsPerPoll);i===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const l=Rr(e.maxNewRoundsPerDay);l===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const o=Rr(e.maxOpenRounds);return o===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:n,resolveGapMs:s,submissionWindowMs:n,maxNewRoundsPerPoll:i,maxNewRoundsPerDay:l,maxOpenRounds:o,allowlistConditionIds:K_(e.allowlistConditionIds),blocklistConditionIds:K_(e.blocklistConditionIds)}}}function Rr(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 K_(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function XD({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>ZD(e.generatorConfig),[e.generatorConfig]),[l,o]=C.useState(i),[c,u]=C.useState(!1),g=c?q_(l):{ok:!0,errors:{}},d=c?g.errors:{},v=()=>{u(!0);const b=q_(l);!b.ok||!b.generatorConfig||t({generatorConfig:b.generatorConfig,completedSteps:pa(e.completedSteps,"configureGenerator")})},_=(b,x)=>{o(f=>({...f,[b]:x}))};return a.jsxs(Ii,{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:a.jsx(Bi,{onBack:r,onNext:v,busy:n,nextDisabled:c&&!g.ok}),children:[a.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[a.jsx(_t,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:d.cadenceMs??null,children:a.jsx(ct,{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:l.cadenceMs,onChange:b=>_("cadenceMs",b.target.value),className:X(d.cadenceMs&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:d.windowMs??null,children:a.jsx(ct,{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:l.windowMs,onChange:b=>_("windowMs",b.target.value),className:X(d.windowMs&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:d.resolveGapMs??null,children:a.jsx(ct,{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:l.resolveGapMs,onChange:b=>_("resolveGapMs",b.target.value),className:X(d.resolveGapMs&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:d.maxNewRoundsPerPoll??null,children:a.jsx(ct,{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerPoll,onChange:b=>_("maxNewRoundsPerPoll",b.target.value),className:X(d.maxNewRoundsPerPoll&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:d.maxNewRoundsPerDay??null,children:a.jsx(ct,{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerDay,onChange:b=>_("maxNewRoundsPerDay",b.target.value),className:X(d.maxNewRoundsPerDay&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:d.maxOpenRounds??null,children:a.jsx(ct,{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:l.maxOpenRounds,onChange:b=>_("maxOpenRounds",b.target.value),className:X(d.maxOpenRounds&&"border-break-red"),disabled:n})})]}),a.jsx(_t,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:a.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:l.allowlistConditionIds,onChange:b=>_("allowlistConditionIds",b.target.value),rows:2,placeholder:"0xabc…, 0xdef…",className:U_,disabled:n})}),a.jsx(_t,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:a.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:l.blocklistConditionIds,onChange:b=>_("blocklistConditionIds",b.target.value),rows:2,placeholder:"0xabc…",className:U_,disabled:n})})]})}function JD(e){const t=jS.generatorDefaults,r=typeof(e==null?void 0:e.claimPolicy)=="object"&&e.claimPolicy!==null?e.claimPolicy:{};return{N_target_successes:jr(e==null?void 0:e.N_target_successes,t.N_target_successes),N_max_postings_per_task:jr(e==null?void 0:e.N_max_postings_per_task,t.N_max_postings_per_task),posting_window_ms:jr(e==null?void 0:e.posting_window_ms,t.posting_window_ms),post_batch_size:jr(e==null?void 0:e.post_batch_size,t.post_batch_size),maxClaimsPerOperator:jr((e==null?void 0:e.maxClaimsPerOperator)??r.maxClaimsPerOperator,t.maxClaimsPerOperator??t.N_target_successes),claimLeaseTtlSeconds:jr((e==null?void 0:e.claimLeaseTtlSeconds)??r.claimLeaseTtlSeconds,t.claimLeaseTtlSeconds)}}function G_(e){const t={},r=Rr(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=Rr(e.N_max_postings_per_task);n===null?t.N_max_postings_per_task="Must be a positive integer.":r!==null&&n<r&&(t.N_max_postings_per_task="Max postings must be ≥ target successes — otherwise saturation is unreachable.");const s=Rr(e.posting_window_ms);s===null&&(t.posting_window_ms="Must be a positive integer (ms).");const i=Rr(e.post_batch_size);i===null&&(t.post_batch_size="Must be a positive integer.");const l=Rr(e.maxClaimsPerOperator);l===null&&(t.maxClaimsPerOperator="Must be a positive integer.");const o=Rr(e.claimLeaseTtlSeconds);return o===null&&(t.claimLeaseTtlSeconds="Must be a positive integer (seconds)."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:r,N_max_postings_per_task:n,posting_window_ms:s,post_batch_size:i,maxClaimsPerOperator:l,claimLeaseTtlSeconds:o}}}function eL({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>JD(e.generatorConfig),[e.generatorConfig]),[l,o]=C.useState(i),[c,u]=C.useState(!1),g=c?G_(l):{ok:!0,errors:{}},d=c?g.errors:{},v=()=>{u(!0);const b=G_(l);!b.ok||!b.generatorConfig||t({generatorConfig:b.generatorConfig,completedSteps:pa(e.completedSteps,"configureGenerator")})},_=(b,x)=>{o(f=>({...f,[b]:x}))};return a.jsx(Ii,{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:a.jsx(Bi,{onBack:r,onNext:v,busy:n,nextDisabled:c&&!g.ok}),children:a.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[a.jsx(_t,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:d.N_target_successes??null,children:a.jsx(ct,{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:l.N_target_successes,onChange:b=>_("N_target_successes",b.target.value),className:X(d.N_target_successes&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Max Task postings per instance",helperText:"Hard ceiling on Task postings to bound spend on impossible SWE instances.",error:d.N_max_postings_per_task??null,children:a.jsx(ct,{"data-testid":"launcher-create-N_max_postings_per_task",type:"text",inputMode:"numeric",value:l.N_max_postings_per_task,onChange:b=>_("N_max_postings_per_task",b.target.value),className:X(d.N_max_postings_per_task&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Posting window (ms)",helperText:"A posting stays live for this long; expired unsaturated instances can be reposted.",error:d.posting_window_ms??null,children:a.jsx(ct,{"data-testid":"launcher-create-posting_window_ms",type:"text",inputMode:"numeric",value:l.posting_window_ms,onChange:b=>_("posting_window_ms",b.target.value),className:X(d.posting_window_ms&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Post batch size",helperText:"Maximum number of SWE instances to post in one creator tick.",error:d.post_batch_size??null,children:a.jsx(ct,{"data-testid":"launcher-create-post_batch_size",type:"text",inputMode:"numeric",value:l.post_batch_size,onChange:b=>_("post_batch_size",b.target.value),className:X(d.post_batch_size&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Max claims per operator",helperText:"Optional cap; each posting is still limited by remaining target successes.",error:d.maxClaimsPerOperator??null,children:a.jsx(ct,{"data-testid":"launcher-create-maxClaimsPerOperator",type:"text",inputMode:"numeric",value:l.maxClaimsPerOperator,onChange:b=>_("maxClaimsPerOperator",b.target.value),className:X(d.maxClaimsPerOperator&&"border-break-red"),disabled:n})}),a.jsx(_t,{label:"Claim lease (seconds)",helperText:"How long a claimed SWE task slot stays leased.",error:d.claimLeaseTtlSeconds??null,children:a.jsx(ct,{"data-testid":"launcher-create-claimLeaseTtlSeconds",type:"text",inputMode:"numeric",value:l.claimLeaseTtlSeconds,onChange:b=>_("claimLeaseTtlSeconds",b.target.value),className:X(d.claimLeaseTtlSeconds&&"border-break-red"),disabled:n})})]})})}function tL(e,t){const r={};let n,s;try{n=$_(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=$_(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 rL(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 nL({draft:e,template:t=ma,onAdvance:r,onBack:n,fundingSafeAddress:s,fundingSafeBalanceWei:i,busy:l,error:o}){var m,y;const[c,u]=C.useState(e.solutionPriceWei??""),[g,d]=C.useState(e.verdictPriceWei??""),[v,_]=C.useState(!1),b=C.useMemo(()=>tL(c,g),[c,g]),x=t.claimPolicyDefaults.maxClaimsPerOperator,f=C.useMemo(()=>rL(i??null,b.solutionWei,b.verdictWei,x),[i,b.solutionWei,b.verdictWei,x]),p=()=>{_(!0),b.ok&&r({solutionPriceWei:c,verdictPriceWei:g,completedSteps:pa(e.completedSteps,"configurePricing")})},h=v?b.errors:{};return a.jsxs(Ii,{step:4,title:"Configure pricing",blurb:"Set what each Task pays out. The funding Safe is your launcher's master Safe; pricing applies per claim and per verdict.",error:o,footer:a.jsx(Bi,{onBack:n,onNext:p,busy:l,nextDisabled:v&&!b.ok}),children:[a.jsx(_t,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",asLabel:!1,children:a.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)"})}),a.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[a.jsx(_t,{label:"Solution price (wei)",helperText:`≈ ${ui((m=b.solutionWei)==null?void 0:m.toString())}`,error:h.solutionPriceWei??null,children:a.jsx(ct,{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:c,onChange:w=>u(w.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",className:X(h.solutionPriceWei&&"border-break-red"),disabled:l})}),a.jsx(_t,{label:"Verdict price (wei)",helperText:`≈ ${ui((y=b.verdictWei)==null?void 0:y.toString())}`,error:h.verdictPriceWei??null,children:a.jsx(ct,{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:g,onChange:w=>d(w.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",className:X(h.verdictPriceWei&&"border-break-red"),disabled:l})})]}),h.combined&&a.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",className:"font-mono text-[12px] text-break-red",children:h.combined}),a.jsx(ke,{"data-testid":"launcher-create-projection",children:a.jsxs(et,{className:"flex flex-col gap-2.5 p-5",children:[a.jsx("h3",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted",children:"Runway projection"}),a.jsx(pt,{}),a.jsx(uh,{label:"Safe balance",value:i?`${ui(i)} (${i} wei)`:"—"}),a.jsx(uh,{label:"Per-Task cost",value:f?`${ui(f.perTaskWei.toString())} (${f.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${x})`}),a.jsx(uh,{label:"Projected Tasks",value:f?`~${f.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})})]})}function uh({label:e,value:t,hint:r,testId:n}){return a.jsxs("div",{"data-testid":n,className:"grid grid-cols-[160px_1fr] items-baseline gap-3",children:[a.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),a.jsxs("span",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t}),r&&a.jsx("span",{className:"text-[12px] text-fg-muted",children:r})]})]})}const sL=1500,Y_=["pinning","recording","broadcasting","confirming","spawning"],iL={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function oL({draft:e,template:t=ma,onUpdateDraft:r,onBack:n,onLaunchFailure:s,navigateTo:i,pollIntervalMs:l=sL}){const[,o]=En(),c=i??o,u=C.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[g,d]=C.useState(u),[v,_]=C.useState({kind:"idle"}),b=C.useRef(!1);C.useEffect(()=>()=>{b.current=!0},[]);const x=m=>{d(y=>y.includes(m)?y.filter(w=>w!==m):[...y,m])},f=async()=>{var m,y,w;if(g.length!==0){_(k=>k.kind==="failed"?{kind:"idle"}:k),b.current=!1;try{await r({openRoles:g,completedSteps:pa(e.completedSteps,"configurePricing")});const k=await ge.solvernets.launch(e.draftId);if(b.current)return;let j="pinning";for(_({kind:"launching",phase:j,solverNetId:k.solverNetId});;){if(b.current)return;let S;try{S=await ge.solvernets.get(k.solverNetId)}catch{if(b.current)return;await J_(l);continue}if((m=S.launchProgress)!=null&&m.phase&&(j=S.launchProgress.phase),S.status==="launched"){_({kind:"launching",phase:"spawning",solverNetId:k.solverNetId}),c(`/launcher/launched/${encodeURIComponent(k.solverNetId)}`);return}if(S.status==="failed"){const E=((w=(y=S.launchProgress)==null?void 0:y.txError)==null?void 0:w.message)??`Launch failed during ${j}.`;_({kind:"failed",message:E,solverNetId:k.solverNetId}),s==null||s();return}_({kind:"launching",phase:j,solverNetId:k.solverNetId}),await J_(l)}}catch(k){if(b.current)return;_({kind:"failed",message:k instanceof Error?k.message:String(k)}),s==null||s()}}},p=v.kind==="launching",h=g.length===0||p;return a.jsxs(Ii,{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:a.jsx(Bi,{onBack:n,onNext:()=>{f()},nextLabel:p?"Launching…":"Launch",nextDisabled:h,busy:p,right:p&&a.jsx(aL,{current:v.kind==="launching"?v.phase:"pinning"})}),children:[a.jsx(lL,{draft:e,template:t}),a.jsxs(_t,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",asLabel:!1,children:[a.jsxs("div",{"data-testid":"launcher-create-openRoles",className:"flex flex-col gap-2.5",children:[a.jsx(X_,{role:"solver",checked:g.includes("solver"),onChange:()=>x("solver"),disabled:p}),a.jsx(X_,{role:"evaluator",checked:g.includes("evaluator"),onChange:()=>x("evaluator"),disabled:p})]}),g.length===0&&a.jsx("span",{"data-testid":"launcher-create-openRoles-error",className:"font-mono text-[12px] text-break-red",children:"At least one role must be open."})]}),v.kind==="failed"&&a.jsxs(ut,{variant:"blocking","data-testid":"launcher-create-launch-failure",children:[a.jsx(or,{className:"font-mono text-[13px] font-medium text-break-red",children:"Launch failed."}),a.jsx(mt,{className:"font-mono text-[12px] text-fg-muted",children:v.message}),a.jsxs("div",{className:"mt-2.5 flex gap-2",children:[a.jsx(ce,{type:"button",size:"sm","data-testid":"launcher-create-launch-retry",onClick:()=>{f()},children:"Retry"}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-create-launch-abandon",onClick:()=>{c("/launcher")},children:"Abandon"})]})]})]})}function aL({current:e}){const t=Y_.indexOf(e);return a.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:[a.jsx("span",{"data-testid":"launcher-create-launch-phase",children:iL[e]}),a.jsx("div",{className:"flex gap-[3px]",children:Y_.map((r,n)=>a.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",className:X("h-[3px] w-2 rounded-sm",n<=t?"bg-accent-sky":"bg-border")},r))})]})}function lL({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,s=e.templateContractVersion??t.version;return a.jsx(ke,{"data-testid":"launcher-create-manifest-summary",children:a.jsxs(et,{className:"flex flex-col gap-3 p-6",children:[a.jsxs("header",{className:"flex flex-col gap-1",children:[a.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim",children:[n,".",s]}),a.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:e.name??"— unnamed"}),e.description&&a.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:e.description})]}),a.jsx(pt,{}),a.jsxs(dL,{children:[a.jsx(Jr,{label:"Solution price",value:Q_(e.solutionPriceWei)}),a.jsx(Jr,{label:"Verdict price",value:Q_(e.verdictPriceWei)}),t.id==="prediction"?a.jsx(cL,{generator:r}):a.jsx(uL,{generator:r})]})]})})}function cL({generator:e}){const t=di(e.cadenceMs),r=di(e.windowMs??e.submissionWindowMs),n=di(e.maxOpenRounds);return a.jsxs(a.Fragment,{children:[a.jsx(Jr,{label:"Cadence",value:t?`${t} ms`:"—"}),a.jsx(Jr,{label:"Window",value:r?`${r} ms`:"—"}),a.jsx(Jr,{label:"Max open rounds",value:n??"—"}),a.jsx(Jr,{label:"Allowlist",value:Z_(e.allowlistConditionIds)}),a.jsx(Jr,{label:"Blocklist",value:Z_(e.blocklistConditionIds)})]})}function uL({generator:e}){const t=di(e.N_target_successes),r=di(e.N_max_postings_per_task),n=di(e.posting_window_ms),s=di(e.post_batch_size);return a.jsxs(a.Fragment,{children:[a.jsx(Jr,{label:"Target successes",value:t??"—"}),a.jsx(Jr,{label:"Max postings / Task",value:r??"—"}),a.jsx(Jr,{label:"Posting window",value:n?`${n} ms`:"—"}),a.jsx(Jr,{label:"Batch size",value:s??"—"})]})}function Q_(e){return e?`${e} wei (${ui(e)})`:"—"}function di(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function Z_(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function dL({children:e}){return a.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2",children:e})}function Jr({label:e,value:t}){return a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-fg-dim",children:e}),a.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t})]})}function X_({role:e,checked:t,onChange:r,disabled:n}){return a.jsxs("label",{className:X("flex items-center gap-2.5",n?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[a.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"}),a.jsx("span",{className:"font-mono text-[13px] text-foreground",children:e})]})}function J_(e){return new Promise(t=>setTimeout(t,e))}const Yf="jinn.launcher-create.draftId.v1";function hL(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Yf)}catch{return null}}function ey(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(Yf):window.localStorage.setItem(Yf,e)}catch{}}function fL(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function pL({templateKey:e}={}){var k;const t=e??fL()??KD,r=C.useMemo(()=>Gf[t]??null,[t]),[n,s]=C.useState(null),[i,l]=C.useState(null),[o,c]=C.useState(1),[u,g]=C.useState(!1),[d,v]=C.useState(null),_=C.useRef(!1),{data:b}=Oe({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:3e4}),{data:x}=Oe({queryKey:["status"],queryFn:()=>ge.getStatus(),refetchInterval:3e4}),f=(b==null?void 0:b.master_address)??(x==null?void 0:x.master_address)??null,p=((k=x==null?void 0:x.masterGas)==null?void 0:k.balanceWei)??null;C.useEffect(()=>{if(_.current)return;_.current=!0;let j=!1;return(async()=>{const E=hL();if(E)try{const N=await ge.solvernets.getDraft(E);if(j)return;s(N);return}catch{ey(null)}try{const N=await ge.solvernets.createDraft();if(j)return;ey(N.draftId),s(N)}catch(N){if(j)return;l(N instanceof Error?N.message:"Failed to create draft.")}})(),()=>{j=!0}},[]);const h=async j=>{if(n){g(!0),v(null);try{const S=await ge.solvernets.updateDraft(n.draftId,j);s(S),c(E=>E<5?E+1:E)}catch(S){v(S instanceof Error?S.message:String(S))}finally{g(!1)}}},m=async j=>{if(n){g(!0),v(null);try{const S=await ge.solvernets.updateDraft(n.draftId,j);s(S)}catch(S){v(S instanceof Error?S.message:String(S))}finally{g(!1)}}},y=()=>{v(null),c(j=>j>1?j-1:j)},w=()=>{v(null)};if(r===null)return a.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:[a.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Unknown SolverNet template"}),a.jsx(ut,{variant:"blocking",children:a.jsxs(mt,{className:"font-mono text-[13px]",children:["No template registered for ",a.jsx("code",{children:t}),". Available keys:"," ",Object.keys(Gf).map(j=>`?template=${j}`).join(", "),"."]})})]});if(i)return a.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[a.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Couldn't start a new draft"}),a.jsxs(ut,{variant:"blocking",children:[a.jsx(or,{className:"font-mono text-[12px]",children:"Bootstrap error"}),a.jsx(mt,{className:"font-mono text-[13px]",children:i})]})]});if(!n)return a.jsx("main",{"data-testid":"launcher-create-loading",className:"p-6 font-mono text-[13px] text-fg-muted",children:"Loading draft…"});switch(o){case 1:return a.jsx(z_,{draft:n,onAdvance:h,busy:u,error:d});case 2:return a.jsx(YD,{draft:n,template:r,onAdvance:h,onBack:y,busy:u,error:d});case 3:return a.jsx(QD,{draft:n,template:r,onAdvance:h,onBack:y,busy:u,error:d});case 4:return a.jsx(nL,{draft:n,template:r,onAdvance:h,onBack:y,fundingSafeAddress:f,fundingSafeBalanceWei:p??null,busy:u,error:d});case 5:return a.jsx(oL,{draft:n,template:r,onUpdateDraft:m,onBack:y,onLaunchFailure:w});default:return a.jsx(z_,{draft:n,onAdvance:h,busy:u,error:d})}}function RS(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function NS(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function Xm(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 mL={launched:["paused","retired"],paused:["launched","retired"]};function ty(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const o=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return o?`${s}.${o}`:s.toString()}function Ts(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?`${ty(t,18,t>=r?4:6)} ETH`:t>=s?`${ty(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function gL(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 ry=6e4;function vL(e){const t=e??{};return{cadenceMs:Nr(t.cadenceMs),windowMs:Nr(t.windowMs??t.submissionWindowMs),resolveGapMs:Nr(t.resolveGapMs),maxNewRoundsPerPoll:Nr(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:Nr(t.maxNewRoundsPerDay),maxOpenRounds:Nr(t.maxOpenRounds),allowlistConditionIds:ny(t.allowlistConditionIds),blocklistConditionIds:ny(t.blocklistConditionIds)}}function _L(e,t){const r=e??{},n=yL(r.claimPolicy),s=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:Nr(r.N_target_successes),N_max_postings_per_task:Nr(r.N_max_postings_per_task),posting_window_ms:Nr(r.posting_window_ms),post_batch_size:Nr(r.post_batch_size),maxClaimsPerOperator:Nr(r.maxClaimsPerOperator??n.maxClaimsPerOperator??s.maxClaimsPerOperator),claimLeaseTtlSeconds:Nr(r.claimLeaseTtlSeconds??n.claimLeaseTtlSeconds??s.claimLeaseTtlSeconds)}}function yL(e){return typeof e=="object"&&e!==null?e:{}}function Nr(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function ny(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function Wc(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 xL(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function bL(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=Wc(e[s]);if(i===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&i<ry){r[s]=`Cadence must be at least ${ry/1e3}s.`;continue}s==="windowMs"?n.submissionWindowMs=i:n[s]=i}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(n[s]=xL(e[s]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function wL(e,t){const r={},n={},s=Wc(e.N_target_successes),i=Wc(e.N_max_postings_per_task);for(const l of["N_target_successes","N_max_postings_per_task","posting_window_ms","post_batch_size","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[l]===t[l]||e[l].trim().length===0)continue;const o=Wc(e[l]);if(o===null){r[l]=l==="posting_window_ms"?"Must be a positive integer (ms).":l==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}n[l]=o}return s!==null&&i!==null&&i<s&&(r.N_max_postings_per_task="Max postings must be >= target successes."),{ok:Object.keys(r).length===0,patch:n,errors:r}}function SL(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 CL({record:e,manifest:t,template:r,onSave:n}){return SL(e,r)?a.jsx(EL,{record:e,manifest:t,onSave:n}):a.jsx(kL,{record:e,onSave:n})}function PS({record:e,configExpanded:t,setConfigExpanded:r,children:n}){var s,i;return a.jsxs(ke,{"data-testid":"launcher-launched-generator-panel",role:"region","aria-label":"Generator",className:"flex flex-col gap-4 p-6",children:[a.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[a.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Generator"}),a.jsx(PL,{record:e})]}),a.jsx(ce,{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"})]}),a.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[a.jsx(Bn,{label:"Last poll",value:Xm((s=e.generatorState)==null?void 0:s.lastPollAt),testid:"launcher-launched-generator-last-poll"}),a.jsx(Bn,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),a.jsx(jL,{record:e}),((i=e.generatorState)==null?void 0:i.lastError)&&a.jsx(NL,{record:e}),n]})}function kL({record:e,onSave:t}){const r=C.useMemo(()=>vL(e.generatorConfig),[e.generatorConfig]),[n,s]=C.useState(r),[i,l]=C.useState({kind:"idle"}),[o,c]=C.useState(!1);C.useEffect(()=>{s(x=>JSON.stringify(x)!==JSON.stringify(b())?x:r);function b(){return r}},[JSON.stringify(e.generatorConfig)]);const u=(b,x)=>{s(f=>({...f,[b]:x}))},g=C.useMemo(()=>bL(n,r),[n,r]),d=Object.keys(g.patch).length>0,v=i.kind==="saving",_=async()=>{if(!(!g.ok||!d||v)){l({kind:"saving"});try{await t(g.patch),l({kind:"saved",at:new Date})}catch(b){l({kind:"error",message:b instanceof Error?b.message:String(b)})}}};return a.jsx(PS,{record:e,configExpanded:o,setConfigExpanded:c,children:o&&a.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[a.jsx(pt,{}),a.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),a.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[a.jsx(Pr,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:b=>u("cadenceMs",b),error:g.errors.cadenceMs,disabled:v}),a.jsx(Pr,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:b=>u("windowMs",b),error:g.errors.windowMs,disabled:v}),a.jsx(Pr,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:b=>u("resolveGapMs",b),error:g.errors.resolveGapMs,disabled:v}),a.jsx(Pr,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:b=>u("maxNewRoundsPerPoll",b),error:g.errors.maxNewRoundsPerPoll,disabled:v}),a.jsx(Pr,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:b=>u("maxNewRoundsPerDay",b),error:g.errors.maxNewRoundsPerDay,disabled:v}),a.jsx(Pr,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:b=>u("maxOpenRounds",b),error:g.errors.maxOpenRounds,disabled:v})]}),a.jsx(sy,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:b=>u("allowlistConditionIds",b),disabled:v}),a.jsx(sy,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:b=>u("blocklistConditionIds",b),disabled:v}),a.jsx(TS,{dirty:d,saving:v,validationOk:g.ok,saveStatus:i,onSubmit:_})]})})}function EL({record:e,manifest:t,onSave:r}){const n=C.useMemo(()=>_L(e.generatorConfig,t),[e.generatorConfig,t]),[s,i]=C.useState(n),[l,o]=C.useState({kind:"idle"}),[c,u]=C.useState(!1);C.useEffect(()=>{i(x=>JSON.stringify(x)!==JSON.stringify(n)?x:n)},[JSON.stringify(e.generatorConfig)]);const g=(x,f)=>{i(p=>({...p,[x]:f}))},d=C.useMemo(()=>wL(s,n),[s,n]),v=Object.keys(d.patch).length>0,_=l.kind==="saving",b=async()=>{if(!(!d.ok||!v||_)){o({kind:"saving"});try{await r(d.patch),o({kind:"saved",at:new Date})}catch(x){o({kind:"error",message:x instanceof Error?x.message:String(x)})}}};return a.jsx(PS,{record:e,configExpanded:c,setConfigExpanded:u,children:c&&a.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[a.jsx(pt,{}),a.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),a.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[a.jsx(Pr,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:s.N_target_successes,onChange:x=>g("N_target_successes",x),error:d.errors.N_target_successes,disabled:_}),a.jsx(Pr,{label:"Max Task postings per instance",testid:"launcher-launched-generator-N_max_postings_per_task",value:s.N_max_postings_per_task,onChange:x=>g("N_max_postings_per_task",x),error:d.errors.N_max_postings_per_task,disabled:_}),a.jsx(Pr,{label:"Posting window (ms)",testid:"launcher-launched-generator-posting_window_ms",value:s.posting_window_ms,onChange:x=>g("posting_window_ms",x),error:d.errors.posting_window_ms,disabled:_}),a.jsx(Pr,{label:"Post batch size",testid:"launcher-launched-generator-post_batch_size",value:s.post_batch_size,onChange:x=>g("post_batch_size",x),error:d.errors.post_batch_size,disabled:_})]}),a.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Claim policy"}),a.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[a.jsx(Pr,{label:"Max claims per operator",testid:"launcher-launched-generator-maxClaimsPerOperator",value:s.maxClaimsPerOperator,onChange:x=>g("maxClaimsPerOperator",x),error:d.errors.maxClaimsPerOperator,disabled:_}),a.jsx(Pr,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimLeaseTtlSeconds",value:s.claimLeaseTtlSeconds,onChange:x=>g("claimLeaseTtlSeconds",x),error:d.errors.claimLeaseTtlSeconds,disabled:_})]}),a.jsx(TS,{dirty:v,saving:_,validationOk:d.ok,saveStatus:l,onSubmit:b})]})})}function TS({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:s}){const i=e&&r&&!t;return a.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[a.jsx(pt,{}),a.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[a.jsx(TL,{status:n}),a.jsx(ce,{type:"button",variant:"default","data-testid":"launcher-launched-generator-save",onClick:()=>{s()},disabled:!i,children:t?"Saving…":"Save"})]})]})}function jL({record:e}){var r;const t=(r=e.generatorState)==null?void 0:r.lastPollSummary;return RL(t)?a.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:[a.jsx(Bn,{label:"Pool",value:String(t.poolSize),testid:"launcher-launched-generator-poolSize"}),a.jsx(Bn,{label:"Posted",value:String(t.posted),testid:"launcher-launched-generator-posted"}),a.jsx(Bn,{label:"Unposted",value:String(t.unposted),testid:"launcher-launched-generator-unposted"}),a.jsx(Bn,{label:"Live",value:String(t.live),testid:"launcher-launched-generator-live"}),a.jsx(Bn,{label:"Repostable",value:String(t.repostable),testid:"launcher-launched-generator-repostable"}),a.jsx(Bn,{label:"Saturated",value:String(t.saturated),testid:"launcher-launched-generator-saturated"}),a.jsx(Bn,{label:"Abandoned",value:String(t.abandoned),testid:"launcher-launched-generator-abandoned"})]}):null}function RL(e){if(typeof e!="object"||e===null)return!1;const t=e;return["poolSize","posted","unposted","live","repostable","saturated","abandoned"].every(r=>typeof t[r]=="number")}function NL({record:e}){var t,r,n,s;return a.jsxs("div",{"data-testid":"launcher-launched-generator-error",className:"flex flex-col gap-1 rounded-md border border-destructive bg-card p-3",children:[a.jsxs("span",{className:"font-mono text-[12px] font-medium text-destructive",children:["Last error · ",Xm((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),a.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 PL({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 a.jsx(Pe,{"data-testid":"launcher-launched-generator-state-badge",variant:n.variant,children:n.label})}function TL({status:e}){if(e.kind==="saving")return a.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 a.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"?a.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-destructive",children:["Save failed: ",e.message]}):a.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 Pr({label:e,testid:t,value:r,onChange:n,error:s,disabled:i}){return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(yr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),a.jsx(ct,{id:t,"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:l=>n(l.target.value),disabled:i,className:X(s&&"border-destructive")}),s&&a.jsx("span",{"data-testid":`${t}-error`,className:"font-mono text-[11px] text-destructive",children:s})]})}function sy({label:e,testid:t,value:r,onChange:n,disabled:s}){return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(yr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),a.jsx("textarea",{id:t,"data-testid":t,value:r,onChange:i=>n(i.target.value),disabled:s,rows:2,placeholder:"0xabc…, 0xdef…",className:"flex w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground transition-colors placeholder:text-[var(--fg-dim)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})]})}function Bn({label:e,value:t,testid:r}){return a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),a.jsx("dd",{"data-testid":r,className:"m-0 font-mono text-[13px] text-foreground",children:t})]})}var dh="focusScope.autoFocusOnMount",hh="focusScope.autoFocusOnUnmount",iy={bubbles:!1,cancelable:!0},AL="FocusScope",gd=C.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[o,c]=C.useState(null),u=Bt(s),g=Bt(i),d=C.useRef(null),v=Be(t,x=>c(x)),_=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let x=function(m){if(_.paused||!o)return;const y=m.target;o.contains(y)?d.current=y:fs(d.current,{select:!0})},f=function(m){if(_.paused||!o)return;const y=m.relatedTarget;y!==null&&(o.contains(y)||fs(d.current,{select:!0}))},p=function(m){if(document.activeElement===document.body)for(const w of m)w.removedNodes.length>0&&fs(o)};document.addEventListener("focusin",x),document.addEventListener("focusout",f);const h=new MutationObserver(p);return o&&h.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",f),h.disconnect()}}},[n,o,_.paused]),C.useEffect(()=>{if(o){ay.add(_);const x=document.activeElement;if(!o.contains(x)){const p=new CustomEvent(dh,iy);o.addEventListener(dh,u),o.dispatchEvent(p),p.defaultPrevented||(DL(BL(AS(o)),{select:!0}),document.activeElement===x&&fs(o))}return()=>{o.removeEventListener(dh,u),setTimeout(()=>{const p=new CustomEvent(hh,iy);o.addEventListener(hh,g),o.dispatchEvent(p),p.defaultPrevented||fs(x??document.body,{select:!0}),o.removeEventListener(hh,g),ay.remove(_)},0)}}},[o,u,g,_]);const b=C.useCallback(x=>{if(!r&&!n||_.paused)return;const f=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,p=document.activeElement;if(f&&p){const h=x.currentTarget,[m,y]=LL(h);m&&y?!x.shiftKey&&p===y?(x.preventDefault(),r&&fs(m,{select:!0})):x.shiftKey&&p===m&&(x.preventDefault(),r&&fs(y,{select:!0})):p===h&&x.preventDefault()}},[r,n,_.paused]);return a.jsx(Fe.div,{tabIndex:-1,...l,ref:v,onKeyDown:b})});gd.displayName=AL;function DL(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(fs(n,{select:t}),document.activeElement!==r)return}function LL(e){const t=AS(e),r=oy(t,e),n=oy(t.reverse(),e);return[r,n]}function AS(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 oy(e,t){for(const r of e)if(!OL(r,{upTo:t}))return r}function OL(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 ML(e){return e instanceof HTMLInputElement&&"select"in e}function fs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ML(e)&&t&&e.select()}}var ay=IL();function IL(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ly(e,t),e.unshift(t)},remove(t){var r;e=ly(e,t),(r=e[0])==null||r.resume()}}}function ly(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function BL(e){return e.filter(t=>t.tagName!=="A")}var fh=0;function Jm(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cy()),document.body.insertAdjacentElement("beforeend",e[1]??cy()),fh++,()=>{fh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fh--}},[])}function cy(){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 yn=function(){return yn=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},yn.apply(this,arguments)};function DS(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 FL(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 Vc="right-scroll-bar-position",qc="width-before-scroll-bar",$L="with-scroll-bars-hidden",HL="--removed-body-scroll-bar-size";function ph(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zL(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 UL=typeof window<"u"?C.useLayoutEffect:C.useEffect,uy=new WeakMap;function WL(e,t){var r=zL(null,function(n){return e.forEach(function(s){return ph(s,n)})});return UL(function(){var n=uy.get(r);if(n){var s=new Set(n),i=new Set(e),l=r.current;s.forEach(function(o){i.has(o)||ph(o,null)}),i.forEach(function(o){s.has(o)||ph(o,l)})}uy.set(r,e)},[e]),r}function VL(e){return e}function qL(e,t){t===void 0&&(t=VL);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(o){return o!==l})}},assignSyncMedium:function(i){for(n=!0;r.length;){var l=r;r=[],l.forEach(i)}r={push:function(o){return i(o)},filter:function(){return r}}},assignMedium:function(i){n=!0;var l=[];if(r.length){var o=r;r=[],o.forEach(i),l=r}var c=function(){var g=l;l=[],g.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(g){l.push(g),u()},filter:function(g){return l=l.filter(g),r}}}};return s}function KL(e){e===void 0&&(e={});var t=qL(null);return t.options=yn({async:!0,ssr:!1},e),t}var LS=function(e){var t=e.sideCar,r=DS(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,yn({},r))};LS.isSideCarExport=!0;function GL(e,t){return e.useMedium(t),LS}var OS=KL(),mh=function(){},vd=C.forwardRef(function(e,t){var r=C.useRef(null),n=C.useState({onScrollCapture:mh,onWheelCapture:mh,onTouchMoveCapture:mh}),s=n[0],i=n[1],l=e.forwardProps,o=e.children,c=e.className,u=e.removeScrollBar,g=e.enabled,d=e.shards,v=e.sideCar,_=e.noRelative,b=e.noIsolation,x=e.inert,f=e.allowPinchZoom,p=e.as,h=p===void 0?"div":p,m=e.gapMode,y=DS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=v,k=WL([r,t]),j=yn(yn({},y),s);return C.createElement(C.Fragment,null,g&&C.createElement(w,{sideCar:OS,removeScrollBar:u,shards:d,noRelative:_,noIsolation:b,inert:x,setCallbacks:i,allowPinchZoom:!!f,lockRef:r,gapMode:m}),l?C.cloneElement(C.Children.only(o),yn(yn({},j),{ref:k})):C.createElement(h,yn({},j,{className:c,ref:k}),o))});vd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vd.classNames={fullWidth:qc,zeroRight:Vc};var YL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=YL();return t&&e.setAttribute("nonce",t),e}function ZL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function XL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var JL=function(){var e=0,t=null;return{add:function(r){e==0&&(t=QL())&&(ZL(t,r),XL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},eO=function(){var e=JL();return function(t,r){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},MS=function(){var e=eO(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},tO={left:0,top:0,right:0,gap:0},gh=function(e){return parseInt(e||"",10)||0},rO=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[gh(r),gh(n),gh(s)]},nO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return tO;var t=rO(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])}},sO=MS(),wo="data-scroll-locked",iO=function(e,t,r,n){var s=e.left,i=e.top,l=e.right,o=e.gap;return r===void 0&&(r="margin"),`
|
|
187
|
+
.`.concat($L,` {
|
|
188
|
+
overflow: hidden `).concat(n,`;
|
|
189
|
+
padding-right: `).concat(o,"px ").concat(n,`;
|
|
190
|
+
}
|
|
191
|
+
body[`).concat(wo,`] {
|
|
192
|
+
overflow: hidden `).concat(n,`;
|
|
193
|
+
overscroll-behavior: contain;
|
|
194
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
195
|
+
padding-left: `.concat(s,`px;
|
|
196
|
+
padding-top: `).concat(i,`px;
|
|
197
|
+
padding-right: `).concat(l,`px;
|
|
198
|
+
margin-left:0;
|
|
199
|
+
margin-top:0;
|
|
200
|
+
margin-right: `).concat(o,"px ").concat(n,`;
|
|
201
|
+
`),r==="padding"&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.`).concat(Vc,` {
|
|
205
|
+
right: `).concat(o,"px ").concat(n,`;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.`).concat(qc,` {
|
|
209
|
+
margin-right: `).concat(o,"px ").concat(n,`;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.`).concat(Vc," .").concat(Vc,` {
|
|
213
|
+
right: 0 `).concat(n,`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.`).concat(qc," .").concat(qc,` {
|
|
217
|
+
margin-right: 0 `).concat(n,`;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
body[`).concat(wo,`] {
|
|
221
|
+
`).concat(HL,": ").concat(o,`px;
|
|
222
|
+
}
|
|
223
|
+
`)},dy=function(){var e=parseInt(document.body.getAttribute(wo)||"0",10);return isFinite(e)?e:0},oO=function(){C.useEffect(function(){return document.body.setAttribute(wo,(dy()+1).toString()),function(){var e=dy()-1;e<=0?document.body.removeAttribute(wo):document.body.setAttribute(wo,e.toString())}},[])},aO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;oO();var i=C.useMemo(function(){return nO(s)},[s]);return C.createElement(sO,{styles:iO(i,!t,s,r?"":"!important")})},Qf=!1;if(typeof window<"u")try{var Cc=Object.defineProperty({},"passive",{get:function(){return Qf=!0,!0}});window.addEventListener("test",Cc,Cc),window.removeEventListener("test",Cc,Cc)}catch{Qf=!1}var Ui=Qf?{passive:!1}:!1,lO=function(e){return e.tagName==="TEXTAREA"},IS=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!lO(e)&&r[t]==="visible")},cO=function(e){return IS(e,"overflowY")},uO=function(e){return IS(e,"overflowX")},hy=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=BS(e,n);if(s){var i=FS(e,n),l=i[1],o=i[2];if(l>o)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},dO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},hO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},BS=function(e,t){return e==="v"?cO(t):uO(t)},FS=function(e,t){return e==="v"?dO(t):hO(t)},fO=function(e,t){return e==="h"&&t==="rtl"?-1:1},pO=function(e,t,r,n,s){var i=fO(e,window.getComputedStyle(t).direction),l=i*n,o=r.target,c=t.contains(o),u=!1,g=l>0,d=0,v=0;do{if(!o)break;var _=FS(e,o),b=_[0],x=_[1],f=_[2],p=x-f-i*b;(b||p)&&BS(e,o)&&(d+=p,v+=b);var h=o.parentNode;o=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(g&&Math.abs(d)<1||!g&&Math.abs(v)<1)&&(u=!0),u},kc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fy=function(e){return[e.deltaX,e.deltaY]},py=function(e){return e&&"current"in e?e.current:e},mO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gO=function(e){return`
|
|
224
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
225
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
226
|
+
`)},vO=0,Wi=[];function _O(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(vO++)[0],i=C.useState(MS)[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 x=FL([e.lockRef.current],(e.shards||[]).map(py),!0).filter(Boolean);return x.forEach(function(f){return f.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),x.forEach(function(f){return f.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var o=C.useCallback(function(x,f){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var p=kc(x),h=r.current,m="deltaX"in x?x.deltaX:h[0]-p[0],y="deltaY"in x?x.deltaY:h[1]-p[1],w,k=x.target,j=Math.abs(m)>Math.abs(y)?"h":"v";if("touches"in x&&j==="h"&&k.type==="range")return!1;var S=window.getSelection(),E=S&&S.anchorNode,N=E?E===k||E.contains(k):!1;if(N)return!1;var O=hy(j,k);if(!O)return!0;if(O?w=j:(w=j==="v"?"h":"v",O=hy(j,k)),!O)return!1;if(!n.current&&"changedTouches"in x&&(m||y)&&(n.current=w),!w)return!0;var T=n.current||w;return pO(T,f,x,T==="h"?m:y)},[]),c=C.useCallback(function(x){var f=x;if(!(!Wi.length||Wi[Wi.length-1]!==i)){var p="deltaY"in f?fy(f):kc(f),h=t.current.filter(function(w){return w.name===f.type&&(w.target===f.target||f.target===w.shadowParent)&&mO(w.delta,p)})[0];if(h&&h.should){f.cancelable&&f.preventDefault();return}if(!h){var m=(l.current.shards||[]).map(py).filter(Boolean).filter(function(w){return w.contains(f.target)}),y=m.length>0?o(f,m[0]):!l.current.noIsolation;y&&f.cancelable&&f.preventDefault()}}},[]),u=C.useCallback(function(x,f,p,h){var m={name:x,delta:f,target:p,should:h,shadowParent:yO(p)};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(y){return y!==m})},1)},[]),g=C.useCallback(function(x){r.current=kc(x),n.current=void 0},[]),d=C.useCallback(function(x){u(x.type,fy(x),x.target,o(x,e.lockRef.current))},[]),v=C.useCallback(function(x){u(x.type,kc(x),x.target,o(x,e.lockRef.current))},[]);C.useEffect(function(){return Wi.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Ui),document.addEventListener("touchmove",c,Ui),document.addEventListener("touchstart",g,Ui),function(){Wi=Wi.filter(function(x){return x!==i}),document.removeEventListener("wheel",c,Ui),document.removeEventListener("touchmove",c,Ui),document.removeEventListener("touchstart",g,Ui)}},[]);var _=e.removeScrollBar,b=e.inert;return C.createElement(C.Fragment,null,b?C.createElement(i,{styles:gO(s)}):null,_?C.createElement(aO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const xO=GL(OS,_O);var _d=C.forwardRef(function(e,t){return C.createElement(vd,yn({},e,{ref:t,sideCar:xO}))});_d.classNames=vd.classNames;var bO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vi=new WeakMap,Ec=new WeakMap,jc={},vh=0,$S=function(e){return e&&(e.host||$S(e.parentNode))},wO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=$S(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})},SO=function(e,t,r,n){var s=wO(t,Array.isArray(e)?e:[e]);jc[r]||(jc[r]=new WeakMap);var i=jc[r],l=[],o=new Set,c=new Set(s),u=function(d){!d||o.has(d)||(o.add(d),u(d.parentNode))};s.forEach(u);var g=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(v){if(o.has(v))g(v);else try{var _=v.getAttribute(n),b=_!==null&&_!=="false",x=(Vi.get(v)||0)+1,f=(i.get(v)||0)+1;Vi.set(v,x),i.set(v,f),l.push(v),x===1&&b&&Ec.set(v,!0),f===1&&v.setAttribute(r,"true"),b||v.setAttribute(n,"true")}catch(p){console.error("aria-hidden: cannot operate on ",v,p)}})};return g(t),o.clear(),vh++,function(){l.forEach(function(d){var v=Vi.get(d)-1,_=i.get(d)-1;Vi.set(d,v),i.set(d,_),v||(Ec.has(d)||d.removeAttribute(n),Ec.delete(d)),_||d.removeAttribute(r)}),vh--,vh||(Vi=new WeakMap,Vi=new WeakMap,Ec=new WeakMap,jc={})}},eg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=bO(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),SO(n,s,r,"aria-hidden")):function(){return null}};function CO(e){const t=kO(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,o=C.Children.toArray(i),c=o.find(jO);if(c){const u=c.props.children,g=o.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return a.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function kO(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=NO(s),o=RO(i,s.props);return s.type!==C.Fragment&&(o.ref=n?ss(n,l):l),C.cloneElement(s,o)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EO=Symbol("radix.slottable");function jO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EO}function RO(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function NO(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 yd="Dialog",[HS,zS]=un(yd),[PO,dn]=HS(yd),US=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,o=C.useRef(null),c=C.useRef(null),[u,g]=ua({prop:n,defaultProp:s??!1,onChange:i,caller:yd});return a.jsx(PO,{scope:t,triggerRef:o,contentRef:c,contentId:zs(),titleId:zs(),descriptionId:zs(),open:u,onOpenChange:g,onOpenToggle:C.useCallback(()=>g(d=>!d),[g]),modal:l,children:r})};US.displayName=yd;var WS="DialogTrigger",VS=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=dn(WS,r),i=Be(t,s.triggerRef);return a.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ng(s.open),...n,ref:i,onClick:ve(e.onClick,s.onOpenToggle)})});VS.displayName=WS;var tg="DialogPortal",[TO,qS]=HS(tg,{forceMount:void 0}),KS=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=dn(tg,t);return a.jsx(TO,{scope:t,forceMount:r,children:C.Children.map(n,l=>a.jsx(Ht,{present:r||i.open,children:a.jsx(Hl,{asChild:!0,container:s,children:l})}))})};KS.displayName=tg;var Ru="DialogOverlay",GS=C.forwardRef((e,t)=>{const r=qS(Ru,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=dn(Ru,e.__scopeDialog);return i.modal?a.jsx(Ht,{present:n||i.open,children:a.jsx(DO,{...s,ref:t})}):null});GS.displayName=Ru;var AO=CO("DialogOverlay.RemoveScroll"),DO=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=dn(Ru,r);return a.jsx(_d,{as:AO,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Fe.div,{"data-state":ng(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ai="DialogContent",YS=C.forwardRef((e,t)=>{const r=qS(Ai,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=dn(Ai,e.__scopeDialog);return a.jsx(Ht,{present:n||i.open,children:i.modal?a.jsx(LO,{...s,ref:t}):a.jsx(OO,{...s,ref:t})})});YS.displayName=Ai;var LO=C.forwardRef((e,t)=>{const r=dn(Ai,e.__scopeDialog),n=C.useRef(null),s=Be(t,r.contentRef,n);return C.useEffect(()=>{const i=n.current;if(i)return eg(i)},[]),a.jsx(QS,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,o=l.button===0&&l.ctrlKey===!0;(l.button===2||o)&&i.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,i=>i.preventDefault())})}),OO=C.forwardRef((e,t)=>{const r=dn(Ai,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return a.jsx(QS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,o;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(o=r.triggerRef.current)==null||o.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),QS=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,o=dn(Ai,r),c=C.useRef(null),u=Be(t,c);return Jm(),a.jsxs(a.Fragment,{children:[a.jsx(gd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Fl,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":ng(o.open),...l,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(IO,{titleId:o.titleId}),a.jsx(FO,{contentRef:c,descriptionId:o.descriptionId})]})]})}),rg="DialogTitle",ZS=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=dn(rg,r);return a.jsx(Fe.h2,{id:s.titleId,...n,ref:t})});ZS.displayName=rg;var XS="DialogDescription",JS=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=dn(XS,r);return a.jsx(Fe.p,{id:s.descriptionId,...n,ref:t})});JS.displayName=XS;var e1="DialogClose",t1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=dn(e1,r);return a.jsx(Fe.button,{type:"button",...n,ref:t,onClick:ve(e.onClick,()=>s.onOpenChange(!1))})});t1.displayName=e1;function ng(e){return e?"open":"closed"}var r1="DialogTitleWarning",[MO,n1]=b2(r1,{contentName:Ai,titleName:rg,docsSlug:"dialog"}),IO=({titleId:e})=>{const t=n1(r1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
227
|
+
|
|
228
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
229
|
+
|
|
230
|
+
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},BO="DialogDescriptionWarning",FO=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n1(BO).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},s1=US,$O=VS,i1=KS,sg=GS,ig=YS,og=ZS,ag=JS,lg=t1,HO=Symbol("radix.slottable");function zO(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=HO,t}var o1="AlertDialog",[UO]=un(o1,[zS]),os=zS(),a1=e=>{const{__scopeAlertDialog:t,...r}=e,n=os(t);return a.jsx(s1,{...n,...r,modal:!0})};a1.displayName=o1;var WO="AlertDialogTrigger",VO=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return a.jsx($O,{...s,...n,ref:t})});VO.displayName=WO;var qO="AlertDialogPortal",l1=e=>{const{__scopeAlertDialog:t,...r}=e,n=os(t);return a.jsx(i1,{...n,...r})};l1.displayName=qO;var KO="AlertDialogOverlay",c1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return a.jsx(sg,{...s,...n,ref:t})});c1.displayName=KO;var So="AlertDialogContent",[GO,YO]=UO(So),QO=zO("AlertDialogContent"),u1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=os(r),l=C.useRef(null),o=Be(t,l),c=C.useRef(null);return a.jsx(MO,{contentName:So,titleName:d1,docsSlug:"alert-dialog",children:a.jsx(GO,{scope:r,cancelRef:c,children:a.jsxs(ig,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:ve(s.onOpenAutoFocus,u=>{var g;u.preventDefault(),(g=c.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[a.jsx(QO,{children:n}),a.jsx(XO,{contentRef:l})]})})})});u1.displayName=So;var d1="AlertDialogTitle",h1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return a.jsx(og,{...s,...n,ref:t})});h1.displayName=d1;var f1="AlertDialogDescription",p1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return a.jsx(ag,{...s,...n,ref:t})});p1.displayName=f1;var ZO="AlertDialogAction",m1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=os(r);return a.jsx(lg,{...s,...n,ref:t})});m1.displayName=ZO;var g1="AlertDialogCancel",v1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=YO(g1,r),i=os(r),l=Be(t,s);return a.jsx(lg,{...i,...n,ref:l})});v1.displayName=g1;var XO=({contentRef:e})=>{const t=`\`${So}\` requires a description for the component to be accessible for screen reader users.
|
|
231
|
+
|
|
232
|
+
You can add a description to the \`${So}\` by passing a \`${f1}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
233
|
+
|
|
234
|
+
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 \`${So}\`. 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.
|
|
235
|
+
|
|
236
|
+
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},JO=a1,eM=l1,_1=c1,y1=u1,x1=m1,b1=v1,w1=h1,S1=p1;const C1=JO,tM=eM,k1=C.forwardRef(({className:e,...t},r)=>a.jsx(_1,{className:X("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}));k1.displayName=_1.displayName;const cg=C.forwardRef(({className:e,...t},r)=>a.jsxs(tM,{children:[a.jsx(k1,{}),a.jsx(y1,{ref:r,className:X("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})]}));cg.displayName=y1.displayName;const ug=({className:e,...t})=>a.jsx("div",{className:X("flex flex-col gap-2 text-left",e),...t});ug.displayName="AlertDialogHeader";const dg=({className:e,...t})=>a.jsx("div",{className:X("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});dg.displayName="AlertDialogFooter";const hg=C.forwardRef(({className:e,...t},r)=>a.jsx(w1,{ref:r,className:X("font-serif text-[20px] leading-tight text-foreground",e),...t}));hg.displayName=w1.displayName;const fg=C.forwardRef(({className:e,...t},r)=>a.jsx(S1,{ref:r,className:X("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));fg.displayName=S1.displayName;const pg=C.forwardRef(({className:e,...t},r)=>a.jsx(x1,{ref:r,className:X(jm(),e),...t}));pg.displayName=x1.displayName;const mg=C.forwardRef(({className:e,...t},r)=>a.jsx(b1,{ref:r,className:X(jm({variant:"secondary"}),"mt-2 sm:mt-0",e),...t}));mg.displayName=b1.displayName;const rM={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 nM({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:s,pending:i=!1,errorMessage:l}){const[o,c]=C.useState("");C.useEffect(()=>{e||c("")},[e,t]);const u=rM[t],g=t==="retired",d=!g||o.trim().toLowerCase()===r.trim().toLowerCase(),v=i||!d;return a.jsx(C1,{open:e,onOpenChange:_=>{!_&&!i&&s()},children:a.jsxs(cg,{"data-testid":"launcher-launched-dialog","data-target":t,className:X("gap-4",u.danger&&"border-destructive"),children:[a.jsxs(ug,{children:[a.jsx(hg,{className:X(u.danger&&"text-destructive"),children:u.title}),a.jsx(fg,{children:u.body})]}),g&&a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs(yr,{htmlFor:"launcher-launched-dialog-typed",className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:["Type"," ",a.jsx("span",{className:"text-foreground",children:r})," to confirm"]}),a.jsx(ct,{id:"launcher-launched-dialog-typed","data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:o,onChange:_=>c(_.target.value),disabled:i,className:X(d&&"border-[var(--vow-green)]")})]}),l&&a.jsx("span",{"data-testid":"launcher-launched-dialog-error",className:"font-mono text-[12px] text-destructive",children:l}),a.jsxs(dg,{children:[a.jsx(mg,{"data-testid":"launcher-launched-dialog-cancel",onClick:_=>{_.preventDefault(),s()},disabled:i,children:"Cancel"}),a.jsx(pg,{"data-testid":"launcher-launched-dialog-confirm",onClick:_=>{if(v){_.preventDefault();return}_.preventDefault(),n()},disabled:v,className:X(u.danger&&"border border-destructive bg-transparent text-destructive hover:bg-[var(--severity-blocking-bg)]"),children:i?`${u.confirmLabel}…`:u.confirmLabel})]})]})})}function sM({record:e,manifest:t,fetchLauncherStatus:r}){var b,x;const n=r??(()=>ge.fetchLauncherStatus()),{data:s,isLoading:i,isError:l}=Oe({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),o=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,c=o?s==null?void 0:s.nets.find(f=>{var p;return f.solverType===o||f.name===((t==null?void 0:t.name)??((p=e.summary)==null?void 0:p.name))}):void 0,u=c==null?void 0:c.budget.safeBalanceWei,g=(c==null?void 0:c.budget.safeAddress)??e.launcherSafeAddress,d=(t==null?void 0:t.solutionPriceWei)??((b=e.summary)==null?void 0:b.solutionPriceWei),v=(t==null?void 0:t.verdictPriceWei)??((x=e.summary)==null?void 0:x.verdictPriceWei),_=gL(u,d,v);return a.jsx(Cn,{delayDuration:150,children:a.jsxs(ke,{"data-testid":"launcher-launched-spend-panel",role:"region","aria-label":"Spend and runway",className:"flex flex-col gap-3 p-6",children:[a.jsx("header",{className:"flex items-center justify-between gap-3",children:a.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Spend & runway"})}),a.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[a.jsx(qi,{label:"Safe address",value:NS(g),tooltip:g,testid:"launcher-launched-spend-safe-address"}),a.jsx(qi,{label:"Safe balance",value:i?"—":u?Ts(u):"unavailable",tooltip:u?`${u} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),a.jsx(qi,{label:"Solution price",value:d?Ts(d):"—",tooltip:d?`${d} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),a.jsx(qi,{label:"Verdict price",value:v?Ts(v):"—",tooltip:v?`${v} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),a.jsx(qi,{label:"Per-Task cost",value:_?Ts(_.perTaskWei.toString()):"—",tooltip:_?`${_.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),a.jsx(qi,{label:"Projected runway",value:_?`${_.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),l&&a.jsx("span",{"data-testid":"launcher-launched-spend-error",className:"font-mono text-[12px] text-destructive",children:"Failed to load Safe balance."}),a.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 qi({label:e,value:t,testid:r,tooltip:n}){const s=a.jsx("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:n?0:void 0,children:t});return a.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),n?a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:s}),a.jsx(Dr,{children:n})]}):s]})}const iM={paused:"Pause",launched:"Resume",retired:"Retire"},my={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 oM({record:e,manifest:t,operatorCount:r,onAction:n,pending:s}){var c;const i=my[e.status]??my.launching,l=mL[e.status]??[],o=(t==null?void 0:t.name)??((c=e.summary)==null?void 0:c.name)??e.solverNetId;return a.jsx(Cn,{delayDuration:150,children:a.jsxs(ke,{"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:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("h1",{"data-testid":"launcher-launched-name",className:"m-0 font-serif text-[32px] font-normal tracking-[-0.01em] text-foreground",children:o}),a.jsx(Pe,{"data-testid":"launcher-launched-status-badge",variant:i.variant,className:"whitespace-nowrap",children:i.label})]}),(t==null?void 0:t.description)&&a.jsx("p",{className:"m-0 max-w-[720px] text-[13px] leading-relaxed text-[var(--fg-muted)]",children:t.description})]}),a.jsx(aM,{allowed:l,onAction:n,pending:s??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),a.jsx(pt,{}),a.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[a.jsx(Na,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id"}),a.jsx(Na,{label:"Manifest cid",value:RS(e.manifestCid),testid:"launcher-launched-manifest-cid",additionalTestIds:["manifest-cid"],tooltip:e.manifestCid}),a.jsx(Na,{label:"Launcher Safe",value:NS(e.launcherSafeAddress),testid:"launcher-launched-safe",tooltip:e.launcherSafeAddress}),a.jsx(Na,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent"}),r!==void 0&&a.jsx(Na,{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 Na({label:e,value:t,testid:r,additionalTestIds:n,tooltip:s}){const i=a.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=>a.jsx("span",{"data-testid":l,className:"hidden","aria-hidden":"true",children:t},l))]});return a.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),s?a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:i}),a.jsx(Dr,{children:s})]}):i]})}function aM({allowed:e,onAction:t,pending:r,terminal:n,launching:s}){return n?a.jsx(Pe,{"data-testid":"launcher-launched-terminal-pill",variant:"outline",className:"self-start whitespace-nowrap",children:"Retired — no further actions"}):s?a.jsx(Pe,{"data-testid":"launcher-launched-launching-pill",variant:"outline",className:"self-start whitespace-nowrap border-primary text-primary",children:"Launching…"}):e.length===0?null:a.jsx("div",{"data-testid":"launcher-launched-actions",className:"flex flex-wrap gap-2 self-start",children:e.map(i=>{const l=iM[i],o=r===i,c=i==="retired";return a.jsx(ce,{type:"button",variant:c?"destructive":"default","data-testid":`launcher-launched-action-${i}`,onClick:()=>t(i),disabled:r!==null,className:r!==null&&!o?"opacity-60":void 0,children:o?`${l}…`:l},i)})})}const gy=5,lM={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 cM({record:e,fetchTasks:t}){var _;const[r,n]=C.useState([void 0]),s=r[r.length-1],i=t??(b=>ge.fetchLauncherTasks(b)),{data:l,isLoading:o,isError:c,error:u,refetch:g}=Oe({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>i({cursor:s,limit:gy}),refetchInterval:15e3}),d=()=>{var b;(b=l==null?void 0:l.cursor)!=null&&b.before&&n(x=>[...x,l.cursor.before])},v=()=>{n(b=>b.length>1?b.slice(0,-1):b)};return a.jsx(Cn,{delayDuration:150,children:a.jsxs(ke,{"data-testid":"launcher-launched-tasks-panel",role:"region","aria-label":"Recent posted Tasks",className:"flex flex-col gap-3 p-6",children:[a.jsxs("header",{className:"flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Recent posted Tasks"}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{g()},children:"Refresh"})]}),o&&a.jsx("p",{"data-testid":"launcher-launched-tasks-loading",className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Loading…"}),c&&a.jsxs("div",{"data-testid":"launcher-launched-tasks-error",className:"font-mono text-[12px] text-destructive",children:["Failed to load tasks: ",u instanceof Error?u.message:"unknown error"]}),!o&&!c&&l&&l.tasks.length===0&&a.jsx(dM,{}),!o&&!c&&l&&l.tasks.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{"data-testid":"launcher-launched-tasks-list",className:"overflow-hidden rounded-md border border-border",children:a.jsxs(da,{className:"table-fixed",children:[a.jsx(ha,{children:a.jsxs(cn,{className:"bg-[var(--bg)] hover:bg-[var(--bg)]",children:[a.jsx(tt,{className:"w-[34%]",children:"Task"}),a.jsx(tt,{className:"w-[16%]",children:"SolverType"}),a.jsx(tt,{className:"w-[22%]",children:"Posted"}),a.jsx(tt,{className:"w-[14%]",children:"State"}),a.jsx(tt,{className:"w-[14%] text-right",children:"Claims"})]})}),a.jsx(fa,{children:l.tasks.map(b=>a.jsx(uM,{task:b},b.taskId))})]})}),a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-prev",onClick:v,disabled:r.length<=1,children:"← Newer"}),a.jsxs("span",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Page ",r.length,l.tasks.length<gy&&l.cursor===void 0?" · end":""]}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-next",onClick:d,disabled:!((_=l.cursor)!=null&&_.before),children:"Older →"})]})]})]})})}function uM({task:e}){var s;const t=lM[e.state]??{variant:"secondary",label:e.state},r=((s=e.summary)==null?void 0:s.title)??RS(e.taskCid),n=e.solverType??e.solverNet;return a.jsxs(cn,{"data-testid":"launcher-launched-task-row","data-task-id":e.taskId,children:[a.jsx(rt,{className:"font-mono text-[13px] text-foreground",children:a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("span",{className:"block truncate",tabIndex:0,children:r})}),a.jsx(Dr,{children:e.taskCid})]})}),a.jsx(rt,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:a.jsxs(nn,{children:[a.jsx(sn,{asChild:!0,children:a.jsx("span",{className:"block truncate",tabIndex:0,children:n})}),a.jsx(Dr,{children:n})]})}),a.jsx(rt,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:Xm(e.postedAt)}),a.jsx(rt,{children:a.jsx(Pe,{variant:t.variant,className:"normal-case tracking-[0.1em]",children:t.label})}),a.jsxs(rt,{className:"text-right font-mono text-[12px] text-[var(--fg-muted)]",children:[e.claims.current," / ",e.claims.max]})]})}function dM(){return a.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 hM=2500,fM=3e4,Rc="mx-auto flex max-w-[960px] flex-col gap-4 p-6";function pM({pollIntervalMs:e=hM,navigateTo:t,solverNetId:r}={}){var k,j,S,E;const n=bm(),[,s]=En(),i=t??s,l=ei(),o=r??n.solverNetId,c=Oe({queryKey:["solvernets","launched",o],queryFn:()=>ge.solvernets.get(o),refetchInterval:e,enabled:!!o}),u=(k=c.data)==null?void 0:k.manifestCid,g=Oe({queryKey:["solvernets","manifest",u],queryFn:()=>ge.solvernets.getManifest(u),enabled:!!u,staleTime:1/0}),d=Oe({queryKey:["solvernets","operator-count",u],queryFn:async()=>(await ge.discovery.getSolverNetOperatorCount(u)).operatorCount,enabled:!!u,refetchInterval:fM}),[v,_]=C.useState(null),[b,x]=C.useState(null),f=Kn({mutationFn:({target:N})=>ge.solvernets.transitionLifecycle(o,N),onSuccess:async N=>{await l.cancelQueries({queryKey:["solvernets","launched",o]}),l.setQueryData(["solvernets","launched",o],N),_(null),x(null)},onError:N=>{x(N instanceof Error?N.message:String(N))}}),p=Kn({mutationFn:N=>ge.solvernets.updateGeneratorConfig(o,N),onSuccess:()=>{l.invalidateQueries({queryKey:["solvernets","launched",o]})}});if(!o)return a.jsx("main",{"data-testid":"launcher-launched-missing-id",className:Rc,children:a.jsx(vy,{message:"No solverNetId supplied.",onBack:()=>i("/launcher")})});if(c.isLoading)return a.jsx("main",{"data-testid":"launcher-launched-loading",className:Rc,children:a.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"})});if(c.isError||!c.data){const N=c.error instanceof Error?c.error.message:"Unknown error";return a.jsx("main",{"data-testid":"launcher-launched-error",className:Rc,children:a.jsx(vy,{message:`Failed to load SolverNet: ${N}`,onBack:()=>i("/launcher"),onRetry:()=>{c.refetch()}})})}const h=c.data,m=(j=g.data)==null?void 0:j.manifest,y=gM(h,m),w=(m==null?void 0:m.name)??((S=h.summary)==null?void 0:S.name)??h.solverNetId;return a.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":o,className:Rc,children:[a.jsx(oM,{record:h,manifest:m,operatorCount:d.data,onAction:N=>{x(null),_(N)},pending:f.isPending?((E=f.variables)==null?void 0:E.target)??null:null}),a.jsx(CL,{record:h,manifest:m,template:y,onSave:async N=>{await p.mutateAsync(N)}}),a.jsx(sM,{record:h,manifest:m}),a.jsx(cM,{record:h}),g.isError&&a.jsxs("p",{"data-testid":"launcher-launched-manifest-error",className:"m-0 font-mono text-[12px] text-destructive",children:["Failed to load manifest:"," ",mM(g.error)]}),a.jsx(nM,{open:v!==null,target:v??"paused",solverNetName:w,pending:f.isPending,errorMessage:b??void 0,onCancel:()=>{f.isPending||(_(null),x(null))},onConfirm:()=>{v&&f.mutate({target:v})}})]})}function mM(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 gM(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 Gf[`${r.id}.${r.version}`]}function vy({message:e,onBack:t,onRetry:r}){return a.jsxs(ut,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[a.jsx(mt,{className:"font-mono text-[13px] text-destructive",children:e}),a.jsxs("div",{className:"flex gap-2",children:[r&&a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-retry",onClick:r,children:"Retry"}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-back",onClick:t,children:"Back to launcher"})]})]})}const _y="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",_h="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 vM({onSuccess:e,onCancel:t}){const[r,n]=C.useState("checking"),[s,i]=C.useState(""),[l,o]=C.useState(""),c=()=>{n("checking"),ge.hermesDoctor().then(g=>{if(!g.installed){n("not-installed");return}if(g.exitCode!==0){n("config-issue"),i(g.stderr);return}n("ok"),e()}).catch(g=>{o(g instanceof Error?g.message:String(g)),n("network-error")})},u=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(_y).catch(()=>{})};return C.useEffect(()=>{c()},[]),r==="checking"?a.jsxs(ke,{"data-testid":"hermes-precheck-checking",className:"flex flex-col gap-3 p-4",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes install check"}),a.jsx("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Checking hermes install…"})]}):r==="not-installed"?a.jsxs(ke,{"data-testid":"hermes-precheck-not-installed",className:"flex flex-col gap-3 p-4",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent not installed"}),a.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:"}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("pre",{className:`${_h} flex-1`,children:_y}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:u,children:"Copy"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ce,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"I've installed Hermes — retry precheck"}),a.jsx(ce,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="network-error"?a.jsxs(ut,{"data-testid":"hermes-precheck-network-error",variant:"blocking",className:"flex flex-col gap-3 border-l-0 border border-destructive p-4",children:[a.jsx(or,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes precheck failed"}),a.jsxs(mt,{className:"font-mono text-[13px] text-foreground",children:["Could not reach the daemon API to run ",a.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),l?a.jsx("pre",{className:_h,children:l}):null,a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ce,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),a.jsx(ce,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="config-issue"?a.jsxs(ut,{"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:[a.jsx(or,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent configuration issue"}),a.jsx(mt,{className:"font-mono text-[13px] text-foreground",children:"Hermes is installed but reports configuration issues:"}),a.jsx("pre",{className:_h,children:s||"(no diagnostic output)"}),a.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Run ",a.jsx("code",{children:"hermes model"})," or ",a.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ce,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),a.jsx(ce,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):a.jsx(a.Fragment,{})}const E1=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],j1=[{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"}],R1=[{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 _M(e){return Br(e)===Zm}function yM(e){return Br(e)===Yo}function xd(e){return yM(e)?R1:_M(e)?j1:E1}function Co(e){return xd(e)[0].id}function gg(e,t){const n=xd(t).find(s=>s.id===e)??null??E1.find(s=>s.id===e)??j1.find(s=>s.id===e)??R1.find(s=>s.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}function xM(e){const t=bM(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,o=C.Children.toArray(i),c=o.find(SM);if(c){const u=c.props.children,g=o.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return a.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function bM(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=kM(s),o=CM(i,s.props);return s.type!==C.Fragment&&(o.ref=n?ss(n,l):l),C.cloneElement(s,o)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wM=Symbol("radix.slottable");function SM(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wM}function CM(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function kM(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 bd="Popover",[N1]=un(bd,[ca]),Ul=ca(),[EM,ti]=N1(bd),P1=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,o=Ul(t),c=C.useRef(null),[u,g]=C.useState(!1),[d,v]=ua({prop:n,defaultProp:s??!1,onChange:i,caller:bd});return a.jsx(Vm,{...o,children:a.jsx(EM,{scope:t,contentId:zs(),triggerRef:c,open:d,onOpenChange:v,onOpenToggle:C.useCallback(()=>v(_=>!_),[v]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>g(!0),[]),onCustomAnchorRemove:C.useCallback(()=>g(!1),[]),modal:l,children:r})})};P1.displayName=bd;var T1="PopoverAnchor",jM=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ti(T1,r),i=Ul(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:o}=s;return C.useEffect(()=>(l(),()=>o()),[l,o]),a.jsx(fd,{...i,...n,ref:t})});jM.displayName=T1;var A1="PopoverTrigger",D1=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ti(A1,r),i=Ul(r),l=Be(t,s.triggerRef),o=a.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":B1(s.open),...n,ref:l,onClick:ve(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:a.jsx(fd,{asChild:!0,...i,children:o})});D1.displayName=A1;var vg="PopoverPortal",[RM,NM]=N1(vg,{forceMount:void 0}),L1=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,i=ti(vg,t);return a.jsx(RM,{scope:t,forceMount:r,children:a.jsx(Ht,{present:r||i.open,children:a.jsx(Hl,{asChild:!0,container:s,children:n})})})};L1.displayName=vg;var Qo="PopoverContent",O1=C.forwardRef((e,t)=>{const r=NM(Qo,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,i=ti(Qo,e.__scopePopover);return a.jsx(Ht,{present:n||i.open,children:i.modal?a.jsx(TM,{...s,ref:t}):a.jsx(AM,{...s,ref:t})})});O1.displayName=Qo;var PM=xM("PopoverContent.RemoveScroll"),TM=C.forwardRef((e,t)=>{const r=ti(Qo,e.__scopePopover),n=C.useRef(null),s=Be(t,n),i=C.useRef(!1);return C.useEffect(()=>{const l=n.current;if(l)return eg(l)},[]),a.jsx(_d,{as:PM,allowPinchZoom:!0,children:a.jsx(M1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,l=>{var o;l.preventDefault(),i.current||(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,l=>{const o=l.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),AM=C.forwardRef((e,t)=>{const r=ti(Qo,e.__scopePopover),n=C.useRef(!1),s=C.useRef(!1);return a.jsx(M1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,o;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(o=r.triggerRef.current)==null||o.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),M1=C.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:g,...d}=e,v=ti(Qo,r),_=Ul(r);return Jm(),a.jsx(gd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Fl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:a.jsx(qm,{"data-state":B1(v.open),role:"dialog",id:v.contentId,..._,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),I1="PopoverClose",DM=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ti(I1,r);return a.jsx(Fe.button,{type:"button",...n,ref:t,onClick:ve(e.onClick,()=>s.onOpenChange(!1))})});DM.displayName=I1;var LM="PopoverArrow",OM=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Ul(r);return a.jsx(Km,{...s,...n,ref:t})});OM.displayName=LM;function B1(e){return e?"open":"closed"}var MM=P1,IM=D1,BM=L1,F1=O1;const $1=MM,H1=IM,_g=C.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(BM,{children:a.jsx(F1,{ref:s,align:t,sideOffset:r,className:X("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})}));_g.displayName=F1.displayName;const yy=[{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 FM(e){return Br(e)===Yo?yy.filter(t=>t.name!=="claude-code-learner"):yy}const $M=new Set(["swe-rebench-v2-runtime"]),HM={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},Nu="bundled:";function Pa(e){return HM[e]??e}function fo(e){return e.startsWith(Nu)?e.slice(Nu.length):e}function zM(e){return e.source==="bundled"?`${Nu}${e.name}`:e.name}function xy(e){const t=new Set,r=[];for(const n of e){const s=fo(n);t.has(s)||(t.add(s),r.push(n))}return r}function UM(e,t,r){const n=new Set,s=[];for(const i of FM(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=$M.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=fo(i);n.has(l)||(n.add(l),s.push({name:l,version:"configured",source:i.startsWith(Nu)?"bundled":"custom",description:"Already configured"}))}return s}function WM(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function Zf({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:s,searchTestId:i,harness:l}){const[o,c]=C.useState(""),[u,g]=C.useState(!1),[d,v]=C.useState(null),_=C.useMemo(()=>UM(e,t,l),[e,t,l]),b=new Set(t.map(fo)),x=new Set(r.map(fo)),f=new Set(b);for(const N of _)N.defaultIncluded&&!x.has(N.name)&&f.add(N.name);const p=_.filter(N=>f.has(N.name)),h=p.filter(N=>N.defaultIncluded).length,m=p.length-h,y=_.filter(N=>!f.has(N.name)),w=o.trim().toLowerCase(),k=w?y.filter(N=>`${N.name} ${Pa(N.name)} ${N.source} ${N.description??""}`.toLowerCase().includes(w)):y,j=N=>{const O=N.defaultIncluded?r.filter(L=>fo(L)!==N.name):r,T=N.defaultIncluded?t:xy([...t,zM(N)]);n(T,O),g(!1),c("")},S=N=>{if(N.defaultIncluded){v(N),g(!1),c("");return}n(t.filter(O=>fo(O)!==N.name),r)},E=()=>{d&&(n(t,xy([...r,d.name])),v(null))};return a.jsxs("div",{className:"relative flex flex-col gap-2",children:[a.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(N=>a.jsxs("span",{"data-testid":`${s}-chip`,"data-plugin":N.name,className:X("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",N.defaultIncluded?"bg-sunken":"bg-transparent"),children:[a.jsxs("span",{children:[Pa(N.name),a.jsx("span",{className:"text-dim",children:N.defaultIncluded?" · default":" · selected"})]}),a.jsx(ce,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove ${Pa(N.name)}`,"data-testid":`${s}-remove`,"data-plugin":N.name,onClick:()=>S(N),className:"h-5 w-5 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:a.jsx(yu,{"aria-hidden":"true",className:"!size-3"})})]},N.name))}),d&&a.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:[a.jsxs("span",{className:"text-[12px] text-foreground",children:[Pa(d.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),a.jsxs("span",{className:"flex gap-2",children:[a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":`${s}-default-warning-cancel`,onClick:()=>v(null),children:"Keep"}),a.jsx(ce,{type:"button",variant:"destructive",size:"sm","data-testid":`${s}-default-warning-confirm`,onClick:E,children:"Remove"})]})]}),a.jsxs($1,{open:u,onOpenChange:N=>{g(N),N||c("")},children:[a.jsx(H1,{asChild:!0,children:a.jsxs(ce,{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:[a.jsxs("span",{className:"min-w-0",children:["Add plugin",a.jsxs("span",{className:"text-dim",children:[" ","· ",h," default",m>0?` · ${m} selected`:""]})]}),u?a.jsx(aw,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"}):a.jsx(Sm,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"})]})}),a.jsxs(_g,{align:"start",sideOffset:6,className:"w-[min(28rem,90vw)] overflow-hidden p-0",children:[a.jsx(ct,{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":i,value:o,onChange:N=>c(N.target.value),onKeyDown:N=>{N.key==="Escape"&&(g(!1),c(""))},placeholder:"Search plugins",className:"h-auto rounded-none border-0 border-b border-border bg-background px-3 py-2.5 text-[12px] focus-visible:ring-0"}),a.jsx(Bl,{className:"max-h-60",children:a.jsx("div",{role:"listbox","aria-label":"Plugins",className:"flex flex-col",children:k.length===0?a.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."}):k.map((N,O)=>{const T=f.has(N.name),L=N.defaultIncluded?"text-dim":N.recommended?"text-primary":"text-muted-foreground";return a.jsxs(ce,{type:"button",variant:"ghost",role:"option","aria-selected":T,"data-testid":s,"data-plugin":N.name,"data-plugin-active":T?"true":"false","data-plugin-default":N.defaultIncluded?"true":"false",onClick:()=>j(N),className:X("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",O===0?"":"border-t border-border",T?"bg-sunken text-foreground":"bg-transparent text-foreground","hover:bg-sunken focus-visible:bg-sunken"),children:[a.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[a.jsx("span",{className:"text-[13px] text-foreground",children:Pa(N.name)}),a.jsx("span",{className:"text-[11px] text-dim",children:WM(N)})]}),a.jsx("span",{className:X("self-center text-[11px] uppercase",L),children:N.defaultIncluded?"Default":N.recommended?"Recommended":"Add"})]},N.name)})})})]})]})]})}const z1="claude-code",U1="codex",VM="hermes-agent",qM={"claude-code-learner":z1,"codex-code-learner":U1};function KM(e){return qM[e]??e}const GM={"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}},YM={[z1]:{subscriptionPath:!0},[U1]:{subscriptionPath:!0},[VM]:{subscriptionPath:!1}},yg=1;function QM(e){const t=GM[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 ZM(e){if(!e)return!1;const t=KM(e),r=YM[t];return r?!r.subscriptionPath:!0}function W1(e,t,r=yg){if(!ZM(e))return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."};const n=t?QM(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 XM(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 V1(e,t,r=yg){return W1(e,t,r)}function q1({harness:e,modelId:t,thresholdUsd:r=yg,variant:n="card",testIdPrefix:s="cost-estimate"}){const i=W1(e,t,r);if(!i.showEstimate)return a.jsxs("div",{"data-testid":`${s}-subscription`,"data-cost-mode":"subscription",className:X("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:[a.jsx(pN,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),a.jsx("span",{className:"text-[12px] text-muted-foreground",children:i.suppressedReason??"Included in subscription, no per-task API cost."})]});const l=i.estimate,o=(l==null?void 0:l.usd)??null,c=i.requiresConfirmation;return a.jsxs("div",{"data-testid":`${s}-panel`,"data-cost-mode":"paid-api","data-cost-usd":o!==null?o.toFixed(4):"unknown","data-cost-high-cost":c?"true":"false",className:X("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:[a.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Estimated cost per task"}),a.jsx("span",{"data-testid":`${s}-amount`,className:X("font-mono font-medium",n==="card"?"text-[18px]":"text-[14px]",c?"text-destructive":"text-foreground"),children:o!==null?`~${XM(o)}`:"unavailable"})]}),l&&a.jsx("span",{"data-testid":`${s}-heuristic`,className:"font-mono text-[11px] text-muted-foreground",children:"Rough estimate — actual cost varies."}),o===null&&a.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&&a.jsxs("span",{"data-testid":`${s}-warning`,className:"font-mono text-[11px] text-destructive",children:["This model is above $",r.toFixed(2),"/task. You will be asked to confirm before joining."]})]})}function Ki({label:e,children:t,docHref:r,docLabel:n="Read more"}){const[s,i]=C.useState(!1);return a.jsxs($1,{open:s,onOpenChange:i,children:[a.jsx(H1,{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:a.jsx(mN,{className:"h-2.5 w-2.5","aria-hidden":"true"})}),a.jsxs(_g,{"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&&a.jsxs(a.Fragment,{children:[" ",a.jsx("a",{"data-testid":"inline-help-doc-link",href:r,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:n})]})]})]})}const JM="Self-improving agent by Nous Research. Built-in learning loop.",Gi="https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md",eI=Qm,Ta="mx-auto flex max-w-[880px] flex-col gap-4 p-6",Zi="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",yh=Zi,Yi="flex items-start gap-2",by="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 tI(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function rI(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function nI(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 ge.harnessReadiness(s)]}catch(i){if(i.code==="harness_not_found")return[s,void 0];throw i}}));return new Map(n)}}).data??new Map}}function sI({manifestCid:e,navigateTo:t}={}){var q,Z,ee;const r=bm(),[,n]=En(),s=t??n,i=ei(),l=e??r.cid,o=Oe({queryKey:["solvernets","manifest",l],queryFn:()=>ge.solvernets.getManifest(l),enabled:!!l,retry:!1}),c=Oe({queryKey:["solvernets","catalog"],queryFn:()=>ge.getSolverNets()}),u=(q=o.data)==null?void 0:q.manifest,g=u?tI(c.data,u.contract):void 0,d=((g==null?void 0:g.compatibleHarnesses)??[]).filter(J=>J.supportsRoles.includes("solving")).map(J=>({...J,name:Br(J.name)})).filter((J,A,z)=>z.findIndex(G=>G.name===J.name)===A),v=((Z=d[0])==null?void 0:Z.name)??eI,_=Co(v),[b,x]=C.useState({roles:[],harness:v,plugins:[],disabledDefaultPlugins:[],model:_}),[f,p]=C.useState(null),[h,m]=C.useState(null),[y,w]=C.useState(!1),k=C.useRef(!1),[j,S]=C.useState(!1),E=(ee=d[0])==null?void 0:ee.name;C.useEffect(()=>{k.current||E&&E!==b.harness&&x(J=>({...J,harness:E,model:Co(E)}))},[E]);const N=xd(b.harness),{readiness:O}=nI(d.map(J=>J.name)),T=O.get(b.harness),L=Kn({mutationFn:()=>ge.operator.join(l,{...(u==null?void 0:u.name)!==void 0?{name:u.name}:{},...(u==null?void 0:u.contract)!==void 0?{contract:{id:u.contract.id,version:u.contract.version}}:{},roles:b.roles,...b.roles.includes("solver")?{harness:b.harness,plugins:b.plugins,disabledDefaultPlugins:b.disabledDefaultPlugins,model:b.model}:{}}),onSuccess:J=>{i.invalidateQueries({queryKey:["operator","joined"]}),i.invalidateQueries({queryKey:["bootstrap"]}),m({manifestCid:J.manifestCid,name:J.config.name??(u==null?void 0:u.name)??J.manifestCid,roles:J.config.roles,restartRequired:J.restartRequired})},onError:J=>{p(J instanceof Error?J.message:String(J))}});if(!l)return a.jsx("main",{"data-testid":"join-flow-missing-cid",className:Ta,children:a.jsx(wy,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(o.isLoading)return a.jsx("main",{"data-testid":"join-flow-loading",className:Ta,children:a.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading manifest…"})});if(o.isError||!u){const J=o.error instanceof Error?o.error.message:"Unknown error";return a.jsx("main",{"data-testid":"join-flow-error",className:Ta,children:a.jsx(wy,{message:`Failed to load manifest: ${J}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{o.refetch()}})})}if(h)return a.jsx("main",{"data-testid":"join-flow-success",className:Ta,children:a.jsx(iI,{success:h,navigate:s})});const{openRoles:$}=u,W=J=>{$.includes(J)&&x(A=>{const G=A.roles.includes(J)?A.roles.filter(Y=>Y!==J):$.filter(Y=>Y===J||A.roles.includes(Y));return{...A,roles:G}})},U=b.roles.includes("solver"),K=b.roles.includes("evaluator"),R=V1(U?b.harness:void 0,U?b.model:void 0),P=U&&R.requiresConfirmation,D=P&&!j,M=U&&(T==null?void 0:T.ready)===!1,B=b.roles.length>0&&!L.isPending&&!D&&!M;return a.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":l,className:Ta,children:[a.jsxs("header",{className:"flex flex-col gap-1.5",children:[a.jsxs("span",{"data-testid":"join-flow-title",className:"font-mono text-[20px] font-medium text-foreground",children:["Join ",u.name]}),a.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:u.description})]}),a.jsxs(ke,{"data-testid":"join-flow-summary",className:"flex flex-col gap-3 p-4",children:[a.jsx("span",{className:Zi,children:"Manifest"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[a.jsx("span",{children:"Contract"}),a.jsxs("span",{className:"text-foreground",children:[u.contract.id," · ",u.contract.version]}),a.jsx("span",{children:"Solution price"}),a.jsx("span",{className:"text-foreground",children:Ts(u.solutionPriceWei)}),a.jsx("span",{children:"Verdict price"}),a.jsx("span",{className:"text-foreground",children:Ts(u.verdictPriceWei)}),a.jsx("span",{children:"Open roles"}),a.jsx("span",{"data-testid":"join-flow-open-roles",className:"text-foreground",children:$.join(", ")||"none"}),a.jsx("span",{children:"Launcher"}),a.jsxs("span",{className:"text-foreground",children:[rI(u.launcher.safeAddress)," · agentId"," ",u.launcher.agentId]}),a.jsx("span",{children:"Manifest CID"}),a.jsx("span",{"data-testid":"join-flow-manifest-cid",className:"truncate text-[var(--fg-dim)]",children:l})]})]}),a.jsxs(ke,{className:"flex flex-col gap-3 p-4",children:[a.jsxs("span",{className:Yi,children:[a.jsx("span",{className:Zi,children:"Roles"}),a.jsxs(Ki,{label:"Roles help",docHref:`${Gi}#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.",`
|
|
237
|
+
|
|
238
|
+
`,"Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.",`
|
|
239
|
+
|
|
240
|
+
`,"You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for."]})]}),a.jsx("div",{className:"flex overflow-hidden rounded-md border border-border",children:$.map((J,A)=>{const z=b.roles.includes(J),G=`join-role-${J}`;return a.jsxs("label",{htmlFor:G,"data-testid":"join-role-option","data-role":J,"data-role-active":z?"true":"false",className:X("flex flex-1 cursor-pointer flex-col gap-1.5 p-3 font-mono",z?"bg-[var(--bg)] text-foreground":"bg-transparent text-[var(--fg-muted)]",A<$.length-1&&"border-r border-border"),children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("input",{id:G,type:"checkbox",checked:z,onChange:()=>W(J),"aria-label":J==="solver"?"Solver":"Evaluator",className:"size-3.5 accent-primary"}),a.jsx("span",{className:"text-[14px] font-medium",children:J==="solver"?"Solver":"Evaluator"})]}),a.jsx("span",{className:X("pl-[22px] text-[11px]",z?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]"),children:J==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},J)})})]}),U&&a.jsxs(ke,{"data-testid":"join-flow-solver-fields",className:"flex flex-col gap-3 p-4",children:[a.jsx("span",{className:Zi,children:"Solver configuration"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs("span",{className:Yi,children:[a.jsx(yr,{htmlFor:"join-harness-select",className:yh,children:"Harness"}),a.jsxs(Ki,{label:"Harness help",docHref:`${Gi}#harness-and-model`,children:["The harness is the runtime that runs a task.",`
|
|
241
|
+
|
|
242
|
+
`,"You only need credentials for one harness — the harness, not the harness and the model separately.",`
|
|
243
|
+
|
|
244
|
+
`,"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.",`
|
|
245
|
+
|
|
246
|
+
`,"The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two."]})]}),a.jsxs("select",{id:"join-harness-select","aria-label":"Harness","data-testid":"join-harness-select",value:b.harness,onChange:J=>{const A=J.target.value;k.current=!0,x({...b,harness:A,model:Co(A)}),S(!1)},className:by,children:[d.map(J=>{const A=O.get(J.name),z=(A==null?void 0:A.ready)===!1;return a.jsxs("option",{value:J.name,disabled:z,"data-testid":"join-harness-option","data-harness":J.name,"data-harness-ready":A===void 0?"unknown":A.ready?"true":"false",children:[CS(J.name,J.version),z?" — setup required":""]},J.name)}),(!g||d.length===0)&&a.jsx("option",{value:b.harness,children:Ci(b.harness)})]}),b.harness===Yo&&a.jsx("span",{"data-testid":"join-harness-hermes-description",className:"font-mono text-[11px] text-[var(--fg-muted)]",children:JM}),(T==null?void 0:T.ready)===!1&&a.jsxs("div",{"data-testid":"join-harness-not-ready","data-harness":b.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:[a.jsxs("span",{className:"text-destructive",children:[Ci(b.harness)," is not ready",T.reason?`: ${T.reason}`:""]}),T.nextStep&&a.jsxs("span",{"data-testid":"join-harness-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[T.nextStep.description,T.nextStep.cli?` (${T.nextStep.cli})`:""]})]})]}),a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs("span",{className:Yi,children:[a.jsx(yr,{htmlFor:"join-model-select",className:yh,children:"Model"}),a.jsxs(Ki,{label:"Model help",docHref:`${Gi}#harness-and-model`,children:["The model is the LLM the harness runs.",`
|
|
247
|
+
|
|
248
|
+
`,"This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.",`
|
|
249
|
+
|
|
250
|
+
`,"You pay for the model through the harness's credentials. There is no extra model subscription on top.",`
|
|
251
|
+
|
|
252
|
+
`,"Check the cost estimate below before you join."]})]}),a.jsxs("select",{id:"join-model-select","aria-label":"Model","data-testid":"join-model-select",value:b.model,onChange:J=>{x({...b,model:J.target.value}),S(!1)},className:by,children:[N.map(J=>a.jsx("option",{value:J.id,children:J.label},J.id)),(()=>{const J=gg(b.model,b.harness);return J.isCustom?a.jsx("option",{value:b.model,children:J.label},b.model):null})()]})]})]}),a.jsx(q1,{harness:b.harness,modelId:b.model,testIdPrefix:"join-flow-cost"}),P&&a.jsxs("label",{"data-testid":"join-flow-cost-confirmation","data-cost-confirmation-checked":j?"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:[a.jsx("input",{type:"checkbox","data-testid":"join-flow-cost-confirmation-checkbox",checked:j,onChange:J=>S(J.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"}),a.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."})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs("span",{className:Yi,children:[a.jsx("span",{className:yh,children:"Plugins"}),a.jsxs(Ki,{label:"Plugins help",docHref:`${Gi}#plug-ins`,children:["Plug-ins are optional. On your first run you do not need to touch this section.",`
|
|
253
|
+
|
|
254
|
+
`,"A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.",`
|
|
255
|
+
|
|
256
|
+
`,"This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.",`
|
|
257
|
+
|
|
258
|
+
`,"You can re-join later with more plug-ins."]})]}),a.jsx(Zf,{available:(g==null?void 0:g.compatiblePlugins)??[],selected:b.plugins,disabledDefaultPlugins:b.disabledDefaultPlugins,onChange:(J,A)=>x({...b,plugins:J,disabledDefaultPlugins:A}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search",harness:b.harness})]})]}),K&&!U&&a.jsxs(ke,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[a.jsxs("span",{className:Yi,children:[a.jsx("span",{className:Zi,children:"Evaluator configuration"}),a.jsxs(Ki,{label:"Evaluator configuration help",docHref:`${Gi}#why-the-evaluator-role-has-no-model-selector`,children:["The evaluator role has no harness or model picker. That is by design.",`
|
|
259
|
+
|
|
260
|
+
`,"Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.",`
|
|
261
|
+
|
|
262
|
+
`,"For many SolverNets that function is deterministic and uses no model at all."]})]}),a.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["The evaluator harness is bound to"," ",a.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]})]}),K&&U&&a.jsxs(ke,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[a.jsxs("span",{className:Yi,children:[a.jsx("span",{className:Zi,children:"Evaluator binding"}),a.jsxs(Ki,{label:"Evaluator binding help",docHref:`${Gi}#why-the-evaluator-role-has-no-model-selector`,children:["The SolverNet's manifest sets the evaluator harness for you.",`
|
|
263
|
+
|
|
264
|
+
`,"Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.",`
|
|
265
|
+
|
|
266
|
+
`,"The harness and model fields above apply only to the solver role."]})]}),a.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Evaluator harness is bound to"," ",a.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]})]}),y&&a.jsx(vM,{onSuccess:()=>{w(!1),L.mutate()},onCancel:()=>{w(!1)}}),f&&a.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",className:"m-0 font-mono text-[13px] text-destructive",children:f}),a.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[a.jsx(ce,{type:"button",variant:"secondary","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),children:"Cancel"}),a.jsx(ce,{type:"button",variant:"default","data-testid":"join-flow-submit",disabled:!B,onClick:()=>{if(p(null),b.roles.includes("solver")&&b.harness===Yo){w(!0);return}L.mutate()},children:L.isPending?"Joining…":"Join SolverNet"})]})]})}function wy({message:e,onBack:t,onRetry:r}){return a.jsxs(ut,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[a.jsx(mt,{className:"font-mono text-[13px] text-destructive",children:e}),a.jsxs("div",{className:"flex gap-2",children:[r&&a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-retry",onClick:r,children:"Retry"}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-back",onClick:t,children:"Back"})]})]})}function iI({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),o=async()=>{s(!0),l(null);try{if(!(await ge.restartDaemon()).ok)throw new Error("Restart request failed.");t("/overview")}catch(c){l(c instanceof Error?c.message:"Restart request failed."),s(!1)}};return a.jsxs(a.Fragment,{children:[a.jsxs(ke,{"data-testid":"join-flow-success-card",role:"status",className:"flex flex-col gap-2.5 border-[var(--vow-green)] p-5",children:[a.jsx(Pe,{variant:"success",className:"self-start",children:"Joined"}),a.jsxs("span",{"data-testid":"join-flow-success-name",className:"font-mono text-[18px] font-medium text-foreground",children:["You joined ",e.name]}),a.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&&a.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&&a.jsx(or,{role:"alert","data-testid":"join-flow-success-restart-error",className:"font-mono text-[12px] leading-relaxed text-destructive",children:i}),a.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[a.jsx(ce,{type:"button",variant:"secondary","data-testid":"join-flow-success-browse",onClick:()=>t("/operator#solvernets"),children:"Browse SolverNets"}),a.jsx(ce,{type:"button",variant:"secondary","data-testid":"join-flow-success-view",onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),children:"View joined SolverNet"}),a.jsx(ce,{type:"button",variant:"default","data-testid":"join-flow-success-restart-button",onClick:()=>{o()},disabled:n,children:n?"Restarting…":"Restart node now"})]})]})}function oI({capture:e}){var t;return a.jsxs("section",{className:"flex flex-col gap-2",children:[a.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Executor"}),a.jsxs("dl",{className:"m-0 grid gap-x-3 gap-y-1.5 [grid-template-columns:120px_minmax(0,1fr)]",children:[a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Tool"}),a.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.name}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Version"}),a.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.version??"unknown"}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Repo"}),a.jsx("dd",{className:"m-0 break-words font-mono text-[12px] text-foreground",children:e.repoRemoteUrl??"none"}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Commit"}),a.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function aI({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return a.jsxs("section",{className:"flex flex-col gap-2",children:[a.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Redactions"}),t.length===0?a.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No redacted attributes."}):a.jsx("div",{className:"flex flex-col gap-1.5",children:t.map((r,n)=>a.jsxs("div",{className:"grid gap-3 font-mono text-[12px] text-foreground [grid-template-columns:minmax(120px,180px)_minmax(0,1fr)]",children:[a.jsx("span",{className:"text-muted-foreground",children:r.span}),a.jsx("span",{className:"break-words",children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function lI({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:s,onTrustRepo:i}){const{capture:l,spans:o}=e;return a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsxs("header",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:l.sessionId}),a.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[new Date(l.capturedAt).toLocaleString()," · ",o.length," spans"]})]}),a.jsxs("div",{className:"flex shrink-0 items-start gap-2",children:[l.repoRemoteUrl?a.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>i(!0),children:"Trust repo"}):null,a.jsx(ce,{variant:"secondary",size:"sm",disabled:r,onClick:s,children:r?"Skipping":"Skip"}),a.jsx(ce,{variant:"default",size:"sm",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),a.jsx(oI,{capture:l}),a.jsx(aI,{spans:o}),a.jsxs("section",{className:"flex flex-col gap-2",children:[a.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Trajectory"}),o.length===0?a.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No spans recorded."}):a.jsx(ke,{children:a.jsx(et,{className:"flex flex-col p-0",children:o.map((c,u)=>a.jsxs("div",{children:[u>0&&a.jsx(pt,{}),a.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5",children:[a.jsx("strong",{className:"min-w-0 truncate font-mono text-[12px] font-medium text-foreground",children:c.name}),a.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:c.spanId})]})]},c.spanId))})})]})]})}function cI(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 wd="Switch",[uI]=un(wd),[dI,hI]=uI(wd),K1=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:l,disabled:o,value:c="on",onCheckedChange:u,form:g,...d}=e,[v,_]=C.useState(null),b=Be(t,m=>_(m)),x=C.useRef(!1),f=v?g||!!v.closest("form"):!0,[p,h]=ua({prop:s,defaultProp:i??!1,onChange:u,caller:wd});return a.jsxs(dI,{scope:r,checked:p,disabled:o,children:[a.jsx(Fe.button,{type:"button",role:"switch","aria-checked":p,"aria-required":l,"data-state":Z1(p),"data-disabled":o?"":void 0,disabled:o,value:c,...d,ref:b,onClick:ve(e.onClick,m=>{h(y=>!y),f&&(x.current=m.isPropagationStopped(),x.current||m.stopPropagation())})}),f&&a.jsx(Q1,{control:v,bubbles:!x.current,name:n,value:c,checked:p,required:l,disabled:o,form:g,style:{transform:"translateX(-100%)"}})]})});K1.displayName=wd;var G1="SwitchThumb",Y1=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=hI(G1,r);return a.jsx(Fe.span,{"data-state":Z1(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Y1.displayName=G1;var fI="SwitchBubbleInput",Q1=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const l=C.useRef(null),o=Be(l,i),c=cI(r),u=nS(t);return C.useEffect(()=>{const g=l.current;if(!g)return;const d=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&_){const b=new Event("click",{bubbles:n});_.call(g,r),g.dispatchEvent(b)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Q1.displayName=fI;function Z1(e){return e?"checked":"unchecked"}var X1=K1,pI=Y1;const J1=C.forwardRef(({className:e,...t},r)=>a.jsx(X1,{className:X("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:a.jsx(pI,{className:X("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")})}));J1.displayName=X1.displayName;const Lr=C.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:X("animate-pulse rounded-md bg-muted",e),...t}));Lr.displayName="Skeleton";function Xf(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function mI(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(Xf(e.perArtifactTypePrice))===JSON.stringify(Xf(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function Sy({label:e,value:t,meta:r}){return a.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:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:e}),a.jsx("strong",{className:"font-mono text-[18px] font-medium text-foreground",children:t}),a.jsx("span",{className:"truncate font-mono text-[12px] text-[var(--fg-dim)]",children:r})]})}function gI({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,onSave:s,registerRevert:i}){const[l,o]=C.useState(e.donation.enabled),[c,u]=C.useState(!1),g=C.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:l}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,l]),d=!mI(e,g),v=b=>{if(b&&!l&&!e.donation.enabled){u(!0);return}o(b)},_=()=>{const b={...g,donation:{enabled:!0}};o(!0),u(!1),i(()=>o(!1)),s(b)};return a.jsxs("div",{"data-testid":"operator-donation-status",className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex min-w-[260px] flex-[1_1_360px] flex-col gap-2",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Donate execution data"}),a.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"}),a.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."})]}),a.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:[a.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"}),a.jsx(J1,{"aria-label":"Donate produced data",checked:l,onCheckedChange:v})]})]}),a.jsxs("div",{"data-testid":"operator-donation-facts",className:"grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(150px,1fr))]",children:[a.jsx(Sy,{label:"Eligible runs",value:String(t),meta:"local history"}),a.jsx(Sy,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),a.jsx(ut,{variant:"info","data-testid":"operator-donation-caveat",children:a.jsx(mt,{children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."})}),a.jsx(pt,{}),a.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{"data-testid":"operator-donation-settings-state",className:d?"font-mono text-[12px] text-primary":"font-mono text-[12px] text-[var(--fg-dim)]",children:d?"Donation changed":"Current"}),a.jsx(ce,{variant:"default",size:"sm",type:"button",disabled:!d||n,onClick:()=>{const b=e.donation.enabled;l!==b&&i(()=>o(b)),s(g)},children:n?"Saving…":"Save"})]})}),a.jsx(C1,{open:c,onOpenChange:u,children:a.jsxs(cg,{"data-testid":"operator-donation-confirm",children:[a.jsxs(ug,{children:[a.jsx(hg,{children:"Share future execution data"}),a.jsx(fg,{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."})]}),a.jsxs(dg,{children:[a.jsx(mg,{children:"Cancel"}),a.jsx(pg,{onClick:_,children:"Enable donation"})]})]})})]})}function vI({onRestartPending:e=()=>{}}){const t=ei(),{data:r,isLoading:n,isError:s,error:i,refetch:l}=Oe({queryKey:["operator-artifacts","served"],queryFn:()=>ge.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),o=C.useRef(null),c=v=>{o.current=v},u=Kn({mutationFn:v=>ge.operator.updatePricing(v),onSuccess:async()=>{o.current=null,Gs.success("Donation setting saved",{description:"Restart pending — applies on next daemon start."}),e(),await t.invalidateQueries({queryKey:["operator-artifacts"]})},onError:v=>{const _=o.current;o.current=null,_==null||_(),Gs.error("Failed to save donation setting",{description:v instanceof Error?v.message:String(v)})}}),g=r==null?void 0:r.summary,d=g?`${g.served.totalCount} eligible runs · donation ${r!=null&&r.pricing.donation.enabled?"on":"off"} · ${g.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return a.jsxs(ke,{children:[a.jsxs(Rn,{className:"flex flex-row items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs(oa,{className:"flex items-center gap-2",children:[a.jsx(wN,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Data donation"]}),a.jsx(od,{children:d})]}),a.jsx(Pe,{variant:r!=null&&r.pricing.donation.enabled?"success":"outline",children:r!=null&&r.pricing.donation.enabled?"IPFS donation on":"Donation off"})]}),a.jsxs(et,{children:[n&&a.jsxs("div",{"data-testid":"operator-data-market-loading",className:"flex flex-col gap-3","aria-label":"Loading execution data",children:[a.jsx(Lr,{className:"h-6 w-40"}),a.jsx(Lr,{className:"h-4 w-72"}),a.jsx(Lr,{className:"h-20 w-full"})]}),s&&a.jsxs(ut,{variant:"blocking",role:"alert","data-testid":"operator-data-market-error",className:"flex items-center justify-between gap-3",children:[a.jsx(or,{className:"text-[var(--break-red)]",children:i instanceof Error?i.message:"Failed to load execution data."}),a.jsxs(ce,{variant:"outline",size:"sm",type:"button",onClick:()=>{l()},children:[a.jsx(bN,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]})]}),r&&a.jsx(gI,{pricing:r.pricing,eligibleRuns:r.summary.served.totalCount,peerDatasetsUsed:r.summary.network.totalCount,saving:u.isPending,onSave:v=>u.mutate(v),registerRevert:c},`${r.pricing.publicEndpoint}|${r.pricing.defaultPriceUsdc}|${r.pricing.donation.enabled}|${JSON.stringify(Xf(r.pricing.perArtifactTypePrice))}`)]})]})}const _I=s1,yI=i1,eC=C.forwardRef(({className:e,...t},r)=>a.jsx(sg,{className:X("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}));eC.displayName=sg.displayName;const xI=id("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"}}),tC=C.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(yI,{children:[a.jsx(eC,{}),a.jsxs(ig,{ref:s,className:X(xI({side:e}),t),...n,children:[r,a.jsxs(lg,{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:[a.jsx(yu,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));tC.displayName=ig.displayName;const rC=({className:e,...t})=>a.jsx("div",{className:X("flex flex-col gap-2 text-left",e),...t});rC.displayName="SheetHeader";const nC=C.forwardRef(({className:e,...t},r)=>a.jsx(og,{ref:r,className:X("font-serif text-[20px] text-foreground",e),...t}));nC.displayName=og.displayName;const sC=C.forwardRef(({className:e,...t},r)=>a.jsx(ag,{ref:r,className:X("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));sC.displayName=ag.displayName;function xg(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 Jf(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function bI(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function Pu(e){return e.source==="served"?e.createdAt:e.fetchedAt}function Tu(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function Cy(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 ep(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function xh(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(ep(e))}function ky({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 a.jsx(ut,{variant:e==="permission"?"warning":"blocking","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",children:a.jsx(mt,{children:r})})}function wI(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 SI(e){const t=Tu(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"} · ${xg(e.contentSize)} · ${bI(e.sha256)}`,at:Pu(e)}}function CI({artifact:e}){const t=Pu(e);return a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsx("header",{className:"flex items-start justify-between gap-4",children:a.jsxs("div",{className:"min-w-0",children:[a.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:e.artifactType}),a.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[Tu(e)," · ",xg(e.contentSize)," · ",Jf(t)]})]})}),a.jsx(ke,{children:a.jsx(et,{className:"p-4",children:a.jsxs("dl",{className:"m-0 grid gap-x-3.5 gap-y-2.5 [grid-template-columns:140px_minmax(0,1fr)]",children:[a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"type"}),a.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.artifactType}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"state"}),a.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:Tu(e)}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"sha256"}),a.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.sha256}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"envelope"}),a.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.envelopeCid??"—"}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"recorded"}),a.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:Jf(t)}),e.source==="served"?a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"request"}),a.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.requestId??"—"}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"accesses"}),a.jsxs("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:[e.access.accessCount," total · ",e.access.failedPaymentCount," failed"]})]}):a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"operator"}),a.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.sourceOperator??"—"}),a.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"source"}),a.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:e.sourceEndpoint??"—"})]})]})})})]})}function kI(){var S,E,N,O;const e=ei(),[t,r]=C.useState(),[n,s]=C.useState(!1),i=Oe({queryKey:["captures","pending"],queryFn:()=>ge.captures.listPending(),refetchInterval:2500}),l=Oe({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>ge.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),o=Oe({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>ge.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),c=((S=i.data)==null?void 0:S.captures)??[],u=[...((E=l.data)==null?void 0:E.artifacts)??[],...((N=o.data)==null?void 0:N.artifacts)??[]].sort((T,L)=>Pu(L).localeCompare(Pu(T))),g=[...c.map(wI),...u.map(SI)].sort((T,L)=>L.at.localeCompare(T.at)),d=(t==null?void 0:t.kind)==="capture"?t.id:void 0,v=(t==null?void 0:t.kind)==="artifact"?u.find(T=>T.source===t.source&&T.sha256===t.sha256):void 0,_=i.isLoading||l.isLoading||o.isLoading,b=[i.isError?i.error:i.failureReason,l.isError?l.error:l.failureReason,o.isError?o.error:o.failureReason].filter(Boolean),x=b.find(xh),f=x??b[0];C.useEffect(()=>{if(g.length===0){t&&r(void 0),n&&s(!1);return}(!t||!g.some(T=>Cy(t,T.selection)))&&r(g[0].selection)},[g,t,n]);const p=Oe({queryKey:["captures",d],queryFn:()=>ge.captures.get(d),enabled:!!d}),h=Kn({mutationFn:T=>ge.captures.approve(T),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),m=Kn({mutationFn:T=>ge.captures.skip(T),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),y=Kn({mutationFn:T=>ge.captures.trustRepo(T,!0)}),w=T=>{r(T),s(!0)},k=(t==null?void 0:t.kind)==="capture"?((O=p.data)==null?void 0:O.capture.sessionId)??"Capture":(v==null?void 0:v.artifactType)??"Artifact",j=(t==null?void 0:t.kind)==="capture"&&p.data?`${new Date(p.data.capture.capturedAt).toLocaleString()} · ${p.data.spans.length} spans`:(t==null?void 0:t.kind)==="artifact"&&v?`${Tu(v)} · ${xg(v.contentSize)}`:"Execution data detail.";return a.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[a.jsx(vI,{defaultExpanded:!0}),a.jsxs(ke,{children:[a.jsx(Rn,{children:a.jsx(oa,{children:"Execution data"})}),a.jsxs(et,{children:[f?a.jsx("div",{className:"mb-3",children:a.jsx(ky,{kind:x?"permission":"error",message:x?void 0:ep(f)})}):null,_&&g.length===0?a.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"Loading execution data."}):g.length===0?a.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"No execution data yet."}):a.jsx(Bl,{className:"max-h-[560px]",children:a.jsx("div",{className:"flex flex-col gap-2 pr-2",children:g.map(T=>{const L=Cy(t,T.selection);return a.jsxs(ce,{variant:"ghost","data-testid":"execution-data-row","data-state":L?"active":void 0,"aria-current":L?"true":void 0,onClick:()=>w(T.selection),className:X("flex h-auto w-full flex-col items-stretch gap-1.5 rounded-md border border-border bg-card px-4 py-3 text-left font-mono text-[12px] normal-case tracking-normal hover:bg-accent",L&&"border-primary bg-primary/[0.06]"),children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("strong",{className:"min-w-0 truncate font-medium text-foreground",children:T.title}),a.jsx(Pe,{variant:"outline",className:"shrink-0",children:T.state})]}),a.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[T.meta," · ",Jf(T.at)]})]},T.id)})})})]})]}),a.jsx(_I,{open:n,onOpenChange:s,children:a.jsxs(tC,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl","data-testid":"execution-data-sheet",children:[a.jsxs(rC,{children:[a.jsx(nC,{className:"break-all",children:k}),a.jsx(sC,{children:j})]}),a.jsx("div",{className:"mt-4",children:p.error?a.jsx(ky,{kind:xh(p.error)?"permission":"error",message:xh(p.error)?void 0:ep(p.error)}):(t==null?void 0:t.kind)==="capture"&&p.data?a.jsx(lI,{detail:p.data,approving:h.isPending,skipping:m.isPending,onApprove:()=>d&&h.mutate(d),onSkip:()=>d&&m.mutate(d),onTrustRepo:()=>{const T=p.data.capture.repoRemoteUrl;T&&y.mutate(T)}}):(t==null?void 0:t.kind)==="artifact"&&v?a.jsx(CI,{artifact:v}):a.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:_?"Loading execution data.":"Select execution data."})})]})})]})}function Ey(e){const t=EI(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,o=C.Children.toArray(i),c=o.find(RI);if(c){const u=c.props.children,g=o.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return a.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function EI(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=PI(s),o=NI(i,s.props);return s.type!==C.Fragment&&(o.ref=n?ss(n,l):l),C.cloneElement(s,o)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jI=Symbol("radix.slottable");function RI(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jI}function NI(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function PI(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 iC(e){const t=e+"CollectionProvider",[r,n]=un(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:f,children:p}=x,h=Q.useRef(null),m=Q.useRef(new Map).current;return a.jsx(s,{scope:f,itemMap:m,collectionRef:h,children:p})};l.displayName=t;const o=e+"CollectionSlot",c=Ey(o),u=Q.forwardRef((x,f)=>{const{scope:p,children:h}=x,m=i(o,p),y=Be(f,m.collectionRef);return a.jsx(c,{ref:y,children:h})});u.displayName=o;const g=e+"CollectionItemSlot",d="data-radix-collection-item",v=Ey(g),_=Q.forwardRef((x,f)=>{const{scope:p,children:h,...m}=x,y=Q.useRef(null),w=Be(f,y),k=i(g,p);return Q.useEffect(()=>(k.itemMap.set(y,{ref:y,...m}),()=>void k.itemMap.delete(y))),a.jsx(v,{[d]:"",ref:w,children:h})});_.displayName=g;function b(x){const f=i(e+"CollectionConsumer",x);return Q.useCallback(()=>{const h=f.collectionRef.current;if(!h)return[];const m=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(f.itemMap.values()).sort((k,j)=>m.indexOf(k.ref.current)-m.indexOf(j.ref.current))},[f.collectionRef,f.itemMap])}return[{Provider:l,Slot:u,ItemSlot:_},b,n]}var bh="rovingFocusGroup.onEntryFocus",TI={bubbles:!1,cancelable:!0},Wl="RovingFocusGroup",[tp,oC,AI]=iC(Wl),[DI,aC]=un(Wl,[AI]),[LI,OI]=DI(Wl),lC=C.forwardRef((e,t)=>a.jsx(tp.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(tp.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(MI,{...e,ref:t})})}));lC.displayName=Wl;var MI=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:g=!1,...d}=e,v=C.useRef(null),_=Be(t,v),b=Rm(i),[x,f]=ua({prop:l,defaultProp:o??null,onChange:c,caller:Wl}),[p,h]=C.useState(!1),m=Bt(u),y=oC(r),w=C.useRef(!1),[k,j]=C.useState(0);return C.useEffect(()=>{const S=v.current;if(S)return S.addEventListener(bh,m),()=>S.removeEventListener(bh,m)},[m]),a.jsx(LI,{scope:r,orientation:n,dir:b,loop:s,currentTabStopId:x,onItemFocus:C.useCallback(S=>f(S),[f]),onItemShiftTab:C.useCallback(()=>h(!0),[]),onFocusableItemAdd:C.useCallback(()=>j(S=>S+1),[]),onFocusableItemRemove:C.useCallback(()=>j(S=>S-1),[]),children:a.jsx(Fe.div,{tabIndex:p||k===0?-1:0,"data-orientation":n,...d,ref:_,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{w.current=!0}),onFocus:ve(e.onFocus,S=>{const E=!w.current;if(S.target===S.currentTarget&&E&&!p){const N=new CustomEvent(bh,TI);if(S.currentTarget.dispatchEvent(N),!N.defaultPrevented){const O=y().filter(U=>U.focusable),T=O.find(U=>U.active),L=O.find(U=>U.id===x),W=[T,L,...O].filter(Boolean).map(U=>U.ref.current);dC(W,g)}}w.current=!1}),onBlur:ve(e.onBlur,()=>h(!1))})})}),cC="RovingFocusGroupItem",uC=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:l,...o}=e,c=zs(),u=i||c,g=OI(cC,r),d=g.currentTabStopId===u,v=oC(r),{onFocusableItemAdd:_,onFocusableItemRemove:b,currentTabStopId:x}=g;return C.useEffect(()=>{if(n)return _(),()=>b()},[n,_,b]),a.jsx(tp.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:a.jsx(Fe.span,{tabIndex:d?0:-1,"data-orientation":g.orientation,...o,ref:t,onMouseDown:ve(e.onMouseDown,f=>{n?g.onItemFocus(u):f.preventDefault()}),onFocus:ve(e.onFocus,()=>g.onItemFocus(u)),onKeyDown:ve(e.onKeyDown,f=>{if(f.key==="Tab"&&f.shiftKey){g.onItemShiftTab();return}if(f.target!==f.currentTarget)return;const p=FI(f,g.orientation,g.dir);if(p!==void 0){if(f.metaKey||f.ctrlKey||f.altKey||f.shiftKey)return;f.preventDefault();let m=v().filter(y=>y.focusable).map(y=>y.ref.current);if(p==="last")m.reverse();else if(p==="prev"||p==="next"){p==="prev"&&m.reverse();const y=m.indexOf(f.currentTarget);m=g.loop?$I(m,y+1):m.slice(y+1)}setTimeout(()=>dC(m))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:x!=null}):l})})});uC.displayName=cC;var II={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function BI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function FI(e,t,r){const n=BI(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return II[n]}function dC(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function $I(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var HI=lC,zI=uC;function UI(e){const t=WI(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,o=C.Children.toArray(i),c=o.find(qI);if(c){const u=c.props.children,g=o.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return a.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,g):null})}return a.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function WI(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=GI(s),o=KI(i,s.props);return s.type!==C.Fragment&&(o.ref=n?ss(n,l):l),C.cloneElement(s,o)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var VI=Symbol("radix.slottable");function qI(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===VI}function KI(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function GI(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 rp=["Enter"," "],YI=["ArrowDown","PageUp","Home"],hC=["ArrowUp","PageDown","End"],QI=[...YI,...hC],ZI={ltr:[...rp,"ArrowRight"],rtl:[...rp,"ArrowLeft"]},XI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vl="Menu",[wl,JI,e3]=iC(Vl),[Fi,fC]=un(Vl,[e3,ca,aC]),Sd=ca(),pC=aC(),[t3,$i]=Fi(Vl),[r3,ql]=Fi(Vl),mC=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:l=!0}=e,o=Sd(t),[c,u]=C.useState(null),g=C.useRef(!1),d=Bt(i),v=Rm(s);return C.useEffect(()=>{const _=()=>{g.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>g.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),a.jsx(Vm,{...o,children:a.jsx(t3,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:a.jsx(r3,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:g,dir:v,modal:l,children:n})})})};mC.displayName=Vl;var n3="MenuAnchor",bg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Sd(r);return a.jsx(fd,{...s,...n,ref:t})});bg.displayName=n3;var wg="MenuPortal",[s3,gC]=Fi(wg,{forceMount:void 0}),vC=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=$i(wg,t);return a.jsx(s3,{scope:t,forceMount:r,children:a.jsx(Ht,{present:r||i.open,children:a.jsx(Hl,{asChild:!0,container:s,children:n})})})};vC.displayName=wg;var Or="MenuContent",[i3,Sg]=Fi(Or),_C=C.forwardRef((e,t)=>{const r=gC(Or,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=$i(Or,e.__scopeMenu),l=ql(Or,e.__scopeMenu);return a.jsx(wl.Provider,{scope:e.__scopeMenu,children:a.jsx(Ht,{present:n||i.open,children:a.jsx(wl.Slot,{scope:e.__scopeMenu,children:l.modal?a.jsx(o3,{...s,ref:t}):a.jsx(a3,{...s,ref:t})})})})}),o3=C.forwardRef((e,t)=>{const r=$i(Or,e.__scopeMenu),n=C.useRef(null),s=Be(t,n);return C.useEffect(()=>{const i=n.current;if(i)return eg(i)},[]),a.jsx(Cg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),a3=C.forwardRef((e,t)=>{const r=$i(Or,e.__scopeMenu);return a.jsx(Cg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),l3=UI("MenuContent.ScrollLock"),Cg=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:v,onDismiss:_,disableOutsideScroll:b,...x}=e,f=$i(Or,r),p=ql(Or,r),h=Sd(r),m=pC(r),y=JI(r),[w,k]=C.useState(null),j=C.useRef(null),S=Be(t,j,f.onContentChange),E=C.useRef(0),N=C.useRef(""),O=C.useRef(0),T=C.useRef(null),L=C.useRef("right"),$=C.useRef(0),W=b?_d:C.Fragment,U=b?{as:l3,allowPinchZoom:!0}:void 0,K=P=>{var A,z;const D=N.current+P,M=y().filter(G=>!G.disabled),B=document.activeElement,q=(A=M.find(G=>G.ref.current===B))==null?void 0:A.textValue,Z=M.map(G=>G.textValue),ee=x3(Z,D,q),J=(z=M.find(G=>G.textValue===ee))==null?void 0:z.ref.current;(function G(Y){N.current=Y,window.clearTimeout(E.current),Y!==""&&(E.current=window.setTimeout(()=>G(""),1e3))})(D),J&&setTimeout(()=>J.focus())};C.useEffect(()=>()=>window.clearTimeout(E.current),[]),Jm();const R=C.useCallback(P=>{var M,B;return L.current===((M=T.current)==null?void 0:M.side)&&w3(P,(B=T.current)==null?void 0:B.area)},[]);return a.jsx(i3,{scope:r,searchRef:N,onItemEnter:C.useCallback(P=>{R(P)&&P.preventDefault()},[R]),onItemLeave:C.useCallback(P=>{var D;R(P)||((D=j.current)==null||D.focus(),k(null))},[R]),onTriggerLeave:C.useCallback(P=>{R(P)&&P.preventDefault()},[R]),pointerGraceTimerRef:O,onPointerGraceIntentChange:C.useCallback(P=>{T.current=P},[]),children:a.jsx(W,{...U,children:a.jsx(gd,{asChild:!0,trapped:s,onMountAutoFocus:ve(i,P=>{var D;P.preventDefault(),(D=j.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:a.jsx(Fl,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:g,onFocusOutside:d,onInteractOutside:v,onDismiss:_,children:a.jsx(HI,{asChild:!0,...m,dir:p.dir,orientation:"vertical",loop:n,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:ve(c,P=>{p.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(qm,{role:"menu","aria-orientation":"vertical","data-state":LC(f.open),"data-radix-menu-content":"",dir:p.dir,...h,...x,ref:S,style:{outline:"none",...x.style},onKeyDown:ve(x.onKeyDown,P=>{const M=P.target.closest("[data-radix-menu-content]")===P.currentTarget,B=P.ctrlKey||P.altKey||P.metaKey,q=P.key.length===1;M&&(P.key==="Tab"&&P.preventDefault(),!B&&q&&K(P.key));const Z=j.current;if(P.target!==Z||!QI.includes(P.key))return;P.preventDefault();const J=y().filter(A=>!A.disabled).map(A=>A.ref.current);hC.includes(P.key)&&J.reverse(),_3(J)}),onBlur:ve(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(E.current),N.current="")}),onPointerMove:ve(e.onPointerMove,Sl(P=>{const D=P.target,M=$.current!==P.clientX;if(P.currentTarget.contains(D)&&M){const B=P.clientX>$.current?"right":"left";L.current=B,$.current=P.clientX}}))})})})})})})});_C.displayName=Or;var c3="MenuGroup",kg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Fe.div,{role:"group",...n,ref:t})});kg.displayName=c3;var u3="MenuLabel",yC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Fe.div,{...n,ref:t})});yC.displayName=u3;var Au="MenuItem",jy="menu.itemSelect",Cd=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=C.useRef(null),l=ql(Au,e.__scopeMenu),o=Sg(Au,e.__scopeMenu),c=Be(t,i),u=C.useRef(!1),g=()=>{const d=i.current;if(!r&&d){const v=new CustomEvent(jy,{bubbles:!0,cancelable:!0});d.addEventListener(jy,_=>n==null?void 0:n(_),{once:!0}),vw(d,v),v.defaultPrevented?u.current=!1:l.onClose()}};return a.jsx(xC,{...s,ref:c,disabled:r,onClick:ve(e.onClick,g),onPointerDown:d=>{var v;(v=e.onPointerDown)==null||v.call(e,d),u.current=!0},onPointerUp:ve(e.onPointerUp,d=>{var v;u.current||(v=d.currentTarget)==null||v.click()}),onKeyDown:ve(e.onKeyDown,d=>{const v=o.searchRef.current!=="";r||v&&d.key===" "||rp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Cd.displayName=Au;var xC=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,l=Sg(Au,r),o=pC(r),c=C.useRef(null),u=Be(t,c),[g,d]=C.useState(!1),[v,_]=C.useState("");return C.useEffect(()=>{const b=c.current;b&&_((b.textContent??"").trim())},[i.children]),a.jsx(wl.ItemSlot,{scope:r,disabled:n,textValue:s??v,children:a.jsx(zI,{asChild:!0,...o,focusable:!n,children:a.jsx(Fe.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:ve(e.onPointerMove,Sl(b=>{n?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,Sl(b=>l.onItemLeave(b))),onFocus:ve(e.onFocus,()=>d(!0)),onBlur:ve(e.onBlur,()=>d(!1))})})})}),d3="MenuCheckboxItem",bC=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return a.jsx(EC,{scope:e.__scopeMenu,checked:r,children:a.jsx(Cd,{role:"menuitemcheckbox","aria-checked":Du(r)?"mixed":r,...s,ref:t,"data-state":jg(r),onSelect:ve(s.onSelect,()=>n==null?void 0:n(Du(r)?!0:!r),{checkForDefaultPrevented:!1})})})});bC.displayName=d3;var wC="MenuRadioGroup",[h3,f3]=Fi(wC,{value:void 0,onValueChange:()=>{}}),SC=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=Bt(n);return a.jsx(h3,{scope:e.__scopeMenu,value:r,onValueChange:i,children:a.jsx(kg,{...s,ref:t})})});SC.displayName=wC;var CC="MenuRadioItem",kC=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=f3(CC,e.__scopeMenu),i=r===s.value;return a.jsx(EC,{scope:e.__scopeMenu,checked:i,children:a.jsx(Cd,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":jg(i),onSelect:ve(n.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,r)},{checkForDefaultPrevented:!1})})})});kC.displayName=CC;var Eg="MenuItemIndicator",[EC,p3]=Fi(Eg,{checked:!1}),jC=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=p3(Eg,r);return a.jsx(Ht,{present:n||Du(i.checked)||i.checked===!0,children:a.jsx(Fe.span,{...s,ref:t,"data-state":jg(i.checked)})})});jC.displayName=Eg;var m3="MenuSeparator",RC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return a.jsx(Fe.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});RC.displayName=m3;var g3="MenuArrow",NC=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Sd(r);return a.jsx(Km,{...s,...n,ref:t})});NC.displayName=g3;var v3="MenuSub",[Z4,PC]=Fi(v3),Ha="MenuSubTrigger",TC=C.forwardRef((e,t)=>{const r=$i(Ha,e.__scopeMenu),n=ql(Ha,e.__scopeMenu),s=PC(Ha,e.__scopeMenu),i=Sg(Ha,e.__scopeMenu),l=C.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},g=C.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return C.useEffect(()=>g,[g]),C.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),c(null)}},[o,c]),a.jsx(bg,{asChild:!0,...u,children:a.jsx(xC,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":LC(r.open),...e,ref:ss(t,s.onTriggerChange),onClick:d=>{var v;(v=e.onClick)==null||v.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,Sl(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),g()},100))})),onPointerLeave:ve(e.onPointerLeave,Sl(d=>{var _,b;g();const v=(_=r.content)==null?void 0:_.getBoundingClientRect();if(v){const x=(b=r.content)==null?void 0:b.dataset.side,f=x==="right",p=f?-5:5,h=v[f?"left":"right"],m=v[f?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:h,y:v.top},{x:m,y:v.top},{x:m,y:v.bottom},{x:h,y:v.bottom}],side:x}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,d=>{var _;const v=i.searchRef.current!=="";e.disabled||v&&d.key===" "||ZI[n.dir].includes(d.key)&&(r.onOpenChange(!0),(_=r.content)==null||_.focus(),d.preventDefault())})})})});TC.displayName=Ha;var AC="MenuSubContent",DC=C.forwardRef((e,t)=>{const r=gC(Or,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=$i(Or,e.__scopeMenu),l=ql(Or,e.__scopeMenu),o=PC(AC,e.__scopeMenu),c=C.useRef(null),u=Be(t,c);return a.jsx(wl.Provider,{scope:e.__scopeMenu,children:a.jsx(Ht,{present:n||i.open,children:a.jsx(wl.Slot,{scope:e.__scopeMenu,children:a.jsx(Cg,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:u,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var d;l.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ve(e.onFocusOutside,g=>{g.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:ve(e.onKeyDown,g=>{var _;const d=g.currentTarget.contains(g.target),v=XI[l.dir].includes(g.key);d&&v&&(i.onOpenChange(!1),(_=o.trigger)==null||_.focus(),g.preventDefault())})})})})})});DC.displayName=AC;function LC(e){return e?"open":"closed"}function Du(e){return e==="indeterminate"}function jg(e){return Du(e)?"indeterminate":e?"checked":"unchecked"}function _3(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function y3(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function x3(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=y3(e,Math.max(i,0));s.length===1&&(l=l.filter(u=>u!==r));const c=l.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function b3(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 o=t[i],c=t[l],u=o.x,g=o.y,d=c.x,v=c.y;g>n!=v>n&&r<(d-u)*(n-g)/(v-g)+u&&(s=!s)}return s}function w3(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return b3(r,t)}function Sl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var S3=mC,C3=bg,k3=vC,E3=_C,j3=kg,R3=yC,N3=Cd,P3=bC,T3=SC,A3=kC,D3=jC,L3=RC,O3=NC,M3=TC,I3=DC,kd="DropdownMenu",[B3]=un(kd,[fC]),Qt=fC(),[F3,OC]=B3(kd),MC=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:l,modal:o=!0}=e,c=Qt(t),u=C.useRef(null),[g,d]=ua({prop:s,defaultProp:i??!1,onChange:l,caller:kd});return a.jsx(F3,{scope:t,triggerId:zs(),triggerRef:u,contentId:zs(),open:g,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(v=>!v),[d]),modal:o,children:a.jsx(S3,{...c,open:g,onOpenChange:d,dir:n,modal:o,children:r})})};MC.displayName=kd;var IC="DropdownMenuTrigger",BC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=OC(IC,r),l=Qt(r);return a.jsx(C3,{asChild:!0,...l,children:a.jsx(Fe.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:ss(t,i.triggerRef),onPointerDown:ve(e.onPointerDown,o=>{!n&&o.button===0&&o.ctrlKey===!1&&(i.onOpenToggle(),i.open||o.preventDefault())}),onKeyDown:ve(e.onKeyDown,o=>{n||(["Enter"," "].includes(o.key)&&i.onOpenToggle(),o.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});BC.displayName=IC;var $3="DropdownMenuPortal",FC=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Qt(t);return a.jsx(k3,{...n,...r})};FC.displayName=$3;var $C="DropdownMenuContent",HC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=OC($C,r),i=Qt(r),l=C.useRef(!1);return a.jsx(E3,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,o=>{var c;l.current||(c=s.triggerRef.current)==null||c.focus(),l.current=!1,o.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,g=c.button===2||u;(!s.modal||g)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HC.displayName=$C;var H3="DropdownMenuGroup",z3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(j3,{...s,...n,ref:t})});z3.displayName=H3;var U3="DropdownMenuLabel",zC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(R3,{...s,...n,ref:t})});zC.displayName=U3;var W3="DropdownMenuItem",UC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(N3,{...s,...n,ref:t})});UC.displayName=W3;var V3="DropdownMenuCheckboxItem",WC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(P3,{...s,...n,ref:t})});WC.displayName=V3;var q3="DropdownMenuRadioGroup",K3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(T3,{...s,...n,ref:t})});K3.displayName=q3;var G3="DropdownMenuRadioItem",Y3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(A3,{...s,...n,ref:t})});Y3.displayName=G3;var Q3="DropdownMenuItemIndicator",VC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(D3,{...s,...n,ref:t})});VC.displayName=Q3;var Z3="DropdownMenuSeparator",qC=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(L3,{...s,...n,ref:t})});qC.displayName=Z3;var X3="DropdownMenuArrow",J3=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(O3,{...s,...n,ref:t})});J3.displayName=X3;var e5="DropdownMenuSubTrigger",t5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(M3,{...s,...n,ref:t})});t5.displayName=e5;var r5="DropdownMenuSubContent",n5=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Qt(r);return a.jsx(I3,{...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)"}})});n5.displayName=r5;var s5=MC,i5=BC,o5=FC,KC=HC,GC=zC,YC=UC,QC=WC,a5=VC,ZC=qC;const l5=s5,c5=i5,XC=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(o5,{children:a.jsx(KC,{ref:n,sideOffset:t,className:X("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})}));XC.displayName=KC.displayName;const JC=C.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(YC,{ref:n,className:X("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}));JC.displayName=YC.displayName;const u5=C.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(QC,{ref:s,className:X("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:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(a5,{children:a.jsx(uN,{className:"h-3 w-3"})})}),t]}));u5.displayName=QC.displayName;const d5=C.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(GC,{ref:n,className:X("px-2 py-1.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",t&&"pl-8",e),...r}));d5.displayName=GC.displayName;const h5=C.forwardRef(({className:e,...t},r)=>a.jsx(ZC,{ref:r,className:X("-mx-1 my-1 h-px bg-border",e),...t}));h5.displayName=ZC.displayName;const Ry=[{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 f5({to:e,label:t}){const[r]=tN(e);return a.jsx("li",{children:a.jsx(jn,{href:e,"aria-current":r?"page":void 0,className:X("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 p5(){const[,e]=En();return a.jsxs("nav",{"aria-label":"Operator sections","data-testid":"operator-sub-nav",className:"flex min-w-[160px] flex-col pt-1",children:[a.jsx("div",{className:"mb-2 sm:hidden",children:a.jsxs(l5,{children:[a.jsx(c5,{asChild:!0,children:a.jsxs(ce,{variant:"outline",size:"sm","data-testid":"operator-sub-nav-trigger",children:[a.jsx(vN,{className:"h-3.5 w-3.5"})," Sections"]})}),a.jsx(XC,{align:"start",children:Ry.map(t=>a.jsx(JC,{onSelect:()=>e(t.to),children:t.label},t.to))})]})}),a.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:Ry.map(t=>a.jsx(f5,{to:t.to,label:t.label},t.to))})]})}function Aa({children:e}){return a.jsxs("div",{"data-testid":"operator-shell",className:"flex items-start gap-6 p-6",children:[a.jsx(p5,{}),a.jsx("div",{className:"min-w-0 flex-1",children:e})]})}function wh(e){const t=Br(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Co(t)}}function Ny(e,t){const r=Br(t.harness);if(e.harness!==r||e.model!==(t.model??Co(r)))return!0;const n=[...e.plugins].sort(),s=[...t.plugins??[]].sort();if(n.length!==s.length)return!0;for(let o=0;o<n.length;o+=1)if(n[o]!==s[o])return!0;const i=[...e.disabledDefaultPlugins].sort(),l=[...t.disabledDefaultPlugins??[]].sort();if(i.length!==l.length)return!0;for(let o=0;o<i.length;o+=1)if(i[o]!==l[o])return!0;return!1}const Py="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 m5({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:s}){const[i,l]=C.useState(r),[o,c]=C.useState(()=>wh(e)),u=C.useRef(null),g=C.useRef(null),d=ei(),v=t!==void 0,_=Oe({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>ge.solvernets.getManifest(e.manifestCid),enabled:!v&&!!e.manifestCid,staleTime:1/0,retry:!1}),b=Oe({queryKey:["solvernets","catalog"],queryFn:()=>ge.getSolverNets(),enabled:!v}),f=(()=>{var q;if(v)return t;const B=(q=_.data)==null?void 0:q.manifest;if(!(!B||!b.data))return b.data.nets.find(Z=>Z.contract.id===B.contract.id&&Z.contract.version===B.contract.version)})(),p=e.contract??(f==null?void 0:f.contract),h=!v&&(_.isLoading||b.isLoading),m=!v&&_.isError&&!_.isLoading;C.useEffect(()=>{Ny(o,e)||c(wh(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),C.useEffect(()=>{r&&(l(!0),n==="harness"&&setTimeout(()=>{var B,q;(B=u.current)==null||B.scrollIntoView({block:"center",behavior:"smooth"}),(q=g.current)==null||q.focus()},50))},[r,n]);const y=((f==null?void 0:f.compatibleHarnesses)??[]).filter(B=>B.supportsRoles.includes("solving")).map(B=>({...B,name:Br(B.name)})).filter((B,q,Z)=>Z.findIndex(ee=>ee.name===B.name)===q),w=new Set(y.map(B=>B.name)),k=o.harness!==""&&y.length>0&&![...w].some(B=>ED(B,o.harness)),j=f?`${f.contract.id}@${f.contract.version}`:"",S=xd(o.harness),E=Kn({mutationFn:()=>ge.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...p!==void 0?{contract:{id:p.id,version:p.version}}:{},roles:e.roles,...o.harness?{harness:o.harness}:{},plugins:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,...o.model?{model:o.model}:{}}),onSuccess:B=>{d.invalidateQueries({queryKey:["operator","joined"]}),B.restartRequired&&(s==null||s())}}),[N,O]=C.useState(!1),T=e.roles.includes("solver"),L=V1(T?o.harness:void 0,T?o.model:void 0),$=T&&L.requiresConfirmation,W=$&&!N,[U,K]=C.useState(!1),R=Kn({mutationFn:()=>ge.operator.leave(e.manifestCid),onSuccess:B=>{d.invalidateQueries({queryKey:["operator","joined"]}),B.restartRequired&&(s==null||s()),K(!1)}}),P=Ny(o,e),D=e.name??e.manifestCid,M=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return a.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:[a.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[a.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[a.jsx("span",{"data-testid":"joined-net-card-name",className:"truncate font-serif text-[20px] leading-tight text-foreground tracking-[-0.01em]",children:D}),a.jsxs("div",{className:"flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground",children:[e.roles.map(B=>a.jsx(g5,{label:B},B)),a.jsxs("span",{className:"text-dim",children:["cid ",M]})]})]}),m?a.jsx("div",{className:"flex flex-col items-end gap-1.5",children:U?a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:R.isPending,onClick:()=>K(!1),children:"Cancel"}),a.jsx(ce,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:R.isPending,onClick:()=>R.mutate(),children:R.isPending?"Leaving…":"Confirm leave"})]}):a.jsxs(ce,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>K(!0),children:[a.jsx(yu,{"aria-hidden":"true",className:"!size-3"}),"Leave"]})}):a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-toggle",onClick:()=>l(B=>!B),children:i?a.jsxs(a.Fragment,{children:[a.jsx(Sm,{"aria-hidden":"true",className:"!size-3.5"}),"Close"]}):a.jsxs(a.Fragment,{children:[a.jsx(dN,{"aria-hidden":"true",className:"!size-3.5"}),"Edit"]})})]}),m&&a.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:[a.jsx(Pe,{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.",R.isError&&a.jsx("div",{role:"alert",className:"mt-1.5 text-[11px] text-destructive",children:R.error instanceof Error?R.error.message:"Leave failed."})]}),!i&&!m&&a.jsx(Ty,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:k?`does not support ${j}`:null,warningTestId:"joined-net-card-warn-collapsed"}),m&&a.jsx(Ty,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:null}),i&&!m&&a.jsxs("div",{"data-testid":"joined-net-card-form",className:"flex flex-col gap-3.5 border-t border-border pt-3",children:[a.jsxs("div",{ref:u,className:"flex flex-col gap-1.5",children:[a.jsx(yr,{htmlFor:"joined-net-card-harness-select",children:"Harness"}),a.jsxs("select",{ref:g,id:"joined-net-card-harness-select","aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:o.harness,onChange:B=>{const q=B.target.value;c(Z=>({...Z,harness:q,model:Co(q)})),O(!1)},className:X(Py,k&&"border-destructive"),children:[o.harness===""&&a.jsx("option",{value:"",children:"—"}),y.map(B=>a.jsx("option",{value:B.name,children:CS(B.name,B.version)},B.name)),o.harness&&y.length>0&&!w.has(o.harness)&&a.jsxs("option",{value:o.harness,children:[Ci(o.harness)," (incompatible)"]}),o.harness&&y.length===0&&a.jsx("option",{value:o.harness,children:Ci(o.harness)})]}),k&&a.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",className:"font-mono text-[11px] leading-relaxed text-destructive",children:["⚠ This harness does not support ",a.jsx("span",{className:"text-foreground",children:j}),".",y.length>0&&a.jsxs(a.Fragment,{children:[" Compatible: ",y.map((B,q)=>a.jsxs("span",{className:"text-primary",children:[Ci(B.name),q<y.length-1?" · ":""]},B.name))]})]})]}),a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsx(yr,{children:"Plugins"}),h?a.jsx("span",{"data-testid":"joined-net-card-catalog-loading",className:"font-mono text-[12px] text-dim",children:"Loading registry catalog…"}):f?(f.compatiblePlugins??[]).length===0?a.jsx(Zf,{available:[],selected:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,onChange:(B,q)=>c(Z=>({...Z,plugins:B,disabledDefaultPlugins:q})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:o.harness}):a.jsx(Zf,{available:(f==null?void 0:f.compatiblePlugins)??[],selected:o.plugins,disabledDefaultPlugins:o.disabledDefaultPlugins,onChange:(B,q)=>c(Z=>({...Z,plugins:B,disabledDefaultPlugins:q})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:o.harness}):a.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."})]}),a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsx(yr,{htmlFor:"joined-net-card-model-select",children:"Model"}),a.jsxs("select",{id:"joined-net-card-model-select","aria-label":"Model","data-testid":"joined-net-card-model-select",value:o.model,onChange:B=>{c({...o,model:B.target.value}),O(!1)},className:Py,children:[S.map(B=>a.jsx("option",{value:B.id,children:B.label},B.id)),(()=>{const B=gg(o.model,o.harness);return B.isCustom?a.jsx("option",{value:o.model,children:B.label},o.model):null})()]})]}),T&&a.jsx(q1,{harness:o.harness,modelId:o.model,variant:"inline",testIdPrefix:"joined-net-card-cost"}),$&&a.jsxs("label",{"data-testid":"joined-net-card-cost-confirmation","data-cost-confirmation-checked":N?"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:[a.jsx("input",{type:"checkbox","data-testid":"joined-net-card-cost-confirmation-checkbox",checked:N,onChange:B=>O(B.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),a.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key."})]}),E.isError&&a.jsx("span",{role:"alert","data-testid":"joined-net-card-error",className:"font-mono text-[12px] text-destructive",children:E.error instanceof Error?E.error.message:"Save failed."}),a.jsx(pt,{}),a.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-dim",children:[a.jsx("span",{children:P?"Restart required to apply.":"No unsaved changes."}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-cancel",disabled:!P||E.isPending,onClick:()=>c(wh(e)),children:"Cancel"}),a.jsx(ce,{type:"button",size:"sm","data-testid":"joined-net-card-save",disabled:!P||E.isPending||W,onClick:()=>E.mutate(),children:E.isPending?"Saving…":"Save"})]})]}),a.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:[a.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?a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:R.isPending,onClick:()=>K(!1),children:"Cancel"}),a.jsx(ce,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:R.isPending,onClick:()=>R.mutate(),children:R.isPending?"Leaving…":"Confirm leave"})]}):a.jsxs(ce,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>K(!0),children:[a.jsx(yu,{"aria-hidden":"true",className:"!size-3"}),"Leave SolverNet"]})]})]})]})}function Ty({harness:e,plugins:t,model:r,harnessWarning:n,warningTestId:s}){return a.jsxs("div",{className:"grid grid-cols-[90px_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-muted-foreground",children:[a.jsx("span",{children:"harness"}),a.jsxs("span",{className:"text-foreground",children:[e?Ci(e):a.jsx("span",{className:"text-dim",children:"—"}),n&&s&&a.jsxs("span",{"data-testid":s,className:"ml-2.5 text-destructive",children:["⚠ ",n]})]}),a.jsx("span",{children:"plugins"}),a.jsx("span",{className:"text-foreground",children:(t??[]).length===0?a.jsx("span",{className:"text-dim",children:"—"}):`${t.length} active`}),a.jsx("span",{children:"model"}),a.jsx("span",{className:"text-foreground",children:r?gg(r,Br(e)).label:a.jsx("span",{className:"text-dim",children:"—"})})]})}function g5({label:e}){return a.jsx(Pe,{variant:"outline","data-testid":"joined-net-card-role",className:"px-1.5 py-px text-[10px]",children:e})}function v5({onRestartPending:e}={}){const t=Oe({queryKey:["operator","joined"],queryFn:()=>ge.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 a.jsxs("div",{"data-testid":"memberships-tab",className:"flex flex-col gap-3",children:[a.jsxs("div",{className:"flex items-baseline justify-between",children:[a.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Joined · ",r.length]}),t.isError&&a.jsx("span",{role:"alert",className:"font-mono text-[11px] text-[var(--break-red)]",children:"Failed to load joined SolverNets."})]}),t.isLoading&&a.jsxs("div",{"data-testid":"memberships-tab-loading",className:"flex flex-col gap-3","aria-label":"Loading",children:[a.jsx(Lr,{className:"h-20 w-full"}),a.jsx(Lr,{className:"h-20 w-full"})]}),!t.isLoading&&r.length===0&&a.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"," ",a.jsx(jn,{href:"/operator/registry",className:"text-primary no-underline hover:underline",children:"Registry"})," ","to participate."]}),r.map(n=>a.jsx(m5,{joined:n,onRestartPending:e},n.manifestCid))]})}const Ay={launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"}};function _5(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function y5(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 x5(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 b5={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 w5(e){switch(x5(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 b5;default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function S5({code:e,message:t}){return e==="rpc_rate_limited"?a.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:[a.jsx("span",{children:"RPC rate-limited — add your own key"}),a.jsx(jn,{href:"/operator#network","data-testid":"registry-catalog-warn-action",className:"text-primary no-underline hover:underline",children:"Network settings →"})]}):a.jsxs("span",{"data-testid":"registry-catalog-warn",className:"normal-case tracking-normal text-[var(--wane)]",children:["stale (",t,")"]})}function C5({status:e}){const t=Ay[e]??Ay.launched;return a.jsx(Pe,{"data-testid":"registry-status-badge","data-status":e,variant:t.variant,className:"whitespace-nowrap",children:t.label})}function k5({openRoles:e}){return e.length===0?a.jsx("span",{className:"text-[12px] text-[var(--fg-dim)]",children:"no open roles"}):a.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map(t=>a.jsx(Pe,{"data-testid":"registry-open-role","data-role":t,variant:"outline",className:"rounded-full text-foreground",children:t},t))})}function E5({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0,s=e.status==="launched";return a.jsx(ke,{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,className:"flex flex-col gap-3 p-4",children:a.jsxs("article",{className:"flex flex-col gap-3",children:[a.jsxs("header",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[a.jsx("span",{className:"truncate font-mono text-[15px] font-medium text-foreground",children:e.name}),a.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:["Launcher: ",_5(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),a.jsx(C5,{status:e.status})]}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[a.jsx("span",{children:"Open roles"}),a.jsx(k5,{openRoles:e.openRoles}),a.jsx("span",{children:"Solution price"}),a.jsx("span",{className:"text-foreground",children:Ts(e.solutionPriceWei)}),a.jsx("span",{children:"Verdict price"}),a.jsx("span",{className:"text-foreground",children:Ts(e.verdictPriceWei)})]}),a.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[n&&a.jsxs(Pe,{"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?a.jsx(ce,{asChild:!0,variant:n?"secondary":"default","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,children:a.jsx(jn,{href:r,children:n?"Edit":"Join"})}):a.jsx(ce,{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 j5({refetchIntervalMs:e=3e4}={}){var v;const{data:t,isLoading:r,isError:n,error:s,refetch:i}=Oe({queryKey:["solvernets","registry"],queryFn:()=>ge.solvernets.listRegistry(),refetchInterval:e}),l=Oe({queryKey:["operator","joined"],queryFn:()=>ge.operator.listJoined(),refetchInterval:e}),o=((v=l.data)==null?void 0:v.joinedSolverNets)??{};if(r||l.isLoading)return a.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,b=w5(_);return a.jsxs(ut,{"data-testid":"registry-catalog-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx(or,{className:"font-mono text-[13px] font-medium text-destructive",children:b.title}),a.jsx(mt,{className:"text-[12px] text-[var(--fg-muted)]",children:b.detail}),b.actionHref&&b.actionLabel&&a.jsx(jn,{href:b.actionHref,"data-testid":"registry-catalog-error-action",className:"mt-0.5 font-mono text-[12px] text-primary no-underline hover:underline",children:b.actionLabel})]}),a.jsx(ce,{type:"button",variant:"secondary",size:"sm","data-testid":"registry-catalog-retry",onClick:()=>{i()},children:"Retry"})]})}const c=(t==null?void 0:t.summaries)??[],u=c.filter(_=>o[_.manifestCid]===void 0),g=y5((t==null?void 0:t.lastRefreshedAt)??null),d=(t==null?void 0:t.lastError)??null;return a.jsxs("div",{"data-testid":"registry-catalog",className:"flex flex-col gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:[a.jsxs("span",{"data-testid":"registry-catalog-meta",children:[u.length," discoverable · last refreshed"," ",g??"never"]}),d&&a.jsx(S5,{code:d.code,message:d.message})]}),u.length===0?a.jsx(ke,{"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."}):a.jsx("div",{className:"flex flex-col gap-2.5",children:u.map(_=>{var b;return a.jsx(E5,{summary:_,joinedRoles:(b=o[_.manifestCid])==null?void 0:b.roles},_.manifestCid)})})]})}function R5(){return a.jsxs("div",{"data-testid":"registry-tab",className:"flex flex-col gap-3",children:[a.jsxs("span",{className:"flex items-center gap-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[a.jsx(fN,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Discover"]}),a.jsx(j5,{})]})}function N5({onRestartPending:e=()=>{}}={}){const{data:t}=Oe({queryKey:["bootstrap"],queryFn:()=>ge.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 a.jsx("div",{"data-testid":"network-tab",children:a.jsx(P5,{chain:r,rpcUrl:n,defaultRpcUrl:s,rpcHealthy:!0,onRestartPending:e})})}function P5({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:s}){const[i,l]=C.useState(t),[o,c]=C.useState(!1),u=i!==t,g=t===r,d=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",v=d.split(" (")[0],_=async()=>{c(!0);try{const b=i.length===0?null:i,x=await ge.updateNetwork({rpcUrl:b});Gs.success("RPC URL saved",{description:x.restartRequired?"Restart pending — applies on next daemon start.":"Applied to the running daemon."}),x.restartRequired&&s()}catch(b){Gs.error("Failed to save RPC URL",{description:b instanceof Error?b.message:String(b)})}finally{c(!1)}};return a.jsxs(ke,{children:[a.jsxs(Rn,{className:"flex flex-row items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs(oa,{className:"flex items-center gap-2",children:[a.jsx(_N,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Network"]}),a.jsxs(od,{children:[v," · ",t]})]}),a.jsx(Pe,{variant:n?"success":"destructive",children:n?"Healthy":"Unreachable"})]}),a.jsxs(et,{children:[a.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx(yr,{children:"Chain"}),a.jsx("div",{className:"rounded-md border border-border bg-[var(--bg-sunken)] px-3 py-2 font-mono text-[13px] text-muted-foreground",children:d}),a.jsx(Pe,{variant:"outline",className:"self-start",children:"locked"}),a.jsx("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Switching chains resets fleet state — that's a separate flow."})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yr,{htmlFor:"rpc-url",children:"RPC URL"}),u&&a.jsx(Pe,{variant:"warning",children:"Restart"})]}),a.jsx(ct,{id:"rpc-url",type:"text",value:i,onChange:b=>l(b.target.value),placeholder:r,className:u?"border-primary":void 0}),a.jsx(ce,{variant:"link",size:"sm",type:"button",onClick:()=>l(""),className:"h-auto self-start p-0 text-[11px]",children:"Use default"}),g&&a.jsxs(ut,{variant:"warning",className:"mt-3","data-testid":"network-shared-rpc-warning",children:[a.jsx(Cm,{className:"h-4 w-4 text-[var(--wane)]"}),a.jsx(or,{className:"text-[var(--wane)]",children:"Shared RPC"}),a.jsxs(mt,{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"," ",a.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 ",a.jsx(Xa,{className:"h-2.5 w-2.5"})]}),","," ",a.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 ",a.jsx(Xa,{className:"h-2.5 w-2.5"})]}),", or"," ",a.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 ",a.jsx(Xa,{className:"h-2.5 w-2.5"})]})," ","and paste it above."]})]}),a.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Default: ",r]})]})]}),u&&a.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2 border-t border-border pt-4",children:[a.jsx(ce,{variant:"secondary",size:"sm",type:"button",onClick:()=>l(t),children:"Cancel"}),a.jsx(ce,{variant:"default",size:"sm",type:"button",disabled:o,onClick:()=>{_()},children:o?"Saving…":"Save"})]})]})]})}var Kl=e=>e.type==="checkbox",hi=e=>e instanceof Date,Nt=e=>e==null;const ek=e=>typeof e=="object";var nt=e=>!Nt(e)&&!Array.isArray(e)&&ek(e)&&!hi(e),tk=e=>nt(e)&&e.target?Kl(e.target)?e.target.checked:e.target.value:e,np=(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},T5=e=>{const t=e.constructor&&e.constructor.prototype;return nt(t)&&t.hasOwnProperty("isPrototypeOf")},Rg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ht(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Rg&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(nt(e)&&T5(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=ht(e[s]));return n}var Gl=e=>/^\w*$/.test(e),Ye=e=>e===void 0,Ng=e=>Array.isArray(e)?e.filter(Boolean):[],Ed=e=>Ng(e.replace(/["|']|\]/g,"").split(/\.|\[/)),oe=(e,t,r)=>{if(!t||!nt(e))return r;const s=(Gl(t)?[t]:Ed(t)).reduce((i,l)=>Nt(i)?void 0:i[l],e);return Ye(s)||s===e?Ye(e[t])?r:e[t]:s},fr=e=>typeof e=="boolean",It=e=>typeof e=="function",He=(e,t,r)=>{let n=-1;const s=Gl(t)?[t]:Ed(t),i=s.length,l=i-1;for(;++n<i;){const o=s[n];let c=r;if(n!==l){const u=e[o];c=nt(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=c,e=e[o]}};const gs={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},en={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Gr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Sh="form",rk="root",Pg=Q.createContext(null);Pg.displayName="HookFormControlContext";const Tg=()=>Q.useContext(Pg);var nk=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==en.all&&(t._proxyFormState[l]=!n||en.all),r&&(r[l]=!0),e[l]}});return s};const Ag=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function A5(e){const t=Tg(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[l,o]=Q.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=Q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Ag(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&o({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),Q.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),Q.useMemo(()=>nk(l,r,c.current,!1),[l,r])}var Ft=e=>typeof e=="string",sp=(e,t,r,n,s)=>Ft(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),ip=e=>Nt(e)||!ek(e);function pr(e,t,r=new WeakSet){if(e===t)return!0;if(ip(e)||ip(t))return Object.is(e,t);if(hi(e)&&hi(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 o=t[i];if(hi(l)&&hi(o)||(nt(l)||Array.isArray(l))&&(nt(o)||Array.isArray(o))?!pr(l,o,r):!Object.is(l,o))return!1}}return!0}function D5(e){const t=Tg(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:l,compute:o}=e||{},c=Q.useRef(s),u=Q.useRef(o),g=Q.useRef(void 0),d=Q.useRef(r),v=Q.useRef(n);u.current=o;const[_,b]=Q.useState(()=>{const y=r._getWatch(n,c.current);return u.current?u.current(y):y}),x=Q.useCallback(y=>{const w=sp(n,r._names,y||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),f=Q.useCallback(y=>{if(!i){const w=sp(n,r._names,y||r._formValues,!1,c.current);if(u.current){const k=u.current(w);pr(k,g.current)||(b(k),g.current=k)}else b(w)}},[r._formValues,r._names,i,n]);Ag(()=>((d.current!==r||!pr(v.current,n))&&(d.current=r,v.current=n,f()),r._subscribe({name:n,formState:{values:!0},exact:l,callback:y=>{f(y.values)}})),[r,l,n,f]),Q.useEffect(()=>r._removeUnmounted());const p=d.current!==r,h=v.current,m=Q.useMemo(()=>{if(i)return null;const y=!p&&!pr(h,n);return p||y?x():null},[i,p,n,h,x]);return m!==null?m:_}function L5(e){const t=Tg(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:l,exact:o=!0}=e,c=!!np(s._names.array,r).length,u=Q.useMemo(()=>oe(s._formValues,r,oe(s._defaultValues,r,l)),[s,r,l]),g=D5({control:s,name:r,defaultValue:u,exact:o}),d=A5({control:s,name:r,exact:o}),v=Q.useRef(e),_=Q.useRef(s.register(r,{...e.rules,value:g,...fr(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const b=Q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!oe(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!oe(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!oe(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!oe(d.validatingFields,r)},error:{enumerable:!0,get:()=>oe(d.errors,r)}}),[d,r]),x=Q.useCallback(m=>_.current.onChange({target:{value:tk(m),name:r},type:gs.CHANGE}),[r]),f=Q.useCallback(()=>_.current.onBlur({target:{value:oe(s._formValues,r),name:r},type:gs.BLUR}),[r,s._formValues]),p=Q.useCallback(m=>{const y=oe(s._fields,r);y&&y._f&&m&&(y._f.ref={focus:()=>It(m.focus)&&m.focus(),select:()=>It(m.select)&&m.select(),setCustomValidity:w=>It(m.setCustomValidity)&&m.setCustomValidity(w),reportValidity:()=>It(m.reportValidity)&&m.reportValidity()})},[s._fields,r]),h=Q.useMemo(()=>({name:r,value:g,...fr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:x,onBlur:f,ref:p}),[r,n,d.disabled,x,f,p,g]);return Q.useEffect(()=>{const m=s._options.shouldUnregister||i;s.register(r,{...v.current.rules,...fr(v.current.disabled)?{disabled:v.current.disabled}:{}});const y=(w,k)=>{const j=oe(s._fields,w);j&&j._f&&(j._f.mount=k)};if(y(r,!0),m){const w=ht(oe(s._defaultValues,r,oe(s._options.defaultValues,r,v.current.defaultValue)));He(s._defaultValues,r,w),Ye(oe(s._formValues,r))&&He(s._formValues,r,w)}return!c&&s.register(r),()=>{(c?m&&!s._state.action:m)?s.unregister(r):y(r,!1)}},[r,s,c,i]),Q.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),Q.useMemo(()=>({field:h,formState:d,fieldState:b}),[h,d,b])}const O5=e=>e.render(L5(e)),Dg=Q.createContext(null);Dg.displayName="HookFormContext";const M5=()=>Q.useContext(Dg),I5=e=>{const{children:t,watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:o,setValues:c,trigger:u,formState:g,resetField:d,reset:v,handleSubmit:_,unregister:b,control:x,register:f,setFocus:p,subscribe:h}=e,m=Q.useMemo(()=>({watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:o,setValues:c,trigger:u,formState:g,resetField:d,reset:v,handleSubmit:_,unregister:b,control:x,register:f,setFocus:p,subscribe:h}),[l,x,g,s,n,_,f,v,d,i,p,o,c,h,u,b,r]);return Q.createElement(Dg.Provider,{value:m},Q.createElement(Pg.Provider,{value:m.control},t))};var sk=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Ja=e=>Array.isArray(e)?e:[e],Dy=()=>{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 ik(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&nt(s)&&i){const l=ik(s,i);nt(l)&&(r[n]=l)}else e[n]&&(r[n]=i)}return r}var Ot=e=>nt(e)&&!Object.keys(e).length,Lg=e=>e.type==="file",Lu=e=>{if(!Rg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ok=e=>e.type==="select-multiple",Og=e=>e.type==="radio",B5=e=>Og(e)||Kl(e),Ch=e=>Lu(e)&&e.isConnected;function F5(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(Nt(e)){e=void 0;break}e=e[t[n]],n++}return e}function $5(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ye(e[t]))return!1;return!0}function gt(e,t){if(Ft(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Gl(t)?[t]:Ed(t),n=r.length===1?e:F5(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(nt(n)&&Ot(n)||Array.isArray(n)&&$5(n))&>(e,r.slice(0,-1)),e}var H5=e=>{for(const t in e)if(It(e[t]))return!0;return!1};function ak(e){return Array.isArray(e)||nt(e)&&!H5(e)}function op(e,t={}){for(const r in e){const n=e[r];ak(n)?(t[r]=Array.isArray(n)?[]:{},op(n,t[r])):Ye(n)||(t[r]=!0)}return t}function ap(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>ap(r));return t.some(r=>r!==void 0)?t:void 0}if(nt(e)){const t={};for(const r in e){const n=ap(e[r]);Ye(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Xi(e,t,r){r||(r=op(t));for(const n in e){const s=e[n];if(ak(s))Ye(t)||ip(r[n])?r[n]=op(s,Array.isArray(s)?[]:{}):Xi(s,Nt(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!pr(s,i)}}return ap(r)||{}}const Ly={value:!1,isValid:!1},Oy={value:!0,isValid:!0};var lk=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&&!Ye(e[0].attributes.value)?Ye(e[0].value)||e[0].value===""?Oy:{value:e[0].value,isValid:!0}:Oy:Ly}return Ly},ck=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ye(e)?e:t?e===""?NaN:e&&+e:r&&Ft(e)?new Date(e):n?n(e):e;const My={isValid:!1,value:null};var uk=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,My):My;function Iy(e){const t=e.ref;return Lg(t)?t.files:Og(t)?uk(e.refs).value:ok(t)?[...t.selectedOptions].map(({value:r})=>r):Kl(t)?lk(e.refs).value:ck(Ye(t.value)?e.ref.value:t.value,e)}var z5=(e,t,r,n)=>{const s={};for(const i of e){const l=oe(t,i);l&&He(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ou=e=>e instanceof RegExp,Da=e=>Ye(e)?e:Ou(e)?e.source:nt(e)?Ou(e.value)?e.value.source:e.value:e,By=e=>({isOnSubmit:!e||e===en.onSubmit,isOnBlur:e===en.onBlur,isOnChange:e===en.onChange,isOnAll:e===en.all,isOnTouch:e===en.onTouched});const Fy="AsyncFunction";var U5=e=>!!e&&!!e.validate&&!!(It(e.validate)&&e.validate.constructor.name===Fy||nt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Fy)),W5=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),$y=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const el=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=oe(e,s);if(i){const{_f:l,...o}=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(el(o,t))break}else if(nt(o)&&el(o,t))break}}};function Hy(e,t,r){const n=oe(e,r);if(n||Gl(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=oe(t,i),o=oe(e,i);if(l&&!Array.isArray(l)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};s.pop()}return{name:r}}var V5=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Ot(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!n||en.all))},q5=(e,t,r)=>!e||!t||e===t||Ja(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),K5=(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,G5=(e,t)=>!Ng(oe(e,t)).length&>(e,t),zy=(e,t,r)=>{const n=Ja(oe(e,r));return He(n,rk,t[r]),He(e,r,n),e};function Uy(e,t,r="validate"){if(Ft(e)||Array.isArray(e)&&e.every(Ft)||fr(e)&&!e)return{type:r,message:Ft(e)?e:"",ref:t}}var Qi=e=>nt(e)&&!Ou(e)?e:{value:e,message:""},Wy=async(e,t,r,n,s,i)=>{const{ref:l,refs:o,required:c,maxLength:u,minLength:g,min:d,max:v,pattern:_,validate:b,name:x,valueAsNumber:f,mount:p}=e._f,h=oe(r,x);if(!p||t.has(x))return{};const m=o?o[0]:l,y=T=>{s&&m.reportValidity&&(m.setCustomValidity(fr(T)?"":T||""),m.reportValidity())},w={},k=Og(l),j=Kl(l),S=k||j,E=(f||Lg(l))&&Ye(l.value)&&Ye(h)||Lu(l)&&l.value===""||h===""||Array.isArray(h)&&!h.length||f&&typeof h=="number"&&isNaN(h),N=sk.bind(null,x,n,w),O=(T,L,$,W=Gr.maxLength,U=Gr.minLength)=>{const K=T?L:$;w[x]={type:T?W:U,message:K,ref:l,...N(T?W:U,K)}};if(i?!Array.isArray(h)||!h.length:c&&(!S&&(E||Nt(h))||fr(h)&&!h||j&&!lk(o).isValid||k&&!uk(o).isValid)){const{value:T,message:L}=Ft(c)?{value:!!c,message:c}:Qi(c);if(T&&(w[x]={type:Gr.required,message:L,ref:m,...N(Gr.required,L)},!n))return y(L),w}if(!E&&(!Nt(d)||!Nt(v))){let T,L;const $=Qi(v),W=Qi(d);if(!Nt(h)&&!isNaN(h)){const U=l.valueAsNumber||h&&+h;Nt($.value)||(T=U>$.value),Nt(W.value)||(L=U<W.value)}else{const U=l.valueAsDate||new Date(h),K=D=>new Date(new Date().toDateString()+" "+D),R=l.type=="time",P=l.type=="week";Ft($.value)&&h&&(T=R?K(h)>K($.value):P?h>$.value:U>new Date($.value)),Ft(W.value)&&h&&(L=R?K(h)<K(W.value):P?h<W.value:U<new Date(W.value))}if((T||L)&&(O(!!T,$.message,W.message,Gr.max,Gr.min),!n))return y(w[x].message),w}if((u||g)&&!E&&(Ft(h)||i&&Array.isArray(h))){const T=Qi(u),L=Qi(g),$=!Nt(T.value)&&h.length>+T.value,W=!Nt(L.value)&&h.length<+L.value;if(($||W)&&(O($,T.message,L.message),!n))return y(w[x].message),w}if(_&&!E&&Ft(h)){const{value:T,message:L}=Qi(_);if(Ou(T)&&!h.match(T)&&(w[x]={type:Gr.pattern,message:L,ref:l,...N(Gr.pattern,L)},!n))return y(L),w}if(b){if(It(b)){const T=await b(h,r),L=Uy(T,m);if(L&&(w[x]={...L,...N(Gr.validate,L.message)},!n))return y(L.message),w}else if(nt(b)){let T={};for(const L in b){if(!Ot(T)&&!n)break;const $=Uy(await b[L](h,r),m,L);$&&(T={...$,...N(L,$.message)},y($.message),n&&(w[x]=T))}if(!Ot(T)&&(w[x]={ref:m,...T},!n))return w}}return y(!0),w};const Y5={mode:en.onSubmit,reValidateMode:en.onChange,shouldFocusError:!0},dk={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Q5(e={}){let t={...Y5,...e},r={...ht(dk),isLoading:It(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=nt(t.defaultValues)||nt(t.values)?ht(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:ht(s),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...g};let v={...d};const _={array:Dy(),state:Dy()},b=t.criteriaMode===en.all,x=I=>H=>{clearTimeout(u),u=setTimeout(I,H)},f=async I=>{if(!l.keepIsValid&&!t.disabled&&(d.isValid||v.isValid||I)){let H;t.resolver?(H=Ot((await N()).errors),p()):H=await L({fields:n,onlyCheckValid:!0,eventType:gs.VALID}),H!==r.isValid&&_.state.next({isValid:H})}},p=(I,H)=>{!t.disabled&&(d.isValidating||d.validatingFields||v.isValidating||v.validatingFields)&&((I||Array.from(o.mount)).forEach(V=>{V&&(H?He(r.validatingFields,V,H):gt(r.validatingFields,V))}),_.state.next({validatingFields:r.validatingFields,isValidating:!Ot(r.validatingFields)}))},h=()=>{r.dirtyFields=Xi(s,i)},m=(I,H=[],V,re,se=!0,te=!0)=>{if(re&&V&&!t.disabled){if(l.action=!0,te&&Array.isArray(oe(n,I))){const le=V(oe(n,I),re.argA,re.argB);se&&He(n,I,le)}if(te&&Array.isArray(oe(r.errors,I))){const le=V(oe(r.errors,I),re.argA,re.argB);se&&He(r.errors,I,le),G5(r.errors,I)}if((d.touchedFields||v.touchedFields)&&te&&Array.isArray(oe(r.touchedFields,I))){const le=V(oe(r.touchedFields,I),re.argA,re.argB);se&&He(r.touchedFields,I,le)}(d.dirtyFields||v.dirtyFields)&&h(),_.state.next({name:I,isDirty:W(I,H),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else He(i,I,H)},y=(I,H)=>{He(r.errors,I,H),_.state.next({errors:r.errors})},w=I=>{r.errors=I,_.state.next({errors:r.errors,isValid:!1})},k=I=>{const H=Gl(I)?[I]:Ed(I);let V=i,re=s;for(let se=0;se<H.length-1;se++){const te=H[se];if(V=Nt(V)?V:V[te],re=Nt(re)?re:re[te],V===null&&re!==null)return!0}return!1},j=(I,H,V,re)=>{const se=oe(n,I);if(se){if(k(I))return;const te=Ye(oe(i,I)),le=oe(i,I,Ye(V)?oe(s,I):V);Ye(le)||re&&re.defaultChecked||H?He(i,I,H?le:Iy(se._f)):R(I,le),l.mount&&!l.action&&(f(),te&&r.isDirty&&(d.isDirty||v.isDirty)&&(W()||(r.isDirty=!1,_.state.next({...r}))))}},S=(I,H,V,re,se)=>{let te=!1,le=!1;const he={name:I};if(!t.disabled){if(!V||re){(d.isDirty||v.isDirty)&&(le=r.isDirty,r.isDirty=he.isDirty=W(),te=le!==he.isDirty);const Ee=pr(oe(s,I),H);le=!!oe(r.dirtyFields,I),Ee!==r.isDirty?r.dirtyFields=Xi(s,i):Ee?gt(r.dirtyFields,I):He(r.dirtyFields,I,!0),he.dirtyFields=r.dirtyFields,te=te||(d.dirtyFields||v.dirtyFields)&&le!==!Ee}if(V){const Ee=oe(r.touchedFields,I);Ee||(He(r.touchedFields,I,V),he.touchedFields=r.touchedFields,te=te||(d.touchedFields||v.touchedFields)&&Ee!==V)}te&&se&&_.state.next(he)}return te?he:{}},E=(I,H,V,re)=>{const se=oe(r.errors,I),te=(d.isValid||v.isValid)&&fr(H)&&r.isValid!==H;if(t.delayError&&V?(c=x(()=>y(I,V)),c(t.delayError)):(clearTimeout(u),c=null,V?He(r.errors,I,V):gt(r.errors,I)),(V?!pr(se,V):se)||!Ot(re)||te){const le={...re,...te&&fr(H)?{isValid:H}:{},errors:r.errors,name:I};r={...r,...le},_.state.next(le)}},N=async I=>(p(I,!0),await t.resolver(i,t.context,z5(I||o.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),O=async I=>{const{errors:H}=await N(I);if(p(I),I)for(const V of I){const re=oe(H,V);re?o.array.has(V)&&nt(re)?zy(r.errors,{[V]:re},V):He(r.errors,V,re):gt(r.errors,V)}else r.errors=H;return H},T=async({name:I,eventType:H})=>{if(e.validate){const V=await e.validate({formValues:i,formState:r,name:I,eventType:H});if(nt(V))for(const re in V){const se=V[re];se&&z(`${Sh}.${re}`,{message:Ft(se.message)?se.message:"",type:se.type||Gr.validate})}else Ft(V)||!V?z(Sh,{message:V||"",type:Gr.validate}):A(Sh);return V}return!0},L=async({fields:I,onlyCheckValid:H,name:V,eventType:re,context:se={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(se.runRootValidation=!0,!await T({name:V,eventType:re})&&(se.valid=!1,H)))return se.valid;for(const te in I){const le=I[te];if(le){const{_f:he,...Ee}=le;if(he){const qe=o.array.has(he.name),zt=le._f&&U5(le._f),Ct=d.validatingFields||d.isValidating||v.validatingFields||v.isValidating;zt&&Ct&&p([he.name],!0);const Dn=await Wy(le,o.disabled,i,b,t.shouldUseNativeValidation&&!H,qe);if(zt&&Ct&&p([he.name]),Dn[he.name]&&(se.valid=!1,H)||(!H&&(oe(Dn,he.name)?qe?zy(r.errors,Dn,he.name):He(r.errors,he.name,Dn[he.name]):gt(r.errors,he.name)),e.shouldUseNativeValidation&&Dn[he.name]))break}!Ot(Ee)&&await L({context:se,onlyCheckValid:H,fields:Ee,name:te,eventType:re})}}return se.valid},$=()=>{for(const I of o.unMount){const H=oe(n,I);H&&(H._f.refs?H._f.refs.every(V=>!Ch(V)):!Ch(H._f.ref))&&ae(I)}o.unMount=new Set},W=(I,H)=>!t.disabled&&(I&&H&&He(i,I,H),!pr(ee(),s)),U=(I,H,V)=>sp(I,o,{...l.mount?i:Ye(H)?s:Ft(I)?{[I]:H}:H},V,H),K=I=>Ng(oe(l.mount?i:s,I,t.shouldUnregister?oe(s,I,[]):[])),R=(I,H,V={})=>{const re=oe(n,I);let se=H;if(re){const te=re._f;te&&(!te.disabled&&He(i,I,ck(H,te)),se=Lu(te.ref)&&Nt(H)?"":H,ok(te.ref)?[...te.ref.options].forEach(le=>le.selected=se.includes(le.value)):te.refs?Kl(te.ref)?te.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(se)?le.checked=!!se.find(he=>he===le.value):le.checked=se===le.value||!!se)}):te.refs.forEach(le=>le.checked=le.value===se):Lg(te.ref)?te.ref.value="":(te.ref.value=se,te.ref.type||_.state.next({name:I,values:ht(i)})))}(V.shouldDirty||V.shouldTouch)&&S(I,se,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&Z(I)},P=(I,H,V)=>{for(const re in H){if(!H.hasOwnProperty(re))return;const se=H[re],te=I+"."+re,le=oe(n,te);(o.array.has(I)||nt(se)||le&&!le._f)&&!hi(se)?P(te,se,V):R(te,se,V)}},D=(I,H,V={})=>{const re=oe(n,I),se=o.array.has(I),te=ht(H),le=oe(i,I),he=pr(le,te);if(he||He(i,I,te),se)_.array.next({name:I,values:ht(i)}),(d.isDirty||d.dirtyFields||v.isDirty||v.dirtyFields)&&V.shouldDirty&&(h(),_.state.next({name:I,dirtyFields:r.dirtyFields,isDirty:W(I,te)}));else{const Ee=Array.isArray(te)&&!te.length||Ot(te);!re||re._f||Nt(te)||Ee?R(I,te,V):P(I,te,V)}if(!he){const Ee=$y(I,o),qe=ht(i);if(!se)for(const zt of np(o.array,I))_.array.next({name:zt,values:qe});_.state.next({...Ee&&r,name:l.mount||Ee?I:void 0,values:qe})}},M=I=>{const H=It(I)?I(i):I;if(!pr(i,H)){i={...i,...H};for(const V of o.mount)D(V,oe(H,V));_.state.next({...r,values:i})}},B=async I=>{l.mount=!0;const H=I.target;let V=H.name,re=!0;const se=oe(n,V),te=Ee=>{re=Number.isNaN(Ee)||hi(Ee)&&isNaN(Ee.getTime())||pr(Ee,oe(i,V,Ee))},le=By(t.mode),he=By(t.reValidateMode);if(se){let Ee,qe;const zt=H.type?Iy(se._f):tk(I),Ct=I.type===gs.BLUR||I.type===gs.FOCUS_OUT,Dn=!W5(se._f)&&!e.validate&&!t.resolver&&!oe(r.errors,V)&&!se._f.deps||K5(Ct,oe(r.touchedFields,V),r.isSubmitted,he,le),ga=$y(V,o,Ct);He(i,V,zt),Ct?(!H||!H.readOnly)&&(se._f.onBlur&&se._f.onBlur(I),c&&c(0)):se._f.onChange&&se._f.onChange(I);const Hi=S(V,zt,Ct),Yl=!Ot(Hi)||ga;if(!Ct&&_.state.next({name:V,type:I.type,values:ht(i)}),Dn)return(d.isValid||v.isValid)&&(t.mode==="onBlur"?Ct&&f():Ct||f()),Yl&&_.state.next({name:V,...ga?{}:Hi});if(!t.resolver&&e.validate&&await T({name:V,eventType:I.type}),!Ct&&ga&&_.state.next({...r}),t.resolver){const{errors:Ql}=await N([V]);if(p([V]),te(zt),re){const va=Hy(r.errors,n,V),zr=Hy(Ql,n,va.name||V);Ee=zr.error,V=zr.name,qe=Ot(Ql)}}else p([V],!0),Ee=(await Wy(se,o.disabled,i,b,t.shouldUseNativeValidation))[V],p([V]),te(zt),re&&(Ee?qe=!1:(d.isValid||v.isValid)&&(qe=await L({fields:n,onlyCheckValid:!0,name:V,eventType:I.type})));re&&(se._f.deps&&(!Array.isArray(se._f.deps)||se._f.deps.length>0)&&Z(se._f.deps),E(V,qe,Ee,Hi))}},q=(I,H)=>{if(oe(r.errors,H)&&I.focus)return I.focus(),1},Z=async(I,H={})=>{let V,re;const se=Ja(I);if(t.resolver){const te=await O(Ye(I)?I:se);V=Ot(te),re=I?!se.some(le=>oe(te,le)):V}else I?(re=(await Promise.all(se.map(async te=>{const le=oe(n,te);return await L({fields:le&&le._f?{[te]:le}:le,eventType:gs.TRIGGER})}))).every(Boolean),!(!re&&!r.isValid)&&f()):re=V=await L({fields:n,name:I,eventType:gs.TRIGGER});return _.state.next({...!Ft(I)||(d.isValid||v.isValid)&&V!==r.isValid?{}:{name:I},...t.resolver||!I?{isValid:V}:{},errors:r.errors}),H.shouldFocus&&!re&&el(n,q,I?se:o.mount),re},ee=(I,H)=>{let V={...l.mount?i:s};return H&&(V=ik(H.dirtyFields?r.dirtyFields:r.touchedFields,V)),Ye(I)?V:Ft(I)?oe(V,I):I.map(re=>oe(V,re))},J=(I,H)=>({invalid:!!oe((H||r).errors,I),isDirty:!!oe((H||r).dirtyFields,I),error:oe((H||r).errors,I),isValidating:!!oe(r.validatingFields,I),isTouched:!!oe((H||r).touchedFields,I)}),A=I=>{const H=I?Ja(I):void 0;H==null||H.forEach(V=>gt(r.errors,V)),H?H.forEach(V=>{_.state.next({name:V,errors:r.errors})}):_.state.next({errors:{}})},z=(I,H,V)=>{const re=(oe(n,I,{_f:{}})._f||{}).ref,se=oe(r.errors,I)||{},{ref:te,message:le,type:he,...Ee}=se;He(r.errors,I,{...Ee,...H,ref:re}),_.state.next({name:I,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&re&&re.focus&&re.focus()},G=(I,H)=>It(I)?_.state.subscribe({next:V=>"values"in V&&I(V.values||U(void 0,H),V)}):U(I,H,!0),Y=I=>_.state.subscribe({next:H=>{if(q5(I.name,H.name,I.exact)&&V5(H,I.formState||d,An,I.reRenderRoot)){const V={...i};I.callback({values:V,...r,...H,defaultValues:s})}}}).unsubscribe,ye=I=>(l.mount=!0,v={...v,...I.formState},Y({...I,formState:{...g,...I.formState}})),ae=(I,H={})=>{for(const V of I?Ja(I):o.mount)o.mount.delete(V),o.array.delete(V),H.keepValue||(gt(n,V),gt(i,V)),!H.keepError&>(r.errors,V),!H.keepDirty&>(r.dirtyFields,V),!H.keepTouched&>(r.touchedFields,V),!H.keepIsValidating&>(r.validatingFields,V),!t.shouldUnregister&&!H.keepDefaultValue&>(s,V);_.state.next({values:ht(i)}),_.state.next({...r,...H.keepDirty?{isDirty:W()}:{}}),!H.keepIsValid&&f()},je=({disabled:I,name:H})=>{if(fr(I)&&l.mount||I||o.disabled.has(H)){const se=o.disabled.has(H)!==!!I;I?o.disabled.add(H):o.disabled.delete(H),se&&l.mount&&!l.action&&f()}},We=(I,H={})=>{let V=oe(n,I);const re=fr(H.disabled)||fr(t.disabled),se=!o.registerName.has(I)&&V&&V._f&&!V._f.mount;return He(n,I,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:I}},name:I,mount:!0,...H}}),o.mount.add(I),V&&!se?je({disabled:fr(H.disabled)?H.disabled:t.disabled,name:I}):j(I,!0,H.value),{...re?{disabled:H.disabled||t.disabled}:{},...t.progressive?{required:!!H.required,min:Da(H.min),max:Da(H.max),minLength:Da(H.minLength),maxLength:Da(H.maxLength),pattern:Da(H.pattern)}:{},name:I,onChange:B,onBlur:B,ref:te=>{if(te){o.registerName.add(I),We(I,H),o.registerName.delete(I),V=oe(n,I);const le=Ye(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,he=B5(le),Ee=V._f.refs||[];if(he?Ee.find(qe=>qe===le):le===V._f.ref)return;He(n,I,{_f:{...V._f,...he?{refs:[...Ee.filter(Ch),le,...Array.isArray(oe(s,I))?[{}]:[]],ref:{type:le.type,name:I}}:{ref:le}}}),j(I,!1,void 0,le)}else V=oe(n,I,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||H.shouldUnregister)&&!(np(o.array,I).length&&l.action)&&o.unMount.add(I)}}},ot=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&el(n,q,o.mount),ar=I=>{fr(I)&&(_.state.next({disabled:I}),el(n,(H,V)=>{const re=oe(n,V);re&&(H.disabled=re._f.disabled||I,Array.isArray(re._f.refs)&&re._f.refs.forEach(se=>{se.disabled=re._f.disabled||I}))},0,!1))},be=(I,H)=>async V=>{let re;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let se=ht(i);if(_.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:le}=await N();p(),r.errors=te,se=ht(le)}else await L({fields:n,eventType:gs.SUBMIT});if(o.disabled.size)for(const te of o.disabled)gt(se,te);if(gt(r.errors,rk),Ot(r.errors)){_.state.next({errors:{}});try{await I(se,V)}catch(te){re=te}}else H&&await H({...r.errors},V),ot(),setTimeout(ot);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ot(r.errors)&&!re,submitCount:r.submitCount+1,errors:r.errors}),re)throw re},lr=(I,H={})=>{oe(n,I)&&(Ye(H.defaultValue)?D(I,ht(oe(s,I))):(D(I,H.defaultValue),He(s,I,ht(H.defaultValue))),H.keepTouched||gt(r.touchedFields,I),H.keepDirty||(gt(r.dirtyFields,I),r.isDirty=H.defaultValue?W(I,ht(oe(s,I))):W()),H.keepError||(gt(r.errors,I),d.isValid&&f()),_.state.next({...r}))},cr=(I,H={})=>{const V=I?ht(I):s,re=ht(V),se=Ot(I),te=se?s:re;if(H.keepDefaultValues||(s=V),!H.keepValues){if(H.keepDirtyValues){const le=new Set([...o.mount,...Object.keys(Xi(s,i))]);for(const he of Array.from(le)){const Ee=oe(r.dirtyFields,he),qe=oe(i,he),zt=oe(te,he);Ee&&!Ye(qe)?He(te,he,qe):!Ee&&!Ye(zt)&&D(he,zt)}}else{if(Rg&&Ye(I))for(const le of o.mount){const he=oe(n,le);if(he&&he._f){const Ee=Array.isArray(he._f.refs)?he._f.refs[0]:he._f.ref;if(Lu(Ee)){const qe=Ee.closest("form");if(qe){qe.reset();break}}}}if(H.keepFieldsRef)for(const le of o.mount)D(le,oe(te,le));else n={}}i=t.shouldUnregister?H.keepDefaultValues?ht(s):{}:ht(te),_.array.next({values:{...te}}),_.state.next({values:{...te}})}o={mount:H.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!d.isValid||!!H.keepIsValid||!!H.keepDirtyValues||!t.shouldUnregister&&!Ot(te),l.watch=!!t.shouldUnregister,l.keepIsValid=!!H.keepIsValid,l.action=!1,H.keepErrors||(r.errors={}),_.state.next({submitCount:H.keepSubmitCount?r.submitCount:0,isDirty:se?!1:H.keepDirty?r.isDirty:!!(H.keepDefaultValues&&!pr(I,s)),isSubmitted:H.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:se?{}:H.keepDirtyValues?H.keepDefaultValues&&i?Xi(s,i):r.dirtyFields:H.keepDefaultValues&&I?Xi(s,I):H.keepDirty?r.dirtyFields:{},touchedFields:H.keepTouched?r.touchedFields:{},errors:H.keepErrors?r.errors:{},isSubmitSuccessful:H.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Tn=(I,H)=>cr(It(I)?I(i):I,{...t.resetOptions,...H}),Hr=(I,H={})=>{const V=oe(n,I),re=V&&V._f;if(re){const se=re.refs?re.refs[0]:re.ref;se.focus&&setTimeout(()=>{se.focus(),H.shouldSelect&&It(se.select)&&se.select()})}},An=I=>{r={...r,...I}},hn={control:{register:We,unregister:ae,getFieldState:J,handleSubmit:be,setError:z,_subscribe:Y,_runSchema:N,_updateIsValidating:p,_focusError:ot,_getWatch:U,_getDirty:W,_setValid:f,_setFieldArray:m,_setDisabledField:je,_setErrors:w,_getFieldArray:K,_reset:cr,_resetDefaultValues:()=>It(t.defaultValues)&&t.defaultValues().then(I=>{Tn(I,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:ar,_subjects:_,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(I){l=I},get _defaultValues(){return s},get _names(){return o},set _names(I){o=I},get _formState(){return r},get _options(){return t},set _options(I){t={...t,...I}}},subscribe:ye,trigger:Z,register:We,handleSubmit:be,watch:G,setValue:D,setValues:M,getValues:ee,reset:Tn,resetField:lr,clearErrors:A,unregister:ae,setError:z,setFocus:Hr,getFieldState:J};return{...hn,formControl:hn}}function Z5(e={}){const t=Q.useRef(void 0),r=Q.useRef(void 0),[n,s]=Q.useState(()=>({...ht(dk),isLoading:It(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:It(e.defaultValues)?void 0:e.defaultValues}));if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!It(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...o}=Q5(e);t.current={...o,formState:n}}const i=t.current.control;return i._options=e,Ag(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(o=>({...o,isReady:!0})),i._formState.isReady=!0,l},[i]),Q.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Q.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),Q.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),Q.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),Q.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),Q.useEffect(()=>{var l;e.values&&!pr(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(o=>({...o}))):i._resetDefaultValues()},[i,e.values]),Q.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=Q.useMemo(()=>nk(n,i),[i,n]),t.current}const Vy=(e,t,r)=>{if(e&&"reportValidity"in e){const n=oe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},hk=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Vy(n.ref,r,e):n.refs&&n.refs.forEach(s=>Vy(s,r,e))}},X5=(e,t)=>{t.shouldUseNativeValidation&&hk(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(J5(t.names||Object.keys(e),n)){const l=Object.assign({},oe(r,n));He(l,"root",i),He(r,n,l)}else He(r,n,i)}return r},J5=(e,t)=>e.some(r=>r.startsWith(t+"."));var e4=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,l=n.path.join(".");if(!r[l])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[l]={message:o.message,type:o.code}}else r[l]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(g){return g.errors.forEach(function(d){return e.push(d)})}),t){var c=r[l].types,u=c&&c[n.code];r[l]=sk(l,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},t4=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(l,o){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&hk({},i),{errors:{},values:r.raw?n:u}})}catch(u){return o(u)}return c&&c.then?c.then(void 0,o):c}(0,function(l){if(function(o){return Array.isArray(o==null?void 0:o.errors)}(l))return{values:{},errors:X5(e4(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}}},Ie;(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(o=>typeof s[s[o]]!="number"),l={};for(const o of i)l[o]=s[o];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})(Ie||(Ie={}));var qy;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(qy||(qy={}));const pe=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vs=e=>{switch(typeof e){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return Number.isNaN(e)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":return Array.isArray(e)?pe.array:e===null?pe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?pe.promise:typeof Map<"u"&&e instanceof Map?pe.map:typeof Set<"u"&&e instanceof Set?pe.set:typeof Date<"u"&&e instanceof Date?pe.date:pe.object;default:return pe.unknown}},ie=Ie.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 rs 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 o=n,c=0;for(;c<l.path.length;){const u=l.path[c];c===l.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(l))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof rs))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.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()}}rs.create=e=>new rs(e);const lp=(e,t)=>{let r;switch(e.code){case ie.invalid_type:e.received===pe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ie.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ie.joinValues(e.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ie.joinValues(e.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Ie.joinValues(e.options)}, received '${e.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.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}"`:Ie.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ie.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 ie.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 ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ie.assertNever(e)}return{message:r}};let r4=lp;function n4(){return r4}const s4=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 o="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)o=u(l,{data:t,defaultError:o}).message;return{...s,path:i,message:o}};function de(e,t){const r=n4(),n=s4({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===lp?void 0:lp].filter(s=>!!s)});e.common.issues.push(n)}class br{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 we;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 br.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 we;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 we=Object.freeze({status:"aborted"}),za=e=>({status:"dirty",value:e}),$r=e=>({status:"valid",value:e}),Ky=e=>e.status==="aborted",Gy=e=>e.status==="dirty",Zo=e=>e.status==="valid",Mu=e=>typeof Promise<"u"&&e instanceof Promise;var me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(me||(me={}));class Ys{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 Yy=(e,t)=>{if(Zo(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 rs(e.common.issues);return this._error=r,this._error}}};function Te(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,o)=>{const{message:c}=e;return l.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??n??o.defaultError}:l.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}class Me{get description(){return this._def.description}_getType(t){return vs(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:vs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new br,ctx:{common:t.parent.common,data:t.data,parsedType:vs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Mu(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:vs(t)},s=this._parseSync({data:t,path:n.path,parent:n});return Yy(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:vs(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return Zo(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=>Zo(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:vs(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(Mu(s)?s:Promise.resolve(s));return Yy(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),o=()=>i.addIssue({code:ie.custom,...n(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(o(),!1)):l?!0:(o(),!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 Jo({schema:this,typeName:Se.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 Us.create(this,this._def)}nullable(){return ea.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kn.create(this)}promise(){return $u.create(this,this._def)}or(t){return Bu.create([this,t],this._def)}and(t){return Fu.create(this,t,this._def)}transform(t){return new Jo({...Te(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new up({...Te(this._def),innerType:this,defaultValue:r,typeName:Se.ZodDefault})}brand(){return new j4({typeName:Se.ZodBranded,type:this,...Te(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new dp({...Te(this._def),innerType:this,catchValue:r,typeName:Se.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Mg.create(this,t)}readonly(){return hp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const i4=/^c[^\s-]{8,}$/i,o4=/^[0-9a-z]+$/,a4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,l4=/^[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,c4=/^[a-z0-9_-]{21}$/i,u4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,d4=/^[-+]?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)?)??$/,h4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,f4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kh;const p4=/^(?:(?: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])$/,m4=/^(?:(?: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])$/,g4=/^(([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]))$/,v4=/^(([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])$/,_4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,y4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fk="((\\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])))",x4=new RegExp(`^${fk}$`);function pk(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 b4(e){return new RegExp(`^${pk(e)}$`)}function w4(e){let t=`${fk}T${pk(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 S4(e,t){return!!((t==="v4"||!t)&&p4.test(e)||(t==="v6"||!t)&&g4.test(e))}function C4(e,t){if(!u4.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 k4(e,t){return!!((t==="v4"||!t)&&m4.test(e)||(t==="v6"||!t)&&v4.test(e))}class As extends Me{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==pe.string){const i=this._getOrReturnCtx(t);return de(i,{code:ie.invalid_type,expected:pe.string,received:i.parsedType}),we}const n=new br;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),de(s,{code:ie.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),de(s,{code:ie.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,o=t.data.length<i.value;(l||o)&&(s=this._getOrReturnCtx(t,s),l?de(s,{code:ie.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&de(s,{code:ie.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")h4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"email",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")kh||(kh=new RegExp(f4,"u")),kh.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"emoji",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")l4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"uuid",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")c4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"nanoid",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")i4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"cuid",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")o4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"cuid2",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")a4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"ulid",code:ie.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),de(s,{validation:"url",code:ie.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),de(s,{validation:"regex",code:ie.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),de(s,{code:ie.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),de(s,{code:ie.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),de(s,{code:ie.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?w4(i).test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{code:ie.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?x4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{code:ie.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?b4(i).test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{code:ie.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?d4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"duration",code:ie.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?S4(t.data,i.version)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"ip",code:ie.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?C4(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"jwt",code:ie.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?k4(t.data,i.version)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"cidr",code:ie.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?_4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"base64",code:ie.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?y4.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"base64url",code:ie.invalid_string,message:i.message}),n.dirty()):Ie.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:ie.invalid_string,...me.errToObj(n)})}_addCheck(t){return new As({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...me.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,...me.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,...me.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...me.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...me.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...me.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...me.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...me.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...me.errToObj(r)})}nonempty(t){return this.min(1,me.errToObj(t))}trim(){return new As({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new As({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new As({...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}}As.create=e=>new As({checks:[],typeName:Se.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Te(e)});function E4(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 Cl extends Me{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)!==pe.number){const i=this._getOrReturnCtx(t);return de(i,{code:ie.invalid_type,expected:pe.number,received:i.parsedType}),we}let n;const s=new br;for(const i of this._def.checks)i.kind==="int"?Ie.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:ie.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),de(n,{code:ie.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),de(n,{code:ie.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?E4(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),de(n,{code:ie.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:ie.not_finite,message:i.message}),s.dirty()):Ie.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,me.toString(r))}setLimit(t,r,n,s){return new Cl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:me.toString(s)}]})}_addCheck(t){return new Cl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.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"&&Ie.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)}}Cl.create=e=>new Cl({checks:[],typeName:Se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Te(e)});class kl extends Me{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)!==pe.bigint)return this._getInvalidInput(t);let n;const s=new br;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),de(n,{code:ie.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),de(n,{code:ie.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),de(n,{code:ie.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Ie.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return de(r,{code:ie.invalid_type,expected:pe.bigint,received:r.parsedType}),we}gte(t,r){return this.setLimit("min",t,!0,me.toString(r))}gt(t,r){return this.setLimit("min",t,!1,me.toString(r))}lte(t,r){return this.setLimit("max",t,!0,me.toString(r))}lt(t,r){return this.setLimit("max",t,!1,me.toString(r))}setLimit(t,r,n,s){return new kl({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:me.toString(s)}]})}_addCheck(t){return new kl({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:me.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}}kl.create=e=>new kl({checks:[],typeName:Se.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Te(e)});class Qy extends Me{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==pe.boolean){const n=this._getOrReturnCtx(t);return de(n,{code:ie.invalid_type,expected:pe.boolean,received:n.parsedType}),we}return $r(t.data)}}Qy.create=e=>new Qy({typeName:Se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Te(e)});class Iu extends Me{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==pe.date){const i=this._getOrReturnCtx(t);return de(i,{code:ie.invalid_type,expected:pe.date,received:i.parsedType}),we}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return de(i,{code:ie.invalid_date}),we}const n=new br;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),de(s,{code:ie.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),de(s,{code:ie.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ie.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Iu({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:me.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}}Iu.create=e=>new Iu({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Se.ZodDate,...Te(e)});class Zy extends Me{_parse(t){if(this._getType(t)!==pe.symbol){const n=this._getOrReturnCtx(t);return de(n,{code:ie.invalid_type,expected:pe.symbol,received:n.parsedType}),we}return $r(t.data)}}Zy.create=e=>new Zy({typeName:Se.ZodSymbol,...Te(e)});class Xy extends Me{_parse(t){if(this._getType(t)!==pe.undefined){const n=this._getOrReturnCtx(t);return de(n,{code:ie.invalid_type,expected:pe.undefined,received:n.parsedType}),we}return $r(t.data)}}Xy.create=e=>new Xy({typeName:Se.ZodUndefined,...Te(e)});class Jy extends Me{_parse(t){if(this._getType(t)!==pe.null){const n=this._getOrReturnCtx(t);return de(n,{code:ie.invalid_type,expected:pe.null,received:n.parsedType}),we}return $r(t.data)}}Jy.create=e=>new Jy({typeName:Se.ZodNull,...Te(e)});class ex extends Me{constructor(){super(...arguments),this._any=!0}_parse(t){return $r(t.data)}}ex.create=e=>new ex({typeName:Se.ZodAny,...Te(e)});class tx extends Me{constructor(){super(...arguments),this._unknown=!0}_parse(t){return $r(t.data)}}tx.create=e=>new tx({typeName:Se.ZodUnknown,...Te(e)});class Qs extends Me{_parse(t){const r=this._getOrReturnCtx(t);return de(r,{code:ie.invalid_type,expected:pe.never,received:r.parsedType}),we}}Qs.create=e=>new Qs({typeName:Se.ZodNever,...Te(e)});class rx extends Me{_parse(t){if(this._getType(t)!==pe.undefined){const n=this._getOrReturnCtx(t);return de(n,{code:ie.invalid_type,expected:pe.void,received:n.parsedType}),we}return $r(t.data)}}rx.create=e=>new rx({typeName:Se.ZodVoid,...Te(e)});class kn extends Me{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==pe.array)return de(r,{code:ie.invalid_type,expected:pe.array,received:r.parsedType}),we;if(s.exactLength!==null){const l=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(l||o)&&(de(r,{code:l?ie.too_big:ie.too_small,minimum:o?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&&(de(r,{code:ie.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&&(de(r,{code:ie.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,o)=>s.type._parseAsync(new Ys(r,l,r.path,o)))).then(l=>br.mergeArray(n,l));const i=[...r.data].map((l,o)=>s.type._parseSync(new Ys(r,l,r.path,o)));return br.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new kn({...this._def,minLength:{value:t,message:me.toString(r)}})}max(t,r){return new kn({...this._def,maxLength:{value:t,message:me.toString(r)}})}length(t,r){return new kn({...this._def,exactLength:{value:t,message:me.toString(r)}})}nonempty(t){return this.min(1,t)}}kn.create=(e,t)=>new kn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...Te(t)});function Ji(e){if(e instanceof vt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Us.create(Ji(n))}return new vt({...e._def,shape:()=>t})}else return e instanceof kn?new kn({...e._def,type:Ji(e.element)}):e instanceof Us?Us.create(Ji(e.unwrap())):e instanceof ea?ea.create(Ji(e.unwrap())):e instanceof Di?Di.create(e.items.map(t=>Ji(t))):e}class vt extends Me{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=Ie.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==pe.object){const u=this._getOrReturnCtx(t);return de(u,{code:ie.invalid_type,expected:pe.object,received:u.parsedType}),we}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),o=[];if(!(this._def.catchall instanceof Qs&&this._def.unknownKeys==="strip"))for(const u in s.data)l.includes(u)||o.push(u);const c=[];for(const u of l){const g=i[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:g._parse(new Ys(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Qs){const u=this._def.unknownKeys;if(u==="passthrough")for(const g of o)c.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(u==="strict")o.length>0&&(de(s,{code:ie.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const g of o){const d=s.data[g];c.push({key:{status:"valid",value:g},value:u._parse(new Ys(s,d,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const g of c){const d=await g.key,v=await g.value;u.push({key:d,value:v,alwaysSet:g.alwaysSet})}return u}).then(u=>br.mergeObjectSync(n,u)):br.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new vt({...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:me.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new vt({...this._def,unknownKeys:"strip"})}passthrough(){return new vt({...this._def,unknownKeys:"passthrough"})}extend(t){return new vt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new vt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Se.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new vt({...this._def,catchall:t})}pick(t){const r={};for(const n of Ie.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new vt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Ie.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new vt({...this._def,shape:()=>r})}deepPartial(){return Ji(this)}partial(t){const r={};for(const n of Ie.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new vt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Ie.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Us;)i=i._def.innerType;r[n]=i}return new vt({...this._def,shape:()=>r})}keyof(){return mk(Ie.objectKeys(this.shape))}}vt.create=(e,t)=>new vt({shape:()=>e,unknownKeys:"strip",catchall:Qs.create(),typeName:Se.ZodObject,...Te(t)});vt.strictCreate=(e,t)=>new vt({shape:()=>e,unknownKeys:"strict",catchall:Qs.create(),typeName:Se.ZodObject,...Te(t)});vt.lazycreate=(e,t)=>new vt({shape:e,unknownKeys:"strip",catchall:Qs.create(),typeName:Se.ZodObject,...Te(t)});class Bu extends Me{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const l=i.map(o=>new rs(o.ctx.common.issues));return de(r,{code:ie.invalid_union,unionErrors:l}),we}if(r.common.async)return Promise.all(n.map(async i=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},g=c._parseSync({data:r.data,path:r.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const o=l.map(c=>new rs(c));return de(r,{code:ie.invalid_union,unionErrors:o}),we}}get options(){return this._def.options}}Bu.create=(e,t)=>new Bu({options:e,typeName:Se.ZodUnion,...Te(t)});function cp(e,t){const r=vs(e),n=vs(t);if(e===t)return{valid:!0,data:e};if(r===pe.object&&n===pe.object){const s=Ie.objectKeys(t),i=Ie.objectKeys(e).filter(o=>s.indexOf(o)!==-1),l={...e,...t};for(const o of i){const c=cp(e[o],t[o]);if(!c.valid)return{valid:!1};l[o]=c.data}return{valid:!0,data:l}}else if(r===pe.array&&n===pe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const l=e[i],o=t[i],c=cp(l,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===pe.date&&n===pe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Fu extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(i,l)=>{if(Ky(i)||Ky(l))return we;const o=cp(i.value,l.value);return o.valid?((Gy(i)||Gy(l))&&r.dirty(),{status:r.value,value:o.data}):(de(n,{code:ie.invalid_intersection_types}),we)};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}))}}Fu.create=(e,t,r)=>new Fu({left:e,right:t,typeName:Se.ZodIntersection,...Te(r)});class Di extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==pe.array)return de(n,{code:ie.invalid_type,expected:pe.array,received:n.parsedType}),we;if(n.data.length<this._def.items.length)return de(n,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),we;!this._def.rest&&n.data.length>this._def.items.length&&(de(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((l,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Ys(n,l,n.path,o)):null}).filter(l=>!!l);return n.common.async?Promise.all(i).then(l=>br.mergeArray(r,l)):br.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Di({...this._def,rest:t})}}Di.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Di({items:e,typeName:Se.ZodTuple,rest:null,...Te(t)})};class nx extends Me{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!==pe.map)return de(n,{code:ie.invalid_type,expected:pe.map,received:n.parsedType}),we;const s=this._def.keyType,i=this._def.valueType,l=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new Ys(n,o,n.path,[u,"key"])),value:i._parse(new Ys(n,c,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of l){const u=await c.key,g=await c.value;if(u.status==="aborted"||g.status==="aborted")return we;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),o.set(u.value,g.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const c of l){const u=c.key,g=c.value;if(u.status==="aborted"||g.status==="aborted")return we;(u.status==="dirty"||g.status==="dirty")&&r.dirty(),o.set(u.value,g.value)}return{status:r.value,value:o}}}}nx.create=(e,t,r)=>new nx({valueType:t,keyType:e,typeName:Se.ZodMap,...Te(r)});class El extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==pe.set)return de(n,{code:ie.invalid_type,expected:pe.set,received:n.parsedType}),we;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(de(n,{code:ie.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&&(de(n,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function l(c){const u=new Set;for(const g of c){if(g.status==="aborted")return we;g.status==="dirty"&&r.dirty(),u.add(g.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((c,u)=>i._parse(new Ys(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>l(c)):l(o)}min(t,r){return new El({...this._def,minSize:{value:t,message:me.toString(r)}})}max(t,r){return new El({...this._def,maxSize:{value:t,message:me.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}El.create=(e,t)=>new El({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...Te(t)});class sx extends Me{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})}}sx.create=(e,t)=>new sx({getter:e,typeName:Se.ZodLazy,...Te(t)});class ix extends Me{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return de(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:t.data}}get value(){return this._def.value}}ix.create=(e,t)=>new ix({value:e,typeName:Se.ZodLiteral,...Te(t)});function mk(e,t){return new Xo({values:e,typeName:Se.ZodEnum,...Te(t)})}class Xo extends Me{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{expected:Ie.joinValues(n),received:r.parsedType,code:ie.invalid_type}),we}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 de(r,{received:r.data,code:ie.invalid_enum_value,options:n}),we}return $r(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 Xo.create(t,{...this._def,...r})}exclude(t,r=this._def){return Xo.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Xo.create=mk;class ox extends Me{_parse(t){const r=Ie.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==pe.string&&n.parsedType!==pe.number){const s=Ie.objectValues(r);return de(n,{expected:Ie.joinValues(s),received:n.parsedType,code:ie.invalid_type}),we}if(this._cache||(this._cache=new Set(Ie.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Ie.objectValues(r);return de(n,{received:n.data,code:ie.invalid_enum_value,options:s}),we}return $r(t.data)}get enum(){return this._def.values}}ox.create=(e,t)=>new ox({values:e,typeName:Se.ZodNativeEnum,...Te(t)});class $u extends Me{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==pe.promise&&r.common.async===!1)return de(r,{code:ie.invalid_type,expected:pe.promise,received:r.parsedType}),we;const n=r.parsedType===pe.promise?r.data:Promise.resolve(r.data);return $r(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}$u.create=(e,t)=>new $u({type:e,typeName:Se.ZodPromise,...Te(t)});class Jo extends Me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.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=>{de(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 o=>{if(r.value==="aborted")return we;const c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?we:c.status==="dirty"||r.value==="dirty"?za(c.value):c});{if(r.value==="aborted")return we;const o=this._def.schema._parseSync({data:l,path:n.path,parent:n});return o.status==="aborted"?we:o.status==="dirty"||r.value==="dirty"?za(o.value):o}}if(s.type==="refinement"){const l=o=>{const c=s.refinement(o,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 o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?we:(o.status==="dirty"&&r.dirty(),l(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?we:(o.status==="dirty"&&r.dirty(),l(o.value).then(()=>({status:r.value,value:o.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(!Zo(l))return we;const o=s.transform(l.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>Zo(l)?Promise.resolve(s.transform(l.value,i)).then(o=>({status:r.value,value:o})):we);Ie.assertNever(s)}}Jo.create=(e,t,r)=>new Jo({schema:e,typeName:Se.ZodEffects,effect:t,...Te(r)});Jo.createWithPreprocess=(e,t,r)=>new Jo({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...Te(r)});class Us extends Me{_parse(t){return this._getType(t)===pe.undefined?$r(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:Se.ZodOptional,...Te(t)});class ea extends Me{_parse(t){return this._getType(t)===pe.null?$r(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ea.create=(e,t)=>new ea({innerType:e,typeName:Se.ZodNullable,...Te(t)});class up extends Me{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===pe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}up.create=(e,t)=>new up({innerType:e,typeName:Se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});class dp extends Me{_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 Mu(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new rs(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new rs(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}dp.create=(e,t)=>new dp({innerType:e,typeName:Se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});class ax extends Me{_parse(t){if(this._getType(t)!==pe.nan){const n=this._getOrReturnCtx(t);return de(n,{code:ie.invalid_type,expected:pe.nan,received:n.parsedType}),we}return{status:"valid",value:t.data}}}ax.create=e=>new ax({typeName:Se.ZodNaN,...Te(e)});class j4 extends Me{_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 Mg extends Me{_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"?we:i.status==="dirty"?(r.dirty(),za(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"?we: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 Mg({in:t,out:r,typeName:Se.ZodPipeline})}}class hp extends Me{_parse(t){const r=this._def.innerType._parse(t),n=s=>(Zo(s)&&(s.value=Object.freeze(s.value)),s);return Mu(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}hp.create=(e,t)=>new hp({innerType:e,typeName:Se.ZodReadonly,...Te(t)});var Se;(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"})(Se||(Se={}));const lx=As.create;Qs.create;kn.create;const R4=vt.create;Bu.create;Fu.create;Di.create;Xo.create;$u.create;Us.create;ea.create;const N4=I5,gk=C.createContext({}),cx=e=>a.jsx(gk.Provider,{value:{name:e.name},children:a.jsx(O5,{...e})}),vk=C.createContext({}),jd=()=>{const e=C.useContext(gk),t=C.useContext(vk),{getFieldState:r,formState:n}=M5(),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}},fp=C.forwardRef(({className:e,...t},r)=>{const n=C.useId();return a.jsx(vk.Provider,{value:{id:n},children:a.jsx("div",{ref:r,className:X("flex flex-col gap-1.5",e),...t})})});fp.displayName="FormItem";const pp=C.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=jd();return a.jsx(yr,{ref:r,className:X(n&&"text-[var(--break-red)]",e),htmlFor:s,...t})});pp.displayName="FormLabel";const mp=C.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=jd();return a.jsx(cw,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:s,"aria-invalid":!!r,...e})});mp.displayName="FormControl";const _k=C.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=jd();return a.jsx("p",{ref:r,id:n,className:X("font-mono text-[11px] text-[var(--fg-dim)]",e),...t})});_k.displayName="FormDescription";const gp=C.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=jd(),l=s?String((s==null?void 0:s.message)??""):t;return l?a.jsx("p",{ref:n,id:i,className:X("font-mono text-[11px] text-[var(--break-red)]",e),...r,children:l}):null});gp.displayName="FormMessage";const P4=R4({current:lx().min(1,"Current password is required."),next:lx().min(8,"New password must be at least 8 characters.")});function T4(){const[e,t]=C.useState("idle"),r=Z5({resolver:t4(P4),defaultValues:{current:"",next:""}}),n=async s=>{t("rotating");try{await ge.changeKeystorePassword(s.current,s.next),r.reset({current:"",next:""}),Gs.success("Password rotated",{description:"Re-run `jinn run` with the new password."})}catch(i){Gs.error("Rotation failed",{description:i instanceof Error?i.message:String(i)})}finally{t("idle")}};return a.jsx("div",{"data-testid":"security-tab",children:a.jsxs(ke,{className:"border-[var(--severity-blocking-border)]",children:[a.jsxs(Rn,{className:"flex flex-row items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.jsxs(oa,{className:"flex items-center gap-2 text-[var(--break-red)]",children:[a.jsx(SN,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Security"]}),a.jsx(od,{children:"Rotate keystore password · last rotated never"})]}),a.jsx(Pe,{variant:"destructive",children:"Danger zone"})]}),a.jsx(et,{children:a.jsx(N4,{...r,children:a.jsxs("form",{onSubmit:r.handleSubmit(n),className:"flex flex-col gap-4","data-testid":"security-password-form",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(cx,{control:r.control,name:"current",render:({field:s})=>a.jsxs(fp,{children:[a.jsx(pp,{children:"Current password"}),a.jsx(mp,{children:a.jsx(ct,{type:"password",autoComplete:"current-password",...s})}),a.jsx(gp,{})]})}),a.jsx(cx,{control:r.control,name:"next",render:({field:s})=>a.jsxs(fp,{children:[a.jsx(pp,{children:"New password"}),a.jsx(mp,{children:a.jsx(ct,{type:"password",autoComplete:"new-password",...s})}),a.jsx(_k,{children:"At least 8 characters."}),a.jsx(gp,{})]})})]}),a.jsxs(ce,{type:"submit",variant:"destructive",disabled:e==="rotating"||!r.formState.isValid,className:"self-start",children:[a.jsx(gN,{className:"h-3 w-3","aria-hidden":"true"}),e==="rotating"?"Rotating…":"Rotate password"]})]})})})]})})}function A4(e){const t=[],r=e.split(`
|
|
267
|
+
`);let n=0;for(;n<r.length;){const s=r[n]??"";if(/^```/.test(s)){const o=s.slice(3).trim(),c=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)c.push(r[n]??""),n++;n++,t.push({kind:"code",lang:o,text:c.join(`
|
|
268
|
+
`)});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 o=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)o.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:o});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 ux(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 D4(e){const t=A4(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},...ux(s)))):C.createElement("p",{key:n},...ux(r.text??""))))}const L4=`# Build a plug-in
|
|
269
|
+
|
|
270
|
+
Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
|
|
271
|
+
|
|
272
|
+
## 1. Scaffold
|
|
273
|
+
|
|
274
|
+
\`\`\`bash
|
|
275
|
+
jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
|
|
276
|
+
cd @you/my-swe-skill
|
|
277
|
+
yarn install
|
|
278
|
+
yarn test
|
|
279
|
+
\`\`\`
|
|
280
|
+
|
|
281
|
+
The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
|
|
282
|
+
|
|
283
|
+
\`\`\`
|
|
284
|
+
@you/my-swe-skill/
|
|
285
|
+
├── jinn.plugin.json # the canonical manifest
|
|
286
|
+
├── skills/example/SKILL.md
|
|
287
|
+
├── test/plugin.test.ts # passes immediately
|
|
288
|
+
├── package.json
|
|
289
|
+
├── tsconfig.json
|
|
290
|
+
└── README.md
|
|
291
|
+
\`\`\`
|
|
292
|
+
|
|
293
|
+
## 2. Edit your skill
|
|
294
|
+
|
|
295
|
+
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\`.
|
|
296
|
+
|
|
297
|
+
## 3. Publish to npm + chain
|
|
298
|
+
|
|
299
|
+
\`\`\`bash
|
|
300
|
+
npm publish --access public
|
|
301
|
+
jinn solver-plugins publish npm:@you/my-swe-skill
|
|
302
|
+
\`\`\`
|
|
303
|
+
|
|
304
|
+
\`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.
|
|
305
|
+
|
|
306
|
+
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.
|
|
307
|
+
|
|
308
|
+
## 4. Confirm it published
|
|
309
|
+
|
|
310
|
+
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.
|
|
311
|
+
|
|
312
|
+
## 5. Run it
|
|
313
|
+
|
|
314
|
+
An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
|
|
315
|
+
|
|
316
|
+
\`\`\`bash
|
|
317
|
+
jinn solver-plugins show npm:@you/my-swe-skill
|
|
318
|
+
jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
|
|
319
|
+
\`\`\`
|
|
320
|
+
|
|
321
|
+
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.
|
|
322
|
+
|
|
323
|
+
## Next
|
|
324
|
+
|
|
325
|
+
- \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
|
|
326
|
+
- \`examples.md\` — annotated reference plug-ins.
|
|
327
|
+
- \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
|
|
328
|
+
- \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
|
|
329
|
+
- \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
|
|
330
|
+
`,O4="https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md",dx="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function M4(){return a.jsxs(ke,{className:"p-6",children:[a.jsx(Rn,{className:"mb-2 p-0",children:a.jsx("span",{className:dx,children:"Quickstart · 60 seconds"})}),a.jsxs(et,{className:"p-0",children:[a.jsx("div",{className:"hfmf-intro-markdown",children:D4(L4)}),a.jsx(pt,{className:"my-5"}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsx("span",{className:dx,children:"Next"}),a.jsx("a",{href:O4,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 I4=[{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."}],B4=[{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"] } }'}],Eh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function F4(){return a.jsxs(ke,{className:"p-6",children:[a.jsxs(Rn,{className:"mb-5 flex flex-col gap-1 p-0",children:[a.jsx("span",{className:Eh,children:"Reference"}),a.jsx("h2",{className:"m-0 font-serif text-[28px] leading-[1.2] text-foreground",children:"Plug-in shape"})]}),a.jsxs(et,{className:"p-0",children:[a.jsxs(da,{children:[a.jsx(ha,{children:a.jsxs(cn,{children:[a.jsx(tt,{children:"Field"}),a.jsx(tt,{children:"Type"}),a.jsx(tt,{children:"Required"}),a.jsx(tt,{children:"Description"})]})}),a.jsx(fa,{children:I4.map(e=>a.jsxs(cn,{"data-field-required":e.required?"true":"false",children:[a.jsx(rt,{className:"font-mono text-[13px] text-primary",children:e.name}),a.jsx(rt,{className:"font-mono text-[13px] text-muted-foreground",children:e.type}),a.jsx(rt,{children:a.jsx(Pe,{variant:e.required?"default":"outline",children:e.required?"yes":"no"})}),a.jsx(rt,{className:"font-mono text-[13px] text-muted-foreground",children:e.description})]},e.name))})]}),a.jsx(pt,{className:"my-8"}),a.jsxs("div",{className:"mb-4 flex flex-col gap-1",children:[a.jsx("span",{className:Eh,children:"Modes"}),a.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Two modes"}),a.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."})]}),a.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:B4.map((e,t)=>a.jsxs(ke,{className:"flex flex-col gap-2.5 bg-[var(--bg-sunken)] p-4",children:[a.jsx("span",{className:Eh,children:t===0?"Mode · 01":"Mode · 02"}),a.jsx("h4",{className:"m-0 font-mono text-[15px] font-medium tracking-[-0.01em] text-foreground",children:e.label}),a.jsx("p",{className:"m-0 font-mono text-[12px] leading-[1.6] text-muted-foreground",children:e.requires}),a.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:a.jsx("code",{children:e.example})})]},e.id))})]})]})}const yk="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function $4(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function Nc({solverType:e}){return a.jsxs(Rn,{className:"mb-5 flex flex-col gap-1 p-0",children:[a.jsx("span",{className:yk,children:"Registry"}),a.jsxs("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:["Published plug-ins for ",e]})]})}function H4({solverType:e}){const{data:t,isLoading:r,error:n}=Oe({queryKey:["discovery","plugin-publications",e],queryFn:()=>ge.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return a.jsxs(ke,{className:"p-6",children:[a.jsx(Nc,{solverType:e}),a.jsxs(et,{className:"flex flex-col gap-2 p-0",children:[a.jsx(Lr,{className:"h-4 w-full"}),a.jsx(Lr,{className:"h-4 w-5/6"}),a.jsx(Lr,{className:"h-4 w-4/6"})]})]});if(n)return a.jsxs(ke,{className:"p-6",children:[a.jsx(Nc,{solverType:e}),a.jsx(et,{className:"p-0",children:a.jsx(ut,{variant:"blocking",children:a.jsxs(mt,{children:["Discovery unavailable. ",n.message]})})})]});const s=(t==null?void 0:t.publications)??[];return s.length===0?a.jsxs(ke,{className:"p-6",children:[a.jsx(Nc,{solverType:e}),a.jsx(et,{className:"p-0",children:a.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[a.jsx("span",{className:yk,children:"Empty registry"}),a.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."}),a.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Run"," ",a.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."]})]})})]}):a.jsxs(ke,{className:"p-6",children:[a.jsx(Nc,{solverType:e}),a.jsx(et,{className:"p-0",children:a.jsxs(da,{children:[a.jsx(ha,{children:a.jsxs(cn,{children:[a.jsx(tt,{children:"Plug-in"}),a.jsx(tt,{children:"Version"}),a.jsx(tt,{children:"Builder agentId"}),a.jsx(tt,{children:"CID"}),a.jsx(tt,{children:"Status"})]})}),a.jsx(fa,{children:s.map(i=>a.jsxs(cn,{children:[a.jsx(rt,{className:"font-mono text-[12px] text-foreground",children:i.name}),a.jsx(rt,{className:"font-mono text-[12px] text-muted-foreground",children:i.version}),a.jsx(rt,{className:"font-mono text-[12px] text-muted-foreground",children:i.builderAgentId}),a.jsx(rt,{className:"font-mono text-[12px] text-muted-foreground",children:$4(i.cid)}),a.jsx(rt,{children:i.revoked?a.jsxs(Pe,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:["Revoked",i.revokedReason?` · ${i.revokedReason}`:""]}):a.jsx(Pe,{variant:"success",className:"rounded-full",children:"Active"})})]},`${i.builderAgentId}:${i.cid}`))})]})})]})}const vp="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",jh="rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary";function La(){return a.jsxs(Rn,{className:"mb-5 flex flex-col gap-1 p-0",children:[a.jsx("span",{className:vp,children:"Builder"}),a.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Your published plug-ins"})]})}function z4({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:s}=Oe({queryKey:["discovery","builder-artifacts",e],queryFn:()=>ge.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return a.jsxs(ke,{className:"bg-[var(--bg-sunken)] p-6",children:[a.jsx(La,{}),a.jsx(et,{className:"p-0",children:a.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border p-6",children:[a.jsx("span",{className:vp,children:"Identity pending"}),a.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"," ",a.jsx("code",{className:jh,children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})]})})]});if(n)return a.jsxs(ke,{className:"p-6",children:[a.jsx(La,{}),a.jsxs(et,{className:"flex flex-col gap-2 p-0",children:[a.jsx(Lr,{className:"h-4 w-full"}),a.jsx(Lr,{className:"h-4 w-5/6"}),a.jsx(Lr,{className:"h-4 w-4/6"})]})]});if(s)return a.jsxs(ke,{className:"p-6",children:[a.jsx(La,{}),a.jsx(et,{className:"p-0",children:a.jsx(ut,{variant:"blocking",children:a.jsx(mt,{children:"Discovery unavailable."})})})]});const i=((r==null?void 0:r.artifacts)??[]).filter(l=>l.artifactType==="plugin");return i.length===0?a.jsxs(ke,{className:"p-6",children:[a.jsx(La,{}),a.jsx(et,{className:"p-0",children:a.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[a.jsx("span",{className:vp,children:"Nothing yet"}),a.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"," ",a.jsx("code",{className:jh,children:"jinn create plugin"}),", then publish with ",a.jsx("code",{className:jh,children:"jinn solver-plugins publish"}),". It will appear here under your builder agentId."]})]})})]}):a.jsxs(ke,{className:"p-6",children:[a.jsx(La,{}),a.jsx(et,{className:"p-0",children:a.jsxs(da,{children:[a.jsx(ha,{children:a.jsxs(cn,{children:[a.jsx(tt,{children:"Plug-in"}),a.jsx(tt,{children:"Version"}),a.jsx(tt,{children:"Supports"}),a.jsx(tt,{children:"Status"})]})}),a.jsx(fa,{children:i.map(l=>a.jsxs(cn,{children:[a.jsx(rt,{className:"font-mono text-[12px] text-foreground",children:l.name}),a.jsx(rt,{className:"font-mono text-[12px] text-muted-foreground",children:l.version}),a.jsx(rt,{className:"font-mono text-[12px] text-muted-foreground",children:l.supports.join(", ")}),a.jsx(rt,{children:l.revoked?a.jsx(Pe,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:"Revoked"}):a.jsx(Pe,{variant:"success",className:"rounded-full",children:"Active"})})]},`${l.builderAgentId}:${l.cid}`))})]})})]})}function U4({value:e,onChange:t}){const r=e==="plugin";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ce,{type:"button",variant:r?"outline":"ghost",size:"sm","aria-pressed":r?"true":"false",className:"rounded-full",onClick:()=>{r||t("plugin")},children:"Plug-ins"}),a.jsxs(ce,{type:"button",variant:"ghost",size:"sm",disabled:!0,"aria-pressed":"false",className:"rounded-full opacity-60",children:["Harnesses",a.jsx("span",{className:"ml-1 border-l border-border pl-2 text-[9px] tracking-[0.14em] text-[var(--fg-dim)]",children:"Coming soon"})]})]})}const W4="swe-rebench-v2.v1";function V4(){const{data:e}=Oe({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:5e3}),[t,r]=C.useState("plugin");return a.jsxs("div",{className:"mx-auto flex max-w-[1100px] flex-col gap-6 px-6 pb-12 pt-8",children:[a.jsxs("header",{className:"flex flex-col gap-2 pb-2",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",children:"Build · Plug-ins"}),a.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."})]}),a.jsx(M4,{}),a.jsx(F4,{}),a.jsx(pt,{}),a.jsxs("div",{className:"flex items-center justify-between gap-4 pt-2",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Registry"}),a.jsx(U4,{value:t,onChange:r})]}),t==="plugin"?a.jsxs(a.Fragment,{children:[a.jsx(H4,{solverType:W4}),a.jsx(z4,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}const Rh=({...e})=>a.jsx(lD,{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 q4(){const{data:e,isLoading:t}=Oe({queryKey:["bootstrap"],queryFn:()=>ge.getBootstrap(),refetchInterval:1500}),[r,n]=C.useState(!1),s={restartPending:r,setRestartPending:n};if(t||!e||e.mode==="uninitialized"){const c=e?e.mode==="uninitialized"?"Setting up your wallet":"Loading":"Starting jinn";return a.jsxs(Cn,{delayDuration:150,children:[a.jsx($2,{headline:c}),a.jsx(Rh,{})]})}if(e.mode!=="running")return a.jsxs(Cn,{delayDuration:150,children:[a.jsx(yA,{}),a.jsx(Rh,{})]});const i=e.chain==="base"?"mainnet":"testnet",{pluginBuilderUi:l,embeddedAgent:o}=Mm();return a.jsx(Cn,{delayDuration:150,children:a.jsxs(SS.Provider,{value:s,children:[a.jsx(sw,{children:a.jsx(AA,{header:a.jsx(DA,{network:i}),tabs:a.jsx(LA,{}),rail:o?a.jsx(OA,{}):void 0,children:a.jsxs(nN,{children:[a.jsx(Ut,{path:"/overview",component:LD}),a.jsx(Ut,{path:"/operator/join/:cid",children:a.jsx(sI,{})}),a.jsx(Ut,{path:"/operator/execution-data",children:a.jsx(Aa,{children:a.jsx(kI,{})})}),a.jsx(Ut,{path:"/operator/memberships",children:a.jsx(Aa,{children:a.jsx(v5,{onRestartPending:()=>n(!0)})})}),a.jsx(Ut,{path:"/operator/registry",children:a.jsx(Aa,{children:a.jsx(R5,{})})}),a.jsx(Ut,{path:"/operator/network",children:a.jsx(Aa,{children:a.jsx(N5,{onRestartPending:()=>n(!0)})})}),a.jsx(Ut,{path:"/operator/security",children:a.jsx(Aa,{children:a.jsx(T4,{})})}),a.jsx(Ut,{path:"/operator",children:a.jsx($a,{to:"/operator/memberships"})}),a.jsx(Ut,{path:"/captures",children:a.jsx($a,{to:"/operator/execution-data"})}),a.jsx(Ut,{path:"/configuration",children:a.jsx(K4,{})}),a.jsx(Ut,{path:"/launcher/create",children:a.jsx(pL,{})}),a.jsx(Ut,{path:"/launcher/launched/:solverNetId",children:a.jsx(pM,{})}),a.jsx(Ut,{path:"/launcher",children:a.jsx(HD,{})}),a.jsx(Ut,{path:"/build",children:l?a.jsx(V4,{}):a.jsx($a,{to:"/overview"})}),a.jsx(Ut,{children:a.jsx($a,{to:"/overview"})})]})})}),a.jsx(Rh,{})]})})}function K4(){const e=typeof window>"u"?"":window.location.hash;return a.jsx($a,{to:`/operator${e}`})}const G4=new _R({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});iN().finally(()=>{Nh.createRoot(document.getElementById("root")).render(a.jsx(Q.StrictMode,{children:a.jsx(yR,{client:G4,children:a.jsx(q4,{})})}))});
|