0pflow 0.1.0-dev.4fd2ac2 → 0.1.0-dev.582d64d
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/dist/__tests__/discover.integration.test.d.ts +2 -0
- package/dist/__tests__/discover.integration.test.d.ts.map +1 -0
- package/dist/__tests__/discover.integration.test.js +137 -0
- package/dist/__tests__/discover.integration.test.js.map +1 -0
- package/dist/__tests__/factory.test.js +7 -0
- package/dist/__tests__/factory.test.js.map +1 -1
- package/dist/__tests__/integration.e2e.test.js +2 -1
- package/dist/__tests__/integration.e2e.test.js.map +1 -1
- package/dist/__tests__/integration.test.js +87 -82
- package/dist/__tests__/integration.test.js.map +1 -1
- package/dist/agent.d.ts +7 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +59 -9
- package/dist/agent.js.map +1 -1
- package/dist/cli/__tests__/discovery.test.js +1 -1
- package/dist/cli/__tests__/discovery.test.js.map +1 -1
- package/dist/cli/app.d.ts +6 -0
- package/dist/cli/app.d.ts.map +1 -1
- package/dist/cli/app.js +27 -0
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/discovery.d.ts +10 -0
- package/dist/cli/discovery.d.ts.map +1 -1
- package/dist/cli/discovery.js +42 -0
- package/dist/cli/discovery.js.map +1 -1
- package/dist/cli/env.js +1 -1
- package/dist/cli/env.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +124 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +39 -9
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/mcp/lib/scaffolding.d.ts +33 -0
- package/dist/cli/mcp/lib/scaffolding.d.ts.map +1 -0
- package/dist/cli/mcp/lib/scaffolding.js +219 -0
- package/dist/cli/mcp/lib/scaffolding.js.map +1 -0
- package/dist/cli/mcp/lib/templates.d.ts +1 -0
- package/dist/cli/mcp/lib/templates.d.ts.map +1 -1
- package/dist/cli/mcp/lib/templates.js.map +1 -1
- package/dist/cli/mcp/tools/createApp.d.ts +1 -0
- package/dist/cli/mcp/tools/createApp.d.ts.map +1 -1
- package/dist/cli/mcp/tools/createApp.js +12 -55
- package/dist/cli/mcp/tools/createApp.js.map +1 -1
- package/dist/cli/mcp/tools/createDatabase.d.ts.map +1 -1
- package/dist/cli/mcp/tools/createDatabase.js +2 -41
- package/dist/cli/mcp/tools/createDatabase.js.map +1 -1
- package/dist/cli/mcp/tools/getConnectionInfo.d.ts +19 -0
- package/dist/cli/mcp/tools/getConnectionInfo.d.ts.map +1 -0
- package/dist/cli/mcp/tools/getConnectionInfo.js +111 -0
- package/dist/cli/mcp/tools/getConnectionInfo.js.map +1 -0
- package/dist/cli/mcp/tools/getRun.d.ts +22 -0
- package/dist/cli/mcp/tools/getRun.d.ts.map +1 -0
- package/dist/cli/mcp/tools/getRun.js +80 -0
- package/dist/cli/mcp/tools/getRun.js.map +1 -0
- package/dist/cli/mcp/tools/getTrace.d.ts +32 -0
- package/dist/cli/mcp/tools/getTrace.d.ts.map +1 -0
- package/dist/cli/mcp/tools/getTrace.js +104 -0
- package/dist/cli/mcp/tools/getTrace.js.map +1 -0
- package/dist/cli/mcp/tools/index.d.ts +94 -1
- package/dist/cli/mcp/tools/index.d.ts.map +1 -1
- package/dist/cli/mcp/tools/index.js +16 -0
- package/dist/cli/mcp/tools/index.js.map +1 -1
- package/dist/cli/mcp/tools/listIntegrations.d.ts +14 -0
- package/dist/cli/mcp/tools/listIntegrations.d.ts.map +1 -0
- package/dist/cli/mcp/tools/listIntegrations.js +53 -0
- package/dist/cli/mcp/tools/listIntegrations.js.map +1 -0
- package/dist/cli/mcp/tools/listRuns.d.ts +21 -0
- package/dist/cli/mcp/tools/listRuns.d.ts.map +1 -0
- package/dist/cli/mcp/tools/listRuns.js +72 -0
- package/dist/cli/mcp/tools/listRuns.js.map +1 -0
- package/dist/cli/mcp/tools/listWorkflows.d.ts +15 -0
- package/dist/cli/mcp/tools/listWorkflows.d.ts.map +1 -0
- package/dist/cli/mcp/tools/listWorkflows.js +45 -0
- package/dist/cli/mcp/tools/listWorkflows.js.map +1 -0
- package/dist/cli/mcp/tools/runNode.d.ts +17 -0
- package/dist/cli/mcp/tools/runNode.d.ts.map +1 -0
- package/dist/cli/mcp/tools/runNode.js +74 -0
- package/dist/cli/mcp/tools/runNode.js.map +1 -0
- package/dist/cli/mcp/tools/runWorkflow.d.ts +16 -0
- package/dist/cli/mcp/tools/runWorkflow.d.ts.map +1 -0
- package/dist/cli/mcp/tools/runWorkflow.js +66 -0
- package/dist/cli/mcp/tools/runWorkflow.js.map +1 -0
- package/dist/cli/mcp/tools/setupAppSchema.d.ts +1 -1
- package/dist/cli/mcp/tools/setupAppSchema.d.ts.map +1 -1
- package/dist/cli/mcp/tools/setupAppSchema.js +11 -132
- package/dist/cli/mcp/tools/setupAppSchema.js.map +1 -1
- package/dist/cli/mcp/tools/utils.d.ts +7 -0
- package/dist/cli/mcp/tools/utils.d.ts.map +1 -0
- package/dist/cli/mcp/tools/utils.js +28 -0
- package/dist/cli/mcp/tools/utils.js.map +1 -0
- package/dist/cli/run.d.ts +2 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +391 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/trace.d.ts +5 -0
- package/dist/cli/trace.d.ts.map +1 -1
- package/dist/cli/trace.js +1 -1
- package/dist/cli/trace.js.map +1 -1
- package/dist/connections/cloud-auth.d.ts +46 -0
- package/dist/connections/cloud-auth.d.ts.map +1 -0
- package/dist/connections/cloud-auth.js +243 -0
- package/dist/connections/cloud-auth.js.map +1 -0
- package/dist/connections/cloud-client.d.ts +25 -0
- package/dist/connections/cloud-client.d.ts.map +1 -0
- package/dist/connections/cloud-client.js +59 -0
- package/dist/connections/cloud-client.js.map +1 -0
- package/dist/connections/cloud-integration-provider.d.ts +21 -0
- package/dist/connections/cloud-integration-provider.d.ts.map +1 -0
- package/dist/connections/cloud-integration-provider.js +26 -0
- package/dist/connections/cloud-integration-provider.js.map +1 -0
- package/dist/connections/index.d.ts +11 -0
- package/dist/connections/index.d.ts.map +1 -0
- package/dist/connections/index.js +9 -0
- package/dist/connections/index.js.map +1 -0
- package/dist/connections/integration-provider.d.ts +38 -0
- package/dist/connections/integration-provider.d.ts.map +1 -0
- package/dist/connections/integration-provider.js +20 -0
- package/dist/connections/integration-provider.js.map +1 -0
- package/dist/connections/local-integration-provider.d.ts +28 -0
- package/dist/connections/local-integration-provider.d.ts.map +1 -0
- package/dist/connections/local-integration-provider.js +54 -0
- package/dist/connections/local-integration-provider.js.map +1 -0
- package/dist/connections/nango-client.d.ts +14 -0
- package/dist/connections/nango-client.d.ts.map +1 -0
- package/dist/connections/nango-client.js +50 -0
- package/dist/connections/nango-client.js.map +1 -0
- package/dist/connections/resolver.d.ts +26 -0
- package/dist/connections/resolver.d.ts.map +1 -0
- package/dist/connections/resolver.js +48 -0
- package/dist/connections/resolver.js.map +1 -0
- package/dist/connections/schema.d.ts +8 -0
- package/dist/connections/schema.d.ts.map +1 -0
- package/dist/connections/schema.js +31 -0
- package/dist/connections/schema.js.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -1
- package/dist/dev-ui/api.d.ts +16 -0
- package/dist/dev-ui/api.d.ts.map +1 -0
- package/dist/dev-ui/api.js +237 -0
- package/dist/dev-ui/api.js.map +1 -0
- package/dist/dev-ui/dag/extractor.d.ts +19 -0
- package/dist/dev-ui/dag/extractor.d.ts.map +1 -0
- package/dist/dev-ui/dag/extractor.js +716 -0
- package/dist/dev-ui/dag/extractor.js.map +1 -0
- package/dist/dev-ui/dag/types.d.ts +42 -0
- package/dist/dev-ui/dag/types.d.ts.map +1 -0
- package/dist/dev-ui/dag/types.js +2 -0
- package/dist/dev-ui/dag/types.js.map +1 -0
- package/dist/dev-ui/dev-server.d.ts +18 -0
- package/dist/dev-ui/dev-server.d.ts.map +1 -0
- package/dist/dev-ui/dev-server.js +222 -0
- package/dist/dev-ui/dev-server.js.map +1 -0
- package/dist/dev-ui/index.d.ts +3 -0
- package/dist/dev-ui/index.d.ts.map +1 -0
- package/dist/dev-ui/index.js +2 -0
- package/dist/dev-ui/index.js.map +1 -0
- package/dist/dev-ui/pty.d.ts +16 -0
- package/dist/dev-ui/pty.d.ts.map +1 -0
- package/dist/dev-ui/pty.js +87 -0
- package/dist/dev-ui/pty.js.map +1 -0
- package/dist/dev-ui/watcher.d.ts +12 -0
- package/dist/dev-ui/watcher.d.ts.map +1 -0
- package/dist/dev-ui/watcher.js +162 -0
- package/dist/dev-ui/watcher.js.map +1 -0
- package/dist/dev-ui/ws.d.ts +52 -0
- package/dist/dev-ui/ws.d.ts.map +1 -0
- package/dist/dev-ui/ws.js +32 -0
- package/dist/dev-ui/ws.js.map +1 -0
- package/dist/dev-ui-client/assets/index-C-LxzUII.css +32 -0
- package/dist/dev-ui-client/assets/index-DAKTQEvj.js +1 -0
- package/dist/dev-ui-client/assets/index-aAIwXl4O.js +127 -0
- package/dist/dev-ui-client/index.html +13 -0
- package/dist/discover.d.ts +15 -0
- package/dist/discover.d.ts.map +1 -0
- package/dist/discover.js +29 -0
- package/dist/discover.js.map +1 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +25 -12
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -0
- package/dist/node.js.map +1 -1
- package/dist/nodes/agent/executor.d.ts +2 -0
- package/dist/nodes/agent/executor.d.ts.map +1 -1
- package/dist/nodes/agent/executor.js +11 -1
- package/dist/nodes/agent/executor.js.map +1 -1
- package/dist/types.d.ts +21 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/workflow.d.ts +22 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +97 -2
- package/dist/workflow.js.map +1 -1
- package/package.json +26 -5
- package/templates/app/dbos-config.yaml +6 -0
- package/templates/app/package.json +4 -1
- package/templates/app/src/app/api/workflow/[name]/route.ts +37 -0
- package/templates/app/src/instrumentation.ts +6 -0
- package/templates/app/src/lib/pflow.ts +29 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(a){if(a.ep)return;a.ep=!0;const c=n(a);fetch(a.href,c)}})();function Fy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $f={exports:{}},oa={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Av;function zx(){if(Av)return oa;Av=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,c){var u=null;if(c!==void 0&&(u=""+c),a.key!==void 0&&(u=""+a.key),"key"in a){c={};for(var f in a)f!=="key"&&(c[f]=a[f])}else c=a;return a=c.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:c}}return oa.Fragment=t,oa.jsx=n,oa.jsxs=n,oa}var Nv;function Ox(){return Nv||(Nv=1,$f.exports=zx()),$f.exports}var N=Ox(),Wf={exports:{}},Ee={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Rv;function Hx(){if(Rv)return Ee;Rv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),v=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=v&&T[v]||T["@@iterator"],typeof T=="function"?T:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function E(T,j,ee){this.props=T,this.context=j,this.refs=x,this.updater=ee||y}E.prototype.isReactComponent={},E.prototype.setState=function(T,j){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,j,"setState")},E.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function L(){}L.prototype=E.prototype;function C(T,j,ee){this.props=T,this.context=j,this.refs=x,this.updater=ee||y}var D=C.prototype=new L;D.constructor=C,w(D,E.prototype),D.isPureReactComponent=!0;var I=Array.isArray;function z(){}var P={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function G(T,j,ee){var te=ee.ref;return{$$typeof:e,type:T,key:j,ref:te!==void 0?te:null,props:ee}}function ae(T,j){return G(T.type,j,T.props)}function X(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function q(T){var j={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ee){return j[ee]})}var Y=/\/+/g;function A(T,j){return typeof T=="object"&&T!==null&&T.key!=null?q(""+T.key):j.toString(36)}function H(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(z,z):(T.status="pending",T.then(function(j){T.status==="pending"&&(T.status="fulfilled",T.value=j)},function(j){T.status==="pending"&&(T.status="rejected",T.reason=j)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function M(T,j,ee,te,le){var ce=typeof T;(ce==="undefined"||ce==="boolean")&&(T=null);var he=!1;if(T===null)he=!0;else switch(ce){case"bigint":case"string":case"number":he=!0;break;case"object":switch(T.$$typeof){case e:case t:he=!0;break;case p:return he=T._init,M(he(T._payload),j,ee,te,le)}}if(he)return le=le(T),he=te===""?"."+A(T,0):te,I(le)?(ee="",he!=null&&(ee=he.replace(Y,"$&/")+"/"),M(le,j,ee,"",function(xe){return xe})):le!=null&&(X(le)&&(le=ae(le,ee+(le.key==null||T&&T.key===le.key?"":(""+le.key).replace(Y,"$&/")+"/")+he)),j.push(le)),1;he=0;var ue=te===""?".":te+":";if(I(T))for(var _e=0;_e<T.length;_e++)te=T[_e],ce=ue+A(te,_e),he+=M(te,j,ee,ce,le);else if(_e=b(T),typeof _e=="function")for(T=_e.call(T),_e=0;!(te=T.next()).done;)te=te.value,ce=ue+A(te,_e++),he+=M(te,j,ee,ce,le);else if(ce==="object"){if(typeof T.then=="function")return M(H(T),j,ee,te,le);throw j=String(T),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return he}function B(T,j,ee){if(T==null)return T;var te=[],le=0;return M(T,te,"","",function(ce){return j.call(ee,ce,le++)}),te}function R(T){if(T._status===-1){var j=T._result;j=j(),j.then(function(ee){(T._status===0||T._status===-1)&&(T._status=1,T._result=ee)},function(ee){(T._status===0||T._status===-1)&&(T._status=2,T._result=ee)}),T._status===-1&&(T._status=0,T._result=j)}if(T._status===1)return T._result.default;throw T._result}var U=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},Q={map:B,forEach:function(T,j,ee){B(T,function(){j.apply(this,arguments)},ee)},count:function(T){var j=0;return B(T,function(){j++}),j},toArray:function(T){return B(T,function(j){return j})||[]},only:function(T){if(!X(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Ee.Activity=m,Ee.Children=Q,Ee.Component=E,Ee.Fragment=n,Ee.Profiler=a,Ee.PureComponent=C,Ee.StrictMode=r,Ee.Suspense=_,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(T){return P.H.useMemoCache(T)}},Ee.cache=function(T){return function(){return T.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(T,j,ee){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var te=w({},T.props),le=T.key;if(j!=null)for(ce in j.key!==void 0&&(le=""+j.key),j)!W.call(j,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&j.ref===void 0||(te[ce]=j[ce]);var ce=arguments.length-2;if(ce===1)te.children=ee;else if(1<ce){for(var he=Array(ce),ue=0;ue<ce;ue++)he[ue]=arguments[ue+2];te.children=he}return G(T.type,le,te)},Ee.createContext=function(T){return T={$$typeof:u,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},Ee.createElement=function(T,j,ee){var te,le={},ce=null;if(j!=null)for(te in j.key!==void 0&&(ce=""+j.key),j)W.call(j,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(le[te]=j[te]);var he=arguments.length-2;if(he===1)le.children=ee;else if(1<he){for(var ue=Array(he),_e=0;_e<he;_e++)ue[_e]=arguments[_e+2];le.children=ue}if(T&&T.defaultProps)for(te in he=T.defaultProps,he)le[te]===void 0&&(le[te]=he[te]);return G(T,ce,le)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(T){return{$$typeof:f,render:T}},Ee.isValidElement=X,Ee.lazy=function(T){return{$$typeof:p,_payload:{_status:-1,_result:T},_init:R}},Ee.memo=function(T,j){return{$$typeof:h,type:T,compare:j===void 0?null:j}},Ee.startTransition=function(T){var j=P.T,ee={};P.T=ee;try{var te=T(),le=P.S;le!==null&&le(ee,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(z,U)}catch(ce){U(ce)}finally{j!==null&&ee.types!==null&&(j.types=ee.types),P.T=j}},Ee.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ee.use=function(T){return P.H.use(T)},Ee.useActionState=function(T,j,ee){return P.H.useActionState(T,j,ee)},Ee.useCallback=function(T,j){return P.H.useCallback(T,j)},Ee.useContext=function(T){return P.H.useContext(T)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(T,j){return P.H.useDeferredValue(T,j)},Ee.useEffect=function(T,j){return P.H.useEffect(T,j)},Ee.useEffectEvent=function(T){return P.H.useEffectEvent(T)},Ee.useId=function(){return P.H.useId()},Ee.useImperativeHandle=function(T,j,ee){return P.H.useImperativeHandle(T,j,ee)},Ee.useInsertionEffect=function(T,j){return P.H.useInsertionEffect(T,j)},Ee.useLayoutEffect=function(T,j){return P.H.useLayoutEffect(T,j)},Ee.useMemo=function(T,j){return P.H.useMemo(T,j)},Ee.useOptimistic=function(T,j){return P.H.useOptimistic(T,j)},Ee.useReducer=function(T,j,ee){return P.H.useReducer(T,j,ee)},Ee.useRef=function(T){return P.H.useRef(T)},Ee.useState=function(T){return P.H.useState(T)},Ee.useSyncExternalStore=function(T,j,ee){return P.H.useSyncExternalStore(T,j,ee)},Ee.useTransition=function(){return P.H.useTransition()},Ee.version="19.2.4",Ee}var Bv;function Pa(){return Bv||(Bv=1,Wf.exports=Hx()),Wf.exports}var $=Pa();const Ux=Fy($);var Xf={exports:{}},aa={},Kf={exports:{}},Gf={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Lv;function Px(){return Lv||(Lv=1,(function(e){function t(M,B){var R=M.length;M.push(B);e:for(;0<R;){var U=R-1>>>1,Q=M[U];if(0<a(Q,B))M[U]=B,M[R]=Q,R=U;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var B=M[0],R=M.pop();if(R!==B){M[0]=R;e:for(var U=0,Q=M.length,T=Q>>>1;U<T;){var j=2*(U+1)-1,ee=M[j],te=j+1,le=M[te];if(0>a(ee,R))te<Q&&0>a(le,ee)?(M[U]=le,M[te]=R,U=te):(M[U]=ee,M[j]=R,U=j);else if(te<Q&&0>a(le,R))M[U]=le,M[te]=R,U=te;else break e}}return B}function a(M,B){var R=M.sortIndex-B.sortIndex;return R!==0?R:M.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var _=[],h=[],p=1,m=null,v=3,b=!1,y=!1,w=!1,x=!1,E=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function D(M){for(var B=n(h);B!==null;){if(B.callback===null)r(h);else if(B.startTime<=M)r(h),B.sortIndex=B.expirationTime,t(_,B);else break;B=n(h)}}function I(M){if(w=!1,D(M),!y)if(n(_)!==null)y=!0,z||(z=!0,q());else{var B=n(h);B!==null&&H(I,B.startTime-M)}}var z=!1,P=-1,W=5,G=-1;function ae(){return x?!0:!(e.unstable_now()-G<W)}function X(){if(x=!1,z){var M=e.unstable_now();G=M;var B=!0;try{e:{y=!1,w&&(w=!1,L(P),P=-1),b=!0;var R=v;try{t:{for(D(M),m=n(_);m!==null&&!(m.expirationTime>M&&ae());){var U=m.callback;if(typeof U=="function"){m.callback=null,v=m.priorityLevel;var Q=U(m.expirationTime<=M);if(M=e.unstable_now(),typeof Q=="function"){m.callback=Q,D(M),B=!0;break t}m===n(_)&&r(_),D(M)}else r(_);m=n(_)}if(m!==null)B=!0;else{var T=n(h);T!==null&&H(I,T.startTime-M),B=!1}}break e}finally{m=null,v=R,b=!1}B=void 0}}finally{B?q():z=!1}}}var q;if(typeof C=="function")q=function(){C(X)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,A=Y.port2;Y.port1.onmessage=X,q=function(){A.postMessage(null)}}else q=function(){E(X,0)};function H(M,B){P=E(function(){M(e.unstable_now())},B)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var B=3;break;default:B=v}var R=v;v=B;try{return M()}finally{v=R}},e.unstable_requestPaint=function(){x=!0},e.unstable_runWithPriority=function(M,B){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var R=v;v=M;try{return B()}finally{v=R}},e.unstable_scheduleCallback=function(M,B,R){var U=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?U+R:U):R=U,M){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=R+Q,M={id:p++,callback:B,priorityLevel:M,startTime:R,expirationTime:Q,sortIndex:-1},R>U?(M.sortIndex=R,t(h,M),n(_)===null&&M===n(h)&&(w?(L(P),P=-1):w=!0,H(I,R-U))):(M.sortIndex=Q,t(_,M),y||b||(y=!0,z||(z=!0,q()))),M},e.unstable_shouldYield=ae,e.unstable_wrapCallback=function(M){var B=v;return function(){var R=v;v=B;try{return M.apply(this,arguments)}finally{v=R}}}})(Gf)),Gf}var zv;function jx(){return zv||(zv=1,Kf.exports=Px()),Kf.exports}var Ff={exports:{}},Pt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Ov;function qx(){if(Ov)return Pt;Ov=1;var e=Pa();function t(_){var h="https://react.dev/errors/"+_;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+_+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function c(_,h,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:_,containerInfo:h,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(_,h){if(_==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Pt.createPortal=function(_,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return c(_,h,null,p)},Pt.flushSync=function(_){var h=u.T,p=r.p;try{if(u.T=null,r.p=2,_)return _()}finally{u.T=h,r.p=p,r.d.f()}},Pt.preconnect=function(_,h){typeof _=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(_,h))},Pt.prefetchDNS=function(_){typeof _=="string"&&r.d.D(_)},Pt.preinit=function(_,h){if(typeof _=="string"&&h&&typeof h.as=="string"){var p=h.as,m=f(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(_,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:v,fetchPriority:b}):p==="script"&&r.d.X(_,{crossOrigin:m,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Pt.preinitModule=function(_,h){if(typeof _=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=f(h.as,h.crossOrigin);r.d.M(_,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(_)},Pt.preload=function(_,h){if(typeof _=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,m=f(p,h.crossOrigin);r.d.L(_,p,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Pt.preloadModule=function(_,h){if(typeof _=="string")if(h){var p=f(h.as,h.crossOrigin);r.d.m(_,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(_)},Pt.requestFormReset=function(_){r.d.r(_)},Pt.unstable_batchedUpdates=function(_,h){return _(h)},Pt.useFormState=function(_,h,p){return u.H.useFormState(_,h,p)},Pt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Pt.version="19.2.4",Pt}var Hv;function Zy(){if(Hv)return Ff.exports;Hv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ff.exports=qx(),Ff.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Uv;function Ix(){if(Uv)return aa;Uv=1;var e=jx(),t=Pa(),n=Zy();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function c(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function _(i){if(c(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=c(i),s===null)throw Error(r(188));return s!==i?null:i}for(var o=i,l=s;;){var d=o.return;if(d===null)break;var g=d.alternate;if(g===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===g.child){for(g=d.child;g;){if(g===o)return _(d),i;if(g===l)return _(d),s;g=g.sibling}throw Error(r(188))}if(o.return!==l.return)o=d,l=g;else{for(var S=!1,k=d.child;k;){if(k===o){S=!0,o=d,l=g;break}if(k===l){S=!0,l=d,o=g;break}k=k.sibling}if(!S){for(k=g.child;k;){if(k===o){S=!0,o=g,l=d;break}if(k===l){S=!0,l=g,o=d;break}k=k.sibling}if(!S)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var m=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),C=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function q(i){return i===null||typeof i!="object"?null:(i=X&&i[X]||i["@@iterator"],typeof i=="function"?i:null)}var Y=Symbol.for("react.client.reference");function A(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Y?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case E:return"Profiler";case x:return"StrictMode";case I:return"Suspense";case z:return"SuspenseList";case G:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case y:return"Portal";case C:return i.displayName||"Context";case L:return(i._context.displayName||"Context")+".Consumer";case D:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case P:return s=i.displayName||null,s!==null?s:A(i.type)||"Memo";case W:s=i._payload,i=i._init;try{return A(i(s))}catch{}}return null}var H=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},U=[],Q=-1;function T(i){return{current:i}}function j(i){0>Q||(i.current=U[Q],U[Q]=null,Q--)}function ee(i,s){Q++,U[Q]=i.current,i.current=s}var te=T(null),le=T(null),ce=T(null),he=T(null);function ue(i,s){switch(ee(ce,s),ee(le,i),ee(te,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Jp(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Jp(s),i=ev(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}j(te),ee(te,i)}function _e(){j(te),j(le),j(ce)}function xe(i){i.memoizedState!==null&&ee(he,i);var s=te.current,o=ev(s,i.type);s!==o&&(ee(le,i),ee(te,o))}function be(i){le.current===i&&(j(te),j(le)),he.current===i&&(j(he),ia._currentValue=R)}var pe,de;function Me(i){if(pe===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);pe=s&&s[1]||"",de=-1<o.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+pe+i+de}var qe=!1;function Be(i,s){if(!i||qe)return"";qe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(s){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(ie){var J=ie}Reflect.construct(i,[],re)}else{try{re.call()}catch(ie){J=ie}i.call(re.prototype)}}else{try{throw Error()}catch(ie){J=ie}(re=i())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(ie){if(ie&&J&&typeof ie.stack=="string")return[ie.stack,J.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),S=g[0],k=g[1];if(S&&k){var O=S.split(`
|
|
44
|
+
`),Z=k.split(`
|
|
45
|
+
`);for(d=l=0;l<O.length&&!O[l].includes("DetermineComponentFrameRoot");)l++;for(;d<Z.length&&!Z[d].includes("DetermineComponentFrameRoot");)d++;if(l===O.length||d===Z.length)for(l=O.length-1,d=Z.length-1;1<=l&&0<=d&&O[l]!==Z[d];)d--;for(;1<=l&&0<=d;l--,d--)if(O[l]!==Z[d]){if(l!==1||d!==1)do if(l--,d--,0>d||O[l]!==Z[d]){var se=`
|
|
46
|
+
`+O[l].replace(" at new "," at ");return i.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",i.displayName)),se}while(1<=l&&0<=d);break}}}finally{qe=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?Me(o):""}function Ct(i,s){switch(i.tag){case 26:case 27:case 5:return Me(i.type);case 16:return Me("Lazy");case 13:return i.child!==s&&s!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return Be(i.type,!1);case 11:return Be(i.type.render,!1);case 1:return Be(i.type,!0);case 31:return Me("Activity");default:return""}}function ki(i){try{var s="",o=null;do s+=Ct(i,o),o=i,i=i.return;while(i);return s}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var si=Object.prototype.hasOwnProperty,Di=e.unstable_scheduleCallback,ts=e.unstable_cancelCallback,Sn=e.unstable_shouldYield,bn=e.unstable_requestPaint,Nt=e.unstable_now,ar=e.unstable_getCurrentPriorityLevel,is=e.unstable_ImmediatePriority,Bs=e.unstable_UserBlockingPriority,wn=e.unstable_NormalPriority,ku=e.unstable_LowPriority,lr=e.unstable_IdlePriority,Du=e.log,Tu=e.unstable_setDisableYieldValue,xn=null,qt=null;function Pi(i){if(typeof Du=="function"&&Tu(i),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(xn,i)}catch{}}var It=Math.clz32?Math.clz32:Ru,Au=Math.log,Nu=Math.LN2;function Ru(i){return i>>>=0,i===0?32:31-(Au(i)/Nu|0)|0}var cr=256,ur=262144,hr=4194304;function ss(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function fr(i,s,o){var l=i.pendingLanes;if(l===0)return 0;var d=0,g=i.suspendedLanes,S=i.pingedLanes;i=i.warmLanes;var k=l&134217727;return k!==0?(l=k&~g,l!==0?d=ss(l):(S&=k,S!==0?d=ss(S):o||(o=k&~i,o!==0&&(d=ss(o))))):(k=l&~g,k!==0?d=ss(k):S!==0?d=ss(S):o||(o=l&~i,o!==0&&(d=ss(o)))),d===0?0:s!==0&&s!==d&&(s&g)===0&&(g=d&-d,o=s&-s,g>=o||g===32&&(o&4194048)!==0)?s:d}function Cn(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Bu(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fa(){var i=hr;return hr<<=1,(hr&62914560)===0&&(hr=4194304),i}function fo(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function En(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Lu(i,s,o,l,d,g){var S=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var k=i.entanglements,O=i.expirationTimes,Z=i.hiddenUpdates;for(o=S&~o;0<o;){var se=31-It(o),re=1<<se;k[se]=0,O[se]=-1;var J=Z[se];if(J!==null)for(Z[se]=null,se=0;se<J.length;se++){var ie=J[se];ie!==null&&(ie.lane&=-536870913)}o&=~re}l!==0&&Za(i,l,0),g!==0&&d===0&&i.tag!==0&&(i.suspendedLanes|=g&~(S&~s))}function Za(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-It(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&261930}function Qa(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-It(o),d=1<<l;d&s|i[l]&s&&(i[l]|=s),o&=~d}}function Ja(i,s){var o=s&-s;return o=(o&42)!==0?1:_o(o),(o&(i.suspendedLanes|s))!==0?0:o}function _o(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function go(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function el(){var i=B.p;return i!==0?i:(i=window.event,i===void 0?32:xv(i.type))}function tl(i,s){var o=B.p;try{return B.p=i,s()}finally{B.p=o}}var ji=Math.random().toString(36).slice(2),yt="__reactFiber$"+ji,Ut="__reactProps$"+ji,ns="__reactContainer$"+ji,dr="__reactEvents$"+ji,il="__reactListeners$"+ji,zu="__reactHandles$"+ji,sl="__reactResources$"+ji,Mn="__reactMarker$"+ji;function mo(i){delete i[yt],delete i[Ut],delete i[dr],delete i[il],delete i[zu]}function Ls(i){var s=i[yt];if(s)return s;for(var o=i.parentNode;o;){if(s=o[ns]||o[yt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=av(i);i!==null;){if(o=i[yt])return o;i=av(i)}return s}i=o,o=i.parentNode}return null}function zs(i){if(i=i[yt]||i[ns]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Os(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Hs(i){var s=i[sl];return s||(s=i[sl]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function ht(i){i[Mn]=!0}var nl=new Set,rl={};function rs(i,s){Us(i,s),Us(i+"Capture",s)}function Us(i,s){for(rl[i]=s,i=0;i<s.length;i++)nl.add(s[i])}var Ou=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),po={},ol={};function Hu(i){return si.call(ol,i)?!0:si.call(po,i)?!1:Ou.test(i)?ol[i]=!0:(po[i]=!0,!1)}function _r(i,s,o){if(Hu(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var l=s.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function gr(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function Ti(i,s,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+l)}}function Xt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function al(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Uu(i,s,o){var l=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,g=l.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return d.call(this)},set:function(S){o=""+S,g.call(this,S)}}),Object.defineProperty(i,s,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Ps(i){if(!i._valueTracker){var s=al(i)?"checked":"value";i._valueTracker=Uu(i,s,""+i[s])}}function ll(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=al(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function kn(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Pu=/[\n"\\]/g;function Kt(i){return i.replace(Pu,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Dn(i,s,o,l,d,g,S,k){i.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.type=S:i.removeAttribute("type"),s!=null?S==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Xt(s)):i.value!==""+Xt(s)&&(i.value=""+Xt(s)):S!=="submit"&&S!=="reset"||i.removeAttribute("value"),s!=null?vo(i,S,Xt(s)):o!=null?vo(i,S,Xt(o)):l!=null&&i.removeAttribute("value"),d==null&&g!=null&&(i.defaultChecked=!!g),d!=null&&(i.checked=d&&typeof d!="function"&&typeof d!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?i.name=""+Xt(k):i.removeAttribute("name")}function cl(i,s,o,l,d,g,S,k){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.type=g),s!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||s!=null)){Ps(i);return}o=o!=null?""+Xt(o):"",s=s!=null?""+Xt(s):o,k||s===i.value||(i.value=s),i.defaultValue=s}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=k?i.checked:!!l,i.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.name=S),Ps(i)}function vo(i,s,o){s==="number"&&kn(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function os(i,s,o,l){if(i=i.options,s){s={};for(var d=0;d<o.length;d++)s["$"+o[d]]=!0;for(o=0;o<i.length;o++)d=s.hasOwnProperty("$"+i[o].value),i[o].selected!==d&&(i[o].selected=d),d&&l&&(i[o].defaultSelected=!0)}else{for(o=""+Xt(o),s=null,d=0;d<i.length;d++){if(i[d].value===o){i[d].selected=!0,l&&(i[d].defaultSelected=!0);return}s!==null||i[d].disabled||(s=i[d])}s!==null&&(s.selected=!0)}}function K_(i,s,o){if(s!=null&&(s=""+Xt(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+Xt(o):""}function G_(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(r(92));if(H(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=Xt(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l),Ps(i)}function mr(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var Ab=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function F_(i,s,o){var l=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":l?i.setProperty(s,o):typeof o!="number"||o===0||Ab.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function Z_(i,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||s!=null&&s.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var d in s)l=s[d],s.hasOwnProperty(d)&&o[d]!==l&&F_(i,d,l)}else for(var g in s)s.hasOwnProperty(g)&&F_(i,g,s[g])}function ju(i){if(i.indexOf("-")===-1)return!1;switch(i){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 Nb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Rb=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ul(i){return Rb.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function as(){}var qu=null;function Iu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var pr=null,vr=null;function Q_(i){var s=zs(i);if(s&&(i=s.stateNode)){var o=i[Ut]||null;e:switch(i=s.stateNode,s.type){case"input":if(Dn(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Kt(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var d=l[Ut]||null;if(!d)throw Error(r(90));Dn(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(s=0;s<o.length;s++)l=o[s],l.form===i.form&&ll(l)}break e;case"textarea":K_(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&os(i,!!o.multiple,s,!1)}}}var Yu=!1;function J_(i,s,o){if(Yu)return i(s,o);Yu=!0;try{var l=i(s);return l}finally{if(Yu=!1,(pr!==null||vr!==null)&&(Zl(),pr&&(s=pr,i=vr,vr=pr=null,Q_(s),i)))for(s=0;s<i.length;s++)Q_(i[s])}}function yo(i,s){var o=i.stateNode;if(o===null)return null;var l=o[Ut]||null;if(l===null)return null;o=l[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var ls=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vu=!1;if(ls)try{var So={};Object.defineProperty(So,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{Vu=!1}var js=null,$u=null,hl=null;function eg(){if(hl)return hl;var i,s=$u,o=s.length,l,d="value"in js?js.value:js.textContent,g=d.length;for(i=0;i<o&&s[i]===d[i];i++);var S=o-i;for(l=1;l<=S&&s[o-l]===d[g-l];l++);return hl=d.slice(i,1<l?1-l:void 0)}function fl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function dl(){return!0}function tg(){return!1}function Gt(i){function s(o,l,d,g,S){this._reactName=o,this._targetInst=d,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null;for(var k in i)i.hasOwnProperty(k)&&(o=i[k],this[k]=o?o(g):g[k]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?dl:tg,this.isPropagationStopped=tg,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=dl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=dl)},persist:function(){},isPersistent:dl}),s}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_l=Gt(Tn),bo=m({},Tn,{view:0,detail:0}),Bb=Gt(bo),Wu,Xu,wo,gl=m({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gu,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==wo&&(wo&&i.type==="mousemove"?(Wu=i.screenX-wo.screenX,Xu=i.screenY-wo.screenY):Xu=Wu=0,wo=i),Wu)},movementY:function(i){return"movementY"in i?i.movementY:Xu}}),ig=Gt(gl),Lb=m({},gl,{dataTransfer:0}),zb=Gt(Lb),Ob=m({},bo,{relatedTarget:0}),Ku=Gt(Ob),Hb=m({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0}),Ub=Gt(Hb),Pb=m({},Tn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),jb=Gt(Pb),qb=m({},Tn,{data:0}),sg=Gt(qb),Ib={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yb={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"},Vb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $b(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=Vb[i])?!!s[i]:!1}function Gu(){return $b}var Wb=m({},bo,{key:function(i){if(i.key){var s=Ib[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=fl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Yb[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gu,charCode:function(i){return i.type==="keypress"?fl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?fl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Xb=Gt(Wb),Kb=m({},gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ng=Gt(Kb),Gb=m({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gu}),Fb=Gt(Gb),Zb=m({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qb=Gt(Zb),Jb=m({},gl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ew=Gt(Jb),tw=m({},Tn,{newState:0,oldState:0}),iw=Gt(tw),sw=[9,13,27,32],Fu=ls&&"CompositionEvent"in window,xo=null;ls&&"documentMode"in document&&(xo=document.documentMode);var nw=ls&&"TextEvent"in window&&!xo,rg=ls&&(!Fu||xo&&8<xo&&11>=xo),og=" ",ag=!1;function lg(i,s){switch(i){case"keyup":return sw.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var yr=!1;function rw(i,s){switch(i){case"compositionend":return cg(s);case"keypress":return s.which!==32?null:(ag=!0,og);case"textInput":return i=s.data,i===og&&ag?null:i;default:return null}}function ow(i,s){if(yr)return i==="compositionend"||!Fu&&lg(i,s)?(i=eg(),hl=$u=js=null,yr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return rg&&s.locale!=="ko"?null:s.data;default:return null}}var aw={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 ug(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!aw[i.type]:s==="textarea"}function hg(i,s,o,l){pr?vr?vr.push(l):vr=[l]:pr=l,s=nc(s,"onChange"),0<s.length&&(o=new _l("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var Co=null,Eo=null;function lw(i){Xp(i,0)}function ml(i){var s=Os(i);if(ll(s))return i}function fg(i,s){if(i==="change")return s}var dg=!1;if(ls){var Zu;if(ls){var Qu="oninput"in document;if(!Qu){var _g=document.createElement("div");_g.setAttribute("oninput","return;"),Qu=typeof _g.oninput=="function"}Zu=Qu}else Zu=!1;dg=Zu&&(!document.documentMode||9<document.documentMode)}function gg(){Co&&(Co.detachEvent("onpropertychange",mg),Eo=Co=null)}function mg(i){if(i.propertyName==="value"&&ml(Eo)){var s=[];hg(s,Eo,i,Iu(i)),J_(lw,s)}}function cw(i,s,o){i==="focusin"?(gg(),Co=s,Eo=o,Co.attachEvent("onpropertychange",mg)):i==="focusout"&&gg()}function uw(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ml(Eo)}function hw(i,s){if(i==="click")return ml(s)}function fw(i,s){if(i==="input"||i==="change")return ml(s)}function dw(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var ni=typeof Object.is=="function"?Object.is:dw;function Mo(i,s){if(ni(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),l=Object.keys(s);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var d=o[l];if(!si.call(s,d)||!ni(i[d],s[d]))return!1}return!0}function pg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function vg(i,s){var o=pg(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=s&&l>=s)return{node:o,offset:s-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=pg(o)}}function yg(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?yg(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Sg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=kn(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=kn(i.document)}return s}function Ju(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var _w=ls&&"documentMode"in document&&11>=document.documentMode,Sr=null,eh=null,ko=null,th=!1;function bg(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;th||Sr==null||Sr!==kn(l)||(l=Sr,"selectionStart"in l&&Ju(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ko&&Mo(ko,l)||(ko=l,l=nc(eh,"onSelect"),0<l.length&&(s=new _l("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=Sr)))}function An(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var br={animationend:An("Animation","AnimationEnd"),animationiteration:An("Animation","AnimationIteration"),animationstart:An("Animation","AnimationStart"),transitionrun:An("Transition","TransitionRun"),transitionstart:An("Transition","TransitionStart"),transitioncancel:An("Transition","TransitionCancel"),transitionend:An("Transition","TransitionEnd")},ih={},wg={};ls&&(wg=document.createElement("div").style,"AnimationEvent"in window||(delete br.animationend.animation,delete br.animationiteration.animation,delete br.animationstart.animation),"TransitionEvent"in window||delete br.transitionend.transition);function Nn(i){if(ih[i])return ih[i];if(!br[i])return i;var s=br[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in wg)return ih[i]=s[o];return i}var xg=Nn("animationend"),Cg=Nn("animationiteration"),Eg=Nn("animationstart"),gw=Nn("transitionrun"),mw=Nn("transitionstart"),pw=Nn("transitioncancel"),Mg=Nn("transitionend"),kg=new Map,sh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");sh.push("scrollEnd");function Ai(i,s){kg.set(i,s),rs(s,[i])}var pl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},gi=[],wr=0,nh=0;function vl(){for(var i=wr,s=nh=wr=0;s<i;){var o=gi[s];gi[s++]=null;var l=gi[s];gi[s++]=null;var d=gi[s];gi[s++]=null;var g=gi[s];if(gi[s++]=null,l!==null&&d!==null){var S=l.pending;S===null?d.next=d:(d.next=S.next,S.next=d),l.pending=d}g!==0&&Dg(o,d,g)}}function yl(i,s,o,l){gi[wr++]=i,gi[wr++]=s,gi[wr++]=o,gi[wr++]=l,nh|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function rh(i,s,o,l){return yl(i,s,o,l),Sl(i)}function Rn(i,s){return yl(i,null,null,s),Sl(i)}function Dg(i,s,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var d=!1,g=i.return;g!==null;)g.childLanes|=o,l=g.alternate,l!==null&&(l.childLanes|=o),g.tag===22&&(i=g.stateNode,i===null||i._visibility&1||(d=!0)),i=g,g=g.return;return i.tag===3?(g=i.stateNode,d&&s!==null&&(d=31-It(o),i=g.hiddenUpdates,l=i[d],l===null?i[d]=[s]:l.push(s),s.lane=o|536870912),g):null}function Sl(i){if(50<Go)throw Go=0,gf=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var xr={};function vw(i,s,o,l){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(i,s,o,l){return new vw(i,s,o,l)}function oh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function cs(i,s){var o=i.alternate;return o===null?(o=ri(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function Tg(i,s){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function bl(i,s,o,l,d,g){var S=0;if(l=i,typeof i=="function")oh(i)&&(S=1);else if(typeof i=="string")S=xx(i,o,te.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case G:return i=ri(31,o,s,d),i.elementType=G,i.lanes=g,i;case w:return Bn(o.children,d,g,s);case x:S=8,d|=24;break;case E:return i=ri(12,o,s,d|2),i.elementType=E,i.lanes=g,i;case I:return i=ri(13,o,s,d),i.elementType=I,i.lanes=g,i;case z:return i=ri(19,o,s,d),i.elementType=z,i.lanes=g,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case C:S=10;break e;case L:S=9;break e;case D:S=11;break e;case P:S=14;break e;case W:S=16,l=null;break e}S=29,o=Error(r(130,i===null?"null":typeof i,"")),l=null}return s=ri(S,o,s,d),s.elementType=i,s.type=l,s.lanes=g,s}function Bn(i,s,o,l){return i=ri(7,i,l,s),i.lanes=o,i}function ah(i,s,o){return i=ri(6,i,null,s),i.lanes=o,i}function Ag(i){var s=ri(18,null,null,0);return s.stateNode=i,s}function lh(i,s,o){return s=ri(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ng=new WeakMap;function mi(i,s){if(typeof i=="object"&&i!==null){var o=Ng.get(i);return o!==void 0?o:(s={value:i,source:s,stack:ki(s)},Ng.set(i,s),s)}return{value:i,source:s,stack:ki(s)}}var Cr=[],Er=0,wl=null,Do=0,pi=[],vi=0,qs=null,qi=1,Ii="";function us(i,s){Cr[Er++]=Do,Cr[Er++]=wl,wl=i,Do=s}function Rg(i,s,o){pi[vi++]=qi,pi[vi++]=Ii,pi[vi++]=qs,qs=i;var l=qi;i=Ii;var d=32-It(l)-1;l&=~(1<<d),o+=1;var g=32-It(s)+d;if(30<g){var S=d-d%5;g=(l&(1<<S)-1).toString(32),l>>=S,d-=S,qi=1<<32-It(s)+d|o<<d|l,Ii=g+i}else qi=1<<g|o<<d|l,Ii=i}function ch(i){i.return!==null&&(us(i,1),Rg(i,1,0))}function uh(i){for(;i===wl;)wl=Cr[--Er],Cr[Er]=null,Do=Cr[--Er],Cr[Er]=null;for(;i===qs;)qs=pi[--vi],pi[vi]=null,Ii=pi[--vi],pi[vi]=null,qi=pi[--vi],pi[vi]=null}function Bg(i,s){pi[vi++]=qi,pi[vi++]=Ii,pi[vi++]=qs,qi=s.id,Ii=s.overflow,qs=i}var Rt=null,Ge=null,Oe=!1,Is=null,yi=!1,hh=Error(r(519));function Ys(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw To(mi(s,i)),hh}function Lg(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[yt]=i,s[Ut]=l,o){case"dialog":Re("cancel",s),Re("close",s);break;case"iframe":case"object":case"embed":Re("load",s);break;case"video":case"audio":for(o=0;o<Zo.length;o++)Re(Zo[o],s);break;case"source":Re("error",s);break;case"img":case"image":case"link":Re("error",s),Re("load",s);break;case"details":Re("toggle",s);break;case"input":Re("invalid",s),cl(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Re("invalid",s);break;case"textarea":Re("invalid",s),G_(s,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||Zp(s.textContent,o)?(l.popover!=null&&(Re("beforetoggle",s),Re("toggle",s)),l.onScroll!=null&&Re("scroll",s),l.onScrollEnd!=null&&Re("scrollend",s),l.onClick!=null&&(s.onclick=as),s=!0):s=!1,s||Ys(i,!0)}function zg(i){for(Rt=i.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:yi=!1;return;case 27:case 3:yi=!0;return;default:Rt=Rt.return}}function Mr(i){if(i!==Rt)return!1;if(!Oe)return zg(i),Oe=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Af(i.type,i.memoizedProps)),o=!o),o&&Ge&&Ys(i),zg(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ge=ov(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ge=ov(i)}else s===27?(s=Ge,nn(i.type)?(i=zf,zf=null,Ge=i):Ge=s):Ge=Rt?bi(i.stateNode.nextSibling):null;return!0}function Ln(){Ge=Rt=null,Oe=!1}function fh(){var i=Is;return i!==null&&(Jt===null?Jt=i:Jt.push.apply(Jt,i),Is=null),i}function To(i){Is===null?Is=[i]:Is.push(i)}var dh=T(null),zn=null,hs=null;function Vs(i,s,o){ee(dh,s._currentValue),s._currentValue=o}function fs(i){i._currentValue=dh.current,j(dh)}function _h(i,s,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),i===o)break;i=i.return}}function gh(i,s,o,l){var d=i.child;for(d!==null&&(d.return=i);d!==null;){var g=d.dependencies;if(g!==null){var S=d.child;g=g.firstContext;e:for(;g!==null;){var k=g;g=d;for(var O=0;O<s.length;O++)if(k.context===s[O]){g.lanes|=o,k=g.alternate,k!==null&&(k.lanes|=o),_h(g.return,o,i),l||(S=null);break e}g=k.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(r(341));S.lanes|=o,g=S.alternate,g!==null&&(g.lanes|=o),_h(S,o,i),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===i){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function kr(i,s,o,l){i=null;for(var d=s,g=!1;d!==null;){if(!g){if((d.flags&524288)!==0)g=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var S=d.alternate;if(S===null)throw Error(r(387));if(S=S.memoizedProps,S!==null){var k=d.type;ni(d.pendingProps.value,S.value)||(i!==null?i.push(k):i=[k])}}else if(d===he.current){if(S=d.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(i!==null?i.push(ia):i=[ia])}d=d.return}i!==null&&gh(s,i,o,l),s.flags|=262144}function xl(i){for(i=i.firstContext;i!==null;){if(!ni(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function On(i){zn=i,hs=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Bt(i){return Og(zn,i)}function Cl(i,s){return zn===null&&On(i),Og(i,s)}function Og(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},hs===null){if(i===null)throw Error(r(308));hs=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else hs=hs.next=s;return o}var yw=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},Sw=e.unstable_scheduleCallback,bw=e.unstable_NormalPriority,ft={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mh(){return{controller:new yw,data:new Map,refCount:0}}function Ao(i){i.refCount--,i.refCount===0&&Sw(bw,function(){i.controller.abort()})}var No=null,ph=0,Dr=0,Tr=null;function ww(i,s){if(No===null){var o=No=[];ph=0,Dr=bf(),Tr={status:"pending",value:void 0,then:function(l){o.push(l)}}}return ph++,s.then(Hg,Hg),s}function Hg(){if(--ph===0&&No!==null){Tr!==null&&(Tr.status="fulfilled");var i=No;No=null,Dr=0,Tr=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function xw(i,s){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return i.then(function(){l.status="fulfilled",l.value=s;for(var d=0;d<o.length;d++)(0,o[d])(s)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var Ug=M.S;M.S=function(i,s){bp=Nt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&ww(i,s),Ug!==null&&Ug(i,s)};var Hn=T(null);function vh(){var i=Hn.current;return i!==null?i:Ke.pooledCache}function El(i,s){s===null?ee(Hn,Hn.current):ee(Hn,s.pool)}function Pg(){var i=vh();return i===null?null:{parent:ft._currentValue,pool:i}}var Ar=Error(r(460)),yh=Error(r(474)),Ml=Error(r(542)),kl={then:function(){}};function jg(i){return i=i.status,i==="fulfilled"||i==="rejected"}function qg(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(as,as),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Yg(i),i;default:if(typeof s.status=="string")s.then(as,as);else{if(i=Ke,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(l){if(s.status==="pending"){var d=s;d.status="fulfilled",d.value=l}},function(l){if(s.status==="pending"){var d=s;d.status="rejected",d.reason=l}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Yg(i),i}throw Pn=s,Ar}}function Un(i){try{var s=i._init;return s(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Pn=o,Ar):o}}var Pn=null;function Ig(){if(Pn===null)throw Error(r(459));var i=Pn;return Pn=null,i}function Yg(i){if(i===Ar||i===Ml)throw Error(r(483))}var Nr=null,Ro=0;function Dl(i){var s=Ro;return Ro+=1,Nr===null&&(Nr=[]),qg(Nr,i,s)}function Bo(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Tl(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Vg(i){function s(K,V){if(i){var F=K.deletions;F===null?(K.deletions=[V],K.flags|=16):F.push(V)}}function o(K,V){if(!i)return null;for(;V!==null;)s(K,V),V=V.sibling;return null}function l(K){for(var V=new Map;K!==null;)K.key!==null?V.set(K.key,K):V.set(K.index,K),K=K.sibling;return V}function d(K,V){return K=cs(K,V),K.index=0,K.sibling=null,K}function g(K,V,F){return K.index=F,i?(F=K.alternate,F!==null?(F=F.index,F<V?(K.flags|=67108866,V):F):(K.flags|=67108866,V)):(K.flags|=1048576,V)}function S(K){return i&&K.alternate===null&&(K.flags|=67108866),K}function k(K,V,F,ne){return V===null||V.tag!==6?(V=ah(F,K.mode,ne),V.return=K,V):(V=d(V,F),V.return=K,V)}function O(K,V,F,ne){var Se=F.type;return Se===w?se(K,V,F.props.children,ne,F.key):V!==null&&(V.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===W&&Un(Se)===V.type)?(V=d(V,F.props),Bo(V,F),V.return=K,V):(V=bl(F.type,F.key,F.props,null,K.mode,ne),Bo(V,F),V.return=K,V)}function Z(K,V,F,ne){return V===null||V.tag!==4||V.stateNode.containerInfo!==F.containerInfo||V.stateNode.implementation!==F.implementation?(V=lh(F,K.mode,ne),V.return=K,V):(V=d(V,F.children||[]),V.return=K,V)}function se(K,V,F,ne,Se){return V===null||V.tag!==7?(V=Bn(F,K.mode,ne,Se),V.return=K,V):(V=d(V,F),V.return=K,V)}function re(K,V,F){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=ah(""+V,K.mode,F),V.return=K,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case b:return F=bl(V.type,V.key,V.props,null,K.mode,F),Bo(F,V),F.return=K,F;case y:return V=lh(V,K.mode,F),V.return=K,V;case W:return V=Un(V),re(K,V,F)}if(H(V)||q(V))return V=Bn(V,K.mode,F,null),V.return=K,V;if(typeof V.then=="function")return re(K,Dl(V),F);if(V.$$typeof===C)return re(K,Cl(K,V),F);Tl(K,V)}return null}function J(K,V,F,ne){var Se=V!==null?V.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Se!==null?null:k(K,V,""+F,ne);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case b:return F.key===Se?O(K,V,F,ne):null;case y:return F.key===Se?Z(K,V,F,ne):null;case W:return F=Un(F),J(K,V,F,ne)}if(H(F)||q(F))return Se!==null?null:se(K,V,F,ne,null);if(typeof F.then=="function")return J(K,V,Dl(F),ne);if(F.$$typeof===C)return J(K,V,Cl(K,F),ne);Tl(K,F)}return null}function ie(K,V,F,ne,Se){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return K=K.get(F)||null,k(V,K,""+ne,Se);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return K=K.get(ne.key===null?F:ne.key)||null,O(V,K,ne,Se);case y:return K=K.get(ne.key===null?F:ne.key)||null,Z(V,K,ne,Se);case W:return ne=Un(ne),ie(K,V,F,ne,Se)}if(H(ne)||q(ne))return K=K.get(F)||null,se(V,K,ne,Se,null);if(typeof ne.then=="function")return ie(K,V,F,Dl(ne),Se);if(ne.$$typeof===C)return ie(K,V,F,Cl(V,ne),Se);Tl(V,ne)}return null}function me(K,V,F,ne){for(var Se=null,Ue=null,ve=V,De=V=0,ze=null;ve!==null&&De<F.length;De++){ve.index>De?(ze=ve,ve=null):ze=ve.sibling;var Pe=J(K,ve,F[De],ne);if(Pe===null){ve===null&&(ve=ze);break}i&&ve&&Pe.alternate===null&&s(K,ve),V=g(Pe,V,De),Ue===null?Se=Pe:Ue.sibling=Pe,Ue=Pe,ve=ze}if(De===F.length)return o(K,ve),Oe&&us(K,De),Se;if(ve===null){for(;De<F.length;De++)ve=re(K,F[De],ne),ve!==null&&(V=g(ve,V,De),Ue===null?Se=ve:Ue.sibling=ve,Ue=ve);return Oe&&us(K,De),Se}for(ve=l(ve);De<F.length;De++)ze=ie(ve,K,De,F[De],ne),ze!==null&&(i&&ze.alternate!==null&&ve.delete(ze.key===null?De:ze.key),V=g(ze,V,De),Ue===null?Se=ze:Ue.sibling=ze,Ue=ze);return i&&ve.forEach(function(cn){return s(K,cn)}),Oe&&us(K,De),Se}function we(K,V,F,ne){if(F==null)throw Error(r(151));for(var Se=null,Ue=null,ve=V,De=V=0,ze=null,Pe=F.next();ve!==null&&!Pe.done;De++,Pe=F.next()){ve.index>De?(ze=ve,ve=null):ze=ve.sibling;var cn=J(K,ve,Pe.value,ne);if(cn===null){ve===null&&(ve=ze);break}i&&ve&&cn.alternate===null&&s(K,ve),V=g(cn,V,De),Ue===null?Se=cn:Ue.sibling=cn,Ue=cn,ve=ze}if(Pe.done)return o(K,ve),Oe&&us(K,De),Se;if(ve===null){for(;!Pe.done;De++,Pe=F.next())Pe=re(K,Pe.value,ne),Pe!==null&&(V=g(Pe,V,De),Ue===null?Se=Pe:Ue.sibling=Pe,Ue=Pe);return Oe&&us(K,De),Se}for(ve=l(ve);!Pe.done;De++,Pe=F.next())Pe=ie(ve,K,De,Pe.value,ne),Pe!==null&&(i&&Pe.alternate!==null&&ve.delete(Pe.key===null?De:Pe.key),V=g(Pe,V,De),Ue===null?Se=Pe:Ue.sibling=Pe,Ue=Pe);return i&&ve.forEach(function(Lx){return s(K,Lx)}),Oe&&us(K,De),Se}function We(K,V,F,ne){if(typeof F=="object"&&F!==null&&F.type===w&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case b:e:{for(var Se=F.key;V!==null;){if(V.key===Se){if(Se=F.type,Se===w){if(V.tag===7){o(K,V.sibling),ne=d(V,F.props.children),ne.return=K,K=ne;break e}}else if(V.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===W&&Un(Se)===V.type){o(K,V.sibling),ne=d(V,F.props),Bo(ne,F),ne.return=K,K=ne;break e}o(K,V);break}else s(K,V);V=V.sibling}F.type===w?(ne=Bn(F.props.children,K.mode,ne,F.key),ne.return=K,K=ne):(ne=bl(F.type,F.key,F.props,null,K.mode,ne),Bo(ne,F),ne.return=K,K=ne)}return S(K);case y:e:{for(Se=F.key;V!==null;){if(V.key===Se)if(V.tag===4&&V.stateNode.containerInfo===F.containerInfo&&V.stateNode.implementation===F.implementation){o(K,V.sibling),ne=d(V,F.children||[]),ne.return=K,K=ne;break e}else{o(K,V);break}else s(K,V);V=V.sibling}ne=lh(F,K.mode,ne),ne.return=K,K=ne}return S(K);case W:return F=Un(F),We(K,V,F,ne)}if(H(F))return me(K,V,F,ne);if(q(F)){if(Se=q(F),typeof Se!="function")throw Error(r(150));return F=Se.call(F),we(K,V,F,ne)}if(typeof F.then=="function")return We(K,V,Dl(F),ne);if(F.$$typeof===C)return We(K,V,Cl(K,F),ne);Tl(K,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,V!==null&&V.tag===6?(o(K,V.sibling),ne=d(V,F),ne.return=K,K=ne):(o(K,V),ne=ah(F,K.mode,ne),ne.return=K,K=ne),S(K)):o(K,V)}return function(K,V,F,ne){try{Ro=0;var Se=We(K,V,F,ne);return Nr=null,Se}catch(ve){if(ve===Ar||ve===Ml)throw ve;var Ue=ri(29,ve,null,K.mode);return Ue.lanes=ne,Ue.return=K,Ue}finally{}}}var jn=Vg(!0),$g=Vg(!1),$s=!1;function Sh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bh(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ws(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Xs(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var d=l.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s,s=Sl(i),Dg(i,null,o),s}return yl(i,l,s,o),Sl(i)}function Lo(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Qa(i,o)}}function wh(i,s){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?d=g=S:g=g.next=S,o=o.next}while(o!==null);g===null?d=g=s:g=g.next=s}else d=g=s;o={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var xh=!1;function zo(){if(xh){var i=Tr;if(i!==null)throw i}}function Oo(i,s,o,l){xh=!1;var d=i.updateQueue;$s=!1;var g=d.firstBaseUpdate,S=d.lastBaseUpdate,k=d.shared.pending;if(k!==null){d.shared.pending=null;var O=k,Z=O.next;O.next=null,S===null?g=Z:S.next=Z,S=O;var se=i.alternate;se!==null&&(se=se.updateQueue,k=se.lastBaseUpdate,k!==S&&(k===null?se.firstBaseUpdate=Z:k.next=Z,se.lastBaseUpdate=O))}if(g!==null){var re=d.baseState;S=0,se=Z=O=null,k=g;do{var J=k.lane&-536870913,ie=J!==k.lane;if(ie?(Le&J)===J:(l&J)===J){J!==0&&J===Dr&&(xh=!0),se!==null&&(se=se.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=i,we=k;J=s;var We=o;switch(we.tag){case 1:if(me=we.payload,typeof me=="function"){re=me.call(We,re,J);break e}re=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=we.payload,J=typeof me=="function"?me.call(We,re,J):me,J==null)break e;re=m({},re,J);break e;case 2:$s=!0}}J=k.callback,J!==null&&(i.flags|=64,ie&&(i.flags|=8192),ie=d.callbacks,ie===null?d.callbacks=[J]:ie.push(J))}else ie={lane:J,tag:k.tag,payload:k.payload,callback:k.callback,next:null},se===null?(Z=se=ie,O=re):se=se.next=ie,S|=J;if(k=k.next,k===null){if(k=d.shared.pending,k===null)break;ie=k,k=ie.next,ie.next=null,d.lastBaseUpdate=ie,d.shared.pending=null}}while(!0);se===null&&(O=re),d.baseState=O,d.firstBaseUpdate=Z,d.lastBaseUpdate=se,g===null&&(d.shared.lanes=0),Qs|=S,i.lanes=S,i.memoizedState=re}}function Wg(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Xg(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Wg(o[i],s)}var Rr=T(null),Al=T(0);function Kg(i,s){i=bs,ee(Al,i),ee(Rr,s),bs=i|s.baseLanes}function Ch(){ee(Al,bs),ee(Rr,Rr.current)}function Eh(){bs=Al.current,j(Rr),j(Al)}var oi=T(null),Si=null;function Ks(i){var s=i.alternate;ee(lt,lt.current&1),ee(oi,i),Si===null&&(s===null||Rr.current!==null||s.memoizedState!==null)&&(Si=i)}function Mh(i){ee(lt,lt.current),ee(oi,i),Si===null&&(Si=i)}function Gg(i){i.tag===22?(ee(lt,lt.current),ee(oi,i),Si===null&&(Si=i)):Gs()}function Gs(){ee(lt,lt.current),ee(oi,oi.current)}function ai(i){j(oi),Si===i&&(Si=null),j(lt)}var lt=T(0);function Nl(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Bf(o)||Lf(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ds=0,ke=null,Ve=null,dt=null,Rl=!1,Br=!1,qn=!1,Bl=0,Ho=0,Lr=null,Cw=0;function nt(){throw Error(r(321))}function kh(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!ni(i[o],s[o]))return!1;return!0}function Dh(i,s,o,l,d,g){return ds=g,ke=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,M.H=i===null||i.memoizedState===null?Rm:Yh,qn=!1,g=o(l,d),qn=!1,Br&&(g=Zg(s,o,l,d)),Fg(i),g}function Fg(i){M.H=jo;var s=Ve!==null&&Ve.next!==null;if(ds=0,dt=Ve=ke=null,Rl=!1,Ho=0,Lr=null,s)throw Error(r(300));i===null||_t||(i=i.dependencies,i!==null&&xl(i)&&(_t=!0))}function Zg(i,s,o,l){ke=i;var d=0;do{if(Br&&(Lr=null),Ho=0,Br=!1,25<=d)throw Error(r(301));if(d+=1,dt=Ve=null,i.updateQueue!=null){var g=i.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}M.H=Bm,g=s(o,l)}while(Br);return g}function Ew(){var i=M.H,s=i.useState()[0];return s=typeof s.then=="function"?Uo(s):s,i=i.useState()[0],(Ve!==null?Ve.memoizedState:null)!==i&&(ke.flags|=1024),s}function Th(){var i=Bl!==0;return Bl=0,i}function Ah(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function Nh(i){if(Rl){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Rl=!1}ds=0,dt=Ve=ke=null,Br=!1,Ho=Bl=0,Lr=null}function Yt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?ke.memoizedState=dt=i:dt=dt.next=i,dt}function ct(){if(Ve===null){var i=ke.alternate;i=i!==null?i.memoizedState:null}else i=Ve.next;var s=dt===null?ke.memoizedState:dt.next;if(s!==null)dt=s,Ve=i;else{if(i===null)throw ke.alternate===null?Error(r(467)):Error(r(310));Ve=i,i={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},dt===null?ke.memoizedState=dt=i:dt=dt.next=i}return dt}function Ll(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uo(i){var s=Ho;return Ho+=1,Lr===null&&(Lr=[]),i=qg(Lr,i,s),s=ke,(dt===null?s.memoizedState:dt.next)===null&&(s=s.alternate,M.H=s===null||s.memoizedState===null?Rm:Yh),i}function zl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Uo(i);if(i.$$typeof===C)return Bt(i)}throw Error(r(438,String(i)))}function Rh(i){var s=null,o=ke.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(s={data:l.data.map(function(d){return d.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=Ll(),ke.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),l=0;l<i;l++)o[l]=ae;return s.index++,o}function _s(i,s){return typeof s=="function"?s(i):s}function Ol(i){var s=ct();return Bh(s,Ve,i)}function Bh(i,s,o){var l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=i.baseQueue,g=l.pending;if(g!==null){if(d!==null){var S=d.next;d.next=g.next,g.next=S}s.baseQueue=d=g,l.pending=null}if(g=i.baseState,d===null)i.memoizedState=g;else{s=d.next;var k=S=null,O=null,Z=s,se=!1;do{var re=Z.lane&-536870913;if(re!==Z.lane?(Le&re)===re:(ds&re)===re){var J=Z.revertLane;if(J===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),re===Dr&&(se=!0);else if((ds&J)===J){Z=Z.next,J===Dr&&(se=!0);continue}else re={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},O===null?(k=O=re,S=g):O=O.next=re,ke.lanes|=J,Qs|=J;re=Z.action,qn&&o(g,re),g=Z.hasEagerState?Z.eagerState:o(g,re)}else J={lane:re,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},O===null?(k=O=J,S=g):O=O.next=J,ke.lanes|=re,Qs|=re;Z=Z.next}while(Z!==null&&Z!==s);if(O===null?S=g:O.next=k,!ni(g,i.memoizedState)&&(_t=!0,se&&(o=Tr,o!==null)))throw o;i.memoizedState=g,i.baseState=S,i.baseQueue=O,l.lastRenderedState=g}return d===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function Lh(i){var s=ct(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var l=o.dispatch,d=o.pending,g=s.memoizedState;if(d!==null){o.pending=null;var S=d=d.next;do g=i(g,S.action),S=S.next;while(S!==d);ni(g,s.memoizedState)||(_t=!0),s.memoizedState=g,s.baseQueue===null&&(s.baseState=g),o.lastRenderedState=g}return[g,l]}function Qg(i,s,o){var l=ke,d=ct(),g=Oe;if(g){if(o===void 0)throw Error(r(407));o=o()}else o=s();var S=!ni((Ve||d).memoizedState,o);if(S&&(d.memoizedState=o,_t=!0),d=d.queue,Hh(tm.bind(null,l,d,i),[i]),d.getSnapshot!==s||S||dt!==null&&dt.memoizedState.tag&1){if(l.flags|=2048,zr(9,{destroy:void 0},em.bind(null,l,d,o,s),null),Ke===null)throw Error(r(349));g||(ds&127)!==0||Jg(l,s,o)}return o}function Jg(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=ke.updateQueue,s===null?(s=Ll(),ke.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function em(i,s,o,l){s.value=o,s.getSnapshot=l,im(s)&&sm(i)}function tm(i,s,o){return o(function(){im(s)&&sm(i)})}function im(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!ni(i,o)}catch{return!0}}function sm(i){var s=Rn(i,2);s!==null&&ei(s,i,2)}function zh(i){var s=Yt();if(typeof i=="function"){var o=i;if(i=o(),qn){Pi(!0);try{o()}finally{Pi(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:i},s}function nm(i,s,o,l){return i.baseState=o,Bh(i,Ve,typeof l=="function"?l:_s)}function Mw(i,s,o,l,d){if(Pl(i))throw Error(r(485));if(i=s.action,i!==null){var g={payload:d,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};M.T!==null?o(!0):g.isTransition=!1,l(g),o=s.pending,o===null?(g.next=s.pending=g,rm(s,g)):(g.next=o.next,s.pending=o.next=g)}}function rm(i,s){var o=s.action,l=s.payload,d=i.state;if(s.isTransition){var g=M.T,S={};M.T=S;try{var k=o(d,l),O=M.S;O!==null&&O(S,k),om(i,s,k)}catch(Z){Oh(i,s,Z)}finally{g!==null&&S.types!==null&&(g.types=S.types),M.T=g}}else try{g=o(d,l),om(i,s,g)}catch(Z){Oh(i,s,Z)}}function om(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){am(i,s,l)},function(l){return Oh(i,s,l)}):am(i,s,o)}function am(i,s,o){s.status="fulfilled",s.value=o,lm(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,rm(i,o)))}function Oh(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,lm(s),s=s.next;while(s!==l)}i.action=null}function lm(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function cm(i,s){return s}function um(i,s){if(Oe){var o=Ke.formState;if(o!==null){e:{var l=ke;if(Oe){if(Ge){t:{for(var d=Ge,g=yi;d.nodeType!==8;){if(!g){d=null;break t}if(d=bi(d.nextSibling),d===null){d=null;break t}}g=d.data,d=g==="F!"||g==="F"?d:null}if(d){Ge=bi(d.nextSibling),l=d.data==="F!";break e}}Ys(l)}l=!1}l&&(s=o[0])}}return o=Yt(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cm,lastRenderedState:s},o.queue=l,o=Tm.bind(null,ke,l),l.dispatch=o,l=zh(!1),g=Ih.bind(null,ke,!1,l.queue),l=Yt(),d={state:s,dispatch:null,action:i,pending:null},l.queue=d,o=Mw.bind(null,ke,d,g,o),d.dispatch=o,l.memoizedState=i,[s,o,!1]}function hm(i){var s=ct();return fm(s,Ve,i)}function fm(i,s,o){if(s=Bh(i,s,cm)[0],i=Ol(_s)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=Uo(s)}catch(S){throw S===Ar?Ml:S}else l=s;s=ct();var d=s.queue,g=d.dispatch;return o!==s.memoizedState&&(ke.flags|=2048,zr(9,{destroy:void 0},kw.bind(null,d,o),null)),[l,g,i]}function kw(i,s){i.action=s}function dm(i){var s=ct(),o=Ve;if(o!==null)return fm(s,o,i);ct(),s=s.memoizedState,o=ct();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function zr(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=ke.updateQueue,s===null&&(s=Ll(),ke.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,s.lastEffect=i),i}function _m(){return ct().memoizedState}function Hl(i,s,o,l){var d=Yt();ke.flags|=i,d.memoizedState=zr(1|s,{destroy:void 0},o,l===void 0?null:l)}function Ul(i,s,o,l){var d=ct();l=l===void 0?null:l;var g=d.memoizedState.inst;Ve!==null&&l!==null&&kh(l,Ve.memoizedState.deps)?d.memoizedState=zr(s,g,o,l):(ke.flags|=i,d.memoizedState=zr(1|s,g,o,l))}function gm(i,s){Hl(8390656,8,i,s)}function Hh(i,s){Ul(2048,8,i,s)}function Dw(i){ke.flags|=4;var s=ke.updateQueue;if(s===null)s=Ll(),ke.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function mm(i){var s=ct().memoizedState;return Dw({ref:s,nextImpl:i}),function(){if((je&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function pm(i,s){return Ul(4,2,i,s)}function vm(i,s){return Ul(4,4,i,s)}function ym(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function Sm(i,s,o){o=o!=null?o.concat([i]):null,Ul(4,4,ym.bind(null,s,i),o)}function Uh(){}function bm(i,s){var o=ct();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&kh(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function wm(i,s){var o=ct();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&kh(s,l[1]))return l[0];if(l=i(),qn){Pi(!0);try{i()}finally{Pi(!1)}}return o.memoizedState=[l,s],l}function Ph(i,s,o){return o===void 0||(ds&1073741824)!==0&&(Le&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=xp(),ke.lanes|=i,Qs|=i,o)}function xm(i,s,o,l){return ni(o,s)?o:Rr.current!==null?(i=Ph(i,o,l),ni(i,s)||(_t=!0),i):(ds&42)===0||(ds&1073741824)!==0&&(Le&261930)===0?(_t=!0,i.memoizedState=o):(i=xp(),ke.lanes|=i,Qs|=i,s)}function Cm(i,s,o,l,d){var g=B.p;B.p=g!==0&&8>g?g:8;var S=M.T,k={};M.T=k,Ih(i,!1,s,o);try{var O=d(),Z=M.S;if(Z!==null&&Z(k,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var se=xw(O,l);Po(i,s,se,ui(i))}else Po(i,s,l,ui(i))}catch(re){Po(i,s,{then:function(){},status:"rejected",reason:re},ui())}finally{B.p=g,S!==null&&k.types!==null&&(S.types=k.types),M.T=S}}function Tw(){}function jh(i,s,o,l){if(i.tag!==5)throw Error(r(476));var d=Em(i).queue;Cm(i,d,s,R,o===null?Tw:function(){return Mm(i),o(l)})}function Em(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:R},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Mm(i){var s=Em(i);s.next===null&&(s=i.alternate.memoizedState),Po(i,s.next.queue,{},ui())}function qh(){return Bt(ia)}function km(){return ct().memoizedState}function Dm(){return ct().memoizedState}function Aw(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=ui();i=Ws(o);var l=Xs(s,i,o);l!==null&&(ei(l,s,o),Lo(l,s,o)),s={cache:mh()},i.payload=s;return}s=s.return}}function Nw(i,s,o){var l=ui();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Pl(i)?Am(s,o):(o=rh(i,s,o,l),o!==null&&(ei(o,i,l),Nm(o,s,l)))}function Tm(i,s,o){var l=ui();Po(i,s,o,l)}function Po(i,s,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Pl(i))Am(s,d);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=s.lastRenderedReducer,g!==null))try{var S=s.lastRenderedState,k=g(S,o);if(d.hasEagerState=!0,d.eagerState=k,ni(k,S))return yl(i,s,d,0),Ke===null&&vl(),!1}catch{}finally{}if(o=rh(i,s,d,l),o!==null)return ei(o,i,l),Nm(o,s,l),!0}return!1}function Ih(i,s,o,l){if(l={lane:2,revertLane:bf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Pl(i)){if(s)throw Error(r(479))}else s=rh(i,o,l,2),s!==null&&ei(s,i,2)}function Pl(i){var s=i.alternate;return i===ke||s!==null&&s===ke}function Am(i,s){Br=Rl=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Nm(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Qa(i,o)}}var jo={readContext:Bt,use:zl,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useLayoutEffect:nt,useInsertionEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useSyncExternalStore:nt,useId:nt,useHostTransitionStatus:nt,useFormState:nt,useActionState:nt,useOptimistic:nt,useMemoCache:nt,useCacheRefresh:nt};jo.useEffectEvent=nt;var Rm={readContext:Bt,use:zl,useCallback:function(i,s){return Yt().memoizedState=[i,s===void 0?null:s],i},useContext:Bt,useEffect:gm,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,Hl(4194308,4,ym.bind(null,s,i),o)},useLayoutEffect:function(i,s){return Hl(4194308,4,i,s)},useInsertionEffect:function(i,s){Hl(4,2,i,s)},useMemo:function(i,s){var o=Yt();s=s===void 0?null:s;var l=i();if(qn){Pi(!0);try{i()}finally{Pi(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=Yt();if(o!==void 0){var d=o(s);if(qn){Pi(!0);try{o(s)}finally{Pi(!1)}}}else d=s;return l.memoizedState=l.baseState=d,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:d},l.queue=i,i=i.dispatch=Nw.bind(null,ke,i),[l.memoizedState,i]},useRef:function(i){var s=Yt();return i={current:i},s.memoizedState=i},useState:function(i){i=zh(i);var s=i.queue,o=Tm.bind(null,ke,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Uh,useDeferredValue:function(i,s){var o=Yt();return Ph(o,i,s)},useTransition:function(){var i=zh(!1);return i=Cm.bind(null,ke,i.queue,!0,!1),Yt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=ke,d=Yt();if(Oe){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),Ke===null)throw Error(r(349));(Le&127)!==0||Jg(l,s,o)}d.memoizedState=o;var g={value:o,getSnapshot:s};return d.queue=g,gm(tm.bind(null,l,g,i),[i]),l.flags|=2048,zr(9,{destroy:void 0},em.bind(null,l,g,o,s),null),o},useId:function(){var i=Yt(),s=Ke.identifierPrefix;if(Oe){var o=Ii,l=qi;o=(l&~(1<<32-It(l)-1)).toString(32)+o,s="_"+s+"R_"+o,o=Bl++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=Cw++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:qh,useFormState:um,useActionState:um,useOptimistic:function(i){var s=Yt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Ih.bind(null,ke,!0,o),o.dispatch=s,[i,s]},useMemoCache:Rh,useCacheRefresh:function(){return Yt().memoizedState=Aw.bind(null,ke)},useEffectEvent:function(i){var s=Yt(),o={impl:i};return s.memoizedState=o,function(){if((je&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},Yh={readContext:Bt,use:zl,useCallback:bm,useContext:Bt,useEffect:Hh,useImperativeHandle:Sm,useInsertionEffect:pm,useLayoutEffect:vm,useMemo:wm,useReducer:Ol,useRef:_m,useState:function(){return Ol(_s)},useDebugValue:Uh,useDeferredValue:function(i,s){var o=ct();return xm(o,Ve.memoizedState,i,s)},useTransition:function(){var i=Ol(_s)[0],s=ct().memoizedState;return[typeof i=="boolean"?i:Uo(i),s]},useSyncExternalStore:Qg,useId:km,useHostTransitionStatus:qh,useFormState:hm,useActionState:hm,useOptimistic:function(i,s){var o=ct();return nm(o,Ve,i,s)},useMemoCache:Rh,useCacheRefresh:Dm};Yh.useEffectEvent=mm;var Bm={readContext:Bt,use:zl,useCallback:bm,useContext:Bt,useEffect:Hh,useImperativeHandle:Sm,useInsertionEffect:pm,useLayoutEffect:vm,useMemo:wm,useReducer:Lh,useRef:_m,useState:function(){return Lh(_s)},useDebugValue:Uh,useDeferredValue:function(i,s){var o=ct();return Ve===null?Ph(o,i,s):xm(o,Ve.memoizedState,i,s)},useTransition:function(){var i=Lh(_s)[0],s=ct().memoizedState;return[typeof i=="boolean"?i:Uo(i),s]},useSyncExternalStore:Qg,useId:km,useHostTransitionStatus:qh,useFormState:dm,useActionState:dm,useOptimistic:function(i,s){var o=ct();return Ve!==null?nm(o,Ve,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Rh,useCacheRefresh:Dm};Bm.useEffectEvent=mm;function Vh(i,s,o,l){s=i.memoizedState,o=o(l,s),o=o==null?s:m({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var $h={enqueueSetState:function(i,s,o){i=i._reactInternals;var l=ui(),d=Ws(l);d.payload=s,o!=null&&(d.callback=o),s=Xs(i,d,l),s!==null&&(ei(s,i,l),Lo(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=ui(),d=Ws(l);d.tag=1,d.payload=s,o!=null&&(d.callback=o),s=Xs(i,d,l),s!==null&&(ei(s,i,l),Lo(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=ui(),l=Ws(o);l.tag=2,s!=null&&(l.callback=s),s=Xs(i,l,o),s!==null&&(ei(s,i,o),Lo(s,i,o))}};function Lm(i,s,o,l,d,g,S){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,g,S):s.prototype&&s.prototype.isPureReactComponent?!Mo(o,l)||!Mo(d,g):!0}function zm(i,s,o,l){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,l),s.state!==i&&$h.enqueueReplaceState(s,s.state,null)}function In(i,s){var o=s;if("ref"in s){o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}if(i=i.defaultProps){o===s&&(o=m({},o));for(var d in i)o[d]===void 0&&(o[d]=i[d])}return o}function Om(i){pl(i)}function Hm(i){console.error(i)}function Um(i){pl(i)}function jl(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function Pm(i,s,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Wh(i,s,o){return o=Ws(o),o.tag=3,o.payload={element:null},o.callback=function(){jl(i,s)},o}function jm(i){return i=Ws(i),i.tag=3,i}function qm(i,s,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var g=l.value;i.payload=function(){return d(g)},i.callback=function(){Pm(s,o,l)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){Pm(s,o,l),typeof d!="function"&&(Js===null?Js=new Set([this]):Js.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})})}function Rw(i,s,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&kr(s,o,d,!0),o=oi.current,o!==null){switch(o.tag){case 31:case 13:return Si===null?Ql():o.alternate===null&&rt===0&&(rt=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===kl?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),vf(i,l,d)),!1;case 22:return o.flags|=65536,l===kl?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([l]):o.add(l)),vf(i,l,d)),!1}throw Error(r(435,o.tag))}return vf(i,l,d),Ql(),!1}if(Oe)return s=oi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=d,l!==hh&&(i=Error(r(422),{cause:l}),To(mi(i,o)))):(l!==hh&&(s=Error(r(423),{cause:l}),To(mi(s,o))),i=i.current.alternate,i.flags|=65536,d&=-d,i.lanes|=d,l=mi(l,o),d=Wh(i.stateNode,l,d),wh(i,d),rt!==4&&(rt=2)),!1;var g=Error(r(520),{cause:l});if(g=mi(g,o),Ko===null?Ko=[g]:Ko.push(g),rt!==4&&(rt=2),s===null)return!0;l=mi(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=d&-d,o.lanes|=i,i=Wh(o.stateNode,l,i),wh(o,i),!1;case 1:if(s=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Js===null||!Js.has(g))))return o.flags|=65536,d&=-d,o.lanes|=d,d=jm(d),qm(d,i,o,l),wh(o,d),!1}o=o.return}while(o!==null);return!1}var Xh=Error(r(461)),_t=!1;function Lt(i,s,o,l){s.child=i===null?$g(s,null,o,l):jn(s,i.child,o,l)}function Im(i,s,o,l,d){o=o.render;var g=s.ref;if("ref"in l){var S={};for(var k in l)k!=="ref"&&(S[k]=l[k])}else S=l;return On(s),l=Dh(i,s,o,S,g,d),k=Th(),i!==null&&!_t?(Ah(i,s,d),gs(i,s,d)):(Oe&&k&&ch(s),s.flags|=1,Lt(i,s,l,d),s.child)}function Ym(i,s,o,l,d){if(i===null){var g=o.type;return typeof g=="function"&&!oh(g)&&g.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=g,Vm(i,s,g,l,d)):(i=bl(o.type,null,l,s,s.mode,d),i.ref=s.ref,i.return=s,s.child=i)}if(g=i.child,!tf(i,d)){var S=g.memoizedProps;if(o=o.compare,o=o!==null?o:Mo,o(S,l)&&i.ref===s.ref)return gs(i,s,d)}return s.flags|=1,i=cs(g,l),i.ref=s.ref,i.return=s,s.child=i}function Vm(i,s,o,l,d){if(i!==null){var g=i.memoizedProps;if(Mo(g,l)&&i.ref===s.ref)if(_t=!1,s.pendingProps=l=g,tf(i,d))(i.flags&131072)!==0&&(_t=!0);else return s.lanes=i.lanes,gs(i,s,d)}return Kh(i,s,o,l,d)}function $m(i,s,o,l){var d=l.children,g=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((s.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,i!==null){for(l=s.child=i.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~g}else l=0,s.child=null;return Wm(i,s,g,o,l)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&El(s,g!==null?g.cachePool:null),g!==null?Kg(s,g):Ch(),Gg(s);else return l=s.lanes=536870912,Wm(i,s,g!==null?g.baseLanes|o:o,o,l)}else g!==null?(El(s,g.cachePool),Kg(s,g),Gs(),s.memoizedState=null):(i!==null&&El(s,null),Ch(),Gs());return Lt(i,s,d,o),s.child}function qo(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Wm(i,s,o,l,d){var g=vh();return g=g===null?null:{parent:ft._currentValue,pool:g},s.memoizedState={baseLanes:o,cachePool:g},i!==null&&El(s,null),Ch(),Gg(s),i!==null&&kr(i,s,l,!0),s.childLanes=d,null}function ql(i,s){return s=Yl({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Xm(i,s,o){return jn(s,i.child,null,o),i=ql(s,s.pendingProps),i.flags|=2,ai(s),s.memoizedState=null,i}function Bw(i,s,o){var l=s.pendingProps,d=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Oe){if(l.mode==="hidden")return i=ql(s,l),s.lanes=536870912,qo(null,i);if(Mh(s),(i=Ge)?(i=rv(i,yi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:qs!==null?{id:qi,overflow:Ii}:null,retryLane:536870912,hydrationErrors:null},o=Ag(i),o.return=s,s.child=o,Rt=s,Ge=null)):i=null,i===null)throw Ys(s);return s.lanes=536870912,null}return ql(s,l)}var g=i.memoizedState;if(g!==null){var S=g.dehydrated;if(Mh(s),d)if(s.flags&256)s.flags&=-257,s=Xm(i,s,o);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(_t||kr(i,s,o,!1),d=(o&i.childLanes)!==0,_t||d){if(l=Ke,l!==null&&(S=Ja(l,o),S!==0&&S!==g.retryLane))throw g.retryLane=S,Rn(i,S),ei(l,i,S),Xh;Ql(),s=Xm(i,s,o)}else i=g.treeContext,Ge=bi(S.nextSibling),Rt=s,Oe=!0,Is=null,yi=!1,i!==null&&Bg(s,i),s=ql(s,l),s.flags|=4096;return s}return i=cs(i.child,{mode:l.mode,children:l.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Il(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function Kh(i,s,o,l,d){return On(s),o=Dh(i,s,o,l,void 0,d),l=Th(),i!==null&&!_t?(Ah(i,s,d),gs(i,s,d)):(Oe&&l&&ch(s),s.flags|=1,Lt(i,s,o,d),s.child)}function Km(i,s,o,l,d,g){return On(s),s.updateQueue=null,o=Zg(s,l,o,d),Fg(i),l=Th(),i!==null&&!_t?(Ah(i,s,g),gs(i,s,g)):(Oe&&l&&ch(s),s.flags|=1,Lt(i,s,o,g),s.child)}function Gm(i,s,o,l,d){if(On(s),s.stateNode===null){var g=xr,S=o.contextType;typeof S=="object"&&S!==null&&(g=Bt(S)),g=new o(l,g),s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=$h,s.stateNode=g,g._reactInternals=s,g=s.stateNode,g.props=l,g.state=s.memoizedState,g.refs={},Sh(s),S=o.contextType,g.context=typeof S=="object"&&S!==null?Bt(S):xr,g.state=s.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(Vh(s,o,S,l),g.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&$h.enqueueReplaceState(g,g.state,null),Oo(s,l,g,d),zo(),g.state=s.memoizedState),typeof g.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){g=s.stateNode;var k=s.memoizedProps,O=In(o,k);g.props=O;var Z=g.context,se=o.contextType;S=xr,typeof se=="object"&&se!==null&&(S=Bt(se));var re=o.getDerivedStateFromProps;se=typeof re=="function"||typeof g.getSnapshotBeforeUpdate=="function",k=s.pendingProps!==k,se||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k||Z!==S)&&zm(s,g,l,S),$s=!1;var J=s.memoizedState;g.state=J,Oo(s,l,g,d),zo(),Z=s.memoizedState,k||J!==Z||$s?(typeof re=="function"&&(Vh(s,o,re,l),Z=s.memoizedState),(O=$s||Lm(s,o,O,l,J,Z,S))?(se||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(s.flags|=4194308)):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=Z),g.props=l,g.state=Z,g.context=S,l=O):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{g=s.stateNode,bh(i,s),S=s.memoizedProps,se=In(o,S),g.props=se,re=s.pendingProps,J=g.context,Z=o.contextType,O=xr,typeof Z=="object"&&Z!==null&&(O=Bt(Z)),k=o.getDerivedStateFromProps,(Z=typeof k=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==re||J!==O)&&zm(s,g,l,O),$s=!1,J=s.memoizedState,g.state=J,Oo(s,l,g,d),zo();var ie=s.memoizedState;S!==re||J!==ie||$s||i!==null&&i.dependencies!==null&&xl(i.dependencies)?(typeof k=="function"&&(Vh(s,o,k,l),ie=s.memoizedState),(se=$s||Lm(s,o,se,l,J,ie,O)||i!==null&&i.dependencies!==null&&xl(i.dependencies))?(Z||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ie,O),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ie,O)),typeof g.componentDidUpdate=="function"&&(s.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===i.memoizedProps&&J===i.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&J===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=ie),g.props=l,g.state=ie,g.context=O,l=se):(typeof g.componentDidUpdate!="function"||S===i.memoizedProps&&J===i.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&J===i.memoizedState||(s.flags|=1024),l=!1)}return g=l,Il(i,s),l=(s.flags&128)!==0,g||l?(g=s.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:g.render(),s.flags|=1,i!==null&&l?(s.child=jn(s,i.child,null,d),s.child=jn(s,null,o,d)):Lt(i,s,o,d),s.memoizedState=g.state,i=s.child):i=gs(i,s,d),i}function Fm(i,s,o,l){return Ln(),s.flags|=256,Lt(i,s,o,l),s.child}var Gh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fh(i){return{baseLanes:i,cachePool:Pg()}}function Zh(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=ci),i}function Zm(i,s,o){var l=s.pendingProps,d=!1,g=(s.flags&128)!==0,S;if((S=g)||(S=i!==null&&i.memoizedState===null?!1:(lt.current&2)!==0),S&&(d=!0,s.flags&=-129),S=(s.flags&32)!==0,s.flags&=-33,i===null){if(Oe){if(d?Ks(s):Gs(),(i=Ge)?(i=rv(i,yi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:qs!==null?{id:qi,overflow:Ii}:null,retryLane:536870912,hydrationErrors:null},o=Ag(i),o.return=s,s.child=o,Rt=s,Ge=null)):i=null,i===null)throw Ys(s);return Lf(i)?s.lanes=32:s.lanes=536870912,null}var k=l.children;return l=l.fallback,d?(Gs(),d=s.mode,k=Yl({mode:"hidden",children:k},d),l=Bn(l,d,o,null),k.return=s,l.return=s,k.sibling=l,s.child=k,l=s.child,l.memoizedState=Fh(o),l.childLanes=Zh(i,S,o),s.memoizedState=Gh,qo(null,l)):(Ks(s),Qh(s,k))}var O=i.memoizedState;if(O!==null&&(k=O.dehydrated,k!==null)){if(g)s.flags&256?(Ks(s),s.flags&=-257,s=Jh(i,s,o)):s.memoizedState!==null?(Gs(),s.child=i.child,s.flags|=128,s=null):(Gs(),k=l.fallback,d=s.mode,l=Yl({mode:"visible",children:l.children},d),k=Bn(k,d,o,null),k.flags|=2,l.return=s,k.return=s,l.sibling=k,s.child=l,jn(s,i.child,null,o),l=s.child,l.memoizedState=Fh(o),l.childLanes=Zh(i,S,o),s.memoizedState=Gh,s=qo(null,l));else if(Ks(s),Lf(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var Z=S.dgst;S=Z,l=Error(r(419)),l.stack="",l.digest=S,To({value:l,source:null,stack:null}),s=Jh(i,s,o)}else if(_t||kr(i,s,o,!1),S=(o&i.childLanes)!==0,_t||S){if(S=Ke,S!==null&&(l=Ja(S,o),l!==0&&l!==O.retryLane))throw O.retryLane=l,Rn(i,l),ei(S,i,l),Xh;Bf(k)||Ql(),s=Jh(i,s,o)}else Bf(k)?(s.flags|=192,s.child=i.child,s=null):(i=O.treeContext,Ge=bi(k.nextSibling),Rt=s,Oe=!0,Is=null,yi=!1,i!==null&&Bg(s,i),s=Qh(s,l.children),s.flags|=4096);return s}return d?(Gs(),k=l.fallback,d=s.mode,O=i.child,Z=O.sibling,l=cs(O,{mode:"hidden",children:l.children}),l.subtreeFlags=O.subtreeFlags&65011712,Z!==null?k=cs(Z,k):(k=Bn(k,d,o,null),k.flags|=2),k.return=s,l.return=s,l.sibling=k,s.child=l,qo(null,l),l=s.child,k=i.child.memoizedState,k===null?k=Fh(o):(d=k.cachePool,d!==null?(O=ft._currentValue,d=d.parent!==O?{parent:O,pool:O}:d):d=Pg(),k={baseLanes:k.baseLanes|o,cachePool:d}),l.memoizedState=k,l.childLanes=Zh(i,S,o),s.memoizedState=Gh,qo(i.child,l)):(Ks(s),o=i.child,i=o.sibling,o=cs(o,{mode:"visible",children:l.children}),o.return=s,o.sibling=null,i!==null&&(S=s.deletions,S===null?(s.deletions=[i],s.flags|=16):S.push(i)),s.child=o,s.memoizedState=null,o)}function Qh(i,s){return s=Yl({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Yl(i,s){return i=ri(22,i,null,s),i.lanes=0,i}function Jh(i,s,o){return jn(s,i.child,null,o),i=Qh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Qm(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),_h(i.return,s,o)}function ef(i,s,o,l,d,g){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:g}:(S.isBackwards=s,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=o,S.tailMode=d,S.treeForkCount=g)}function Jm(i,s,o){var l=s.pendingProps,d=l.revealOrder,g=l.tail;l=l.children;var S=lt.current,k=(S&2)!==0;if(k?(S=S&1|2,s.flags|=128):S&=1,ee(lt,S),Lt(i,s,l,o),l=Oe?Do:0,!k&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Qm(i,o,s);else if(i.tag===19)Qm(i,o,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(d){case"forwards":for(o=s.child,d=null;o!==null;)i=o.alternate,i!==null&&Nl(i)===null&&(d=o),o=o.sibling;o=d,o===null?(d=s.child,s.child=null):(d=o.sibling,o.sibling=null),ef(s,!1,d,o,g,l);break;case"backwards":case"unstable_legacy-backwards":for(o=null,d=s.child,s.child=null;d!==null;){if(i=d.alternate,i!==null&&Nl(i)===null){s.child=d;break}i=d.sibling,d.sibling=o,o=d,d=i}ef(s,!0,o,null,g,l);break;case"together":ef(s,!1,null,null,void 0,l);break;default:s.memoizedState=null}return s.child}function gs(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),Qs|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(kr(i,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,o=cs(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=cs(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function tf(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&xl(i)))}function Lw(i,s,o){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),Vs(s,ft,i.memoizedState.cache),Ln();break;case 27:case 5:xe(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:Vs(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Mh(s),null;break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(Ks(s),s.flags|=128,null):(o&s.child.childLanes)!==0?Zm(i,s,o):(Ks(s),i=gs(i,s,o),i!==null?i.sibling:null);Ks(s);break;case 19:var d=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(kr(i,s,o,!1),l=(o&s.childLanes)!==0),d){if(l)return Jm(i,s,o);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ee(lt,lt.current),l)break;return null;case 22:return s.lanes=0,$m(i,s,o,s.pendingProps);case 24:Vs(s,ft,i.memoizedState.cache)}return gs(i,s,o)}function ep(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)_t=!0;else{if(!tf(i,o)&&(s.flags&128)===0)return _t=!1,Lw(i,s,o);_t=(i.flags&131072)!==0}else _t=!1,Oe&&(s.flags&1048576)!==0&&Rg(s,Do,s.index);switch(s.lanes=0,s.tag){case 16:e:{var l=s.pendingProps;if(i=Un(s.elementType),s.type=i,typeof i=="function")oh(i)?(l=In(i,l),s.tag=1,s=Gm(null,s,i,l,o)):(s.tag=0,s=Kh(null,s,i,l,o));else{if(i!=null){var d=i.$$typeof;if(d===D){s.tag=11,s=Im(null,s,i,l,o);break e}else if(d===P){s.tag=14,s=Ym(null,s,i,l,o);break e}}throw s=A(i)||i,Error(r(306,s,""))}}return s;case 0:return Kh(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,d=In(l,s.pendingProps),Gm(i,s,l,d,o);case 3:e:{if(ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));l=s.pendingProps;var g=s.memoizedState;d=g.element,bh(i,s),Oo(s,l,null,o);var S=s.memoizedState;if(l=S.cache,Vs(s,ft,l),l!==g.cache&&gh(s,[ft],o,!0),zo(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=Fm(i,s,l,o);break e}else if(l!==d){d=mi(Error(r(424)),s),To(d),s=Fm(i,s,l,o);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Ge=bi(i.firstChild),Rt=s,Oe=!0,Is=null,yi=!0,o=$g(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Ln(),l===d){s=gs(i,s,o);break e}Lt(i,s,l,o)}s=s.child}return s;case 26:return Il(i,s),i===null?(o=hv(s.type,null,s.pendingProps,null))?s.memoizedState=o:Oe||(o=s.type,i=s.pendingProps,l=rc(ce.current).createElement(o),l[yt]=s,l[Ut]=i,zt(l,o,i),ht(l),s.stateNode=l):s.memoizedState=hv(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return xe(s),i===null&&Oe&&(l=s.stateNode=lv(s.type,s.pendingProps,ce.current),Rt=s,yi=!0,d=Ge,nn(s.type)?(zf=d,Ge=bi(l.firstChild)):Ge=d),Lt(i,s,s.pendingProps.children,o),Il(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Oe&&((d=l=Ge)&&(l=ux(l,s.type,s.pendingProps,yi),l!==null?(s.stateNode=l,Rt=s,Ge=bi(l.firstChild),yi=!1,d=!0):d=!1),d||Ys(s)),xe(s),d=s.type,g=s.pendingProps,S=i!==null?i.memoizedProps:null,l=g.children,Af(d,g)?l=null:S!==null&&Af(d,S)&&(s.flags|=32),s.memoizedState!==null&&(d=Dh(i,s,Ew,null,null,o),ia._currentValue=d),Il(i,s),Lt(i,s,l,o),s.child;case 6:return i===null&&Oe&&((i=o=Ge)&&(o=hx(o,s.pendingProps,yi),o!==null?(s.stateNode=o,Rt=s,Ge=null,i=!0):i=!1),i||Ys(s)),null;case 13:return Zm(i,s,o);case 4:return ue(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=jn(s,null,l,o):Lt(i,s,l,o),s.child;case 11:return Im(i,s,s.type,s.pendingProps,o);case 7:return Lt(i,s,s.pendingProps,o),s.child;case 8:return Lt(i,s,s.pendingProps.children,o),s.child;case 12:return Lt(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,Vs(s,s.type,l.value),Lt(i,s,l.children,o),s.child;case 9:return d=s.type._context,l=s.pendingProps.children,On(s),d=Bt(d),l=l(d),s.flags|=1,Lt(i,s,l,o),s.child;case 14:return Ym(i,s,s.type,s.pendingProps,o);case 15:return Vm(i,s,s.type,s.pendingProps,o);case 19:return Jm(i,s,o);case 31:return Bw(i,s,o);case 22:return $m(i,s,o,s.pendingProps);case 24:return On(s),l=Bt(ft),i===null?(d=vh(),d===null&&(d=Ke,g=mh(),d.pooledCache=g,g.refCount++,g!==null&&(d.pooledCacheLanes|=o),d=g),s.memoizedState={parent:l,cache:d},Sh(s),Vs(s,ft,d)):((i.lanes&o)!==0&&(bh(i,s),Oo(s,null,null,o),zo()),d=i.memoizedState,g=s.memoizedState,d.parent!==l?(d={parent:l,cache:l},s.memoizedState=d,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=d),Vs(s,ft,l)):(l=g.cache,Vs(s,ft,l),l!==d.cache&&gh(s,[ft],o,!0))),Lt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function ms(i){i.flags|=4}function sf(i,s,o,l,d){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(d&335544128)===d)if(i.stateNode.complete)i.flags|=8192;else if(kp())i.flags|=8192;else throw Pn=kl,yh}else i.flags&=-16777217}function tp(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!mv(s))if(kp())i.flags|=8192;else throw Pn=kl,yh}function Vl(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Fa():536870912,i.lanes|=s,Pr|=s)}function Io(i,s){if(!Oe)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function Fe(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(s)for(var d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=i,d=d.sibling;else for(d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=i,d=d.sibling;return i.subtreeFlags|=l,i.childLanes=o,s}function zw(i,s,o){var l=s.pendingProps;switch(uh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(s),null;case 1:return Fe(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),fs(ft),_e(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Mr(s)?ms(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,fh())),Fe(s),null;case 26:var d=s.type,g=s.memoizedState;return i===null?(ms(s),g!==null?(Fe(s),tp(s,g)):(Fe(s),sf(s,d,null,l,o))):g?g!==i.memoizedState?(ms(s),Fe(s),tp(s,g)):(Fe(s),s.flags&=-16777217):(i=i.memoizedProps,i!==l&&ms(s),Fe(s),sf(s,d,i,l,o)),null;case 27:if(be(s),o=ce.current,d=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&ms(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return Fe(s),null}i=te.current,Mr(s)?Lg(s):(i=lv(d,l,o),s.stateNode=i,ms(s))}return Fe(s),null;case 5:if(be(s),d=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&ms(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return Fe(s),null}if(g=te.current,Mr(s))Lg(s);else{var S=rc(ce.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?S.createElement(d,{is:l.is}):S.createElement(d)}}g[yt]=s,g[Ut]=l;e:for(S=s.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===s)break e;for(;S.sibling===null;){if(S.return===null||S.return===s)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}s.stateNode=g;e:switch(zt(g,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ms(s)}}return Fe(s),sf(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,o),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&ms(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=ce.current,Mr(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,d=Rt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}i[yt]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||Zp(i.nodeValue,o)),i||Ys(s,!0)}else i=rc(i).createTextNode(l),i[yt]=s,s.stateNode=i}return Fe(s),null;case 31:if(o=s.memoizedState,i===null||i.memoizedState!==null){if(l=Mr(s),o!==null){if(i===null){if(!l)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[yt]=s}else Ln(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Fe(s),i=!1}else o=fh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return s.flags&256?(ai(s),s):(ai(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Fe(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(d=Mr(s),l!==null&&l.dehydrated!==null){if(i===null){if(!d)throw Error(r(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[yt]=s}else Ln(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Fe(s),d=!1}else d=fh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(ai(s),s):(ai(s),null)}return ai(s),(s.flags&128)!==0?(s.lanes=o,s):(o=l!==null,i=i!==null&&i.memoizedState!==null,o&&(l=s.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==d&&(l.flags|=2048)),o!==i&&o&&(s.child.flags|=8192),Vl(s,s.updateQueue),Fe(s),null);case 4:return _e(),i===null&&Ef(s.stateNode.containerInfo),Fe(s),null;case 10:return fs(s.type),Fe(s),null;case 19:if(j(lt),l=s.memoizedState,l===null)return Fe(s),null;if(d=(s.flags&128)!==0,g=l.rendering,g===null)if(d)Io(l,!1);else{if(rt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(g=Nl(i),g!==null){for(s.flags|=128,Io(l,!1),i=g.updateQueue,s.updateQueue=i,Vl(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)Tg(o,i),o=o.sibling;return ee(lt,lt.current&1|2),Oe&&us(s,l.treeForkCount),s.child}i=i.sibling}l.tail!==null&&Nt()>Gl&&(s.flags|=128,d=!0,Io(l,!1),s.lanes=4194304)}else{if(!d)if(i=Nl(g),i!==null){if(s.flags|=128,d=!0,i=i.updateQueue,s.updateQueue=i,Vl(s,i),Io(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!Oe)return Fe(s),null}else 2*Nt()-l.renderingStartTime>Gl&&o!==536870912&&(s.flags|=128,d=!0,Io(l,!1),s.lanes=4194304);l.isBackwards?(g.sibling=s.child,s.child=g):(i=l.last,i!==null?i.sibling=g:s.child=g,l.last=g)}return l.tail!==null?(i=l.tail,l.rendering=i,l.tail=i.sibling,l.renderingStartTime=Nt(),i.sibling=null,o=lt.current,ee(lt,d?o&1|2:o&1),Oe&&us(s,l.treeForkCount),i):(Fe(s),null);case 22:case 23:return ai(s),Eh(),l=s.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(o&536870912)!==0&&(s.flags&128)===0&&(Fe(s),s.subtreeFlags&6&&(s.flags|=8192)):Fe(s),o=s.updateQueue,o!==null&&Vl(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==o&&(s.flags|=2048),i!==null&&j(Hn),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),fs(ft),Fe(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function Ow(i,s){switch(uh(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return fs(ft),_e(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return be(s),null;case 31:if(s.memoizedState!==null){if(ai(s),s.alternate===null)throw Error(r(340));Ln()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(ai(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ln()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return j(lt),null;case 4:return _e(),null;case 10:return fs(s.type),null;case 22:case 23:return ai(s),Eh(),i!==null&&j(Hn),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return fs(ft),null;case 25:return null;default:return null}}function ip(i,s){switch(uh(s),s.tag){case 3:fs(ft),_e();break;case 26:case 27:case 5:be(s);break;case 4:_e();break;case 31:s.memoizedState!==null&&ai(s);break;case 13:ai(s);break;case 19:j(lt);break;case 10:fs(s.type);break;case 22:case 23:ai(s),Eh(),i!==null&&j(Hn);break;case 24:fs(ft)}}function Yo(i,s){try{var o=s.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;do{if((o.tag&i)===i){l=void 0;var g=o.create,S=o.inst;l=g(),S.destroy=l}o=o.next}while(o!==d)}}catch(k){Ye(s,s.return,k)}}function Fs(i,s,o){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var g=d.next;l=g;do{if((l.tag&i)===i){var S=l.inst,k=S.destroy;if(k!==void 0){S.destroy=void 0,d=s;var O=o,Z=k;try{Z()}catch(se){Ye(d,O,se)}}}l=l.next}while(l!==g)}}catch(se){Ye(s,s.return,se)}}function sp(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Xg(s,o)}catch(l){Ye(i,i.return,l)}}}function np(i,s,o){o.props=In(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ye(i,s,l)}}function Vo(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(d){Ye(i,s,d)}}function Yi(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Ye(i,s,d)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Ye(i,s,d)}else o.current=null}function rp(i){var s=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(d){Ye(i,i.return,d)}}function nf(i,s,o){try{var l=i.stateNode;nx(l,i.type,o,s),l[Ut]=s}catch(d){Ye(i,i.return,d)}}function op(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&nn(i.type)||i.tag===4}function rf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||op(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&nn(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function of(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=as));else if(l!==4&&(l===27&&nn(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(of(i,s,o),i=i.sibling;i!==null;)of(i,s,o),i=i.sibling}function $l(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(l!==4&&(l===27&&nn(i.type)&&(o=i.stateNode),i=i.child,i!==null))for($l(i,s,o),i=i.sibling;i!==null;)$l(i,s,o),i=i.sibling}function ap(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);zt(s,l,o),s[yt]=i,s[Ut]=o}catch(g){Ye(i,i.return,g)}}var ps=!1,gt=!1,af=!1,lp=typeof WeakSet=="function"?WeakSet:Set,Et=null;function Hw(i,s){if(i=i.containerInfo,Df=fc,i=Sg(i),Ju(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var d=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var S=0,k=-1,O=-1,Z=0,se=0,re=i,J=null;t:for(;;){for(var ie;re!==o||d!==0&&re.nodeType!==3||(k=S+d),re!==g||l!==0&&re.nodeType!==3||(O=S+l),re.nodeType===3&&(S+=re.nodeValue.length),(ie=re.firstChild)!==null;)J=re,re=ie;for(;;){if(re===i)break t;if(J===o&&++Z===d&&(k=S),J===g&&++se===l&&(O=S),(ie=re.nextSibling)!==null)break;re=J,J=re.parentNode}re=ie}o=k===-1||O===-1?null:{start:k,end:O}}else o=null}o=o||{start:0,end:0}}else o=null;for(Tf={focusedElem:i,selectionRange:o},fc=!1,Et=s;Et!==null;)if(s=Et,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Et=i;else for(;Et!==null;){switch(s=Et,g=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)d=i[o],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&g!==null){i=void 0,o=s,d=g.memoizedProps,g=g.memoizedState,l=o.stateNode;try{var me=In(o.type,d);i=l.getSnapshotBeforeUpdate(me,g),l.__reactInternalSnapshotBeforeUpdate=i}catch(we){Ye(o,o.return,we)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)Rf(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Rf(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Et=i;break}Et=s.return}}function cp(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:ys(i,o),l&4&&Yo(5,o);break;case 1:if(ys(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(S){Ye(o,o.return,S)}else{var d=In(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(d,s,i.__reactInternalSnapshotBeforeUpdate)}catch(S){Ye(o,o.return,S)}}l&64&&sp(o),l&512&&Vo(o,o.return);break;case 3:if(ys(i,o),l&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Xg(i,s)}catch(S){Ye(o,o.return,S)}}break;case 27:s===null&&l&4&&ap(o);case 26:case 5:ys(i,o),s===null&&l&4&&rp(o),l&512&&Vo(o,o.return);break;case 12:ys(i,o);break;case 31:ys(i,o),l&4&&fp(i,o);break;case 13:ys(i,o),l&4&&dp(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=Ww.bind(null,o),fx(i,o))));break;case 22:if(l=o.memoizedState!==null||ps,!l){s=s!==null&&s.memoizedState!==null||gt,d=ps;var g=gt;ps=l,(gt=s)&&!g?Ss(i,o,(o.subtreeFlags&8772)!==0):ys(i,o),ps=d,gt=g}break;case 30:break;default:ys(i,o)}}function up(i){var s=i.alternate;s!==null&&(i.alternate=null,up(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&mo(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Qe=null,Ft=!1;function vs(i,s,o){for(o=o.child;o!==null;)hp(i,s,o),o=o.sibling}function hp(i,s,o){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(xn,o)}catch{}switch(o.tag){case 26:gt||Yi(o,s),vs(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:gt||Yi(o,s);var l=Qe,d=Ft;nn(o.type)&&(Qe=o.stateNode,Ft=!1),vs(i,s,o),Jo(o.stateNode),Qe=l,Ft=d;break;case 5:gt||Yi(o,s);case 6:if(l=Qe,d=Ft,Qe=null,vs(i,s,o),Qe=l,Ft=d,Qe!==null)if(Ft)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(o.stateNode)}catch(g){Ye(o,s,g)}else try{Qe.removeChild(o.stateNode)}catch(g){Ye(o,s,g)}break;case 18:Qe!==null&&(Ft?(i=Qe,sv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Xr(i)):sv(Qe,o.stateNode));break;case 4:l=Qe,d=Ft,Qe=o.stateNode.containerInfo,Ft=!0,vs(i,s,o),Qe=l,Ft=d;break;case 0:case 11:case 14:case 15:Fs(2,o,s),gt||Fs(4,o,s),vs(i,s,o);break;case 1:gt||(Yi(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&np(o,s,l)),vs(i,s,o);break;case 21:vs(i,s,o);break;case 22:gt=(l=gt)||o.memoizedState!==null,vs(i,s,o),gt=l;break;default:vs(i,s,o)}}function fp(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Xr(i)}catch(o){Ye(s,s.return,o)}}}function dp(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Xr(i)}catch(o){Ye(s,s.return,o)}}function Uw(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new lp),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new lp),s;default:throw Error(r(435,i.tag))}}function Wl(i,s){var o=Uw(i);s.forEach(function(l){if(!o.has(l)){o.add(l);var d=Xw.bind(null,i,l);l.then(d,d)}})}function Zt(i,s){var o=s.deletions;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l],g=i,S=s,k=S;e:for(;k!==null;){switch(k.tag){case 27:if(nn(k.type)){Qe=k.stateNode,Ft=!1;break e}break;case 5:Qe=k.stateNode,Ft=!1;break e;case 3:case 4:Qe=k.stateNode.containerInfo,Ft=!0;break e}k=k.return}if(Qe===null)throw Error(r(160));hp(g,S,d),Qe=null,Ft=!1,g=d.alternate,g!==null&&(g.return=null),d.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)_p(s,i),s=s.sibling}var Ni=null;function _p(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Zt(s,i),Qt(i),l&4&&(Fs(3,i,i.return),Yo(3,i),Fs(5,i,i.return));break;case 1:Zt(s,i),Qt(i),l&512&&(gt||o===null||Yi(o,o.return)),l&64&&ps&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var d=Ni;if(Zt(s,i),Qt(i),l&512&&(gt||o===null||Yi(o,o.return)),l&4){var g=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":g=d.getElementsByTagName("title")[0],(!g||g[Mn]||g[yt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=d.createElement(l),d.head.insertBefore(g,d.querySelector("head > title"))),zt(g,l,o),g[yt]=i,ht(g),l=g;break e;case"link":var S=_v("link","href",d).get(l+(o.href||""));if(S){for(var k=0;k<S.length;k++)if(g=S[k],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(k,1);break t}}g=d.createElement(l),zt(g,l,o),d.head.appendChild(g);break;case"meta":if(S=_v("meta","content",d).get(l+(o.content||""))){for(k=0;k<S.length;k++)if(g=S[k],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(k,1);break t}}g=d.createElement(l),zt(g,l,o),d.head.appendChild(g);break;default:throw Error(r(468,l))}g[yt]=i,ht(g),l=g}i.stateNode=l}else gv(d,i.type,i.stateNode);else i.stateNode=dv(d,l,i.memoizedProps);else g!==l?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,l===null?gv(d,i.type,i.stateNode):dv(d,l,i.memoizedProps)):l===null&&i.stateNode!==null&&nf(i,i.memoizedProps,o.memoizedProps)}break;case 27:Zt(s,i),Qt(i),l&512&&(gt||o===null||Yi(o,o.return)),o!==null&&l&4&&nf(i,i.memoizedProps,o.memoizedProps);break;case 5:if(Zt(s,i),Qt(i),l&512&&(gt||o===null||Yi(o,o.return)),i.flags&32){d=i.stateNode;try{mr(d,"")}catch(me){Ye(i,i.return,me)}}l&4&&i.stateNode!=null&&(d=i.memoizedProps,nf(i,d,o!==null?o.memoizedProps:d)),l&1024&&(af=!0);break;case 6:if(Zt(s,i),Qt(i),l&4){if(i.stateNode===null)throw Error(r(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(me){Ye(i,i.return,me)}}break;case 3:if(lc=null,d=Ni,Ni=oc(s.containerInfo),Zt(s,i),Ni=d,Qt(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{Xr(s.containerInfo)}catch(me){Ye(i,i.return,me)}af&&(af=!1,gp(i));break;case 4:l=Ni,Ni=oc(i.stateNode.containerInfo),Zt(s,i),Qt(i),Ni=l;break;case 12:Zt(s,i),Qt(i);break;case 31:Zt(s,i),Qt(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Wl(i,l)));break;case 13:Zt(s,i),Qt(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Kl=Nt()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Wl(i,l)));break;case 22:d=i.memoizedState!==null;var O=o!==null&&o.memoizedState!==null,Z=ps,se=gt;if(ps=Z||d,gt=se||O,Zt(s,i),gt=se,ps=Z,Qt(i),l&8192)e:for(s=i.stateNode,s._visibility=d?s._visibility&-2:s._visibility|1,d&&(o===null||O||ps||gt||Yn(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){O=o=s;try{if(g=O.stateNode,d)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=O.stateNode;var re=O.memoizedProps.style,J=re!=null&&re.hasOwnProperty("display")?re.display:null;k.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(me){Ye(O,O.return,me)}}}else if(s.tag===6){if(o===null){O=s;try{O.stateNode.nodeValue=d?"":O.memoizedProps}catch(me){Ye(O,O.return,me)}}}else if(s.tag===18){if(o===null){O=s;try{var ie=O.stateNode;d?nv(ie,!0):nv(O.stateNode,!1)}catch(me){Ye(O,O.return,me)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Wl(i,o))));break;case 19:Zt(s,i),Qt(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Wl(i,l)));break;case 30:break;case 21:break;default:Zt(s,i),Qt(i)}}function Qt(i){var s=i.flags;if(s&2){try{for(var o,l=i.return;l!==null;){if(op(l)){o=l;break}l=l.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var d=o.stateNode,g=rf(i);$l(i,g,d);break;case 5:var S=o.stateNode;o.flags&32&&(mr(S,""),o.flags&=-33);var k=rf(i);$l(i,k,S);break;case 3:case 4:var O=o.stateNode.containerInfo,Z=rf(i);of(i,Z,O);break;default:throw Error(r(161))}}catch(se){Ye(i,i.return,se)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function gp(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;gp(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function ys(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)cp(i,s.alternate,s),s=s.sibling}function Yn(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Fs(4,s,s.return),Yn(s);break;case 1:Yi(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&np(s,s.return,o),Yn(s);break;case 27:Jo(s.stateNode);case 26:case 5:Yi(s,s.return),Yn(s);break;case 22:s.memoizedState===null&&Yn(s);break;case 30:Yn(s);break;default:Yn(s)}i=i.sibling}}function Ss(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var l=s.alternate,d=i,g=s,S=g.flags;switch(g.tag){case 0:case 11:case 15:Ss(d,g,o),Yo(4,g);break;case 1:if(Ss(d,g,o),l=g,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Z){Ye(l,l.return,Z)}if(l=g,d=l.updateQueue,d!==null){var k=l.stateNode;try{var O=d.shared.hiddenCallbacks;if(O!==null)for(d.shared.hiddenCallbacks=null,d=0;d<O.length;d++)Wg(O[d],k)}catch(Z){Ye(l,l.return,Z)}}o&&S&64&&sp(g),Vo(g,g.return);break;case 27:ap(g);case 26:case 5:Ss(d,g,o),o&&l===null&&S&4&&rp(g),Vo(g,g.return);break;case 12:Ss(d,g,o);break;case 31:Ss(d,g,o),o&&S&4&&fp(d,g);break;case 13:Ss(d,g,o),o&&S&4&&dp(d,g);break;case 22:g.memoizedState===null&&Ss(d,g,o),Vo(g,g.return);break;case 30:break;default:Ss(d,g,o)}s=s.sibling}}function lf(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Ao(o))}function cf(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Ao(i))}function Ri(i,s,o,l){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)mp(i,s,o,l),s=s.sibling}function mp(i,s,o,l){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Ri(i,s,o,l),d&2048&&Yo(9,s);break;case 1:Ri(i,s,o,l);break;case 3:Ri(i,s,o,l),d&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Ao(i)));break;case 12:if(d&2048){Ri(i,s,o,l),i=s.stateNode;try{var g=s.memoizedProps,S=g.id,k=g.onPostCommit;typeof k=="function"&&k(S,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(O){Ye(s,s.return,O)}}else Ri(i,s,o,l);break;case 31:Ri(i,s,o,l);break;case 13:Ri(i,s,o,l);break;case 23:break;case 22:g=s.stateNode,S=s.alternate,s.memoizedState!==null?g._visibility&2?Ri(i,s,o,l):$o(i,s):g._visibility&2?Ri(i,s,o,l):(g._visibility|=2,Or(i,s,o,l,(s.subtreeFlags&10256)!==0||!1)),d&2048&&lf(S,s);break;case 24:Ri(i,s,o,l),d&2048&&cf(s.alternate,s);break;default:Ri(i,s,o,l)}}function Or(i,s,o,l,d){for(d=d&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var g=i,S=s,k=o,O=l,Z=S.flags;switch(S.tag){case 0:case 11:case 15:Or(g,S,k,O,d),Yo(8,S);break;case 23:break;case 22:var se=S.stateNode;S.memoizedState!==null?se._visibility&2?Or(g,S,k,O,d):$o(g,S):(se._visibility|=2,Or(g,S,k,O,d)),d&&Z&2048&&lf(S.alternate,S);break;case 24:Or(g,S,k,O,d),d&&Z&2048&&cf(S.alternate,S);break;default:Or(g,S,k,O,d)}s=s.sibling}}function $o(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,l=s,d=l.flags;switch(l.tag){case 22:$o(o,l),d&2048&&lf(l.alternate,l);break;case 24:$o(o,l),d&2048&&cf(l.alternate,l);break;default:$o(o,l)}s=s.sibling}}var Wo=8192;function Hr(i,s,o){if(i.subtreeFlags&Wo)for(i=i.child;i!==null;)pp(i,s,o),i=i.sibling}function pp(i,s,o){switch(i.tag){case 26:Hr(i,s,o),i.flags&Wo&&i.memoizedState!==null&&Cx(o,Ni,i.memoizedState,i.memoizedProps);break;case 5:Hr(i,s,o);break;case 3:case 4:var l=Ni;Ni=oc(i.stateNode.containerInfo),Hr(i,s,o),Ni=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=Wo,Wo=16777216,Hr(i,s,o),Wo=l):Hr(i,s,o));break;default:Hr(i,s,o)}}function vp(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Xo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];Et=l,Sp(l,i)}vp(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)yp(i),i=i.sibling}function yp(i){switch(i.tag){case 0:case 11:case 15:Xo(i),i.flags&2048&&Fs(9,i,i.return);break;case 3:Xo(i);break;case 12:Xo(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Xl(i)):Xo(i);break;default:Xo(i)}}function Xl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];Et=l,Sp(l,i)}vp(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Fs(8,s,s.return),Xl(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,Xl(s));break;default:Xl(s)}i=i.sibling}}function Sp(i,s){for(;Et!==null;){var o=Et;switch(o.tag){case 0:case 11:case 15:Fs(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ao(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,Et=l;else e:for(o=i;Et!==null;){l=Et;var d=l.sibling,g=l.return;if(up(l),l===o){Et=null;break e}if(d!==null){d.return=g,Et=d;break e}Et=g}}}var Pw={getCacheForType:function(i){var s=Bt(ft),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return Bt(ft).controller.signal}},jw=typeof WeakMap=="function"?WeakMap:Map,je=0,Ke=null,Ne=null,Le=0,Ie=0,li=null,Zs=!1,Ur=!1,uf=!1,bs=0,rt=0,Qs=0,Vn=0,hf=0,ci=0,Pr=0,Ko=null,Jt=null,ff=!1,Kl=0,bp=0,Gl=1/0,Fl=null,Js=null,St=0,en=null,jr=null,ws=0,df=0,_f=null,wp=null,Go=0,gf=null;function ui(){return(je&2)!==0&&Le!==0?Le&-Le:M.T!==null?bf():el()}function xp(){if(ci===0)if((Le&536870912)===0||Oe){var i=ur;ur<<=1,(ur&3932160)===0&&(ur=262144),ci=i}else ci=536870912;return i=oi.current,i!==null&&(i.flags|=32),ci}function ei(i,s,o){(i===Ke&&(Ie===2||Ie===9)||i.cancelPendingCommit!==null)&&(qr(i,0),tn(i,Le,ci,!1)),En(i,o),((je&2)===0||i!==Ke)&&(i===Ke&&((je&2)===0&&(Vn|=o),rt===4&&tn(i,Le,ci,!1)),Vi(i))}function Cp(i,s,o){if((je&6)!==0)throw Error(r(327));var l=!o&&(s&127)===0&&(s&i.expiredLanes)===0||Cn(i,s),d=l?Yw(i,s):pf(i,s,!0),g=l;do{if(d===0){Ur&&!l&&tn(i,s,0,!1);break}else{if(o=i.current.alternate,g&&!qw(o)){d=pf(i,s,!1),g=!1;continue}if(d===2){if(g=s,i.errorRecoveryDisabledLanes&g)var S=0;else S=i.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){s=S;e:{var k=i;d=Ko;var O=k.current.memoizedState.isDehydrated;if(O&&(qr(k,S).flags|=256),S=pf(k,S,!1),S!==2){if(uf&&!O){k.errorRecoveryDisabledLanes|=g,Vn|=g,d=4;break e}g=Jt,Jt=d,g!==null&&(Jt===null?Jt=g:Jt.push.apply(Jt,g))}d=S}if(g=!1,d!==2)continue}}if(d===1){qr(i,0),tn(i,s,0,!0);break}e:{switch(l=i,g=d,g){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:tn(l,s,ci,!Zs);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(d=Kl+300-Nt(),10<d)){if(tn(l,s,ci,!Zs),fr(l,0,!0)!==0)break e;ws=s,l.timeoutHandle=tv(Ep.bind(null,l,o,Jt,Fl,ff,s,ci,Vn,Pr,Zs,g,"Throttled",-0,0),d);break e}Ep(l,o,Jt,Fl,ff,s,ci,Vn,Pr,Zs,g,null,-0,0)}}break}while(!0);Vi(i)}function Ep(i,s,o,l,d,g,S,k,O,Z,se,re,J,ie){if(i.timeoutHandle=-1,re=s.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:as},pp(s,g,re);var me=(g&62914560)===g?Kl-Nt():(g&4194048)===g?bp-Nt():0;if(me=Ex(re,me),me!==null){ws=g,i.cancelPendingCommit=me(Bp.bind(null,i,s,g,o,l,d,S,k,O,se,re,null,J,ie)),tn(i,g,S,!Z);return}}Bp(i,s,g,o,l,d,S,k,O)}function qw(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var d=o[l],g=d.getSnapshot;d=d.value;try{if(!ni(g(),d))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function tn(i,s,o,l){s&=~hf,s&=~Vn,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var d=s;0<d;){var g=31-It(d),S=1<<g;l[g]=-1,d&=~S}o!==0&&Za(i,o,s)}function Zl(){return(je&6)===0?(Fo(0),!1):!0}function mf(){if(Ne!==null){if(Ie===0)var i=Ne.return;else i=Ne,hs=zn=null,Nh(i),Nr=null,Ro=0,i=Ne;for(;i!==null;)ip(i.alternate,i),i=i.return;Ne=null}}function qr(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,ax(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),ws=0,mf(),Ke=i,Ne=o=cs(i.current,null),Le=s,Ie=0,li=null,Zs=!1,Ur=Cn(i,s),uf=!1,Pr=ci=hf=Vn=Qs=rt=0,Jt=Ko=null,ff=!1,(s&8)!==0&&(s|=s&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=s;0<l;){var d=31-It(l),g=1<<d;s|=i[d],l&=~g}return bs=s,vl(),o}function Mp(i,s){ke=null,M.H=jo,s===Ar||s===Ml?(s=Ig(),Ie=3):s===yh?(s=Ig(),Ie=4):Ie=s===Xh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,li=s,Ne===null&&(rt=1,jl(i,mi(s,i.current)))}function kp(){var i=oi.current;return i===null?!0:(Le&4194048)===Le?Si===null:(Le&62914560)===Le||(Le&536870912)!==0?i===Si:!1}function Dp(){var i=M.H;return M.H=jo,i===null?jo:i}function Tp(){var i=M.A;return M.A=Pw,i}function Ql(){rt=4,Zs||(Le&4194048)!==Le&&oi.current!==null||(Ur=!0),(Qs&134217727)===0&&(Vn&134217727)===0||Ke===null||tn(Ke,Le,ci,!1)}function pf(i,s,o){var l=je;je|=2;var d=Dp(),g=Tp();(Ke!==i||Le!==s)&&(Fl=null,qr(i,s)),s=!1;var S=rt;e:do try{if(Ie!==0&&Ne!==null){var k=Ne,O=li;switch(Ie){case 8:mf(),S=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(s=!0);var Z=Ie;if(Ie=0,li=null,Ir(i,k,O,Z),o&&Ur){S=0;break e}break;default:Z=Ie,Ie=0,li=null,Ir(i,k,O,Z)}}Iw(),S=rt;break}catch(se){Mp(i,se)}while(!0);return s&&i.shellSuspendCounter++,hs=zn=null,je=l,M.H=d,M.A=g,Ne===null&&(Ke=null,Le=0,vl()),S}function Iw(){for(;Ne!==null;)Ap(Ne)}function Yw(i,s){var o=je;je|=2;var l=Dp(),d=Tp();Ke!==i||Le!==s?(Fl=null,Gl=Nt()+500,qr(i,s)):Ur=Cn(i,s);e:do try{if(Ie!==0&&Ne!==null){s=Ne;var g=li;t:switch(Ie){case 1:Ie=0,li=null,Ir(i,s,g,1);break;case 2:case 9:if(jg(g)){Ie=0,li=null,Np(s);break}s=function(){Ie!==2&&Ie!==9||Ke!==i||(Ie=7),Vi(i)},g.then(s,s);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:jg(g)?(Ie=0,li=null,Np(s)):(Ie=0,li=null,Ir(i,s,g,7));break;case 5:var S=null;switch(Ne.tag){case 26:S=Ne.memoizedState;case 5:case 27:var k=Ne;if(S?mv(S):k.stateNode.complete){Ie=0,li=null;var O=k.sibling;if(O!==null)Ne=O;else{var Z=k.return;Z!==null?(Ne=Z,Jl(Z)):Ne=null}break t}}Ie=0,li=null,Ir(i,s,g,5);break;case 6:Ie=0,li=null,Ir(i,s,g,6);break;case 8:mf(),rt=6;break e;default:throw Error(r(462))}}Vw();break}catch(se){Mp(i,se)}while(!0);return hs=zn=null,M.H=l,M.A=d,je=o,Ne!==null?0:(Ke=null,Le=0,vl(),rt)}function Vw(){for(;Ne!==null&&!Sn();)Ap(Ne)}function Ap(i){var s=ep(i.alternate,i,bs);i.memoizedProps=i.pendingProps,s===null?Jl(i):Ne=s}function Np(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=Km(o,s,s.pendingProps,s.type,void 0,Le);break;case 11:s=Km(o,s,s.pendingProps,s.type.render,s.ref,Le);break;case 5:Nh(s);default:ip(o,s),s=Ne=Tg(s,bs),s=ep(o,s,bs)}i.memoizedProps=i.pendingProps,s===null?Jl(i):Ne=s}function Ir(i,s,o,l){hs=zn=null,Nh(s),Nr=null,Ro=0;var d=s.return;try{if(Rw(i,d,s,o,Le)){rt=1,jl(i,mi(o,i.current)),Ne=null;return}}catch(g){if(d!==null)throw Ne=d,g;rt=1,jl(i,mi(o,i.current)),Ne=null;return}s.flags&32768?(Oe||l===1?i=!0:Ur||(Le&536870912)!==0?i=!1:(Zs=i=!0,(l===2||l===9||l===3||l===6)&&(l=oi.current,l!==null&&l.tag===13&&(l.flags|=16384))),Rp(s,i)):Jl(s)}function Jl(i){var s=i;do{if((s.flags&32768)!==0){Rp(s,Zs);return}i=s.return;var o=zw(s.alternate,s,bs);if(o!==null){Ne=o;return}if(s=s.sibling,s!==null){Ne=s;return}Ne=s=i}while(s!==null);rt===0&&(rt=5)}function Rp(i,s){do{var o=Ow(i.alternate,i);if(o!==null){o.flags&=32767,Ne=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Ne=i;return}Ne=i=o}while(i!==null);rt=6,Ne=null}function Bp(i,s,o,l,d,g,S,k,O){i.cancelPendingCommit=null;do ec();while(St!==0);if((je&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(g=s.lanes|s.childLanes,g|=nh,Lu(i,o,g,S,k,O),i===Ke&&(Ne=Ke=null,Le=0),jr=s,en=i,ws=o,df=g,_f=d,wp=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Kw(wn,function(){return Up(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,d=B.p,B.p=2,S=je,je|=4;try{Hw(i,s,o)}finally{je=S,B.p=d,M.T=l}}St=1,Lp(),zp(),Op()}}function Lp(){if(St===1){St=0;var i=en,s=jr,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=M.T,M.T=null;var l=B.p;B.p=2;var d=je;je|=4;try{_p(s,i);var g=Tf,S=Sg(i.containerInfo),k=g.focusedElem,O=g.selectionRange;if(S!==k&&k&&k.ownerDocument&&yg(k.ownerDocument.documentElement,k)){if(O!==null&&Ju(k)){var Z=O.start,se=O.end;if(se===void 0&&(se=Z),"selectionStart"in k)k.selectionStart=Z,k.selectionEnd=Math.min(se,k.value.length);else{var re=k.ownerDocument||document,J=re&&re.defaultView||window;if(J.getSelection){var ie=J.getSelection(),me=k.textContent.length,we=Math.min(O.start,me),We=O.end===void 0?we:Math.min(O.end,me);!ie.extend&&we>We&&(S=We,We=we,we=S);var K=vg(k,we),V=vg(k,We);if(K&&V&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==V.node||ie.focusOffset!==V.offset)){var F=re.createRange();F.setStart(K.node,K.offset),ie.removeAllRanges(),we>We?(ie.addRange(F),ie.extend(V.node,V.offset)):(F.setEnd(V.node,V.offset),ie.addRange(F))}}}}for(re=[],ie=k;ie=ie.parentNode;)ie.nodeType===1&&re.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<re.length;k++){var ne=re[k];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}fc=!!Df,Tf=Df=null}finally{je=d,B.p=l,M.T=o}}i.current=s,St=2}}function zp(){if(St===2){St=0;var i=en,s=jr,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=M.T,M.T=null;var l=B.p;B.p=2;var d=je;je|=4;try{cp(i,s.alternate,s)}finally{je=d,B.p=l,M.T=o}}St=3}}function Op(){if(St===4||St===3){St=0,bn();var i=en,s=jr,o=ws,l=wp;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?St=5:(St=0,jr=en=null,Hp(i,i.pendingLanes));var d=i.pendingLanes;if(d===0&&(Js=null),go(o),s=s.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(xn,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=M.T,d=B.p,B.p=2,M.T=null;try{for(var g=i.onRecoverableError,S=0;S<l.length;S++){var k=l[S];g(k.value,{componentStack:k.stack})}}finally{M.T=s,B.p=d}}(ws&3)!==0&&ec(),Vi(i),d=i.pendingLanes,(o&261930)!==0&&(d&42)!==0?i===gf?Go++:(Go=0,gf=i):Go=0,Fo(0)}}function Hp(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Ao(s)))}function ec(){return Lp(),zp(),Op(),Up()}function Up(){if(St!==5)return!1;var i=en,s=df;df=0;var o=go(ws),l=M.T,d=B.p;try{B.p=32>o?32:o,M.T=null,o=_f,_f=null;var g=en,S=ws;if(St=0,jr=en=null,ws=0,(je&6)!==0)throw Error(r(331));var k=je;if(je|=4,yp(g.current),mp(g,g.current,S,o),je=k,Fo(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(xn,g)}catch{}return!0}finally{B.p=d,M.T=l,Hp(i,s)}}function Pp(i,s,o){s=mi(o,s),s=Wh(i.stateNode,s,2),i=Xs(i,s,2),i!==null&&(En(i,2),Vi(i))}function Ye(i,s,o){if(i.tag===3)Pp(i,i,o);else for(;s!==null;){if(s.tag===3){Pp(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Js===null||!Js.has(l))){i=mi(o,i),o=jm(2),l=Xs(s,o,2),l!==null&&(qm(o,l,s,i),En(l,2),Vi(l));break}}s=s.return}}function vf(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new jw;var d=new Set;l.set(s,d)}else d=l.get(s),d===void 0&&(d=new Set,l.set(s,d));d.has(o)||(uf=!0,d.add(o),i=$w.bind(null,i,s,o),s.then(i,i))}function $w(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Ke===i&&(Le&o)===o&&(rt===4||rt===3&&(Le&62914560)===Le&&300>Nt()-Kl?(je&2)===0&&qr(i,0):hf|=o,Pr===Le&&(Pr=0)),Vi(i)}function jp(i,s){s===0&&(s=Fa()),i=Rn(i,s),i!==null&&(En(i,s),Vi(i))}function Ww(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),jp(i,o)}function Xw(i,s){var o=0;switch(i.tag){case 31:case 13:var l=i.stateNode,d=i.memoizedState;d!==null&&(o=d.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(s),jp(i,o)}function Kw(i,s){return Di(i,s)}var tc=null,Yr=null,yf=!1,ic=!1,Sf=!1,sn=0;function Vi(i){i!==Yr&&i.next===null&&(Yr===null?tc=Yr=i:Yr=Yr.next=i),ic=!0,yf||(yf=!0,Fw())}function Fo(i,s){if(!Sf&&ic){Sf=!0;do for(var o=!1,l=tc;l!==null;){if(i!==0){var d=l.pendingLanes;if(d===0)var g=0;else{var S=l.suspendedLanes,k=l.pingedLanes;g=(1<<31-It(42|i)+1)-1,g&=d&~(S&~k),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,Vp(l,g))}else g=Le,g=fr(l,l===Ke?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(g&3)===0||Cn(l,g)||(o=!0,Vp(l,g));l=l.next}while(o);Sf=!1}}function Gw(){qp()}function qp(){ic=yf=!1;var i=0;sn!==0&&ox()&&(i=sn);for(var s=Nt(),o=null,l=tc;l!==null;){var d=l.next,g=Ip(l,s);g===0?(l.next=null,o===null?tc=d:o.next=d,d===null&&(Yr=o)):(o=l,(i!==0||(g&3)!==0)&&(ic=!0)),l=d}St!==0&&St!==5||Fo(i),sn!==0&&(sn=0)}function Ip(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,d=i.expirationTimes,g=i.pendingLanes&-62914561;0<g;){var S=31-It(g),k=1<<S,O=d[S];O===-1?((k&o)===0||(k&l)!==0)&&(d[S]=Bu(k,s)):O<=s&&(i.expiredLanes|=k),g&=~k}if(s=Ke,o=Le,o=fr(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(Ie===2||Ie===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&ts(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||Cn(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&ts(l),go(o)){case 2:case 8:o=Bs;break;case 32:o=wn;break;case 268435456:o=lr;break;default:o=wn}return l=Yp.bind(null,i),o=Di(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&ts(l),i.callbackPriority=2,i.callbackNode=null,2}function Yp(i,s){if(St!==0&&St!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(ec()&&i.callbackNode!==o)return null;var l=Le;return l=fr(i,i===Ke?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(Cp(i,l,s),Ip(i,Nt()),i.callbackNode!=null&&i.callbackNode===o?Yp.bind(null,i):null)}function Vp(i,s){if(ec())return null;Cp(i,s,!0)}function Fw(){lx(function(){(je&6)!==0?Di(is,Gw):qp()})}function bf(){if(sn===0){var i=Dr;i===0&&(i=cr,cr<<=1,(cr&261888)===0&&(cr=256)),sn=i}return sn}function $p(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:ul(""+i)}function Wp(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function Zw(i,s,o,l,d){if(s==="submit"&&o&&o.stateNode===d){var g=$p((d[Ut]||null).action),S=l.submitter;S&&(s=(s=S[Ut]||null)?$p(s.formAction):S.getAttribute("formAction"),s!==null&&(g=s,S=null));var k=new _l("action","action",null,l,d);i.push({event:k,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(sn!==0){var O=S?Wp(d,S):new FormData(d);jh(o,{pending:!0,data:O,method:d.method,action:g},null,O)}}else typeof g=="function"&&(k.preventDefault(),O=S?Wp(d,S):new FormData(d),jh(o,{pending:!0,data:O,method:d.method,action:g},g,O))},currentTarget:d}]})}}for(var wf=0;wf<sh.length;wf++){var xf=sh[wf],Qw=xf.toLowerCase(),Jw=xf[0].toUpperCase()+xf.slice(1);Ai(Qw,"on"+Jw)}Ai(xg,"onAnimationEnd"),Ai(Cg,"onAnimationIteration"),Ai(Eg,"onAnimationStart"),Ai("dblclick","onDoubleClick"),Ai("focusin","onFocus"),Ai("focusout","onBlur"),Ai(gw,"onTransitionRun"),Ai(mw,"onTransitionStart"),Ai(pw,"onTransitionCancel"),Ai(Mg,"onTransitionEnd"),Us("onMouseEnter",["mouseout","mouseover"]),Us("onMouseLeave",["mouseout","mouseover"]),Us("onPointerEnter",["pointerout","pointerover"]),Us("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zo="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(" "),ex=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zo));function Xp(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],d=l.event;l=l.listeners;e:{var g=void 0;if(s)for(var S=l.length-1;0<=S;S--){var k=l[S],O=k.instance,Z=k.currentTarget;if(k=k.listener,O!==g&&d.isPropagationStopped())break e;g=k,d.currentTarget=Z;try{g(d)}catch(se){pl(se)}d.currentTarget=null,g=O}else for(S=0;S<l.length;S++){if(k=l[S],O=k.instance,Z=k.currentTarget,k=k.listener,O!==g&&d.isPropagationStopped())break e;g=k,d.currentTarget=Z;try{g(d)}catch(se){pl(se)}d.currentTarget=null,g=O}}}}function Re(i,s){var o=s[dr];o===void 0&&(o=s[dr]=new Set);var l=i+"__bubble";o.has(l)||(Kp(s,i,2,!1),o.add(l))}function Cf(i,s,o){var l=0;s&&(l|=4),Kp(o,i,l,s)}var sc="_reactListening"+Math.random().toString(36).slice(2);function Ef(i){if(!i[sc]){i[sc]=!0,nl.forEach(function(o){o!=="selectionchange"&&(ex.has(o)||Cf(o,!1,i),Cf(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[sc]||(s[sc]=!0,Cf("selectionchange",!1,s))}}function Kp(i,s,o,l){switch(xv(s)){case 2:var d=Dx;break;case 8:d=Tx;break;default:d=jf}o=d.bind(null,s,o,i),d=void 0,!Vu||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(d=!0),l?d!==void 0?i.addEventListener(s,o,{capture:!0,passive:d}):i.addEventListener(s,o,!0):d!==void 0?i.addEventListener(s,o,{passive:d}):i.addEventListener(s,o,!1)}function Mf(i,s,o,l,d){var g=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var k=l.stateNode.containerInfo;if(k===d)break;if(S===4)for(S=l.return;S!==null;){var O=S.tag;if((O===3||O===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;k!==null;){if(S=Ls(k),S===null)return;if(O=S.tag,O===5||O===6||O===26||O===27){l=g=S;continue e}k=k.parentNode}}l=l.return}J_(function(){var Z=g,se=Iu(o),re=[];e:{var J=kg.get(i);if(J!==void 0){var ie=_l,me=i;switch(i){case"keypress":if(fl(o)===0)break e;case"keydown":case"keyup":ie=Xb;break;case"focusin":me="focus",ie=Ku;break;case"focusout":me="blur",ie=Ku;break;case"beforeblur":case"afterblur":ie=Ku;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=ig;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=zb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Fb;break;case xg:case Cg:case Eg:ie=Ub;break;case Mg:ie=Qb;break;case"scroll":case"scrollend":ie=Bb;break;case"wheel":ie=ew;break;case"copy":case"cut":case"paste":ie=jb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=ng;break;case"toggle":case"beforetoggle":ie=iw}var we=(s&4)!==0,We=!we&&(i==="scroll"||i==="scrollend"),K=we?J!==null?J+"Capture":null:J;we=[];for(var V=Z,F;V!==null;){var ne=V;if(F=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||F===null||K===null||(ne=yo(V,K),ne!=null&&we.push(Qo(V,ne,F))),We)break;V=V.return}0<we.length&&(J=new ie(J,me,null,o,se),re.push({event:J,listeners:we}))}}if((s&7)===0){e:{if(J=i==="mouseover"||i==="pointerover",ie=i==="mouseout"||i==="pointerout",J&&o!==qu&&(me=o.relatedTarget||o.fromElement)&&(Ls(me)||me[ns]))break e;if((ie||J)&&(J=se.window===se?se:(J=se.ownerDocument)?J.defaultView||J.parentWindow:window,ie?(me=o.relatedTarget||o.toElement,ie=Z,me=me?Ls(me):null,me!==null&&(We=c(me),we=me.tag,me!==We||we!==5&&we!==27&&we!==6)&&(me=null)):(ie=null,me=Z),ie!==me)){if(we=ig,ne="onMouseLeave",K="onMouseEnter",V="mouse",(i==="pointerout"||i==="pointerover")&&(we=ng,ne="onPointerLeave",K="onPointerEnter",V="pointer"),We=ie==null?J:Os(ie),F=me==null?J:Os(me),J=new we(ne,V+"leave",ie,o,se),J.target=We,J.relatedTarget=F,ne=null,Ls(se)===Z&&(we=new we(K,V+"enter",me,o,se),we.target=F,we.relatedTarget=We,ne=we),We=ne,ie&&me)t:{for(we=tx,K=ie,V=me,F=0,ne=K;ne;ne=we(ne))F++;ne=0;for(var Se=V;Se;Se=we(Se))ne++;for(;0<F-ne;)K=we(K),F--;for(;0<ne-F;)V=we(V),ne--;for(;F--;){if(K===V||V!==null&&K===V.alternate){we=K;break t}K=we(K),V=we(V)}we=null}else we=null;ie!==null&&Gp(re,J,ie,we,!1),me!==null&&We!==null&&Gp(re,We,me,we,!0)}}e:{if(J=Z?Os(Z):window,ie=J.nodeName&&J.nodeName.toLowerCase(),ie==="select"||ie==="input"&&J.type==="file")var Ue=fg;else if(ug(J))if(dg)Ue=fw;else{Ue=uw;var ve=cw}else ie=J.nodeName,!ie||ie.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Z&&ju(Z.elementType)&&(Ue=fg):Ue=hw;if(Ue&&(Ue=Ue(i,Z))){hg(re,Ue,o,se);break e}ve&&ve(i,J,Z),i==="focusout"&&Z&&J.type==="number"&&Z.memoizedProps.value!=null&&vo(J,"number",J.value)}switch(ve=Z?Os(Z):window,i){case"focusin":(ug(ve)||ve.contentEditable==="true")&&(Sr=ve,eh=Z,ko=null);break;case"focusout":ko=eh=Sr=null;break;case"mousedown":th=!0;break;case"contextmenu":case"mouseup":case"dragend":th=!1,bg(re,o,se);break;case"selectionchange":if(_w)break;case"keydown":case"keyup":bg(re,o,se)}var De;if(Fu)e:{switch(i){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else yr?lg(i,o)&&(ze="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ze="onCompositionStart");ze&&(rg&&o.locale!=="ko"&&(yr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&yr&&(De=eg()):(js=se,$u="value"in js?js.value:js.textContent,yr=!0)),ve=nc(Z,ze),0<ve.length&&(ze=new sg(ze,i,null,o,se),re.push({event:ze,listeners:ve}),De?ze.data=De:(De=cg(o),De!==null&&(ze.data=De)))),(De=nw?rw(i,o):ow(i,o))&&(ze=nc(Z,"onBeforeInput"),0<ze.length&&(ve=new sg("onBeforeInput","beforeinput",null,o,se),re.push({event:ve,listeners:ze}),ve.data=De)),Zw(re,i,Z,o,se)}Xp(re,s)})}function Qo(i,s,o){return{instance:i,listener:s,currentTarget:o}}function nc(i,s){for(var o=s+"Capture",l=[];i!==null;){var d=i,g=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||g===null||(d=yo(i,o),d!=null&&l.unshift(Qo(i,d,g)),d=yo(i,s),d!=null&&l.push(Qo(i,d,g))),i.tag===3)return l;i=i.return}return[]}function tx(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gp(i,s,o,l,d){for(var g=s._reactName,S=[];o!==null&&o!==l;){var k=o,O=k.alternate,Z=k.stateNode;if(k=k.tag,O!==null&&O===l)break;k!==5&&k!==26&&k!==27||Z===null||(O=Z,d?(Z=yo(o,g),Z!=null&&S.unshift(Qo(o,Z,O))):d||(Z=yo(o,g),Z!=null&&S.push(Qo(o,Z,O)))),o=o.return}S.length!==0&&i.push({event:s,listeners:S})}var ix=/\r\n?/g,sx=/\u0000|\uFFFD/g;function Fp(i){return(typeof i=="string"?i:""+i).replace(ix,`
|
|
49
|
+
`).replace(sx,"")}function Zp(i,s){return s=Fp(s),Fp(i)===s}function $e(i,s,o,l,d,g){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||mr(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&mr(i,""+l);break;case"className":gr(i,"class",l);break;case"tabIndex":gr(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":gr(i,o,l);break;case"style":Z_(i,l,g);break;case"data":if(s!=="object"){gr(i,"data",l);break}case"src":case"href":if(l===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=ul(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(o==="formAction"?(s!=="input"&&$e(i,s,"name",d.name,d,null),$e(i,s,"formEncType",d.formEncType,d,null),$e(i,s,"formMethod",d.formMethod,d,null),$e(i,s,"formTarget",d.formTarget,d,null)):($e(i,s,"encType",d.encType,d,null),$e(i,s,"method",d.method,d,null),$e(i,s,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=ul(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=as);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=ul(""+l),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":Re("beforetoggle",i),Re("toggle",i),_r(i,"popover",l);break;case"xlinkActuate":Ti(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ti(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ti(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ti(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ti(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ti(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":_r(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Nb.get(o)||o,_r(i,o,l))}}function kf(i,s,o,l,d,g){switch(o){case"style":Z_(i,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof l=="string"?mr(i,l):(typeof l=="number"||typeof l=="bigint")&&mr(i,""+l);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"onClick":l!=null&&(i.onclick=as);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rl.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),s=o.slice(2,d?o.length-7:void 0),g=i[Ut]||null,g=g!=null?g[o]:null,typeof g=="function"&&i.removeEventListener(s,g,d),typeof l=="function")){typeof g!="function"&&g!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,l,d);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):_r(i,o,l)}}}function zt(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",i),Re("load",i);var l=!1,d=!1,g;for(g in o)if(o.hasOwnProperty(g)){var S=o[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:$e(i,s,g,S,o,null)}}d&&$e(i,s,"srcSet",o.srcSet,o,null),l&&$e(i,s,"src",o.src,o,null);return;case"input":Re("invalid",i);var k=g=S=d=null,O=null,Z=null;for(l in o)if(o.hasOwnProperty(l)){var se=o[l];if(se!=null)switch(l){case"name":d=se;break;case"type":S=se;break;case"checked":O=se;break;case"defaultChecked":Z=se;break;case"value":g=se;break;case"defaultValue":k=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,s));break;default:$e(i,s,l,se,o,null)}}cl(i,g,k,O,Z,S,d,!1);return;case"select":Re("invalid",i),l=S=g=null;for(d in o)if(o.hasOwnProperty(d)&&(k=o[d],k!=null))switch(d){case"value":g=k;break;case"defaultValue":S=k;break;case"multiple":l=k;default:$e(i,s,d,k,o,null)}s=g,o=S,i.multiple=!!l,s!=null?os(i,!!l,s,!1):o!=null&&os(i,!!l,o,!0);return;case"textarea":Re("invalid",i),g=d=l=null;for(S in o)if(o.hasOwnProperty(S)&&(k=o[S],k!=null))switch(S){case"value":l=k;break;case"defaultValue":d=k;break;case"children":g=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:$e(i,s,S,k,o,null)}G_(i,l,d,g);return;case"option":for(O in o)if(o.hasOwnProperty(O)&&(l=o[O],l!=null))switch(O){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:$e(i,s,O,l,o,null)}return;case"dialog":Re("beforetoggle",i),Re("toggle",i),Re("cancel",i),Re("close",i);break;case"iframe":case"object":Re("load",i);break;case"video":case"audio":for(l=0;l<Zo.length;l++)Re(Zo[l],i);break;case"image":Re("error",i),Re("load",i);break;case"details":Re("toggle",i);break;case"embed":case"source":case"link":Re("error",i),Re("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in o)if(o.hasOwnProperty(Z)&&(l=o[Z],l!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:$e(i,s,Z,l,o,null)}return;default:if(ju(s)){for(se in o)o.hasOwnProperty(se)&&(l=o[se],l!==void 0&&kf(i,s,se,l,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(l=o[k],l!=null&&$e(i,s,k,l,o,null))}function nx(i,s,o,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,g=null,S=null,k=null,O=null,Z=null,se=null;for(ie in o){var re=o[ie];if(o.hasOwnProperty(ie)&&re!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":O=re;default:l.hasOwnProperty(ie)||$e(i,s,ie,null,l,re)}}for(var J in l){var ie=l[J];if(re=o[J],l.hasOwnProperty(J)&&(ie!=null||re!=null))switch(J){case"type":g=ie;break;case"name":d=ie;break;case"checked":Z=ie;break;case"defaultChecked":se=ie;break;case"value":S=ie;break;case"defaultValue":k=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,s));break;default:ie!==re&&$e(i,s,J,ie,l,re)}}Dn(i,S,k,O,Z,se,g,d);return;case"select":ie=S=k=J=null;for(g in o)if(O=o[g],o.hasOwnProperty(g)&&O!=null)switch(g){case"value":break;case"multiple":ie=O;default:l.hasOwnProperty(g)||$e(i,s,g,null,l,O)}for(d in l)if(g=l[d],O=o[d],l.hasOwnProperty(d)&&(g!=null||O!=null))switch(d){case"value":J=g;break;case"defaultValue":k=g;break;case"multiple":S=g;default:g!==O&&$e(i,s,d,g,l,O)}s=k,o=S,l=ie,J!=null?os(i,!!o,J,!1):!!l!=!!o&&(s!=null?os(i,!!o,s,!0):os(i,!!o,o?[]:"",!1));return;case"textarea":ie=J=null;for(k in o)if(d=o[k],o.hasOwnProperty(k)&&d!=null&&!l.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:$e(i,s,k,null,l,d)}for(S in l)if(d=l[S],g=o[S],l.hasOwnProperty(S)&&(d!=null||g!=null))switch(S){case"value":J=d;break;case"defaultValue":ie=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==g&&$e(i,s,S,d,l,g)}K_(i,J,ie);return;case"option":for(var me in o)if(J=o[me],o.hasOwnProperty(me)&&J!=null&&!l.hasOwnProperty(me))switch(me){case"selected":i.selected=!1;break;default:$e(i,s,me,null,l,J)}for(O in l)if(J=l[O],ie=o[O],l.hasOwnProperty(O)&&J!==ie&&(J!=null||ie!=null))switch(O){case"selected":i.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:$e(i,s,O,J,l,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in o)J=o[we],o.hasOwnProperty(we)&&J!=null&&!l.hasOwnProperty(we)&&$e(i,s,we,null,l,J);for(Z in l)if(J=l[Z],ie=o[Z],l.hasOwnProperty(Z)&&J!==ie&&(J!=null||ie!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,s));break;default:$e(i,s,Z,J,l,ie)}return;default:if(ju(s)){for(var We in o)J=o[We],o.hasOwnProperty(We)&&J!==void 0&&!l.hasOwnProperty(We)&&kf(i,s,We,void 0,l,J);for(se in l)J=l[se],ie=o[se],!l.hasOwnProperty(se)||J===ie||J===void 0&&ie===void 0||kf(i,s,se,J,l,ie);return}}for(var K in o)J=o[K],o.hasOwnProperty(K)&&J!=null&&!l.hasOwnProperty(K)&&$e(i,s,K,null,l,J);for(re in l)J=l[re],ie=o[re],!l.hasOwnProperty(re)||J===ie||J==null&&ie==null||$e(i,s,re,J,l,ie)}function Qp(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rx(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],g=d.transferSize,S=d.initiatorType,k=d.duration;if(g&&k&&Qp(S)){for(S=0,k=d.responseEnd,l+=1;l<o.length;l++){var O=o[l],Z=O.startTime;if(Z>k)break;var se=O.transferSize,re=O.initiatorType;se&&Qp(re)&&(O=O.responseEnd,S+=se*(O<k?1:(k-Z)/(O-Z)))}if(--l,s+=8*(g+S)/(d.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Df=null,Tf=null;function rc(i){return i.nodeType===9?i:i.ownerDocument}function Jp(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ev(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Af(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Nf=null;function ox(){var i=window.event;return i&&i.type==="popstate"?i===Nf?!1:(Nf=i,!0):(Nf=null,!1)}var tv=typeof setTimeout=="function"?setTimeout:void 0,ax=typeof clearTimeout=="function"?clearTimeout:void 0,iv=typeof Promise=="function"?Promise:void 0,lx=typeof queueMicrotask=="function"?queueMicrotask:typeof iv<"u"?function(i){return iv.resolve(null).then(i).catch(cx)}:tv;function cx(i){setTimeout(function(){throw i})}function nn(i){return i==="head"}function sv(i,s){var o=s,l=0;do{var d=o.nextSibling;if(i.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){i.removeChild(d),Xr(s);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")Jo(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,Jo(o);for(var g=o.firstChild;g;){var S=g.nextSibling,k=g.nodeName;g[Mn]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=S}}else o==="body"&&Jo(i.ownerDocument.body);o=d}while(o);Xr(s)}function nv(i,s){var o=i;i=0;do{var l=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=l}while(o)}function Rf(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Rf(o),mo(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function ux(i,s,o,l){for(;i.nodeType===1;){var d=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[Mn])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(g=i.getAttribute("rel"),g==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(g!==d.rel||i.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||i.getAttribute("title")!==(d.title==null?null:d.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(g=i.getAttribute("src"),(g!==(d.src==null?null:d.src)||i.getAttribute("type")!==(d.type==null?null:d.type)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&g&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var g=d.name==null?null:""+d.name;if(d.type==="hidden"&&i.getAttribute("name")===g)return i}else return i;if(i=bi(i.nextSibling),i===null)break}return null}function hx(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=bi(i.nextSibling),i===null))return null;return i}function rv(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=bi(i.nextSibling),i===null))return null;return i}function Bf(i){return i.data==="$?"||i.data==="$~"}function Lf(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function fx(i,s){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||o.readyState!=="loading")s();else{var l=function(){s(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function bi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var zf=null;function ov(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return bi(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function av(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return i;s--}else o!=="/$"&&o!=="/&"||s++}i=i.previousSibling}return null}function lv(i,s,o){switch(s=rc(o),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Jo(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);mo(i)}var wi=new Map,cv=new Set;function oc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xs=B.d;B.d={f:dx,r:_x,D:gx,C:mx,L:px,m:vx,X:Sx,S:yx,M:bx};function dx(){var i=xs.f(),s=Zl();return i||s}function _x(i){var s=zs(i);s!==null&&s.tag===5&&s.type==="form"?Mm(s):xs.r(i)}var Vr=typeof document>"u"?null:document;function uv(i,s,o){var l=Vr;if(l&&typeof s=="string"&&s){var d=Kt(s);d='link[rel="'+i+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),cv.has(d)||(cv.add(d),i={rel:i,crossOrigin:o,href:s},l.querySelector(d)===null&&(s=l.createElement("link"),zt(s,"link",i),ht(s),l.head.appendChild(s)))}}function gx(i){xs.D(i),uv("dns-prefetch",i,null)}function mx(i,s){xs.C(i,s),uv("preconnect",i,s)}function px(i,s,o){xs.L(i,s,o);var l=Vr;if(l&&i&&s){var d='link[rel="preload"][as="'+Kt(s)+'"]';s==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+Kt(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+Kt(o.imageSizes)+'"]')):d+='[href="'+Kt(i)+'"]';var g=d;switch(s){case"style":g=$r(i);break;case"script":g=Wr(i)}wi.has(g)||(i=m({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),wi.set(g,i),l.querySelector(d)!==null||s==="style"&&l.querySelector(ea(g))||s==="script"&&l.querySelector(ta(g))||(s=l.createElement("link"),zt(s,"link",i),ht(s),l.head.appendChild(s)))}}function vx(i,s){xs.m(i,s);var o=Vr;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+Kt(l)+'"][href="'+Kt(i)+'"]',g=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Wr(i)}if(!wi.has(g)&&(i=m({rel:"modulepreload",href:i},s),wi.set(g,i),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ta(g)))return}l=o.createElement("link"),zt(l,"link",i),ht(l),o.head.appendChild(l)}}}function yx(i,s,o){xs.S(i,s,o);var l=Vr;if(l&&i){var d=Hs(l).hoistableStyles,g=$r(i);s=s||"default";var S=d.get(g);if(!S){var k={loading:0,preload:null};if(S=l.querySelector(ea(g)))k.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},o),(o=wi.get(g))&&Of(i,o);var O=S=l.createElement("link");ht(O),zt(O,"link",i),O._p=new Promise(function(Z,se){O.onload=Z,O.onerror=se}),O.addEventListener("load",function(){k.loading|=1}),O.addEventListener("error",function(){k.loading|=2}),k.loading|=4,ac(S,s,l)}S={type:"stylesheet",instance:S,count:1,state:k},d.set(g,S)}}}function Sx(i,s){xs.X(i,s);var o=Vr;if(o&&i){var l=Hs(o).hoistableScripts,d=Wr(i),g=l.get(d);g||(g=o.querySelector(ta(d)),g||(i=m({src:i,async:!0},s),(s=wi.get(d))&&Hf(i,s),g=o.createElement("script"),ht(g),zt(g,"link",i),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(d,g))}}function bx(i,s){xs.M(i,s);var o=Vr;if(o&&i){var l=Hs(o).hoistableScripts,d=Wr(i),g=l.get(d);g||(g=o.querySelector(ta(d)),g||(i=m({src:i,async:!0,type:"module"},s),(s=wi.get(d))&&Hf(i,s),g=o.createElement("script"),ht(g),zt(g,"link",i),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(d,g))}}function hv(i,s,o,l){var d=(d=ce.current)?oc(d):null;if(!d)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=$r(o.href),o=Hs(d).hoistableStyles,l=o.get(s),l||(l={type:"style",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=$r(o.href);var g=Hs(d).hoistableStyles,S=g.get(i);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(i,S),(g=d.querySelector(ea(i)))&&!g._p&&(S.instance=g,S.state.loading=5),wi.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},wi.set(i,o),g||wx(d,i,o,S.state))),s&&l===null)throw Error(r(528,""));return S}if(s&&l!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Wr(o),o=Hs(d).hoistableScripts,l=o.get(s),l||(l={type:"script",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function $r(i){return'href="'+Kt(i)+'"'}function ea(i){return'link[rel="stylesheet"]['+i+"]"}function fv(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function wx(i,s,o,l){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=i.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),zt(s,"link",o),ht(s),i.head.appendChild(s))}function Wr(i){return'[src="'+Kt(i)+'"]'}function ta(i){return"script[async]"+i}function dv(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var l=i.querySelector('style[data-href~="'+Kt(o.href)+'"]');if(l)return s.instance=l,ht(l),l;var d=m({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),ht(l),zt(l,"style",d),ac(l,o.precedence,i),s.instance=l;case"stylesheet":d=$r(o.href);var g=i.querySelector(ea(d));if(g)return s.state.loading|=4,s.instance=g,ht(g),g;l=fv(o),(d=wi.get(d))&&Of(l,d),g=(i.ownerDocument||i).createElement("link"),ht(g);var S=g;return S._p=new Promise(function(k,O){S.onload=k,S.onerror=O}),zt(g,"link",l),s.state.loading|=4,ac(g,o.precedence,i),s.instance=g;case"script":return g=Wr(o.src),(d=i.querySelector(ta(g)))?(s.instance=d,ht(d),d):(l=o,(d=wi.get(g))&&(l=m({},o),Hf(l,d)),i=i.ownerDocument||i,d=i.createElement("script"),ht(d),zt(d,"link",l),i.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,ac(l,o.precedence,i));return s.instance}function ac(i,s,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,g=d,S=0;S<l.length;S++){var k=l[S];if(k.dataset.precedence===s)g=k;else if(g!==d)break}g?g.parentNode.insertBefore(i,g.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function Of(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Hf(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var lc=null;function _v(i,s,o){if(lc===null){var l=new Map,d=lc=new Map;d.set(o,l)}else d=lc,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),d=0;d<o.length;d++){var g=o[d];if(!(g[Mn]||g[yt]||i==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(s)||"";S=i+S;var k=l.get(S);k?k.push(g):l.set(S,[g])}}return l}function gv(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function xx(i,s,o){if(o===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function mv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Cx(i,s,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var d=$r(l.href),g=s.querySelector(ea(d));if(g){s=g._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=cc.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=g,ht(g);return}g=s.ownerDocument||s,l=fv(l),(d=wi.get(d))&&Of(l,d),g=g.createElement("link"),ht(g);var S=g;S._p=new Promise(function(k,O){S.onload=k,S.onerror=O}),zt(g,"link",l),o.instance=g}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=cc.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var Uf=0;function Ex(i,s){return i.stylesheets&&i.count===0&&hc(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var l=setTimeout(function(){if(i.stylesheets&&hc(i,i.stylesheets),i.unsuspend){var g=i.unsuspend;i.unsuspend=null,g()}},6e4+s);0<i.imgBytes&&Uf===0&&(Uf=62500*rx());var d=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&hc(i,i.stylesheets),i.unsuspend)){var g=i.unsuspend;i.unsuspend=null,g()}},(i.imgBytes>Uf?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var uc=null;function hc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,uc=new Map,s.forEach(Mx,i),uc=null,cc.call(i))}function Mx(i,s){if(!(s.state.loading&4)){var o=uc.get(i);if(o)var l=o.get(null);else{o=new Map,uc.set(i,o);for(var d=i.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<d.length;g++){var S=d[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),l=S)}l&&o.set(null,l)}d=s.instance,S=d.getAttribute("data-precedence"),g=o.get(S)||l,g===l&&o.set(null,d),o.set(S,d),this.count++,l=cc.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),g?g.parentNode.insertBefore(d,g.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(d,i.firstChild)),s.state.loading|=4}}var ia={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function kx(i,s,o,l,d,g,S,k,O){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fo(0),this.hiddenUpdates=fo(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function pv(i,s,o,l,d,g,S,k,O,Z,se,re){return i=new kx(i,s,o,S,O,Z,se,re,k),s=1,g===!0&&(s|=24),g=ri(3,null,null,s),i.current=g,g.stateNode=i,s=mh(),s.refCount++,i.pooledCache=s,s.refCount++,g.memoizedState={element:l,isDehydrated:o,cache:s},Sh(g),i}function vv(i){return i?(i=xr,i):xr}function yv(i,s,o,l,d,g){d=vv(d),l.context===null?l.context=d:l.pendingContext=d,l=Ws(s),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=Xs(i,l,s),o!==null&&(ei(o,i,s),Lo(o,i,s))}function Sv(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Pf(i,s){Sv(i,s),(i=i.alternate)&&Sv(i,s)}function bv(i){if(i.tag===13||i.tag===31){var s=Rn(i,67108864);s!==null&&ei(s,i,67108864),Pf(i,67108864)}}function wv(i){if(i.tag===13||i.tag===31){var s=ui();s=_o(s);var o=Rn(i,s);o!==null&&ei(o,i,s),Pf(i,s)}}var fc=!0;function Dx(i,s,o,l){var d=M.T;M.T=null;var g=B.p;try{B.p=2,jf(i,s,o,l)}finally{B.p=g,M.T=d}}function Tx(i,s,o,l){var d=M.T;M.T=null;var g=B.p;try{B.p=8,jf(i,s,o,l)}finally{B.p=g,M.T=d}}function jf(i,s,o,l){if(fc){var d=qf(l);if(d===null)Mf(i,s,l,dc,o),Cv(i,l);else if(Nx(d,i,s,o,l))l.stopPropagation();else if(Cv(i,l),s&4&&-1<Ax.indexOf(i)){for(;d!==null;){var g=zs(d);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=ss(g.pendingLanes);if(S!==0){var k=g;for(k.pendingLanes|=2,k.entangledLanes|=2;S;){var O=1<<31-It(S);k.entanglements[1]|=O,S&=~O}Vi(g),(je&6)===0&&(Gl=Nt()+500,Fo(0))}}break;case 31:case 13:k=Rn(g,2),k!==null&&ei(k,g,2),Zl(),Pf(g,2)}if(g=qf(l),g===null&&Mf(i,s,l,dc,o),g===d)break;d=g}d!==null&&l.stopPropagation()}else Mf(i,s,l,null,o)}}function qf(i){return i=Iu(i),If(i)}var dc=null;function If(i){if(dc=null,i=Ls(i),i!==null){var s=c(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=u(s),i!==null)return i;i=null}else if(o===31){if(i=f(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return dc=i,null}function xv(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case is:return 2;case Bs:return 8;case wn:case ku:return 32;case lr:return 268435456;default:return 32}default:return 32}}var Yf=!1,rn=null,on=null,an=null,sa=new Map,na=new Map,ln=[],Ax="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Cv(i,s){switch(i){case"focusin":case"focusout":rn=null;break;case"dragenter":case"dragleave":on=null;break;case"mouseover":case"mouseout":an=null;break;case"pointerover":case"pointerout":sa.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":na.delete(s.pointerId)}}function ra(i,s,o,l,d,g){return i===null||i.nativeEvent!==g?(i={blockedOn:s,domEventName:o,eventSystemFlags:l,nativeEvent:g,targetContainers:[d]},s!==null&&(s=zs(s),s!==null&&bv(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,d!==null&&s.indexOf(d)===-1&&s.push(d),i)}function Nx(i,s,o,l,d){switch(s){case"focusin":return rn=ra(rn,i,s,o,l,d),!0;case"dragenter":return on=ra(on,i,s,o,l,d),!0;case"mouseover":return an=ra(an,i,s,o,l,d),!0;case"pointerover":var g=d.pointerId;return sa.set(g,ra(sa.get(g)||null,i,s,o,l,d)),!0;case"gotpointercapture":return g=d.pointerId,na.set(g,ra(na.get(g)||null,i,s,o,l,d)),!0}return!1}function Ev(i){var s=Ls(i.target);if(s!==null){var o=c(s);if(o!==null){if(s=o.tag,s===13){if(s=u(o),s!==null){i.blockedOn=s,tl(i.priority,function(){wv(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,tl(i.priority,function(){wv(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function _c(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=qf(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);qu=l,o.target.dispatchEvent(l),qu=null}else return s=zs(o),s!==null&&bv(s),i.blockedOn=o,!1;s.shift()}return!0}function Mv(i,s,o){_c(i)&&o.delete(s)}function Rx(){Yf=!1,rn!==null&&_c(rn)&&(rn=null),on!==null&&_c(on)&&(on=null),an!==null&&_c(an)&&(an=null),sa.forEach(Mv),na.forEach(Mv)}function gc(i,s){i.blockedOn===s&&(i.blockedOn=null,Yf||(Yf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Rx)))}var mc=null;function kv(i){mc!==i&&(mc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mc===i&&(mc=null);for(var s=0;s<i.length;s+=3){var o=i[s],l=i[s+1],d=i[s+2];if(typeof l!="function"){if(If(l||o)===null)continue;break}var g=zs(o);g!==null&&(i.splice(s,3),s-=3,jh(g,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function Xr(i){function s(O){return gc(O,i)}rn!==null&&gc(rn,i),on!==null&&gc(on,i),an!==null&&gc(an,i),sa.forEach(s),na.forEach(s);for(var o=0;o<ln.length;o++){var l=ln[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<ln.length&&(o=ln[0],o.blockedOn===null);)Ev(o),o.blockedOn===null&&ln.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],g=o[l+1],S=d[Ut]||null;if(typeof g=="function")S||kv(o);else if(S){var k=null;if(g&&g.hasAttribute("formAction")){if(d=g,S=g[Ut]||null)k=S.formAction;else if(If(d)!==null)continue}else k=S.action;typeof k=="function"?o[l+1]=k:(o.splice(l,3),l-=3),kv(o)}}}function Dv(){function i(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return d=S})},focusReset:"manual",scroll:"manual"})}function s(){d!==null&&(d(),d=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),d!==null&&(d(),d=null)}}}function Vf(i){this._internalRoot=i}pc.prototype.render=Vf.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,l=ui();yv(o,l,i,s,null,null)},pc.prototype.unmount=Vf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;yv(i.current,2,null,i,null,null),Zl(),s[ns]=null}};function pc(i){this._internalRoot=i}pc.prototype.unstable_scheduleHydration=function(i){if(i){var s=el();i={blockedOn:null,target:i,priority:s};for(var o=0;o<ln.length&&s!==0&&s<ln[o].priority;o++);ln.splice(o,0,i),o===0&&Ev(i)}};var Tv=t.version;if(Tv!=="19.2.4")throw Error(r(527,Tv,"19.2.4"));B.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var Bx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vc.isDisabled&&vc.supportsFiber)try{xn=vc.inject(Bx),qt=vc}catch{}}return aa.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,l="",d=Om,g=Hm,S=Um;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError)),s=pv(i,1,!1,null,null,o,l,null,d,g,S,Dv),i[ns]=s.current,Ef(i),new Vf(s)},aa.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var l=!1,d="",g=Om,S=Hm,k=Um,O=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(O=o.formState)),s=pv(i,1,!0,s,o??null,l,d,O,g,S,k,Dv),s.context=vv(null),o=s.current,l=ui(),l=_o(l),d=Ws(l),d.callback=null,Xs(o,d,l),o=l,s.current.lanes=o,En(s,o),Vi(s),i[ns]=s.current,Ef(i),new pc(s)},aa.version="19.2.4",aa}var Pv;function Yx(){if(Pv)return Xf.exports;Pv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xf.exports=Ix(),Xf.exports}var Vx=Yx();function vt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=vt(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var $x={value:()=>{}};function uu(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Lc(n)}function Lc(e){this._=e}function Wx(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Lc.prototype=uu.prototype={constructor:Lc,on:function(e,t){var n=this._,r=Wx(e+"",n),a,c=-1,u=r.length;if(arguments.length<2){for(;++c<u;)if((a=(e=r[c]).type)&&(a=Xx(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++c<u;)if(a=(e=r[c]).type)n[a]=jv(n[a],e.name,t);else if(t==null)for(a in n)n[a]=jv(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Lc(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,c;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],r=0,a=c.length;r<a;++r)c[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,c=r.length;a<c;++a)r[a].value.apply(t,n)}};function Xx(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function jv(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=$x,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xd="http://www.w3.org/1999/xhtml";const qv={svg:"http://www.w3.org/2000/svg",xhtml:xd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function hu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),qv.hasOwnProperty(t)?{space:qv[t],local:e}:e}function Kx(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xd&&t.documentElement.namespaceURI===xd?t.createElement(e):t.createElementNS(n,e)}}function Gx(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qy(e){var t=hu(e);return(t.local?Gx:Kx)(t)}function Fx(){}function S_(e){return e==null?Fx:function(){return this.querySelector(e)}}function Zx(e){typeof e!="function"&&(e=S_(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var c=t[a],u=c.length,f=r[a]=new Array(u),_,h,p=0;p<u;++p)(_=c[p])&&(h=e.call(_,_.__data__,p,c))&&("__data__"in _&&(h.__data__=_.__data__),f[p]=h);return new _i(r,this._parents)}function Qx(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Jx(){return[]}function Jy(e){return e==null?Jx:function(){return this.querySelectorAll(e)}}function eC(e){return function(){return Qx(e.apply(this,arguments))}}function tC(e){typeof e=="function"?e=eC(e):e=Jy(e);for(var t=this._groups,n=t.length,r=[],a=[],c=0;c<n;++c)for(var u=t[c],f=u.length,_,h=0;h<f;++h)(_=u[h])&&(r.push(e.call(_,_.__data__,h,u)),a.push(_));return new _i(r,a)}function eS(e){return function(){return this.matches(e)}}function tS(e){return function(t){return t.matches(e)}}var iC=Array.prototype.find;function sC(e){return function(){return iC.call(this.children,e)}}function nC(){return this.firstElementChild}function rC(e){return this.select(e==null?nC:sC(typeof e=="function"?e:tS(e)))}var oC=Array.prototype.filter;function aC(){return Array.from(this.children)}function lC(e){return function(){return oC.call(this.children,e)}}function cC(e){return this.selectAll(e==null?aC:lC(typeof e=="function"?e:tS(e)))}function uC(e){typeof e!="function"&&(e=eS(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var c=t[a],u=c.length,f=r[a]=[],_,h=0;h<u;++h)(_=c[h])&&e.call(_,_.__data__,h,c)&&f.push(_);return new _i(r,this._parents)}function iS(e){return new Array(e.length)}function hC(){return new _i(this._enter||this._groups.map(iS),this._parents)}function Wc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Wc.prototype={constructor:Wc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function fC(e){return function(){return e}}function dC(e,t,n,r,a,c){for(var u=0,f,_=t.length,h=c.length;u<h;++u)(f=t[u])?(f.__data__=c[u],r[u]=f):n[u]=new Wc(e,c[u]);for(;u<_;++u)(f=t[u])&&(a[u]=f)}function _C(e,t,n,r,a,c,u){var f,_,h=new Map,p=t.length,m=c.length,v=new Array(p),b;for(f=0;f<p;++f)(_=t[f])&&(v[f]=b=u.call(_,_.__data__,f,t)+"",h.has(b)?a[f]=_:h.set(b,_));for(f=0;f<m;++f)b=u.call(e,c[f],f,c)+"",(_=h.get(b))?(r[f]=_,_.__data__=c[f],h.delete(b)):n[f]=new Wc(e,c[f]);for(f=0;f<p;++f)(_=t[f])&&h.get(v[f])===_&&(a[f]=_)}function gC(e){return e.__data__}function mC(e,t){if(!arguments.length)return Array.from(this,gC);var n=t?_C:dC,r=this._parents,a=this._groups;typeof e!="function"&&(e=fC(e));for(var c=a.length,u=new Array(c),f=new Array(c),_=new Array(c),h=0;h<c;++h){var p=r[h],m=a[h],v=m.length,b=pC(e.call(p,p&&p.__data__,h,r)),y=b.length,w=f[h]=new Array(y),x=u[h]=new Array(y),E=_[h]=new Array(v);n(p,m,w,x,E,b,t);for(var L=0,C=0,D,I;L<y;++L)if(D=w[L]){for(L>=C&&(C=L+1);!(I=x[C])&&++C<y;);D._next=I||null}}return u=new _i(u,r),u._enter=f,u._exit=_,u}function pC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function vC(){return new _i(this._exit||this._groups.map(iS),this._parents)}function yC(e,t,n){var r=this.enter(),a=this,c=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?c.remove():n(c),r&&a?r.merge(a).order():a}function SC(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,c=r.length,u=Math.min(a,c),f=new Array(a),_=0;_<u;++_)for(var h=n[_],p=r[_],m=h.length,v=f[_]=new Array(m),b,y=0;y<m;++y)(b=h[y]||p[y])&&(v[y]=b);for(;_<a;++_)f[_]=n[_];return new _i(f,this._parents)}function bC(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,c=r[a],u;--a>=0;)(u=r[a])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function wC(e){e||(e=xC);function t(m,v){return m&&v?e(m.__data__,v.__data__):!m-!v}for(var n=this._groups,r=n.length,a=new Array(r),c=0;c<r;++c){for(var u=n[c],f=u.length,_=a[c]=new Array(f),h,p=0;p<f;++p)(h=u[p])&&(_[p]=h);_.sort(t)}return new _i(a,this._parents).order()}function xC(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function CC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function EC(){return Array.from(this)}function MC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,c=r.length;a<c;++a){var u=r[a];if(u)return u}return null}function kC(){let e=0;for(const t of this)++e;return e}function DC(){return!this.node()}function TC(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],c=0,u=a.length,f;c<u;++c)(f=a[c])&&e.call(f,f.__data__,c,a);return this}function AC(e){return function(){this.removeAttribute(e)}}function NC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function RC(e,t){return function(){this.setAttribute(e,t)}}function BC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function LC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function zC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function OC(e,t){var n=hu(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?NC:AC:typeof t=="function"?n.local?zC:LC:n.local?BC:RC)(n,t))}function sS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function HC(e){return function(){this.style.removeProperty(e)}}function UC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function PC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function jC(e,t,n){return arguments.length>1?this.each((t==null?HC:typeof t=="function"?PC:UC)(e,t,n??"")):io(this.node(),e)}function io(e,t){return e.style.getPropertyValue(t)||sS(e).getComputedStyle(e,null).getPropertyValue(t)}function qC(e){return function(){delete this[e]}}function IC(e,t){return function(){this[e]=t}}function YC(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function VC(e,t){return arguments.length>1?this.each((t==null?qC:typeof t=="function"?YC:IC)(e,t)):this.node()[e]}function nS(e){return e.trim().split(/^|\s+/)}function b_(e){return e.classList||new rS(e)}function rS(e){this._node=e,this._names=nS(e.getAttribute("class")||"")}rS.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function oS(e,t){for(var n=b_(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function aS(e,t){for(var n=b_(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function $C(e){return function(){oS(this,e)}}function WC(e){return function(){aS(this,e)}}function XC(e,t){return function(){(t.apply(this,arguments)?oS:aS)(this,e)}}function KC(e,t){var n=nS(e+"");if(arguments.length<2){for(var r=b_(this.node()),a=-1,c=n.length;++a<c;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?XC:t?$C:WC)(n,t))}function GC(){this.textContent=""}function FC(e){return function(){this.textContent=e}}function ZC(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function QC(e){return arguments.length?this.each(e==null?GC:(typeof e=="function"?ZC:FC)(e)):this.node().textContent}function JC(){this.innerHTML=""}function e2(e){return function(){this.innerHTML=e}}function t2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function i2(e){return arguments.length?this.each(e==null?JC:(typeof e=="function"?t2:e2)(e)):this.node().innerHTML}function s2(){this.nextSibling&&this.parentNode.appendChild(this)}function n2(){return this.each(s2)}function r2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function o2(){return this.each(r2)}function a2(e){var t=typeof e=="function"?e:Qy(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function l2(){return null}function c2(e,t){var n=typeof e=="function"?e:Qy(e),r=t==null?l2:typeof t=="function"?t:S_(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function u2(){var e=this.parentNode;e&&e.removeChild(this)}function h2(){return this.each(u2)}function f2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function d2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function _2(e){return this.select(e?d2:f2)}function g2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function m2(e){return function(t){e.call(this,t,this.__data__)}}function p2(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function v2(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,c;n<a;++n)c=t[n],(!e.type||c.type===e.type)&&c.name===e.name?this.removeEventListener(c.type,c.listener,c.options):t[++r]=c;++r?t.length=r:delete this.__on}}}function y2(e,t,n){return function(){var r=this.__on,a,c=m2(t);if(r){for(var u=0,f=r.length;u<f;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=c,a.options=n),a.value=t;return}}this.addEventListener(e.type,c,n),a={type:e.type,name:e.name,value:t,listener:c,options:n},r?r.push(a):this.__on=[a]}}function S2(e,t,n){var r=p2(e+""),a,c=r.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var _=0,h=f.length,p;_<h;++_)for(a=0,p=f[_];a<c;++a)if((u=r[a]).type===p.type&&u.name===p.name)return p.value}return}for(f=t?y2:v2,a=0;a<c;++a)this.each(f(r[a],t,n));return this}function lS(e,t,n){var r=sS(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function b2(e,t){return function(){return lS(this,e,t)}}function w2(e,t){return function(){return lS(this,e,t.apply(this,arguments))}}function x2(e,t){return this.each((typeof t=="function"?w2:b2)(e,t))}function*C2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,c=r.length,u;a<c;++a)(u=r[a])&&(yield u)}var cS=[null];function _i(e,t){this._groups=e,this._parents=t}function ja(){return new _i([[document.documentElement]],cS)}function E2(){return this}_i.prototype=ja.prototype={constructor:_i,select:Zx,selectAll:tC,selectChild:rC,selectChildren:cC,filter:uC,data:mC,enter:hC,exit:vC,join:yC,merge:SC,selection:E2,order:bC,sort:wC,call:CC,nodes:EC,node:MC,size:kC,empty:DC,each:TC,attr:OC,style:jC,property:VC,classed:KC,text:QC,html:i2,raise:n2,lower:o2,append:a2,insert:c2,remove:h2,clone:_2,datum:g2,on:S2,dispatch:x2,[Symbol.iterator]:C2};function di(e){return typeof e=="string"?new _i([[document.querySelector(e)]],[document.documentElement]):new _i([[e]],cS)}function M2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Li(e,t){if(e=M2(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const k2={passive:!1},Ma={capture:!0,passive:!1};function Zf(e){e.stopImmediatePropagation()}function eo(e){e.preventDefault(),e.stopImmediatePropagation()}function uS(e){var t=e.document.documentElement,n=di(e).on("dragstart.drag",eo,Ma);"onselectstart"in t?n.on("selectstart.drag",eo,Ma):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hS(e,t){var n=e.document.documentElement,r=di(e).on("dragstart.drag",null);t&&(r.on("click.drag",eo,Ma),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const yc=e=>()=>e;function Cd(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:c,x:u,y:f,dx:_,dy:h,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:_,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:p}})}Cd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function D2(e){return!e.ctrlKey&&!e.button}function T2(){return this.parentNode}function A2(e,t){return t??{x:e.x,y:e.y}}function N2(){return navigator.maxTouchPoints||"ontouchstart"in this}function fS(){var e=D2,t=T2,n=A2,r=N2,a={},c=uu("start","drag","end"),u=0,f,_,h,p,m=0;function v(D){D.on("mousedown.drag",b).filter(r).on("touchstart.drag",x).on("touchmove.drag",E,k2).on("touchend.drag touchcancel.drag",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(D,I){if(!(p||!e.call(this,D,I))){var z=C(this,t.call(this,D,I),D,I,"mouse");z&&(di(D.view).on("mousemove.drag",y,Ma).on("mouseup.drag",w,Ma),uS(D.view),Zf(D),h=!1,f=D.clientX,_=D.clientY,z("start",D))}}function y(D){if(eo(D),!h){var I=D.clientX-f,z=D.clientY-_;h=I*I+z*z>m}a.mouse("drag",D)}function w(D){di(D.view).on("mousemove.drag mouseup.drag",null),hS(D.view,h),eo(D),a.mouse("end",D)}function x(D,I){if(e.call(this,D,I)){var z=D.changedTouches,P=t.call(this,D,I),W=z.length,G,ae;for(G=0;G<W;++G)(ae=C(this,P,D,I,z[G].identifier,z[G]))&&(Zf(D),ae("start",D,z[G]))}}function E(D){var I=D.changedTouches,z=I.length,P,W;for(P=0;P<z;++P)(W=a[I[P].identifier])&&(eo(D),W("drag",D,I[P]))}function L(D){var I=D.changedTouches,z=I.length,P,W;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),P=0;P<z;++P)(W=a[I[P].identifier])&&(Zf(D),W("end",D,I[P]))}function C(D,I,z,P,W,G){var ae=c.copy(),X=Li(G||z,I),q,Y,A;if((A=n.call(D,new Cd("beforestart",{sourceEvent:z,target:v,identifier:W,active:u,x:X[0],y:X[1],dx:0,dy:0,dispatch:ae}),P))!=null)return q=A.x-X[0]||0,Y=A.y-X[1]||0,function H(M,B,R){var U=X,Q;switch(M){case"start":a[W]=H,Q=u++;break;case"end":delete a[W],--u;case"drag":X=Li(R||B,I),Q=u;break}ae.call(M,D,new Cd(M,{sourceEvent:B,subject:A,target:v,identifier:W,active:Q,x:X[0]+q,y:X[1]+Y,dx:X[0]-U[0],dy:X[1]-U[1],dispatch:ae}),P)}}return v.filter=function(D){return arguments.length?(e=typeof D=="function"?D:yc(!!D),v):e},v.container=function(D){return arguments.length?(t=typeof D=="function"?D:yc(D),v):t},v.subject=function(D){return arguments.length?(n=typeof D=="function"?D:yc(D),v):n},v.touchable=function(D){return arguments.length?(r=typeof D=="function"?D:yc(!!D),v):r},v.on=function(){var D=c.on.apply(c,arguments);return D===c?v:D},v.clickDistance=function(D){return arguments.length?(m=(D=+D)*D,v):Math.sqrt(m)},v}function w_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function dS(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qa(){}var ka=.7,Xc=1/ka,to="\\s*([+-]?\\d+)\\s*",Da="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",R2=/^#([0-9a-f]{3,8})$/,B2=new RegExp(`^rgb\\(${to},${to},${to}\\)$`),L2=new RegExp(`^rgb\\(${Fi},${Fi},${Fi}\\)$`),z2=new RegExp(`^rgba\\(${to},${to},${to},${Da}\\)$`),O2=new RegExp(`^rgba\\(${Fi},${Fi},${Fi},${Da}\\)$`),H2=new RegExp(`^hsl\\(${Da},${Fi},${Fi}\\)$`),U2=new RegExp(`^hsla\\(${Da},${Fi},${Fi},${Da}\\)$`),Iv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};w_(qa,er,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yv,formatHex:Yv,formatHex8:P2,formatHsl:j2,formatRgb:Vv,toString:Vv});function Yv(){return this.rgb().formatHex()}function P2(){return this.rgb().formatHex8()}function j2(){return _S(this).formatHsl()}function Vv(){return this.rgb().formatRgb()}function er(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=R2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$v(t):n===3?new ii(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Sc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Sc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=B2.exec(e))?new ii(t[1],t[2],t[3],1):(t=L2.exec(e))?new ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=z2.exec(e))?Sc(t[1],t[2],t[3],t[4]):(t=O2.exec(e))?Sc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=H2.exec(e))?Kv(t[1],t[2]/100,t[3]/100,1):(t=U2.exec(e))?Kv(t[1],t[2]/100,t[3]/100,t[4]):Iv.hasOwnProperty(e)?$v(Iv[e]):e==="transparent"?new ii(NaN,NaN,NaN,0):null}function $v(e){return new ii(e>>16&255,e>>8&255,e&255,1)}function Sc(e,t,n,r){return r<=0&&(e=t=n=NaN),new ii(e,t,n,r)}function q2(e){return e instanceof qa||(e=er(e)),e?(e=e.rgb(),new ii(e.r,e.g,e.b,e.opacity)):new ii}function Ed(e,t,n,r){return arguments.length===1?q2(e):new ii(e,t,n,r??1)}function ii(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}w_(ii,Ed,dS(qa,{brighter(e){return e=e==null?Xc:Math.pow(Xc,e),new ii(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ka:Math.pow(ka,e),new ii(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ii(Zn(this.r),Zn(this.g),Zn(this.b),Kc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Wv,formatHex:Wv,formatHex8:I2,formatRgb:Xv,toString:Xv}));function Wv(){return`#${Gn(this.r)}${Gn(this.g)}${Gn(this.b)}`}function I2(){return`#${Gn(this.r)}${Gn(this.g)}${Gn(this.b)}${Gn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xv(){const e=Kc(this.opacity);return`${e===1?"rgb(":"rgba("}${Zn(this.r)}, ${Zn(this.g)}, ${Zn(this.b)}${e===1?")":`, ${e})`}`}function Kc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gn(e){return e=Zn(e),(e<16?"0":"")+e.toString(16)}function Kv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zi(e,t,n,r)}function _S(e){if(e instanceof zi)return new zi(e.h,e.s,e.l,e.opacity);if(e instanceof qa||(e=er(e)),!e)return new zi;if(e instanceof zi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),c=Math.max(t,n,r),u=NaN,f=c-a,_=(c+a)/2;return f?(t===c?u=(n-r)/f+(n<r)*6:n===c?u=(r-t)/f+2:u=(t-n)/f+4,f/=_<.5?c+a:2-c-a,u*=60):f=_>0&&_<1?0:u,new zi(u,f,_,e.opacity)}function Y2(e,t,n,r){return arguments.length===1?_S(e):new zi(e,t,n,r??1)}function zi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}w_(zi,Y2,dS(qa,{brighter(e){return e=e==null?Xc:Math.pow(Xc,e),new zi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ka:Math.pow(ka,e),new zi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new ii(Qf(e>=240?e-240:e+120,a,r),Qf(e,a,r),Qf(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new zi(Gv(this.h),bc(this.s),bc(this.l),Kc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Kc(this.opacity);return`${e===1?"hsl(":"hsla("}${Gv(this.h)}, ${bc(this.s)*100}%, ${bc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gv(e){return e=(e||0)%360,e<0?e+360:e}function bc(e){return Math.max(0,Math.min(1,e||0))}function Qf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const x_=e=>()=>e;function V2(e,t){return function(n){return e+n*t}}function $2(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function W2(e){return(e=+e)==1?gS:function(t,n){return n-t?$2(t,n,e):x_(isNaN(t)?n:t)}}function gS(e,t){var n=t-e;return n?V2(e,n):x_(isNaN(e)?t:e)}const Gc=(function e(t){var n=W2(t);function r(a,c){var u=n((a=Ed(a)).r,(c=Ed(c)).r),f=n(a.g,c.g),_=n(a.b,c.b),h=gS(a.opacity,c.opacity);return function(p){return a.r=u(p),a.g=f(p),a.b=_(p),a.opacity=h(p),a+""}}return r.gamma=e,r})(1);function X2(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(c){for(a=0;a<n;++a)r[a]=e[a]*(1-c)+t[a]*c;return r}}function K2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function G2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),c=new Array(n),u;for(u=0;u<r;++u)a[u]=xa(e[u],t[u]);for(;u<n;++u)c[u]=t[u];return function(f){for(u=0;u<r;++u)c[u]=a[u](f);return c}}function F2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ki(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Z2(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=xa(e[a],t[a]):r[a]=t[a];return function(c){for(a in n)r[a]=n[a](c);return r}}var Md=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Jf=new RegExp(Md.source,"g");function Q2(e){return function(){return e}}function J2(e){return function(t){return e(t)+""}}function mS(e,t){var n=Md.lastIndex=Jf.lastIndex=0,r,a,c,u=-1,f=[],_=[];for(e=e+"",t=t+"";(r=Md.exec(e))&&(a=Jf.exec(t));)(c=a.index)>n&&(c=t.slice(n,c),f[u]?f[u]+=c:f[++u]=c),(r=r[0])===(a=a[0])?f[u]?f[u]+=a:f[++u]=a:(f[++u]=null,_.push({i:u,x:Ki(r,a)})),n=Jf.lastIndex;return n<t.length&&(c=t.slice(n),f[u]?f[u]+=c:f[++u]=c),f.length<2?_[0]?J2(_[0].x):Q2(t):(t=_.length,function(h){for(var p=0,m;p<t;++p)f[(m=_[p]).i]=m.x(h);return f.join("")})}function xa(e,t){var n=typeof t,r;return t==null||n==="boolean"?x_(t):(n==="number"?Ki:n==="string"?(r=er(t))?(t=r,Gc):mS:t instanceof er?Gc:t instanceof Date?F2:K2(t)?X2:Array.isArray(t)?G2:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Z2:Ki)(e,t)}var Fv=180/Math.PI,kd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pS(e,t,n,r,a,c){var u,f,_;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(_=e*n+t*r)&&(n-=e*_,r-=t*_),(f=Math.sqrt(n*n+r*r))&&(n/=f,r/=f,_/=f),e*r<t*n&&(e=-e,t=-t,_=-_,u=-u),{translateX:a,translateY:c,rotate:Math.atan2(t,e)*Fv,skewX:Math.atan(_)*Fv,scaleX:u,scaleY:f}}var wc;function eE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?kd:pS(t.a,t.b,t.c,t.d,t.e,t.f)}function tE(e){return e==null||(wc||(wc=document.createElementNS("http://www.w3.org/2000/svg","g")),wc.setAttribute("transform",e),!(e=wc.transform.baseVal.consolidate()))?kd:(e=e.matrix,pS(e.a,e.b,e.c,e.d,e.e,e.f))}function vS(e,t,n,r){function a(h){return h.length?h.pop()+" ":""}function c(h,p,m,v,b,y){if(h!==m||p!==v){var w=b.push("translate(",null,t,null,n);y.push({i:w-4,x:Ki(h,m)},{i:w-2,x:Ki(p,v)})}else(m||v)&&b.push("translate("+m+t+v+n)}function u(h,p,m,v){h!==p?(h-p>180?p+=360:p-h>180&&(h+=360),v.push({i:m.push(a(m)+"rotate(",null,r)-2,x:Ki(h,p)})):p&&m.push(a(m)+"rotate("+p+r)}function f(h,p,m,v){h!==p?v.push({i:m.push(a(m)+"skewX(",null,r)-2,x:Ki(h,p)}):p&&m.push(a(m)+"skewX("+p+r)}function _(h,p,m,v,b,y){if(h!==m||p!==v){var w=b.push(a(b)+"scale(",null,",",null,")");y.push({i:w-4,x:Ki(h,m)},{i:w-2,x:Ki(p,v)})}else(m!==1||v!==1)&&b.push(a(b)+"scale("+m+","+v+")")}return function(h,p){var m=[],v=[];return h=e(h),p=e(p),c(h.translateX,h.translateY,p.translateX,p.translateY,m,v),u(h.rotate,p.rotate,m,v),f(h.skewX,p.skewX,m,v),_(h.scaleX,h.scaleY,p.scaleX,p.scaleY,m,v),h=p=null,function(b){for(var y=-1,w=v.length,x;++y<w;)m[(x=v[y]).i]=x.x(b);return m.join("")}}}var iE=vS(eE,"px, ","px)","deg)"),sE=vS(tE,", ",")",")"),nE=1e-12;function Zv(e){return((e=Math.exp(e))+1/e)/2}function rE(e){return((e=Math.exp(e))-1/e)/2}function oE(e){return((e=Math.exp(2*e))-1)/(e+1)}const zc=(function e(t,n,r){function a(c,u){var f=c[0],_=c[1],h=c[2],p=u[0],m=u[1],v=u[2],b=p-f,y=m-_,w=b*b+y*y,x,E;if(w<nE)E=Math.log(v/h)/t,x=function(P){return[f+P*b,_+P*y,h*Math.exp(t*P*E)]};else{var L=Math.sqrt(w),C=(v*v-h*h+r*w)/(2*h*n*L),D=(v*v-h*h-r*w)/(2*v*n*L),I=Math.log(Math.sqrt(C*C+1)-C),z=Math.log(Math.sqrt(D*D+1)-D);E=(z-I)/t,x=function(P){var W=P*E,G=Zv(I),ae=h/(n*L)*(G*oE(t*W+I)-rE(I));return[f+ae*b,_+ae*y,h*G/Zv(t*W+I)]}}return x.duration=E*1e3*t/Math.SQRT2,x}return a.rho=function(c){var u=Math.max(.001,+c),f=u*u,_=f*f;return e(u,f,_)},a})(Math.SQRT2,2,4);var so=0,ma=0,la=0,yS=1e3,Fc,pa,Zc=0,tr=0,fu=0,Ta=typeof performance=="object"&&performance.now?performance:Date,SS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function C_(){return tr||(SS(aE),tr=Ta.now()+fu)}function aE(){tr=0}function Qc(){this._call=this._time=this._next=null}Qc.prototype=bS.prototype={constructor:Qc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?C_():+n)+(t==null?0:+t),!this._next&&pa!==this&&(pa?pa._next=this:Fc=this,pa=this),this._call=e,this._time=n,Dd()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dd())}};function bS(e,t,n){var r=new Qc;return r.restart(e,t,n),r}function lE(){C_(),++so;for(var e=Fc,t;e;)(t=tr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--so}function Qv(){tr=(Zc=Ta.now())+fu,so=ma=0;try{lE()}finally{so=0,uE(),tr=0}}function cE(){var e=Ta.now(),t=e-Zc;t>yS&&(fu-=t,Zc=e)}function uE(){for(var e,t=Fc,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Fc=n);pa=e,Dd(r)}function Dd(e){if(!so){ma&&(ma=clearTimeout(ma));var t=e-tr;t>24?(e<1/0&&(ma=setTimeout(Qv,e-Ta.now()-fu)),la&&(la=clearInterval(la))):(la||(Zc=Ta.now(),la=setInterval(cE,yS)),so=1,SS(Qv))}}function Jv(e,t,n){var r=new Qc;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var hE=uu("start","end","cancel","interrupt"),fE=[],wS=0,e0=1,Td=2,Oc=3,t0=4,Ad=5,Hc=6;function du(e,t,n,r,a,c){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;dE(e,n,{name:t,index:r,group:a,on:hE,tween:fE,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:wS})}function E_(e,t){var n=Ui(e,t);if(n.state>wS)throw new Error("too late; already scheduled");return n}function es(e,t){var n=Ui(e,t);if(n.state>Oc)throw new Error("too late; already running");return n}function Ui(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function dE(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=bS(c,0,n.time);function c(h){n.state=e0,n.timer.restart(u,n.delay,n.time),n.delay<=h&&u(h-n.delay)}function u(h){var p,m,v,b;if(n.state!==e0)return _();for(p in r)if(b=r[p],b.name===n.name){if(b.state===Oc)return Jv(u);b.state===t0?(b.state=Hc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[p]):+p<t&&(b.state=Hc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[p])}if(Jv(function(){n.state===Oc&&(n.state=t0,n.timer.restart(f,n.delay,n.time),f(h))}),n.state=Td,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Td){for(n.state=Oc,a=new Array(v=n.tween.length),p=0,m=-1;p<v;++p)(b=n.tween[p].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=b);a.length=m+1}}function f(h){for(var p=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(_),n.state=Ad,1),m=-1,v=a.length;++m<v;)a[m].call(e,p);n.state===Ad&&(n.on.call("end",e,e.__data__,n.index,n.group),_())}function _(){n.state=Hc,n.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function Uc(e,t){var n=e.__transition,r,a,c=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){c=!1;continue}a=r.state>Td&&r.state<Ad,r.state=Hc,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}c&&delete e.__transition}}function _E(e){return this.each(function(){Uc(this,e)})}function gE(e,t){var n,r;return function(){var a=es(this,e),c=a.tween;if(c!==n){r=n=c;for(var u=0,f=r.length;u<f;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function mE(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var c=es(this,e),u=c.tween;if(u!==r){a=(r=u).slice();for(var f={name:t,value:n},_=0,h=a.length;_<h;++_)if(a[_].name===t){a[_]=f;break}_===h&&a.push(f)}c.tween=a}}function pE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ui(this.node(),n).tween,a=0,c=r.length,u;a<c;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?gE:mE)(n,e,t))}function M_(e,t,n){var r=e._id;return e.each(function(){var a=es(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Ui(a,r).value[t]}}function xS(e,t){var n;return(typeof t=="number"?Ki:t instanceof er?Gc:(n=er(t))?(t=n,Gc):mS)(e,t)}function vE(e){return function(){this.removeAttribute(e)}}function yE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function SE(e,t,n){var r,a=n+"",c;return function(){var u=this.getAttribute(e);return u===a?null:u===r?c:c=t(r=u,n)}}function bE(e,t,n){var r,a=n+"",c;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?c:c=t(r=u,n)}}function wE(e,t,n){var r,a,c;return function(){var u,f=n(this),_;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),_=f+"",u===_?null:u===r&&_===a?c:(a=_,c=t(r=u,f)))}}function xE(e,t,n){var r,a,c;return function(){var u,f=n(this),_;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),_=f+"",u===_?null:u===r&&_===a?c:(a=_,c=t(r=u,f)))}}function CE(e,t){var n=hu(e),r=n==="transform"?sE:xS;return this.attrTween(e,typeof t=="function"?(n.local?xE:wE)(n,r,M_(this,"attr."+e,t)):t==null?(n.local?yE:vE)(n):(n.local?bE:SE)(n,r,t))}function EE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ME(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function kE(e,t){var n,r;function a(){var c=t.apply(this,arguments);return c!==r&&(n=(r=c)&&ME(e,c)),n}return a._value=t,a}function DE(e,t){var n,r;function a(){var c=t.apply(this,arguments);return c!==r&&(n=(r=c)&&EE(e,c)),n}return a._value=t,a}function TE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=hu(e);return this.tween(n,(r.local?kE:DE)(r,t))}function AE(e,t){return function(){E_(this,e).delay=+t.apply(this,arguments)}}function NE(e,t){return t=+t,function(){E_(this,e).delay=t}}function RE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?AE:NE)(t,e)):Ui(this.node(),t).delay}function BE(e,t){return function(){es(this,e).duration=+t.apply(this,arguments)}}function LE(e,t){return t=+t,function(){es(this,e).duration=t}}function zE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BE:LE)(t,e)):Ui(this.node(),t).duration}function OE(e,t){if(typeof t!="function")throw new Error;return function(){es(this,e).ease=t}}function HE(e){var t=this._id;return arguments.length?this.each(OE(t,e)):Ui(this.node(),t).ease}function UE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;es(this,e).ease=n}}function PE(e){if(typeof e!="function")throw new Error;return this.each(UE(this._id,e))}function jE(e){typeof e!="function"&&(e=eS(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var c=t[a],u=c.length,f=r[a]=[],_,h=0;h<u;++h)(_=c[h])&&e.call(_,_.__data__,h,c)&&f.push(_);return new Ts(r,this._parents,this._name,this._id)}function qE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,c=Math.min(r,a),u=new Array(r),f=0;f<c;++f)for(var _=t[f],h=n[f],p=_.length,m=u[f]=new Array(p),v,b=0;b<p;++b)(v=_[b]||h[b])&&(m[b]=v);for(;f<r;++f)u[f]=t[f];return new Ts(u,this._parents,this._name,this._id)}function IE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function YE(e,t,n){var r,a,c=IE(t)?E_:es;return function(){var u=c(this,e),f=u.on;f!==r&&(a=(r=f).copy()).on(t,n),u.on=a}}function VE(e,t){var n=this._id;return arguments.length<2?Ui(this.node(),n).on.on(e):this.each(YE(n,e,t))}function $E(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function WE(){return this.on("end.remove",$E(this._id))}function XE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=S_(e));for(var r=this._groups,a=r.length,c=new Array(a),u=0;u<a;++u)for(var f=r[u],_=f.length,h=c[u]=new Array(_),p,m,v=0;v<_;++v)(p=f[v])&&(m=e.call(p,p.__data__,v,f))&&("__data__"in p&&(m.__data__=p.__data__),h[v]=m,du(h[v],t,n,v,h,Ui(p,n)));return new Ts(c,this._parents,t,n)}function KE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jy(e));for(var r=this._groups,a=r.length,c=[],u=[],f=0;f<a;++f)for(var _=r[f],h=_.length,p,m=0;m<h;++m)if(p=_[m]){for(var v=e.call(p,p.__data__,m,_),b,y=Ui(p,n),w=0,x=v.length;w<x;++w)(b=v[w])&&du(b,t,n,w,v,y);c.push(v),u.push(p)}return new Ts(c,u,t,n)}var GE=ja.prototype.constructor;function FE(){return new GE(this._groups,this._parents)}function ZE(e,t){var n,r,a;return function(){var c=io(this,e),u=(this.style.removeProperty(e),io(this,e));return c===u?null:c===n&&u===r?a:a=t(n=c,r=u)}}function CS(e){return function(){this.style.removeProperty(e)}}function QE(e,t,n){var r,a=n+"",c;return function(){var u=io(this,e);return u===a?null:u===r?c:c=t(r=u,n)}}function JE(e,t,n){var r,a,c;return function(){var u=io(this,e),f=n(this),_=f+"";return f==null&&(_=f=(this.style.removeProperty(e),io(this,e))),u===_?null:u===r&&_===a?c:(a=_,c=t(r=u,f))}}function eM(e,t){var n,r,a,c="style."+t,u="end."+c,f;return function(){var _=es(this,e),h=_.on,p=_.value[c]==null?f||(f=CS(t)):void 0;(h!==n||a!==p)&&(r=(n=h).copy()).on(u,a=p),_.on=r}}function tM(e,t,n){var r=(e+="")=="transform"?iE:xS;return t==null?this.styleTween(e,ZE(e,r)).on("end.style."+e,CS(e)):typeof t=="function"?this.styleTween(e,JE(e,r,M_(this,"style."+e,t))).each(eM(this._id,e)):this.styleTween(e,QE(e,r,t),n).on("end.style."+e,null)}function iM(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function sM(e,t,n){var r,a;function c(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&iM(e,u,n)),r}return c._value=t,c}function nM(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,sM(e,t,n??""))}function rM(e){return function(){this.textContent=e}}function oM(e){return function(){var t=e(this);this.textContent=t??""}}function aM(e){return this.tween("text",typeof e=="function"?oM(M_(this,"text",e)):rM(e==null?"":e+""))}function lM(e){return function(t){this.textContent=e.call(this,t)}}function cM(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&lM(a)),t}return r._value=e,r}function uM(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cM(e))}function hM(){for(var e=this._name,t=this._id,n=ES(),r=this._groups,a=r.length,c=0;c<a;++c)for(var u=r[c],f=u.length,_,h=0;h<f;++h)if(_=u[h]){var p=Ui(_,t);du(_,e,n,h,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Ts(r,this._parents,e,n)}function fM(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(c,u){var f={value:u},_={value:function(){--a===0&&c()}};n.each(function(){var h=es(this,r),p=h.on;p!==e&&(t=(e=p).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(_)),h.on=t}),a===0&&c()})}var dM=0;function Ts(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ES(){return++dM}var Cs=ja.prototype;Ts.prototype={constructor:Ts,select:XE,selectAll:KE,selectChild:Cs.selectChild,selectChildren:Cs.selectChildren,filter:jE,merge:qE,selection:FE,transition:hM,call:Cs.call,nodes:Cs.nodes,node:Cs.node,size:Cs.size,empty:Cs.empty,each:Cs.each,on:VE,attr:CE,attrTween:TE,style:tM,styleTween:nM,text:aM,textTween:uM,remove:WE,tween:pE,delay:RE,duration:zE,ease:HE,easeVarying:PE,end:fM,[Symbol.iterator]:Cs[Symbol.iterator]};function _M(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var gM={time:null,delay:0,duration:250,ease:_M};function mM(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function pM(e){var t,n;e instanceof Ts?(t=e._id,e=e._name):(t=ES(),(n=gM).time=C_(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,c=0;c<a;++c)for(var u=r[c],f=u.length,_,h=0;h<f;++h)(_=u[h])&&du(_,e,t,h,u,n||mM(_,t));return new Ts(r,this._parents,e,t)}ja.prototype.interrupt=_E;ja.prototype.transition=pM;const xc=e=>()=>e;function vM(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function Ms(e,t,n){this.k=e,this.x=t,this.y=n}Ms.prototype={constructor:Ms,scale:function(e){return e===1?this:new Ms(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ms(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var _u=new Ms(1,0,0);MS.prototype=Ms.prototype;function MS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return _u;return e.__zoom}function ed(e){e.stopImmediatePropagation()}function ca(e){e.preventDefault(),e.stopImmediatePropagation()}function yM(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function SM(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function i0(){return this.__zoom||_u}function bM(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wM(){return navigator.maxTouchPoints||"ontouchstart"in this}function xM(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],c=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function kS(){var e=yM,t=SM,n=xM,r=bM,a=wM,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,_=zc,h=uu("start","zoom","end"),p,m,v,b=500,y=150,w=0,x=10;function E(A){A.property("__zoom",i0).on("wheel.zoom",W,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",ae).filter(a).on("touchstart.zoom",X).on("touchmove.zoom",q).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(A,H,M,B){var R=A.selection?A.selection():A;R.property("__zoom",i0),A!==R?I(A,H,M,B):R.interrupt().each(function(){z(this,arguments).event(B).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},E.scaleBy=function(A,H,M,B){E.scaleTo(A,function(){var R=this.__zoom.k,U=typeof H=="function"?H.apply(this,arguments):H;return R*U},M,B)},E.scaleTo=function(A,H,M,B){E.transform(A,function(){var R=t.apply(this,arguments),U=this.__zoom,Q=M==null?D(R):typeof M=="function"?M.apply(this,arguments):M,T=U.invert(Q),j=typeof H=="function"?H.apply(this,arguments):H;return n(C(L(U,j),Q,T),R,u)},M,B)},E.translateBy=function(A,H,M,B){E.transform(A,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),u)},null,B)},E.translateTo=function(A,H,M,B,R){E.transform(A,function(){var U=t.apply(this,arguments),Q=this.__zoom,T=B==null?D(U):typeof B=="function"?B.apply(this,arguments):B;return n(_u.translate(T[0],T[1]).scale(Q.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof M=="function"?-M.apply(this,arguments):-M),U,u)},B,R)};function L(A,H){return H=Math.max(c[0],Math.min(c[1],H)),H===A.k?A:new Ms(H,A.x,A.y)}function C(A,H,M){var B=H[0]-M[0]*A.k,R=H[1]-M[1]*A.k;return B===A.x&&R===A.y?A:new Ms(A.k,B,R)}function D(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function I(A,H,M,B){A.on("start.zoom",function(){z(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(B).end()}).tween("zoom",function(){var R=this,U=arguments,Q=z(R,U).event(B),T=t.apply(R,U),j=M==null?D(T):typeof M=="function"?M.apply(R,U):M,ee=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),te=R.__zoom,le=typeof H=="function"?H.apply(R,U):H,ce=_(te.invert(j).concat(ee/te.k),le.invert(j).concat(ee/le.k));return function(he){if(he===1)he=le;else{var ue=ce(he),_e=ee/ue[2];he=new Ms(_e,j[0]-ue[0]*_e,j[1]-ue[1]*_e)}Q.zoom(null,he)}})}function z(A,H,M){return!M&&A.__zooming||new P(A,H)}function P(A,H){this.that=A,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,H),this.taps=0}P.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,H){return this.mouse&&A!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var H=di(this.that).datum();h.call(A,this.that,new vM(A,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),H)}};function W(A,...H){if(!e.apply(this,arguments))return;var M=z(this,H).event(A),B=this.__zoom,R=Math.max(c[0],Math.min(c[1],B.k*Math.pow(2,r.apply(this,arguments)))),U=Li(A);if(M.wheel)(M.mouse[0][0]!==U[0]||M.mouse[0][1]!==U[1])&&(M.mouse[1]=B.invert(M.mouse[0]=U)),clearTimeout(M.wheel);else{if(B.k===R)return;M.mouse=[U,B.invert(U)],Uc(this),M.start()}ca(A),M.wheel=setTimeout(Q,y),M.zoom("mouse",n(C(L(B,R),M.mouse[0],M.mouse[1]),M.extent,u));function Q(){M.wheel=null,M.end()}}function G(A,...H){if(v||!e.apply(this,arguments))return;var M=A.currentTarget,B=z(this,H,!0).event(A),R=di(A.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",ee,!0),U=Li(A,M),Q=A.clientX,T=A.clientY;uS(A.view),ed(A),B.mouse=[U,this.__zoom.invert(U)],Uc(this),B.start();function j(te){if(ca(te),!B.moved){var le=te.clientX-Q,ce=te.clientY-T;B.moved=le*le+ce*ce>w}B.event(te).zoom("mouse",n(C(B.that.__zoom,B.mouse[0]=Li(te,M),B.mouse[1]),B.extent,u))}function ee(te){R.on("mousemove.zoom mouseup.zoom",null),hS(te.view,B.moved),ca(te),B.event(te).end()}}function ae(A,...H){if(e.apply(this,arguments)){var M=this.__zoom,B=Li(A.changedTouches?A.changedTouches[0]:A,this),R=M.invert(B),U=M.k*(A.shiftKey?.5:2),Q=n(C(L(M,U),B,R),t.apply(this,H),u);ca(A),f>0?di(this).transition().duration(f).call(I,Q,B,A):di(this).call(E.transform,Q,B,A)}}function X(A,...H){if(e.apply(this,arguments)){var M=A.touches,B=M.length,R=z(this,H,A.changedTouches.length===B).event(A),U,Q,T,j;for(ed(A),Q=0;Q<B;++Q)T=M[Q],j=Li(T,this),j=[j,this.__zoom.invert(j),T.identifier],R.touch0?!R.touch1&&R.touch0[2]!==j[2]&&(R.touch1=j,R.taps=0):(R.touch0=j,U=!0,R.taps=1+!!p);p&&(p=clearTimeout(p)),U&&(R.taps<2&&(m=j[0],p=setTimeout(function(){p=null},b)),Uc(this),R.start())}}function q(A,...H){if(this.__zooming){var M=z(this,H).event(A),B=A.changedTouches,R=B.length,U,Q,T,j;for(ca(A),U=0;U<R;++U)Q=B[U],T=Li(Q,this),M.touch0&&M.touch0[2]===Q.identifier?M.touch0[0]=T:M.touch1&&M.touch1[2]===Q.identifier&&(M.touch1[0]=T);if(Q=M.that.__zoom,M.touch1){var ee=M.touch0[0],te=M.touch0[1],le=M.touch1[0],ce=M.touch1[1],he=(he=le[0]-ee[0])*he+(he=le[1]-ee[1])*he,ue=(ue=ce[0]-te[0])*ue+(ue=ce[1]-te[1])*ue;Q=L(Q,Math.sqrt(he/ue)),T=[(ee[0]+le[0])/2,(ee[1]+le[1])/2],j=[(te[0]+ce[0])/2,(te[1]+ce[1])/2]}else if(M.touch0)T=M.touch0[0],j=M.touch0[1];else return;M.zoom("touch",n(C(Q,T,j),M.extent,u))}}function Y(A,...H){if(this.__zooming){var M=z(this,H).event(A),B=A.changedTouches,R=B.length,U,Q;for(ed(A),v&&clearTimeout(v),v=setTimeout(function(){v=null},b),U=0;U<R;++U)Q=B[U],M.touch0&&M.touch0[2]===Q.identifier?delete M.touch0:M.touch1&&M.touch1[2]===Q.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(Q=Li(Q,this),Math.hypot(m[0]-Q[0],m[1]-Q[1])<x)){var T=di(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return E.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:xc(+A),E):r},E.filter=function(A){return arguments.length?(e=typeof A=="function"?A:xc(!!A),E):e},E.touchable=function(A){return arguments.length?(a=typeof A=="function"?A:xc(!!A),E):a},E.extent=function(A){return arguments.length?(t=typeof A=="function"?A:xc([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),E):t},E.scaleExtent=function(A){return arguments.length?(c[0]=+A[0],c[1]=+A[1],E):[c[0],c[1]]},E.translateExtent=function(A){return arguments.length?(u[0][0]=+A[0][0],u[1][0]=+A[1][0],u[0][1]=+A[0][1],u[1][1]=+A[1][1],E):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},E.constrain=function(A){return arguments.length?(n=A,E):n},E.duration=function(A){return arguments.length?(f=+A,E):f},E.interpolate=function(A){return arguments.length?(_=A,E):_},E.on=function(){var A=h.on.apply(h,arguments);return A===h?E:A},E.clickDistance=function(A){return arguments.length?(w=(A=+A)*A,E):Math.sqrt(w)},E.tapDistance=function(A){return arguments.length?(x=+A,E):x},E}const Qi={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Aa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],DS=["Enter"," ","Escape"],TS={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var no;(function(e){e.Strict="strict",e.Loose="loose"})(no||(no={}));var Qn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Qn||(Qn={}));var Na;(function(e){e.Partial="partial",e.Full="full"})(Na||(Na={}));const AS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var mn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(mn||(mn={}));var Jc;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jc||(Jc={}));var ye;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ye||(ye={}));const s0={[ye.Left]:ye.Right,[ye.Right]:ye.Left,[ye.Top]:ye.Bottom,[ye.Bottom]:ye.Top};function NS(e){return e===null?null:e?"valid":"invalid"}const RS=e=>"id"in e&&"source"in e&&"target"in e,CM=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),k_=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ia=(e,t=[0,0])=>{const{width:n,height:r}=As(e),a=e.origin??t,c=n*a[0],u=r*a[1];return{x:e.position.x-c,y:e.position.y-u}},EM=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const c=typeof a=="string";let u=!t.nodeLookup&&!c?a:void 0;t.nodeLookup&&(u=c?t.nodeLookup.get(a):k_(a)?a:t.nodeLookup.get(a.id));const f=u?eu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return gu(r,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return mu(n)},Ya=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=gu(n,eu(a)),r=!0)}),r?mu(n):{x:0,y:0,width:0,height:0}},D_=(e,t,[n,r,a]=[0,0,1],c=!1,u=!1)=>{const f={...$a(t,[n,r,a]),width:t.width/a,height:t.height/a},_=[];for(const h of e.values()){const{measured:p,selectable:m=!0,hidden:v=!1}=h;if(u&&!m||v)continue;const b=p.width??h.width??h.initialWidth??null,y=p.height??h.height??h.initialHeight??null,w=Ra(f,oo(h)),x=(b??0)*(y??0),E=c&&w>0;(!h.internals.handleBounds||E||w>=x||h.dragging)&&_.push(h)}return _},MM=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function kM(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function DM({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:c},u){if(e.size===0)return Promise.resolve(!0);const f=kM(e,u),_=Ya(f),h=T_(_,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??c,(u==null?void 0:u.padding)??.1);return await r.setViewport(h,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function BS({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:c}){const u=n.get(e),f=u.parentId?n.get(u.parentId):void 0,{x:_,y:h}=f?f.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let m=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!f)c==null||c("005",Qi.error005());else{const b=f.measured.width,y=f.measured.height;b&&y&&(m=[[_,h],[_+b,h+y]])}else f&&ao(u.extent)&&(m=[[u.extent[0][0]+_,u.extent[0][1]+h],[u.extent[1][0]+_,u.extent[1][1]+h]]);const v=ao(m)?ir(t,m,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(c==null||c("015",Qi.error015())),{position:{x:v.x-_+(u.measured.width??0)*p[0],y:v.y-h+(u.measured.height??0)*p[1]},positionAbsolute:v}}async function TM({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const c=new Set(e.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const b=c.has(v.id),y=!b&&v.parentId&&u.find(w=>w.id===v.parentId);(b||y)&&u.push(v)}const f=new Set(t.map(v=>v.id)),_=r.filter(v=>v.deletable!==!1),p=MM(u,_);for(const v of _)f.has(v.id)&&!p.find(y=>y.id===v.id)&&p.push(v);if(!a)return{edges:p,nodes:u};const m=await a({nodes:u,edges:p});return typeof m=="boolean"?m?{edges:p,nodes:u}:{edges:[],nodes:[]}:m}const ro=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ir=(e={x:0,y:0},t,n)=>({x:ro(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ro(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function LS(e,t,n){const{width:r,height:a}=As(n),{x:c,y:u}=n.internals.positionAbsolute;return ir(e,[[c,u],[c+r,u+a]],t)}const n0=(e,t,n)=>e<t?ro(Math.abs(e-t),1,t)/t:e>n?-ro(Math.abs(e-n),1,t)/t:0,zS=(e,t,n=15,r=40)=>{const a=n0(e.x,r,t.width-r)*n,c=n0(e.y,r,t.height-r)*n;return[a,c]},gu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Nd=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),mu=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),oo=(e,t=[0,0])=>{var a,c;const{x:n,y:r}=k_(e)?e.internals.positionAbsolute:Ia(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((c=e.measured)==null?void 0:c.height)??e.height??e.initialHeight??0}},eu=(e,t=[0,0])=>{var a,c;const{x:n,y:r}=k_(e)?e.internals.positionAbsolute:Ia(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((c=e.measured)==null?void 0:c.height)??e.height??e.initialHeight??0)}},OS=(e,t)=>mu(gu(Nd(e),Nd(t))),Ra=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},r0=e=>Oi(e.width)&&Oi(e.height)&&Oi(e.x)&&Oi(e.y),Oi=e=>!isNaN(e)&&isFinite(e),AM=(e,t)=>{},Va=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),$a=({x:e,y:t},[n,r,a],c=!1,u=[1,1])=>{const f={x:(e-n)/a,y:(t-r)/a};return c?Va(f,u):f},tu=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Kr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function NM(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Kr(e,n),a=Kr(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Kr(e.top??e.y??0,n),a=Kr(e.bottom??e.y??0,n),c=Kr(e.left??e.x??0,t),u=Kr(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:c,x:c+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function RM(e,t,n,r,a,c){const{x:u,y:f}=tu(e,[t,n,r]),{x:_,y:h}=tu({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-_,m=c-h;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(p),bottom:Math.floor(m)}}const T_=(e,t,n,r,a,c)=>{const u=NM(c,t,n),f=(t-u.x)/e.width,_=(n-u.y)/e.height,h=Math.min(f,_),p=ro(h,r,a),m=e.x+e.width/2,v=e.y+e.height/2,b=t/2-m*p,y=n/2-v*p,w=RM(e,b,y,p,t,n),x={left:Math.min(w.left-u.left,0),top:Math.min(w.top-u.top,0),right:Math.min(w.right-u.right,0),bottom:Math.min(w.bottom-u.bottom,0)};return{x:b-x.left+x.right,y:y-x.top+x.bottom,zoom:p}},Ba=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ao(e){return e!=null&&e!=="parent"}function As(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function HS(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function US(e,t={width:0,height:0},n,r,a){const c={...e},u=r.get(n);if(u){const f=u.origin||a;c.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],c.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return c}function o0(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function BM(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function LM(e){return{...TS,...e||{}}}function Ca(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:c,y:u}=Hi(e),f=$a({x:c-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:_,y:h}=n?Va(f,t):f;return{xSnapped:_,ySnapped:h,...f}}const A_=e=>({width:e.offsetWidth,height:e.offsetHeight}),PS=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},zM=["INPUT","SELECT","TEXTAREA"];function jS(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:zM.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const qS=e=>"clientX"in e,Hi=(e,t)=>{var c,u;const n=qS(e),r=n?e.clientX:(c=e.touches)==null?void 0:c[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},a0=(e,t,n,r,a)=>{const c=t.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(f.left-n.left)/r,y:(f.top-n.top)/r,...A_(u)}})};function IS({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:f}){const _=e*.125+a*.375+u*.375+n*.125,h=t*.125+c*.375+f*.375+r*.125,p=Math.abs(_-e),m=Math.abs(h-t);return[_,h,p,m]}function Cc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function l0({pos:e,x1:t,y1:n,x2:r,y2:a,c}){switch(e){case ye.Left:return[t-Cc(t-r,c),n];case ye.Right:return[t+Cc(r-t,c),n];case ye.Top:return[t,n-Cc(n-a,c)];case ye.Bottom:return[t,n+Cc(a-n,c)]}}function YS({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:a,targetPosition:c=ye.Top,curvature:u=.25}){const[f,_]=l0({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[h,p]=l0({pos:c,x1:r,y1:a,x2:e,y2:t,c:u}),[m,v,b,y]=IS({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:f,sourceControlY:_,targetControlX:h,targetControlY:p});return[`M${e},${t} C${f},${_} ${h},${p} ${r},${a}`,m,v,b,y]}function VS({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,c=n<e?n+a:n-a,u=Math.abs(r-t)/2,f=r<t?r+u:r-u;return[c,f,a,u]}function OM({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:c="basic"}){if(c==="manual")return r;const u=a&&n?r+1e3:r,f=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+f}function HM({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const c=gu(eu(e),eu(t));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return Ra(u,mu(c))>0}const UM=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,PM=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),jM=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||UM;let a;return RS(e)?a={...e}:a={...e,id:r(e)},PM(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function $S({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,c,u,f]=VS({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,c,u,f]}const c0={[ye.Left]:{x:-1,y:0},[ye.Right]:{x:1,y:0},[ye.Top]:{x:0,y:-1},[ye.Bottom]:{x:0,y:1}},qM=({source:e,sourcePosition:t=ye.Bottom,target:n})=>t===ye.Left||t===ye.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},u0=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function IM({source:e,sourcePosition:t=ye.Bottom,target:n,targetPosition:r=ye.Top,center:a,offset:c,stepPosition:u}){const f=c0[t],_=c0[r],h={x:e.x+f.x*c,y:e.y+f.y*c},p={x:n.x+_.x*c,y:n.y+_.y*c},m=qM({source:h,sourcePosition:t,target:p}),v=m.x!==0?"x":"y",b=m[v];let y=[],w,x;const E={x:0,y:0},L={x:0,y:0},[,,C,D]=VS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(f[v]*_[v]===-1){v==="x"?(w=a.x??h.x+(p.x-h.x)*u,x=a.y??(h.y+p.y)/2):(w=a.x??(h.x+p.x)/2,x=a.y??h.y+(p.y-h.y)*u);const z=[{x:w,y:h.y},{x:w,y:p.y}],P=[{x:h.x,y:x},{x:p.x,y:x}];f[v]===b?y=v==="x"?z:P:y=v==="x"?P:z}else{const z=[{x:h.x,y:p.y}],P=[{x:p.x,y:h.y}];if(v==="x"?y=f.x===b?P:z:y=f.y===b?z:P,t===r){const q=Math.abs(e[v]-n[v]);if(q<=c){const Y=Math.min(c-1,c-q);f[v]===b?E[v]=(h[v]>e[v]?-1:1)*Y:L[v]=(p[v]>n[v]?-1:1)*Y}}if(t!==r){const q=v==="x"?"y":"x",Y=f[v]===_[q],A=h[q]>p[q],H=h[q]<p[q];(f[v]===1&&(!Y&&A||Y&&H)||f[v]!==1&&(!Y&&H||Y&&A))&&(y=v==="x"?z:P)}const W={x:h.x+E.x,y:h.y+E.y},G={x:p.x+L.x,y:p.y+L.y},ae=Math.max(Math.abs(W.x-y[0].x),Math.abs(G.x-y[0].x)),X=Math.max(Math.abs(W.y-y[0].y),Math.abs(G.y-y[0].y));ae>=X?(w=(W.x+G.x)/2,x=y[0].y):(w=y[0].x,x=(W.y+G.y)/2)}return[[e,{x:h.x+E.x,y:h.y+E.y},...y,{x:p.x+L.x,y:p.y+L.y},n],w,x,C,D]}function YM(e,t,n,r){const a=Math.min(u0(e,t)/2,u0(t,n)/2,r),{x:c,y:u}=t;if(e.x===c&&c===n.x||e.y===u&&u===n.y)return`L${c} ${u}`;if(e.y===u){const h=e.x<n.x?-1:1,p=e.y<n.y?1:-1;return`L ${c+a*h},${u}Q ${c},${u} ${c},${u+a*p}`}const f=e.x<n.x?1:-1,_=e.y<n.y?-1:1;return`L ${c},${u+a*_}Q ${c},${u} ${c+a*f},${u}`}function Rd({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:a,targetPosition:c=ye.Top,borderRadius:u=5,centerX:f,centerY:_,offset:h=20,stepPosition:p=.5}){const[m,v,b,y,w]=IM({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:c,center:{x:f,y:_},offset:h,stepPosition:p});return[m.reduce((E,L,C)=>{let D="";return C>0&&C<m.length-1?D=YM(m[C-1],L,m[C+1],u):D=`${C===0?"M":"L"}${L.x} ${L.y}`,E+=D,E},""),v,b,y,w]}function h0(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function VM(e){var m;const{sourceNode:t,targetNode:n}=e;if(!h0(t)||!h0(n))return null;const r=t.internals.handleBounds||f0(t.handles),a=n.internals.handleBounds||f0(n.handles),c=d0((r==null?void 0:r.source)??[],e.sourceHandle),u=d0(e.connectionMode===no.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!c||!u)return(m=e.onError)==null||m.call(e,"008",Qi.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=(c==null?void 0:c.position)||ye.Bottom,_=(u==null?void 0:u.position)||ye.Top,h=sr(t,c,f),p=sr(n,u,_);return{sourceX:h.x,sourceY:h.y,targetX:p.x,targetY:p.y,sourcePosition:f,targetPosition:_}}function f0(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function sr(e,t,n=ye.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,c=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??As(e);if(r)return{x:a+u/2,y:c+f/2};switch((t==null?void 0:t.position)??n){case ye.Top:return{x:a+u/2,y:c};case ye.Right:return{x:a+u,y:c+f/2};case ye.Bottom:return{x:a+u/2,y:c+f};case ye.Left:return{x:a,y:c+f/2}}}function d0(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Bd(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function $M(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const c=new Set;return e.reduce((u,f)=>([f.markerStart||r,f.markerEnd||a].forEach(_=>{if(_&&typeof _=="object"){const h=Bd(_,t);c.has(h)||(u.push({id:h,color:_.color||n,..._}),c.add(h))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const WS=1e3,WM=10,N_={nodeOrigin:[0,0],nodeExtent:Aa,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},XM={...N_,checkEquality:!0};function R_(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function KM(e,t,n){const r=R_(N_,n);for(const a of e.values())if(a.parentId)L_(a,e,t,r);else{const c=Ia(a,r.nodeOrigin),u=ao(a.extent)?a.extent:r.nodeExtent,f=ir(c,u,As(a));a.internals.positionAbsolute=f}}function GM(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const c={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(c):a.type==="target"&&r.push(c)}return{source:n,target:r}}function B_(e){return e==="manual"}function Ld(e,t,n,r={}){var h,p;const a=R_(XM,r),c={i:0},u=new Map(t),f=a!=null&&a.elevateNodesOnSelect&&!B_(a.zIndexMode)?WS:0;let _=e.length>0;t.clear(),n.clear();for(const m of e){let v=u.get(m.id);if(a.checkEquality&&m===(v==null?void 0:v.internals.userNode))t.set(m.id,v);else{const b=Ia(m,a.nodeOrigin),y=ao(m.extent)?m.extent:a.nodeExtent,w=ir(b,y,As(m));v={...a.defaults,...m,measured:{width:(h=m.measured)==null?void 0:h.width,height:(p=m.measured)==null?void 0:p.height},internals:{positionAbsolute:w,handleBounds:GM(m,v),z:XS(m,f,a.zIndexMode),userNode:m}},t.set(m.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(_=!1),m.parentId&&L_(v,t,n,r,c)}return _}function FM(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function L_(e,t,n,r,a){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:f,zIndexMode:_}=R_(N_,r),h=e.parentId,p=t.get(h);if(!p){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}FM(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&_==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*WM),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const m=c&&!B_(_)?WS:0,{x:v,y:b,z:y}=ZM(e,p,u,f,m,_),{positionAbsolute:w}=e.internals,x=v!==w.x||b!==w.y;(x||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:v,y:b}:w,z:y}})}function XS(e,t,n){const r=Oi(e.zIndex)?e.zIndex:0;return B_(n)?r:r+(e.selected?t:0)}function ZM(e,t,n,r,a,c){const{x:u,y:f}=t.internals.positionAbsolute,_=As(e),h=Ia(e,n),p=ao(e.extent)?ir(h,e.extent,_):h;let m=ir({x:u+p.x,y:f+p.y},r,_);e.extent==="parent"&&(m=LS(m,_,t));const v=XS(e,a,c),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=v?b+1:v}}function z_(e,t,n,r=[0,0]){var u;const a=[],c=new Map;for(const f of e){const _=t.get(f.parentId);if(!_)continue;const h=((u=c.get(f.parentId))==null?void 0:u.expandedRect)??oo(_),p=OS(h,f.rect);c.set(f.parentId,{expandedRect:p,parent:_})}return c.size>0&&c.forEach(({expandedRect:f,parent:_},h)=>{var C;const p=_.internals.positionAbsolute,m=As(_),v=_.origin??r,b=f.x<p.x?Math.round(Math.abs(p.x-f.x)):0,y=f.y<p.y?Math.round(Math.abs(p.y-f.y)):0,w=Math.max(m.width,Math.round(f.width)),x=Math.max(m.height,Math.round(f.height)),E=(w-m.width)*v[0],L=(x-m.height)*v[1];(b>0||y>0||E||L)&&(a.push({id:h,type:"position",position:{x:_.position.x-b+E,y:_.position.y-y+L}}),(C=n.get(h))==null||C.forEach(D=>{e.some(I=>I.id===D.id)||a.push({id:D.id,type:"position",position:{x:D.position.x+b,y:D.position.y+y}})})),(m.width<f.width||m.height<f.height||b||y)&&a.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(b?v[0]*b-E:0),height:x+(y?v[1]*y-L:0)}})}),a}function QM(e,t,n,r,a,c,u){const f=r==null?void 0:r.querySelector(".xyflow__viewport");let _=!1;if(!f)return{changes:[],updatedInternals:_};const h=[],p=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(p.transform),v=[];for(const b of e.values()){const y=t.get(b.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),_=!0;continue}const w=A_(b.nodeElement),x=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(x||!y.internals.handleBounds||b.force))){const L=b.nodeElement.getBoundingClientRect(),C=ao(y.extent)?y.extent:c;let{positionAbsolute:D}=y.internals;y.parentId&&y.extent==="parent"?D=LS(D,w,t.get(y.parentId)):C&&(D=ir(D,C,w));const I={...y,measured:w,internals:{...y.internals,positionAbsolute:D,handleBounds:{source:a0("source",b.nodeElement,L,m,y.id),target:a0("target",b.nodeElement,L,m,y.id)}}};t.set(y.id,I),y.parentId&&L_(I,t,n,{nodeOrigin:a,zIndexMode:u}),_=!0,x&&(h.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&v.push({id:y.id,parentId:y.parentId,rect:oo(I,a)}))}}if(v.length>0){const b=z_(v,t,n,a);h.push(...b)}return{changes:h,updatedInternals:_}}async function JM({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:c}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,c]],r),f=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(f)}function _0(e,t,n,r,a,c){let u=a;const f=r.get(u)||new Map;r.set(u,f.set(n,t)),u=`${a}-${e}`;const _=r.get(u)||new Map;if(r.set(u,_.set(n,t)),c){u=`${a}-${e}-${c}`;const h=r.get(u)||new Map;r.set(u,h.set(n,t))}}function KS(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:c,sourceHandle:u=null,targetHandle:f=null}=r,_={edgeId:r.id,source:a,target:c,sourceHandle:u,targetHandle:f},h=`${a}-${u}--${c}-${f}`,p=`${c}-${f}--${a}-${u}`;_0("source",_,p,e,a,u),_0("target",_,h,e,c,f),t.set(r.id,r)}}function GS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:GS(n,t):!1}function g0(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function e3(e,t,n,r){const a=new Map;for(const[c,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!GS(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const f=e.get(c);f&&a.set(c,{id:c,position:f.position||{x:0,y:0},distance:{x:n.x-f.internals.positionAbsolute.x,y:n.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return a}function td({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,f,_;const a=[];for(const[h,p]of t){const m=(u=n.get(h))==null?void 0:u.internals.userNode;m&&a.push({...m,position:p.position,dragging:r})}if(!e)return[a[0],a];const c=(f=n.get(e))==null?void 0:f.internals.userNode;return[c?{...c,position:((_=t.get(e))==null?void 0:_.position)||c.position,dragging:r}:a[0],a]}function t3({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const c={x:n-a.distance.x,y:r-a.distance.y},u=Va(c,t);return{x:u.x-c.x,y:u.y-c.y}}function i3({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let c={x:null,y:null},u=0,f=new Map,_=!1,h={x:0,y:0},p=null,m=!1,v=null,b=!1,y=!1,w=null;function x({noDragClassName:L,handleSelector:C,domNode:D,isSelectable:I,nodeId:z,nodeClickDistance:P=0}){v=di(D);function W({x:q,y:Y}){const{nodeLookup:A,nodeExtent:H,snapGrid:M,snapToGrid:B,nodeOrigin:R,onNodeDrag:U,onSelectionDrag:Q,onError:T,updateNodePositions:j}=t();c={x:q,y:Y};let ee=!1;const te=f.size>1,le=te&&H?Nd(Ya(f)):null,ce=te&&B?t3({dragItems:f,snapGrid:M,x:q,y:Y}):null;for(const[he,ue]of f){if(!A.has(he))continue;let _e={x:q-ue.distance.x,y:Y-ue.distance.y};B&&(_e=ce?{x:Math.round(_e.x+ce.x),y:Math.round(_e.y+ce.y)}:Va(_e,M));let xe=null;if(te&&H&&!ue.extent&&le){const{positionAbsolute:de}=ue.internals,Me=de.x-le.x+H[0][0],qe=de.x+ue.measured.width-le.x2+H[1][0],Be=de.y-le.y+H[0][1],Ct=de.y+ue.measured.height-le.y2+H[1][1];xe=[[Me,Be],[qe,Ct]]}const{position:be,positionAbsolute:pe}=BS({nodeId:he,nextPosition:_e,nodeLookup:A,nodeExtent:xe||H,nodeOrigin:R,onError:T});ee=ee||ue.position.x!==be.x||ue.position.y!==be.y,ue.position=be,ue.internals.positionAbsolute=pe}if(y=y||ee,!!ee&&(j(f,!0),w&&(r||U||!z&&Q))){const[he,ue]=td({nodeId:z,dragItems:f,nodeLookup:A});r==null||r(w,f,he,ue),U==null||U(w,he,ue),z||Q==null||Q(w,ue)}}async function G(){if(!p)return;const{transform:q,panBy:Y,autoPanSpeed:A,autoPanOnNodeDrag:H}=t();if(!H){_=!1,cancelAnimationFrame(u);return}const[M,B]=zS(h,p,A);(M!==0||B!==0)&&(c.x=(c.x??0)-M/q[2],c.y=(c.y??0)-B/q[2],await Y({x:M,y:B})&&W(c)),u=requestAnimationFrame(G)}function ae(q){var te;const{nodeLookup:Y,multiSelectionActive:A,nodesDraggable:H,transform:M,snapGrid:B,snapToGrid:R,selectNodesOnDrag:U,onNodeDragStart:Q,onSelectionDragStart:T,unselectNodesAndEdges:j}=t();m=!0,(!U||!I)&&!A&&z&&((te=Y.get(z))!=null&&te.selected||j()),I&&U&&z&&(e==null||e(z));const ee=Ca(q.sourceEvent,{transform:M,snapGrid:B,snapToGrid:R,containerBounds:p});if(c=ee,f=e3(Y,H,ee,z),f.size>0&&(n||Q||!z&&T)){const[le,ce]=td({nodeId:z,dragItems:f,nodeLookup:Y});n==null||n(q.sourceEvent,f,le,ce),Q==null||Q(q.sourceEvent,le,ce),z||T==null||T(q.sourceEvent,ce)}}const X=fS().clickDistance(P).on("start",q=>{const{domNode:Y,nodeDragThreshold:A,transform:H,snapGrid:M,snapToGrid:B}=t();p=(Y==null?void 0:Y.getBoundingClientRect())||null,b=!1,y=!1,w=q.sourceEvent,A===0&&ae(q),c=Ca(q.sourceEvent,{transform:H,snapGrid:M,snapToGrid:B,containerBounds:p}),h=Hi(q.sourceEvent,p)}).on("drag",q=>{const{autoPanOnNodeDrag:Y,transform:A,snapGrid:H,snapToGrid:M,nodeDragThreshold:B,nodeLookup:R}=t(),U=Ca(q.sourceEvent,{transform:A,snapGrid:H,snapToGrid:M,containerBounds:p});if(w=q.sourceEvent,(q.sourceEvent.type==="touchmove"&&q.sourceEvent.touches.length>1||z&&!R.has(z))&&(b=!0),!b){if(!_&&Y&&m&&(_=!0,G()),!m){const Q=Hi(q.sourceEvent,p),T=Q.x-h.x,j=Q.y-h.y;Math.sqrt(T*T+j*j)>B&&ae(q)}(c.x!==U.xSnapped||c.y!==U.ySnapped)&&f&&m&&(h=Hi(q.sourceEvent,p),W(U))}}).on("end",q=>{if(!(!m||b)&&(_=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:Y,updateNodePositions:A,onNodeDragStop:H,onSelectionDragStop:M}=t();if(y&&(A(f,!1),y=!1),a||H||!z&&M){const[B,R]=td({nodeId:z,dragItems:f,nodeLookup:Y,dragging:!1});a==null||a(q.sourceEvent,f,B,R),H==null||H(q.sourceEvent,B,R),z||M==null||M(q.sourceEvent,R)}}}).filter(q=>{const Y=q.target;return!q.button&&(!L||!g0(Y,`.${L}`,D))&&(!C||g0(Y,C,D))});v.call(X)}function E(){v==null||v.on(".drag",null)}return{update:x,destroy:E}}function s3(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const c of t.values())Ra(a,oo(c))>0&&r.push(c);return r}const n3=250;function r3(e,t,n,r){var f,_;let a=[],c=1/0;const u=s3(e,n,t+n3);for(const h of u){const p=[...((f=h.internals.handleBounds)==null?void 0:f.source)??[],...((_=h.internals.handleBounds)==null?void 0:_.target)??[]];for(const m of p){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:v,y:b}=sr(h,m,m.position,!0),y=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(b-e.y,2));y>t||(y<c?(a=[{...m,x:v,y:b}],c=y):y===c&&a.push({...m,x:v,y:b}))}}if(!a.length)return null;if(a.length>1){const h=r.type==="source"?"target":"source";return a.find(p=>p.type===h)??a[0]}return a[0]}function FS(e,t,n,r,a,c=!1){var h,p,m;const u=r.get(e);if(!u)return null;const f=a==="strict"?(h=u.internals.handleBounds)==null?void 0:h[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((m=u.internals.handleBounds)==null?void 0:m.target)??[]],_=(n?f==null?void 0:f.find(v=>v.id===n):f==null?void 0:f[0])??null;return _&&c?{..._,...sr(u,_,_.position,!0)}:_}function ZS(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function o3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const QS=()=>!0;function a3(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:c,isTarget:u,domNode:f,nodeLookup:_,lib:h,autoPanOnConnect:p,flowId:m,panBy:v,cancelConnection:b,onConnectStart:y,onConnect:w,onConnectEnd:x,isValidConnection:E=QS,onReconnectEnd:L,updateConnection:C,getTransform:D,getFromHandle:I,autoPanSpeed:z,dragThreshold:P=1,handleDomNode:W}){const G=PS(e.target);let ae=0,X;const{x:q,y:Y}=Hi(e),A=ZS(c,W),H=f==null?void 0:f.getBoundingClientRect();let M=!1;if(!H||!A)return;const B=FS(a,A,r,_,t);if(!B)return;let R=Hi(e,H),U=!1,Q=null,T=!1,j=null;function ee(){if(!p||!H)return;const[be,pe]=zS(R,H,z);v({x:be,y:pe}),ae=requestAnimationFrame(ee)}const te={...B,nodeId:a,type:A,position:B.position},le=_.get(a);let he={inProgress:!0,isValid:null,from:sr(le,te,ye.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:le,to:R,toHandle:null,toPosition:s0[te.position],toNode:null,pointer:R};function ue(){M=!0,C(he),y==null||y(e,{nodeId:a,handleId:r,handleType:A})}P===0&&ue();function _e(be){if(!M){const{x:Ct,y:ki}=Hi(be),si=Ct-q,Di=ki-Y;if(!(si*si+Di*Di>P*P))return;ue()}if(!I()||!te){xe(be);return}const pe=D();R=Hi(be,H),X=r3($a(R,pe,!1,[1,1]),n,_,te),U||(ee(),U=!0);const de=JS(be,{handle:X,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:E,doc:G,lib:h,flowId:m,nodeLookup:_});j=de.handleDomNode,Q=de.connection,T=o3(!!X,de.isValid);const Me=_.get(a),qe=Me?sr(Me,te,ye.Left,!0):he.from,Be={...he,from:qe,isValid:T,to:de.toHandle&&T?tu({x:de.toHandle.x,y:de.toHandle.y},pe):R,toHandle:de.toHandle,toPosition:T&&de.toHandle?de.toHandle.position:s0[te.position],toNode:de.toHandle?_.get(de.toHandle.nodeId):null,pointer:R};C(Be),he=Be}function xe(be){if(!("touches"in be&&be.touches.length>0)){if(M){(X||j)&&Q&&T&&(w==null||w(Q));const{inProgress:pe,...de}=he,Me={...de,toPosition:he.toHandle?he.toPosition:null};x==null||x(be,Me),c&&(L==null||L(be,Me))}b(),cancelAnimationFrame(ae),U=!1,T=!1,Q=null,j=null,G.removeEventListener("mousemove",_e),G.removeEventListener("mouseup",xe),G.removeEventListener("touchmove",_e),G.removeEventListener("touchend",xe)}}G.addEventListener("mousemove",_e),G.addEventListener("mouseup",xe),G.addEventListener("touchmove",_e),G.addEventListener("touchend",xe)}function JS(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:c,doc:u,lib:f,flowId:_,isValidConnection:h=QS,nodeLookup:p}){const m=c==="target",v=t?u.querySelector(`.${f}-flow__handle[data-id="${_}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y}=Hi(e),w=u.elementFromPoint(b,y),x=w!=null&&w.classList.contains(`${f}-flow__handle`)?w:v,E={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const L=ZS(void 0,x),C=x.getAttribute("data-nodeid"),D=x.getAttribute("data-handleid"),I=x.classList.contains("connectable"),z=x.classList.contains("connectableend");if(!C||!L)return E;const P={source:m?C:r,sourceHandle:m?D:a,target:m?r:C,targetHandle:m?a:D};E.connection=P;const G=I&&z&&(n===no.Strict?m&&L==="source"||!m&&L==="target":C!==r||D!==a);E.isValid=G&&h(P),E.toHandle=FS(C,L,D,p,n,!0)}return E}const zd={onPointerDown:a3,isValid:JS};function l3({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=di(e);function c({translateExtent:f,width:_,height:h,zoomStep:p=1,pannable:m=!0,zoomable:v=!0,inversePan:b=!1}){const y=C=>{if(C.sourceEvent.type!=="wheel"||!t)return;const D=n(),I=C.sourceEvent.ctrlKey&&Ba()?10:1,z=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*p,P=D[2]*Math.pow(2,z*I);t.scaleTo(P)};let w=[0,0];const x=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(w=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},E=C=>{const D=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const I=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],z=[I[0]-w[0],I[1]-w[1]];w=I;const P=r()*Math.max(D[2],Math.log(D[2]))*(b?-1:1),W={x:D[0]-z[0]*P,y:D[1]-z[1]*P},G=[[0,0],[_,h]];t.setViewportConstrained({x:W.x,y:W.y,zoom:D[2]},G,f)},L=kS().on("start",x).on("zoom",m?E:null).on("zoom.wheel",v?y:null);a.call(L,{})}function u(){a.on("zoom",null)}return{update:c,destroy:u,pointer:Li}}const pu=e=>({x:e.x,y:e.y,zoom:e.k}),id=({x:e,y:t,zoom:n})=>_u.translate(e,t).scale(n),Zr=(e,t)=>e.target.closest(`.${t}`),e1=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),c3=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,sd=(e,t=0,n=c3,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},t1=e=>{const t=e.ctrlKey&&Ba()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function u3({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:_,onPanZoomEnd:h}){return p=>{if(Zr(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(p.ctrlKey&&u){const x=Li(p),E=t1(p),L=m*Math.pow(2,E);r.scaleTo(n,L,x,p);return}const v=p.deltaMode===1?20:1;let b=a===Qn.Vertical?0:p.deltaX*v,y=a===Qn.Horizontal?0:p.deltaY*v;!Ba()&&p.shiftKey&&a!==Qn.Vertical&&(b=p.deltaY*v,y=0),r.translateBy(n,-(b/m)*c,-(y/m)*c,{internal:!0});const w=pu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(_==null||_(p,w),e.panScrollTimeout=setTimeout(()=>{h==null||h(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f==null||f(p,w))}}function h3({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const c=r.type==="wheel",u=!t&&c&&!r.ctrlKey,f=Zr(r,e);if(r.ctrlKey&&c&&f&&r.preventDefault(),u||f)return null;r.preventDefault(),n.call(this,r,a)}}function f3({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var c,u,f;if((c=r.sourceEvent)!=null&&c.internal)return;const a=pu(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((f=r.sourceEvent)==null?void 0:f.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function d3({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return c=>{var u,f;e.usedRightMouseButton=!!(n&&e1(t,e.mouseButton??0)),(u=c.sourceEvent)!=null&&u.sync||r([c.transform.x,c.transform.y,c.transform.k]),a&&!((f=c.sourceEvent)!=null&&f.internal)&&(a==null||a(c.sourceEvent,pu(c.transform)))}}function _3({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:c}){return u=>{var f;if(!((f=u.sourceEvent)!=null&&f.internal)&&(e.isZoomingOrPanning=!1,c&&e1(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const _=pu(u.transform);e.prevViewport=_,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,_)},n?150:0)}}}function g3({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:f,noPanClassName:_,lib:h,connectionInProgress:p}){return m=>{var x;const v=e||t,b=n&&m.ctrlKey,y=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Zr(m,`${h}-flow__node`)||Zr(m,`${h}-flow__edge`)))return!0;if(!r&&!v&&!a&&!c&&!n||u||p&&!y||Zr(m,f)&&y||Zr(m,_)&&(!y||a&&y&&!e)||!n&&m.ctrlKey&&y)return!1;if(!n&&m.type==="touchstart"&&((x=m.touches)==null?void 0:x.length)>1)return m.preventDefault(),!1;if(!v&&!a&&!b&&y||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||y)&&w}}function m3({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:_}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=kS().scaleExtent([t,n]).translateExtent(r),v=di(e).call(m);L({x:a.x,y:a.y,zoom:ro(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const b=v.on("wheel.zoom"),y=v.on("dblclick.zoom");m.wheelDelta(t1);function w(X,q){return v?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?xa:zc).transform(sd(v,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),X)}):Promise.resolve(!1)}function x({noWheelClassName:X,noPanClassName:q,onPaneContextMenu:Y,userSelectionActive:A,panOnScroll:H,panOnDrag:M,panOnScrollMode:B,panOnScrollSpeed:R,preventScrolling:U,zoomOnPinch:Q,zoomOnScroll:T,zoomOnDoubleClick:j,zoomActivationKeyPressed:ee,lib:te,onTransformChange:le,connectionInProgress:ce,paneClickDistance:he,selectionOnDrag:ue}){A&&!h.isZoomingOrPanning&&E();const _e=H&&!ee&&!A;m.clickDistance(ue?1/0:!Oi(he)||he<0?0:he);const xe=_e?u3({zoomPanValues:h,noWheelClassName:X,d3Selection:v,d3Zoom:m,panOnScrollMode:B,panOnScrollSpeed:R,zoomOnPinch:Q,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:f}):h3({noWheelClassName:X,preventScrolling:U,d3ZoomHandler:b});if(v.on("wheel.zoom",xe,{passive:!1}),!A){const pe=f3({zoomPanValues:h,onDraggingChange:_,onPanZoomStart:u});m.on("start",pe);const de=d3({zoomPanValues:h,panOnDrag:M,onPaneContextMenu:!!Y,onPanZoom:c,onTransformChange:le});m.on("zoom",de);const Me=_3({zoomPanValues:h,panOnDrag:M,panOnScroll:H,onPaneContextMenu:Y,onPanZoomEnd:f,onDraggingChange:_});m.on("end",Me)}const be=g3({zoomActivationKeyPressed:ee,panOnDrag:M,zoomOnScroll:T,panOnScroll:H,zoomOnDoubleClick:j,zoomOnPinch:Q,userSelectionActive:A,noPanClassName:q,noWheelClassName:X,lib:te,connectionInProgress:ce});m.filter(be),j?v.on("dblclick.zoom",y):v.on("dblclick.zoom",null)}function E(){m.on("zoom",null)}async function L(X,q,Y){const A=id(X),H=m==null?void 0:m.constrain()(A,q,Y);return H&&await w(H),new Promise(M=>M(H))}async function C(X,q){const Y=id(X);return await w(Y,q),new Promise(A=>A(Y))}function D(X){if(v){const q=id(X),Y=v.property("__zoom");(Y.k!==X.zoom||Y.x!==X.x||Y.y!==X.y)&&(m==null||m.transform(v,q,null,{sync:!0}))}}function I(){const X=v?MS(v.node()):{x:0,y:0,k:1};return{x:X.x,y:X.y,zoom:X.k}}function z(X,q){return v?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?xa:zc).scaleTo(sd(v,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),X)}):Promise.resolve(!1)}function P(X,q){return v?new Promise(Y=>{m==null||m.interpolate((q==null?void 0:q.interpolate)==="linear"?xa:zc).scaleBy(sd(v,q==null?void 0:q.duration,q==null?void 0:q.ease,()=>Y(!0)),X)}):Promise.resolve(!1)}function W(X){m==null||m.scaleExtent(X)}function G(X){m==null||m.translateExtent(X)}function ae(X){const q=!Oi(X)||X<0?0:X;m==null||m.clickDistance(q)}return{update:x,destroy:E,setViewport:C,setViewportConstrained:L,getViewport:I,scaleTo:z,scaleBy:P,setScaleExtent:W,setTranslateExtent:G,syncViewport:D,setClickDistance:ae}}var lo;(function(e){e.Line="line",e.Handle="handle"})(lo||(lo={}));function p3({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:c}){const u=e-t,f=n-r,_=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&a&&(_[0]=_[0]*-1),f&&c&&(_[1]=_[1]*-1),_}function m0(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function un(e,t){return Math.max(0,t-e)}function hn(e,t){return Math.max(0,e-t)}function Ec(e,t,n){return Math.max(0,t-e,e-n)}function p0(e,t){return e?!t:t}function v3(e,t,n,r,a,c,u,f){let{affectsX:_,affectsY:h}=t;const{isHorizontal:p,isVertical:m}=t,v=p&&m,{xSnapped:b,ySnapped:y}=n,{minWidth:w,maxWidth:x,minHeight:E,maxHeight:L}=r,{x:C,y:D,width:I,height:z,aspectRatio:P}=e;let W=Math.floor(p?b-e.pointerX:0),G=Math.floor(m?y-e.pointerY:0);const ae=I+(_?-W:W),X=z+(h?-G:G),q=-c[0]*I,Y=-c[1]*z;let A=Ec(ae,w,x),H=Ec(X,E,L);if(u){let R=0,U=0;_&&W<0?R=un(C+W+q,u[0][0]):!_&&W>0&&(R=hn(C+ae+q,u[1][0])),h&&G<0?U=un(D+G+Y,u[0][1]):!h&&G>0&&(U=hn(D+X+Y,u[1][1])),A=Math.max(A,R),H=Math.max(H,U)}if(f){let R=0,U=0;_&&W>0?R=hn(C+W,f[0][0]):!_&&W<0&&(R=un(C+ae,f[1][0])),h&&G>0?U=hn(D+G,f[0][1]):!h&&G<0&&(U=un(D+X,f[1][1])),A=Math.max(A,R),H=Math.max(H,U)}if(a){if(p){const R=Ec(ae/P,E,L)*P;if(A=Math.max(A,R),u){let U=0;!_&&!h||_&&!h&&v?U=hn(D+Y+ae/P,u[1][1])*P:U=un(D+Y+(_?W:-W)/P,u[0][1])*P,A=Math.max(A,U)}if(f){let U=0;!_&&!h||_&&!h&&v?U=un(D+ae/P,f[1][1])*P:U=hn(D+(_?W:-W)/P,f[0][1])*P,A=Math.max(A,U)}}if(m){const R=Ec(X*P,w,x)/P;if(H=Math.max(H,R),u){let U=0;!_&&!h||h&&!_&&v?U=hn(C+X*P+q,u[1][0])/P:U=un(C+(h?G:-G)*P+q,u[0][0])/P,H=Math.max(H,U)}if(f){let U=0;!_&&!h||h&&!_&&v?U=un(C+X*P,f[1][0])/P:U=hn(C+(h?G:-G)*P,f[0][0])/P,H=Math.max(H,U)}}}G=G+(G<0?H:-H),W=W+(W<0?A:-A),a&&(v?ae>X*P?G=(p0(_,h)?-W:W)/P:W=(p0(_,h)?-G:G)*P:p?(G=W/P,h=_):(W=G*P,_=h));const M=_?C+W:C,B=h?D+G:D;return{width:I+(_?-W:W),height:z+(h?-G:G),x:c[0]*W*(_?-1:1)+M,y:c[1]*G*(h?-1:1)+B}}const i1={width:0,height:0,x:0,y:0},y3={...i1,pointerX:0,pointerY:0,aspectRatio:1};function S3(e){return[[0,0],[e.measured.width,e.measured.height]]}function b3(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,c=e.measured.width??0,u=e.measured.height??0,f=n[0]*c,_=n[1]*u;return[[r-f,a-_],[r+c-f,a+u-_]]}function w3({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const c=di(e);let u={controlDirection:m0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:h,boundaries:p,keepAspectRatio:m,resizeDirection:v,onResizeStart:b,onResize:y,onResizeEnd:w,shouldResize:x}){let E={...i1},L={...y3};u={boundaries:p,resizeDirection:v,keepAspectRatio:m,controlDirection:m0(h)};let C,D=null,I=[],z,P,W,G=!1;const ae=fS().on("start",X=>{const{nodeLookup:q,transform:Y,snapGrid:A,snapToGrid:H,nodeOrigin:M,paneDomNode:B}=n();if(C=q.get(t),!C)return;D=(B==null?void 0:B.getBoundingClientRect())??null;const{xSnapped:R,ySnapped:U}=Ca(X.sourceEvent,{transform:Y,snapGrid:A,snapToGrid:H,containerBounds:D});E={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},L={...E,pointerX:R,pointerY:U,aspectRatio:E.width/E.height},z=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(z=q.get(C.parentId),P=z&&C.extent==="parent"?S3(z):void 0),I=[],W=void 0;for(const[Q,T]of q)if(T.parentId===t&&(I.push({id:Q,position:{...T.position},extent:T.extent}),T.extent==="parent"||T.expandParent)){const j=b3(T,C,T.origin??M);W?W=[[Math.min(j[0][0],W[0][0]),Math.min(j[0][1],W[0][1])],[Math.max(j[1][0],W[1][0]),Math.max(j[1][1],W[1][1])]]:W=j}b==null||b(X,{...E})}).on("drag",X=>{const{transform:q,snapGrid:Y,snapToGrid:A,nodeOrigin:H}=n(),M=Ca(X.sourceEvent,{transform:q,snapGrid:Y,snapToGrid:A,containerBounds:D}),B=[];if(!C)return;const{x:R,y:U,width:Q,height:T}=E,j={},ee=C.origin??H,{width:te,height:le,x:ce,y:he}=v3(L,u.controlDirection,M,u.boundaries,u.keepAspectRatio,ee,P,W),ue=te!==Q,_e=le!==T,xe=ce!==R&&ue,be=he!==U&&_e;if(!xe&&!be&&!ue&&!_e)return;if((xe||be||ee[0]===1||ee[1]===1)&&(j.x=xe?ce:E.x,j.y=be?he:E.y,E.x=j.x,E.y=j.y,I.length>0)){const qe=ce-R,Be=he-U;for(const Ct of I)Ct.position={x:Ct.position.x-qe+ee[0]*(te-Q),y:Ct.position.y-Be+ee[1]*(le-T)},B.push(Ct)}if((ue||_e)&&(j.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?te:E.width,j.height=_e&&(!u.resizeDirection||u.resizeDirection==="vertical")?le:E.height,E.width=j.width,E.height=j.height),z&&C.expandParent){const qe=ee[0]*(j.width??0);j.x&&j.x<qe&&(E.x=qe,L.x=L.x-(j.x-qe));const Be=ee[1]*(j.height??0);j.y&&j.y<Be&&(E.y=Be,L.y=L.y-(j.y-Be))}const pe=p3({width:E.width,prevWidth:Q,height:E.height,prevHeight:T,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),de={...E,direction:pe};(x==null?void 0:x(X,de))!==!1&&(G=!0,y==null||y(X,de),r(j,B))}).on("end",X=>{G&&(w==null||w(X,{...E}),a==null||a({...E}),G=!1)});c.call(ae)}function _(){c.on(".drag",null)}return{update:f,destroy:_}}var nd={exports:{}},rd={},od={exports:{}},ad={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var v0;function x3(){if(v0)return ad;v0=1;var e=Pa();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function f(m,v){var b=v(),y=r({inst:{value:b,getSnapshot:v}}),w=y[0].inst,x=y[1];return c(function(){w.value=b,w.getSnapshot=v,_(w)&&x({inst:w})},[m,b,v]),a(function(){return _(w)&&x({inst:w}),m(function(){_(w)&&x({inst:w})})},[m]),u(b),b}function _(m){var v=m.getSnapshot;m=m.value;try{var b=v();return!n(m,b)}catch{return!0}}function h(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return ad.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,ad}var y0;function C3(){return y0||(y0=1,od.exports=x3()),od.exports}/**
|
|
58
|
+
* @license React
|
|
59
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/var S0;function E3(){if(S0)return rd;S0=1;var e=Pa(),t=C3();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,f=e.useMemo,_=e.useDebugValue;return rd.useSyncExternalStoreWithSelector=function(h,p,m,v,b){var y=c(null);if(y.current===null){var w={hasValue:!1,value:null};y.current=w}else w=y.current;y=f(function(){function E(z){if(!L){if(L=!0,C=z,z=v(z),b!==void 0&&w.hasValue){var P=w.value;if(b(P,z))return D=P}return D=z}if(P=D,r(C,z))return P;var W=v(z);return b!==void 0&&b(P,W)?(C=z,P):(C=z,D=W)}var L=!1,C,D,I=m===void 0?null:m;return[function(){return E(p())},I===null?void 0:function(){return E(I())}]},[p,m,v,b]);var x=a(h,y[0],y[1]);return u(function(){w.hasValue=!0,w.value=x},[x]),_(x),x},rd}var b0;function M3(){return b0||(b0=1,nd.exports=E3()),nd.exports}var k3=M3();const D3=Fy(k3),T3={},w0=e=>{let t;const n=new Set,r=(p,m)=>{const v=typeof p=="function"?p(t):p;if(!Object.is(v,t)){const b=t;t=m??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(y=>y(t,b))}},a=()=>t,_={setState:r,getState:a,getInitialState:()=>h,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(T3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,a,_);return _},A3=e=>e?w0(e):w0,{useDebugValue:N3}=Ux,{useSyncExternalStoreWithSelector:R3}=D3,B3=e=>e;function s1(e,t=B3,n){const r=R3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return N3(r),r}const x0=(e,t)=>{const n=A3(e),r=(a,c=t)=>s1(n,a,c);return Object.assign(r,n),r},L3=(e,t)=>e?x0(e,t):x0;function Je(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}Zy();const vu=$.createContext(null),z3=vu.Provider,n1=Qi.error001();function He(e,t){const n=$.useContext(vu);if(n===null)throw new Error(n1);return s1(n,e,t)}function tt(){const e=$.useContext(vu);if(e===null)throw new Error(n1);return $.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const C0={display:"none"},O3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},r1="react-flow__node-desc",o1="react-flow__edge-desc",H3="react-flow__aria-live",U3=e=>e.ariaLiveMessage,P3=e=>e.ariaLabelConfig;function j3({rfId:e}){const t=He(U3);return N.jsx("div",{id:`${H3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:O3,children:t})}function q3({rfId:e,disableKeyboardA11y:t}){const n=He(P3);return N.jsxs(N.Fragment,{children:[N.jsx("div",{id:`${r1}-${e}`,style:C0,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),N.jsx("div",{id:`${o1}-${e}`,style:C0,children:n["edge.a11yDescription.default"]}),!t&&N.jsx(j3,{rfId:e})]})}const yu=$.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},c)=>{const u=`${e}`.split("-");return N.jsx("div",{className:vt(["react-flow__panel",n,...u]),style:r,ref:c,...a,children:t})});yu.displayName="Panel";function I3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:N.jsx(yu,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:N.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Y3=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Mc=e=>e.id;function V3(e,t){return Je(e.selectedNodes.map(Mc),t.selectedNodes.map(Mc))&&Je(e.selectedEdges.map(Mc),t.selectedEdges.map(Mc))}function $3({onSelectionChange:e}){const t=tt(),{selectedNodes:n,selectedEdges:r}=He(Y3,V3);return $.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(c=>c(a))},[n,r,e]),null}const W3=e=>!!e.onSelectionChangeHandlers;function X3({onSelectionChange:e}){const t=He(W3);return e||t?N.jsx($3,{onSelectionChange:e}):null}const a1=[0,0],K3={x:0,y:0,zoom:1},G3=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],E0=[...G3,"rfId"],F3=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),M0={translateExtent:Aa,nodeOrigin:a1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Z3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:c,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:_}=He(F3,Je),h=tt();$.useEffect(()=>(_(e.defaultNodes,e.defaultEdges),()=>{p.current=M0,f()}),[]);const p=$.useRef(M0);return $.useEffect(()=>{for(const m of E0){const v=e[m],b=p.current[m];v!==b&&(typeof e[m]>"u"||(m==="nodes"?t(v):m==="edges"?n(v):m==="minZoom"?r(v):m==="maxZoom"?a(v):m==="translateExtent"?c(v):m==="nodeExtent"?u(v):m==="ariaLabelConfig"?h.setState({ariaLabelConfig:LM(v)}):m==="fitView"?h.setState({fitViewQueued:v}):m==="fitViewOptions"?h.setState({fitViewOptions:v}):h.setState({[m]:v})))}p.current=e},E0.map(m=>e[m])),null}function k0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Q3(e){var r;const[t,n]=$.useState(e==="system"?null:e);return $.useEffect(()=>{if(e!=="system"){n(e);return}const a=k0(),c=()=>n(a!=null&&a.matches?"dark":"light");return c(),a==null||a.addEventListener("change",c),()=>{a==null||a.removeEventListener("change",c)}},[e]),t!==null?t:(r=k0())!=null&&r.matches?"dark":"light"}const D0=typeof document<"u"?document:null;function La(e=null,t={target:D0,actInsideInputWithModifier:!0}){const[n,r]=$.useState(!1),a=$.useRef(!1),c=$.useRef(new Set([])),[u,f]=$.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
66
|
+
`).replace(`
|
|
67
|
+
|
|
68
|
+
`,`
|
|
69
|
+
+`).split(`
|
|
70
|
+
`)),p=h.reduce((m,v)=>m.concat(...v),[]);return[h,p]}return[[],[]]},[e]);return $.useEffect(()=>{const _=(t==null?void 0:t.target)??D0,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=b=>{var x,E;if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!h)&&jS(b))return!1;const w=A0(b.code,f);if(c.current.add(b[w]),T0(u,c.current,!1)){const L=((E=(x=b.composedPath)==null?void 0:x.call(b))==null?void 0:E[0])||b.target,C=(L==null?void 0:L.nodeName)==="BUTTON"||(L==null?void 0:L.nodeName)==="A";t.preventDefault!==!1&&(a.current||!C)&&b.preventDefault(),r(!0)}},m=b=>{const y=A0(b.code,f);T0(u,c.current,!0)?(r(!1),c.current.clear()):c.current.delete(b[y]),b.key==="Meta"&&c.current.clear(),a.current=!1},v=()=>{c.current.clear(),r(!1)};return _==null||_.addEventListener("keydown",p),_==null||_.addEventListener("keyup",m),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{_==null||_.removeEventListener("keydown",p),_==null||_.removeEventListener("keyup",m),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,r]),n}function T0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function A0(e,t){return t.includes(e)?"code":"key"}const J3=()=>{const e=tt();return $.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,c],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??c},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:c,maxZoom:u,panZoom:f}=e.getState(),_=T_(t,r,a,c,u,(n==null?void 0:n.padding)??.1);return f?(await f.setViewport(_,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:c,domNode:u}=e.getState();if(!u)return t;const{x:f,y:_}=u.getBoundingClientRect(),h={x:t.x-f,y:t.y-_},p=n.snapGrid??a,m=n.snapToGrid??c;return $a(h,r,m,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:c}=r.getBoundingClientRect(),u=tu(t,n);return{x:u.x+a,y:u.y+c}}}),[])};function l1(e,t){const n=[],r=new Map,a=[];for(const c of e)if(c.type==="add"){a.push(c);continue}else if(c.type==="remove"||c.type==="replace")r.set(c.id,[c]);else{const u=r.get(c.id);u?u.push(c):r.set(c.id,[c])}for(const c of t){const u=r.get(c.id);if(!u){n.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const f={...c};for(const _ of u)e5(_,f);n.push(f)}return a.length&&a.forEach(c=>{c.index!==void 0?n.splice(c.index,0,{...c.item}):n.push({...c.item})}),n}function e5(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function c1(e,t){return l1(e,t)}function u1(e,t){return l1(e,t)}function Wn(e,t){return{id:e,type:"select",selected:t}}function Qr(e,t=new Set,n=!1){const r=[];for(const[a,c]of e){const u=t.has(a);!(c.selected===void 0&&!u)&&c.selected!==u&&(n&&(c.selected=u),r.push(Wn(c.id,u)))}return r}function N0({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(c=>[c.id,c]));for(const[c,u]of e.entries()){const f=t.get(u.id),_=((a=f==null?void 0:f.internals)==null?void 0:a.userNode)??f;_!==void 0&&_!==u&&n.push({id:u.id,item:u,type:"replace"}),_===void 0&&n.push({item:u,type:"add",index:c})}for(const[c]of t)r.get(c)===void 0&&n.push({id:c,type:"remove"});return n}function R0(e){return{id:e.id,type:"remove"}}const B0=e=>CM(e),t5=e=>RS(e);function h1(e){return $.forwardRef(e)}const i5=typeof window<"u"?$.useLayoutEffect:$.useEffect;function L0(e){const[t,n]=$.useState(BigInt(0)),[r]=$.useState(()=>s5(()=>n(a=>a+BigInt(1))));return i5(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function s5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const f1=$.createContext(null);function n5({children:e}){const t=tt(),n=$.useCallback(f=>{const{nodes:_=[],setNodes:h,hasDefaultNodes:p,onNodesChange:m,nodeLookup:v,fitViewQueued:b,onNodesChangeMiddlewareMap:y}=t.getState();let w=_;for(const E of f)w=typeof E=="function"?E(w):E;let x=N0({items:w,lookup:v});for(const E of y.values())x=E(x);p&&h(w),x.length>0?m==null||m(x):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:L,setNodes:C}=t.getState();E&&C(L)})},[]),r=L0(n),a=$.useCallback(f=>{const{edges:_=[],setEdges:h,hasDefaultEdges:p,onEdgesChange:m,edgeLookup:v}=t.getState();let b=_;for(const y of f)b=typeof y=="function"?y(b):y;p?h(b):m&&m(N0({items:b,lookup:v}))},[]),c=L0(a),u=$.useMemo(()=>({nodeQueue:r,edgeQueue:c}),[]);return N.jsx(f1.Provider,{value:u,children:e})}function r5(){const e=$.useContext(f1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const o5=e=>!!e.panZoom;function Su(){const e=J3(),t=tt(),n=r5(),r=He(o5),a=$.useMemo(()=>{const c=m=>t.getState().nodeLookup.get(m),u=m=>{n.nodeQueue.push(m)},f=m=>{n.edgeQueue.push(m)},_=m=>{var E,L;const{nodeLookup:v,nodeOrigin:b}=t.getState(),y=B0(m)?m:v.get(m.id),w=y.parentId?US(y.position,y.measured,y.parentId,v,b):y.position,x={...y,position:w,width:((E=y.measured)==null?void 0:E.width)??y.width,height:((L=y.measured)==null?void 0:L.height)??y.height};return oo(x)},h=(m,v,b={replace:!1})=>{u(y=>y.map(w=>{if(w.id===m){const x=typeof v=="function"?v(w):v;return b.replace&&B0(x)?x:{...w,...x}}return w}))},p=(m,v,b={replace:!1})=>{f(y=>y.map(w=>{if(w.id===m){const x=typeof v=="function"?v(w):v;return b.replace&&t5(x)?x:{...w,...x}}return w}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>{var v;return(v=c(m))==null?void 0:v.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(v=>({...v}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const v=Array.isArray(m)?m:[m];n.nodeQueue.push(b=>[...b,...v])},addEdges:m=>{const v=Array.isArray(m)?m:[m];n.edgeQueue.push(b=>[...b,...v])},toObject:()=>{const{nodes:m=[],edges:v=[],transform:b}=t.getState(),[y,w,x]=b;return{nodes:m.map(E=>({...E})),edges:v.map(E=>({...E})),viewport:{x:y,y:w,zoom:x}}},deleteElements:async({nodes:m=[],edges:v=[]})=>{const{nodes:b,edges:y,onNodesDelete:w,onEdgesDelete:x,triggerNodeChanges:E,triggerEdgeChanges:L,onDelete:C,onBeforeDelete:D}=t.getState(),{nodes:I,edges:z}=await TM({nodesToRemove:m,edgesToRemove:v,nodes:b,edges:y,onBeforeDelete:D}),P=z.length>0,W=I.length>0;if(P){const G=z.map(R0);x==null||x(z),L(G)}if(W){const G=I.map(R0);w==null||w(I),E(G)}return(W||P)&&(C==null||C({nodes:I,edges:z})),{deletedNodes:I,deletedEdges:z}},getIntersectingNodes:(m,v=!0,b)=>{const y=r0(m),w=y?m:_(m),x=b!==void 0;return w?(b||t.getState().nodes).filter(E=>{const L=t.getState().nodeLookup.get(E.id);if(L&&!y&&(E.id===m.id||!L.internals.positionAbsolute))return!1;const C=oo(x?E:L),D=Ra(C,w);return v&&D>0||D>=C.width*C.height||D>=w.width*w.height}):[]},isNodeIntersecting:(m,v,b=!0)=>{const w=r0(m)?m:_(m);if(!w)return!1;const x=Ra(w,v);return b&&x>0||x>=v.width*v.height||x>=w.width*w.height},updateNode:h,updateNodeData:(m,v,b={replace:!1})=>{h(m,y=>{const w=typeof v=="function"?v(y):v;return b.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},b)},updateEdge:p,updateEdgeData:(m,v,b={replace:!1})=>{p(m,y=>{const w=typeof v=="function"?v(y):v;return b.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},b)},getNodesBounds:m=>{const{nodeLookup:v,nodeOrigin:b}=t.getState();return EM(m,{nodeLookup:v,nodeOrigin:b})},getHandleConnections:({type:m,id:v,nodeId:b})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${b}-${m}${v?`-${v}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:m,handleId:v,nodeId:b})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${b}${m?v?`-${m}-${v}`:`-${m}`:""}`))==null?void 0:y.values())??[])},fitView:async m=>{const v=t.getState().fitViewResolver??BM();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:v}),n.nodeQueue.push(b=>[...b]),v.promise}}},[]);return $.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const z0=e=>e.selected,a5=typeof window<"u"?window:void 0;function l5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=tt(),{deleteElements:r}=Su(),a=La(e,{actInsideInputWithModifier:!1}),c=La(t,{target:a5});$.useEffect(()=>{if(a){const{edges:u,nodes:f}=n.getState();r({nodes:f.filter(z0),edges:u.filter(z0)}),n.setState({nodesSelectionActive:!1})}},[a]),$.useEffect(()=>{n.setState({multiSelectionActive:c})},[c])}function c5(e){const t=tt();$.useEffect(()=>{const n=()=>{var a,c,u,f;if(!e.current||!(((c=(a=e.current).checkVisibility)==null?void 0:c.call(a))??!0))return!1;const r=A_(e.current);(r.height===0||r.width===0)&&((f=(u=t.getState()).onError)==null||f.call(u,"004",Qi.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const bu={position:"absolute",width:"100%",height:"100%",top:0,left:0},u5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function h5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=Qn.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:_,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:v,preventScrolling:b=!0,children:y,noWheelClassName:w,noPanClassName:x,onViewportChange:E,isControlledViewport:L,paneClickDistance:C,selectionOnDrag:D}){const I=tt(),z=$.useRef(null),{userSelectionActive:P,lib:W,connectionInProgress:G}=He(u5,Je),ae=La(v),X=$.useRef();c5(z);const q=$.useCallback(Y=>{E==null||E({x:Y[0],y:Y[1],zoom:Y[2]}),L||I.setState({transform:Y})},[E,L]);return $.useEffect(()=>{if(z.current){X.current=m3({domNode:z.current,minZoom:p,maxZoom:m,translateExtent:h,viewport:_,onDraggingChange:M=>I.setState({paneDragging:M}),onPanZoomStart:(M,B)=>{const{onViewportChangeStart:R,onMoveStart:U}=I.getState();U==null||U(M,B),R==null||R(B)},onPanZoom:(M,B)=>{const{onViewportChange:R,onMove:U}=I.getState();U==null||U(M,B),R==null||R(B)},onPanZoomEnd:(M,B)=>{const{onViewportChangeEnd:R,onMoveEnd:U}=I.getState();U==null||U(M,B),R==null||R(B)}});const{x:Y,y:A,zoom:H}=X.current.getViewport();return I.setState({panZoom:X.current,transform:[Y,A,H],domNode:z.current.closest(".react-flow")}),()=>{var M;(M=X.current)==null||M.destroy()}}},[]),$.useEffect(()=>{var Y;(Y=X.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:ae,preventScrolling:b,noPanClassName:x,userSelectionActive:P,noWheelClassName:w,lib:W,onTransformChange:q,connectionInProgress:G,selectionOnDrag:D,paneClickDistance:C})},[e,t,n,r,a,c,u,f,ae,b,x,P,w,W,q,G,D,C]),N.jsx("div",{className:"react-flow__renderer",ref:z,style:bu,children:y})}const f5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function d5(){const{userSelectionActive:e,userSelectionRect:t}=He(f5,Je);return e&&t?N.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ld=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},_5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function g5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Na.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:u,onSelectionEnd:f,onPaneClick:_,onPaneContextMenu:h,onPaneScroll:p,onPaneMouseEnter:m,onPaneMouseMove:v,onPaneMouseLeave:b,children:y}){const w=tt(),{userSelectionActive:x,elementsSelectable:E,dragging:L,connectionInProgress:C}=He(_5,Je),D=E&&(e||x),I=$.useRef(null),z=$.useRef(),P=$.useRef(new Set),W=$.useRef(new Set),G=$.useRef(!1),ae=R=>{if(G.current||C){G.current=!1;return}_==null||_(R),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},X=R=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){R.preventDefault();return}h==null||h(R)},q=p?R=>p(R):void 0,Y=R=>{G.current&&(R.stopPropagation(),G.current=!1)},A=R=>{var le,ce;const{domNode:U}=w.getState();if(z.current=U==null?void 0:U.getBoundingClientRect(),!z.current)return;const Q=R.target===I.current;if(!Q&&!!R.target.closest(".nokey")||!e||!(c&&Q||t)||R.button!==0||!R.isPrimary)return;(ce=(le=R.target)==null?void 0:le.setPointerCapture)==null||ce.call(le,R.pointerId),G.current=!1;const{x:ee,y:te}=Hi(R.nativeEvent,z.current);w.setState({userSelectionRect:{width:0,height:0,startX:ee,startY:te,x:ee,y:te}}),Q||(R.stopPropagation(),R.preventDefault())},H=R=>{const{userSelectionRect:U,transform:Q,nodeLookup:T,edgeLookup:j,connectionLookup:ee,triggerNodeChanges:te,triggerEdgeChanges:le,defaultEdgeOptions:ce,resetSelectedElements:he}=w.getState();if(!z.current||!U)return;const{x:ue,y:_e}=Hi(R.nativeEvent,z.current),{startX:xe,startY:be}=U;if(!G.current){const Be=t?0:a;if(Math.hypot(ue-xe,_e-be)<=Be)return;he(),u==null||u(R)}G.current=!0;const pe={startX:xe,startY:be,x:ue<xe?ue:xe,y:_e<be?_e:be,width:Math.abs(ue-xe),height:Math.abs(_e-be)},de=P.current,Me=W.current;P.current=new Set(D_(T,pe,Q,n===Na.Partial,!0).map(Be=>Be.id)),W.current=new Set;const qe=(ce==null?void 0:ce.selectable)??!0;for(const Be of P.current){const Ct=ee.get(Be);if(Ct)for(const{edgeId:ki}of Ct.values()){const si=j.get(ki);si&&(si.selectable??qe)&&W.current.add(ki)}}if(!o0(de,P.current)){const Be=Qr(T,P.current,!0);te(Be)}if(!o0(Me,W.current)){const Be=Qr(j,W.current);le(Be)}w.setState({userSelectionRect:pe,userSelectionActive:!0,nodesSelectionActive:!1})},M=R=>{var U,Q;R.button===0&&((Q=(U=R.target)==null?void 0:U.releasePointerCapture)==null||Q.call(U,R.pointerId),!x&&R.target===I.current&&w.getState().userSelectionRect&&(ae==null||ae(R)),w.setState({userSelectionActive:!1,userSelectionRect:null}),G.current&&(f==null||f(R),w.setState({nodesSelectionActive:P.current.size>0})))},B=r===!0||Array.isArray(r)&&r.includes(0);return N.jsxs("div",{className:vt(["react-flow__pane",{draggable:B,dragging:L,selection:e}]),onClick:D?void 0:ld(ae,I),onContextMenu:ld(X,I),onWheel:ld(q,I),onPointerEnter:D?void 0:m,onPointerMove:D?H:v,onPointerUp:D?M:void 0,onPointerDownCapture:D?A:void 0,onClickCapture:D?Y:void 0,onPointerLeave:b,ref:I,style:bu,children:[y,N.jsx(d5,{})]})}function Od({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:f,onError:_}=t.getState(),h=f.get(e);if(!h){_==null||_("012",Qi.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&u)&&(c({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function d1({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:c,nodeClickDistance:u}){const f=tt(),[_,h]=$.useState(!1),p=$.useRef();return $.useEffect(()=>{p.current=i3({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{Od({id:m,store:f,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),$.useEffect(()=>{var m,v;if(t)(m=p.current)==null||m.destroy();else if(e.current)return(v=p.current)==null||v.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:c,nodeId:a,nodeClickDistance:u}),()=>{var b;(b=p.current)==null||b.destroy()}},[n,r,t,c,e,a]),_}const m5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function _1(){const e=tt();return $.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:c,nodesDraggable:u,onError:f,updateNodePositions:_,nodeLookup:h,nodeOrigin:p}=e.getState(),m=new Map,v=m5(u),b=a?c[0]:5,y=a?c[1]:5,w=n.direction.x*b*n.factor,x=n.direction.y*y*n.factor;for(const[,E]of h){if(!v(E))continue;let L={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+x};a&&(L=Va(L,c));const{position:C,positionAbsolute:D}=BS({nodeId:E.id,nextPosition:L,nodeLookup:h,nodeExtent:r,nodeOrigin:p,onError:f});E.position=C,E.internals.positionAbsolute=D,m.set(E.id,E)}_(m)},[])}const O_=$.createContext(null),p5=O_.Provider;O_.Consumer;const g1=()=>$.useContext(O_),v5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),y5=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:c,connection:u}=r,{fromHandle:f,toHandle:_,isValid:h}=u,p=(_==null?void 0:_.nodeId)===e&&(_==null?void 0:_.id)===t&&(_==null?void 0:_.type)===n;return{connectingFrom:(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:c===no.Strict?(f==null?void 0:f.type)!==n:e!==(f==null?void 0:f.nodeId)||t!==(f==null?void 0:f.id),connectionInProcess:!!f,clickConnectionInProcess:!!a,valid:p&&h}};function S5({type:e="source",position:t=ye.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:c=!0,id:u,onConnect:f,children:_,className:h,onMouseDown:p,onTouchStart:m,...v},b){var H,M;const y=u||null,w=e==="target",x=tt(),E=g1(),{connectOnClick:L,noPanClassName:C,rfId:D}=He(v5,Je),{connectingFrom:I,connectingTo:z,clickConnecting:P,isPossibleEndHandle:W,connectionInProcess:G,clickConnectionInProcess:ae,valid:X}=He(y5(E,y,e),Je);E||(M=(H=x.getState()).onError)==null||M.call(H,"010",Qi.error010());const q=B=>{const{defaultEdgeOptions:R,onConnect:U,hasDefaultEdges:Q}=x.getState(),T={...R,...B};if(Q){const{edges:j,setEdges:ee}=x.getState();ee(jM(T,j))}U==null||U(T),f==null||f(T)},Y=B=>{if(!E)return;const R=qS(B.nativeEvent);if(a&&(R&&B.button===0||!R)){const U=x.getState();zd.onPointerDown(B.nativeEvent,{handleDomNode:B.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:w,handleId:y,nodeId:E,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:U.onConnectEnd,updateConnection:U.updateConnection,onConnect:q,isValidConnection:n||U.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}R?p==null||p(B):m==null||m(B)},A=B=>{const{onClickConnectStart:R,onClickConnectEnd:U,connectionClickStartHandle:Q,connectionMode:T,isValidConnection:j,lib:ee,rfId:te,nodeLookup:le,connection:ce}=x.getState();if(!E||!Q&&!a)return;if(!Q){R==null||R(B.nativeEvent,{nodeId:E,handleId:y,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:E,type:e,id:y}});return}const he=PS(B.target),ue=n||j,{connection:_e,isValid:xe}=zd.isValid(B.nativeEvent,{handle:{nodeId:E,id:y,type:e},connectionMode:T,fromNodeId:Q.nodeId,fromHandleId:Q.id||null,fromType:Q.type,isValidConnection:ue,flowId:te,doc:he,lib:ee,nodeLookup:le});xe&&_e&&q(_e);const be=structuredClone(ce);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,U==null||U(B,be),x.setState({connectionClickStartHandle:null})};return N.jsx("div",{"data-handleid":y,"data-nodeid":E,"data-handlepos":t,"data-id":`${D}-${E}-${y}-${e}`,className:vt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,h,{source:!w,target:w,connectable:r,connectablestart:a,connectableend:c,clickconnecting:P,connectingfrom:I,connectingto:z,valid:X,connectionindicator:r&&(!G||W)&&(G||ae?c:a)}]),onMouseDown:Y,onTouchStart:Y,onClick:L?A:void 0,ref:b,...v,children:_})}const yn=$.memo(h1(S5));function b5({data:e,isConnectable:t,sourcePosition:n=ye.Bottom}){return N.jsxs(N.Fragment,{children:[e==null?void 0:e.label,N.jsx(yn,{type:"source",position:n,isConnectable:t})]})}function w5({data:e,isConnectable:t,targetPosition:n=ye.Top,sourcePosition:r=ye.Bottom}){return N.jsxs(N.Fragment,{children:[N.jsx(yn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,N.jsx(yn,{type:"source",position:r,isConnectable:t})]})}function x5(){return null}function C5({data:e,isConnectable:t,targetPosition:n=ye.Top}){return N.jsxs(N.Fragment,{children:[N.jsx(yn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const iu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},O0={input:b5,default:w5,output:C5,group:x5};function E5(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const M5=e=>{const{width:t,height:n,x:r,y:a}=Ya(e.nodeLookup,{filter:c=>!!c.selected});return{width:Oi(t)?t:null,height:Oi(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function k5({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=tt(),{width:a,height:c,transformString:u,userSelectionActive:f}=He(M5,Je),_=_1(),h=$.useRef(null);if($.useEffect(()=>{var v;n||(v=h.current)==null||v.focus({preventScroll:!0})},[n]),d1({nodeRef:h}),f||!a||!c)return null;const p=e?v=>{const b=r.getState().nodes.filter(y=>y.selected);e(v,b)}:void 0,m=v=>{Object.prototype.hasOwnProperty.call(iu,v.key)&&(v.preventDefault(),_({direction:iu[v.key],factor:v.shiftKey?4:1}))};return N.jsx("div",{className:vt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:N.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:c}})})}const H0=typeof window<"u"?window:void 0,D5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function m1({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:_,selectionKeyCode:h,selectionOnDrag:p,selectionMode:m,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:x,elementsSelectable:E,zoomOnScroll:L,zoomOnPinch:C,panOnScroll:D,panOnScrollSpeed:I,panOnScrollMode:z,zoomOnDoubleClick:P,panOnDrag:W,defaultViewport:G,translateExtent:ae,minZoom:X,maxZoom:q,preventScrolling:Y,onSelectionContextMenu:A,noWheelClassName:H,noPanClassName:M,disableKeyboardA11y:B,onViewportChange:R,isControlledViewport:U}){const{nodesSelectionActive:Q,userSelectionActive:T}=He(D5,Je),j=La(h,{target:H0}),ee=La(w,{target:H0}),te=ee||W,le=ee||D,ce=p&&te!==!0,he=j||T||ce;return l5({deleteKeyCode:_,multiSelectionKeyCode:y}),N.jsx(h5,{onPaneContextMenu:c,elementsSelectable:E,zoomOnScroll:L,zoomOnPinch:C,panOnScroll:le,panOnScrollSpeed:I,panOnScrollMode:z,zoomOnDoubleClick:P,panOnDrag:!j&&te,defaultViewport:G,translateExtent:ae,minZoom:X,maxZoom:q,zoomActivationKeyCode:x,preventScrolling:Y,noWheelClassName:H,noPanClassName:M,onViewportChange:R,isControlledViewport:U,paneClickDistance:f,selectionOnDrag:ce,children:N.jsxs(g5,{onSelectionStart:v,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:te,isSelecting:!!he,selectionMode:m,selectionKeyPressed:j,paneClickDistance:f,selectionOnDrag:ce,children:[e,Q&&N.jsx(k5,{onSelectionContextMenu:A,noPanClassName:M,disableKeyboardA11y:B})]})})}m1.displayName="FlowRenderer";const T5=$.memo(m1),A5=e=>t=>e?D_(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function N5(e){return He($.useCallback(A5(e),[e]),Je)}const R5=e=>e.updateNodeInternals;function B5(){const e=He(R5),[t]=$.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const c=a.target.getAttribute("data-id");r.set(c,{id:c,nodeElement:a.target,force:!0})}),e(r)}));return $.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function L5({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=tt(),c=$.useRef(null),u=$.useRef(null),f=$.useRef(e.sourcePosition),_=$.useRef(e.targetPosition),h=$.useRef(t),p=n&&!!e.internals.handleBounds;return $.useEffect(()=>{c.current&&!e.hidden&&(!p||u.current!==c.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(c.current),u.current=c.current)},[p,e.hidden]),$.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),$.useEffect(()=>{if(c.current){const m=h.current!==t,v=f.current!==e.sourcePosition,b=_.current!==e.targetPosition;(m||v||b)&&(h.current=t,f.current=e.sourcePosition,_.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),c}function z5({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:c,onDoubleClick:u,nodesDraggable:f,elementsSelectable:_,nodesConnectable:h,nodesFocusable:p,resizeObserver:m,noDragClassName:v,noPanClassName:b,disableKeyboardA11y:y,rfId:w,nodeTypes:x,nodeClickDistance:E,onError:L}){const{node:C,internals:D,isParent:I}=He(ue=>{const _e=ue.nodeLookup.get(e),xe=ue.parentLookup.has(e);return{node:_e,internals:_e.internals,isParent:xe}},Je);let z=C.type||"default",P=(x==null?void 0:x[z])||O0[z];P===void 0&&(L==null||L("003",Qi.error003(z)),z="default",P=(x==null?void 0:x.default)||O0.default);const W=!!(C.draggable||f&&typeof C.draggable>"u"),G=!!(C.selectable||_&&typeof C.selectable>"u"),ae=!!(C.connectable||h&&typeof C.connectable>"u"),X=!!(C.focusable||p&&typeof C.focusable>"u"),q=tt(),Y=HS(C),A=L5({node:C,nodeType:z,hasDimensions:Y,resizeObserver:m}),H=d1({nodeRef:A,disabled:C.hidden||!W,noDragClassName:v,handleSelector:C.dragHandle,nodeId:e,isSelectable:G,nodeClickDistance:E}),M=_1();if(C.hidden)return null;const B=As(C),R=E5(C),U=G||W||t||n||r||a,Q=n?ue=>n(ue,{...D.userNode}):void 0,T=r?ue=>r(ue,{...D.userNode}):void 0,j=a?ue=>a(ue,{...D.userNode}):void 0,ee=c?ue=>c(ue,{...D.userNode}):void 0,te=u?ue=>u(ue,{...D.userNode}):void 0,le=ue=>{const{selectNodesOnDrag:_e,nodeDragThreshold:xe}=q.getState();G&&(!_e||!W||xe>0)&&Od({id:e,store:q,nodeRef:A}),t&&t(ue,{...D.userNode})},ce=ue=>{if(!(jS(ue.nativeEvent)||y)){if(DS.includes(ue.key)&&G){const _e=ue.key==="Escape";Od({id:e,store:q,unselect:_e,nodeRef:A})}else if(W&&C.selected&&Object.prototype.hasOwnProperty.call(iu,ue.key)){ue.preventDefault();const{ariaLabelConfig:_e}=q.getState();q.setState({ariaLiveMessage:_e["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~D.positionAbsolute.x,y:~~D.positionAbsolute.y})}),M({direction:iu[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{var Me;if(y||!((Me=A.current)!=null&&Me.matches(":focus-visible")))return;const{transform:ue,width:_e,height:xe,autoPanOnNodeFocus:be,setCenter:pe}=q.getState();if(!be)return;D_(new Map([[e,C]]),{x:0,y:0,width:_e,height:xe},ue,!0).length>0||pe(C.position.x+B.width/2,C.position.y+B.height/2,{zoom:ue[2]})};return N.jsx("div",{className:vt(["react-flow__node",`react-flow__node-${z}`,{[b]:W},C.className,{selected:C.selected,selectable:G,parent:I,draggable:W,dragging:H}]),ref:A,style:{zIndex:D.z,transform:`translate(${D.positionAbsolute.x}px,${D.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:Y?"visible":"hidden",...C.style,...R},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Q,onMouseMove:T,onMouseLeave:j,onContextMenu:ee,onClick:le,onDoubleClick:te,onKeyDown:X?ce:void 0,tabIndex:X?0:void 0,onFocus:X?he:void 0,role:C.ariaRole??(X?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${r1}-${w}`,"aria-label":C.ariaLabel,...C.domAttributes,children:N.jsx(p5,{value:e,children:N.jsx(P,{id:e,data:C.data,type:z,positionAbsoluteX:D.positionAbsolute.x,positionAbsoluteY:D.positionAbsolute.y,selected:C.selected??!1,selectable:G,draggable:W,deletable:C.deletable??!0,isConnectable:ae,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:H,dragHandle:C.dragHandle,zIndex:D.z,parentId:C.parentId,...B})})})}var O5=$.memo(z5);const H5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function p1(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:c}=He(H5,Je),u=N5(e.onlyRenderVisibleElements),f=B5();return N.jsx("div",{className:"react-flow__nodes",style:bu,children:u.map(_=>N.jsx(O5,{id:_,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:c},_))})}p1.displayName="NodeRenderer";const U5=$.memo(p1);function P5(e){return He($.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const c=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);c&&u&&HM({sourceNode:c,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Je)}const j5=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return N.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},q5=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return N.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},U0={[Jc.Arrow]:j5,[Jc.ArrowClosed]:q5};function I5(e){const t=tt();return $.useMemo(()=>{var a,c;return Object.prototype.hasOwnProperty.call(U0,e)?U0[e]:((c=(a=t.getState()).onError)==null||c.call(a,"009",Qi.error009(e)),null)},[e])}const Y5=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const _=I5(t);return _?N.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:f,refX:"0",refY:"0",children:N.jsx(_,{color:n,strokeWidth:u})}):null},v1=({defaultColor:e,rfId:t})=>{const n=He(c=>c.edges),r=He(c=>c.defaultEdgeOptions),a=$.useMemo(()=>$M(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?N.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:N.jsx("defs",{children:a.map(c=>N.jsx(Y5,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};v1.displayName="MarkerDefinitions";var V5=$.memo(v1);function y1({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:_,className:h,...p}){const[m,v]=$.useState({x:1,y:0,width:0,height:0}),b=vt(["react-flow__edge-textwrapper",h]),y=$.useRef(null);return $.useEffect(()=>{if(y.current){const w=y.current.getBBox();v({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?N.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...p,children:[a&&N.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:f,ry:f}),N.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:y,style:r,children:n}),_]}):null}y1.displayName="EdgeText";const $5=$.memo(y1);function wu({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:_,interactionWidth:h=20,...p}){return N.jsxs(N.Fragment,{children:[N.jsx("path",{...p,d:e,fill:"none",className:vt(["react-flow__edge-path",p.className])}),h?N.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&Oi(t)&&Oi(n)?N.jsx($5,{x:t,y:n,label:r,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:_}):null]})}function P0({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===ye.Left||e===ye.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function S1({sourceX:e,sourceY:t,sourcePosition:n=ye.Bottom,targetX:r,targetY:a,targetPosition:c=ye.Top}){const[u,f]=P0({pos:n,x1:e,y1:t,x2:r,y2:a}),[_,h]=P0({pos:c,x1:r,y1:a,x2:e,y2:t}),[p,m,v,b]=IS({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:_,targetControlY:h});return[`M${e},${t} C${u},${f} ${_},${h} ${r},${a}`,p,m,v,b]}function b1(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:c,sourcePosition:u,targetPosition:f,label:_,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:b,style:y,markerEnd:w,markerStart:x,interactionWidth:E})=>{const[L,C,D]=S1({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:c,targetPosition:f}),I=e.isInternal?void 0:t;return N.jsx(wu,{id:I,path:L,labelX:C,labelY:D,label:_,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:b,style:y,markerEnd:w,markerStart:x,interactionWidth:E})})}const W5=b1({isInternal:!1}),w1=b1({isInternal:!0});W5.displayName="SimpleBezierEdge";w1.displayName="SimpleBezierEdgeInternal";function x1(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:c,label:u,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:v,sourcePosition:b=ye.Bottom,targetPosition:y=ye.Top,markerEnd:w,markerStart:x,pathOptions:E,interactionWidth:L})=>{const[C,D,I]=Rd({sourceX:n,sourceY:r,sourcePosition:b,targetX:a,targetY:c,targetPosition:y,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),z=e.isInternal?void 0:t;return N.jsx(wu,{id:z,path:C,labelX:D,labelY:I,label:u,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:v,markerEnd:w,markerStart:x,interactionWidth:L})})}const C1=x1({isInternal:!1}),E1=x1({isInternal:!0});C1.displayName="SmoothStepEdge";E1.displayName="SmoothStepEdgeInternal";function M1(e){return $.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return N.jsx(C1,{...n,id:r,pathOptions:$.useMemo(()=>{var c;return{borderRadius:0,offset:(c=n.pathOptions)==null?void 0:c.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const X5=M1({isInternal:!1}),k1=M1({isInternal:!0});X5.displayName="StepEdge";k1.displayName="StepEdgeInternal";function D1(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:c,label:u,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:v,markerEnd:b,markerStart:y,interactionWidth:w})=>{const[x,E,L]=$S({sourceX:n,sourceY:r,targetX:a,targetY:c}),C=e.isInternal?void 0:t;return N.jsx(wu,{id:C,path:x,labelX:E,labelY:L,label:u,labelStyle:f,labelShowBg:_,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:v,markerEnd:b,markerStart:y,interactionWidth:w})})}const K5=D1({isInternal:!1}),T1=D1({isInternal:!0});K5.displayName="StraightEdge";T1.displayName="StraightEdgeInternal";function A1(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:c,sourcePosition:u=ye.Bottom,targetPosition:f=ye.Top,label:_,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:b,style:y,markerEnd:w,markerStart:x,pathOptions:E,interactionWidth:L})=>{const[C,D,I]=YS({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:c,targetPosition:f,curvature:E==null?void 0:E.curvature}),z=e.isInternal?void 0:t;return N.jsx(wu,{id:z,path:C,labelX:D,labelY:I,label:_,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:v,labelBgBorderRadius:b,style:y,markerEnd:w,markerStart:x,interactionWidth:L})})}const G5=A1({isInternal:!1}),N1=A1({isInternal:!0});G5.displayName="BezierEdge";N1.displayName="BezierEdgeInternal";const j0={default:N1,straight:T1,step:k1,smoothstep:E1,simplebezier:w1},q0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},F5=(e,t,n)=>n===ye.Left?e-t:n===ye.Right?e+t:e,Z5=(e,t,n)=>n===ye.Top?e-t:n===ye.Bottom?e+t:e,I0="react-flow__edgeupdater";function Y0({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:c,onMouseOut:u,type:f}){return N.jsx("circle",{onMouseDown:a,onMouseEnter:c,onMouseOut:u,className:vt([I0,`${I0}-${f}`]),cx:F5(t,r,e),cy:Z5(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Q5({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:c,targetY:u,sourcePosition:f,targetPosition:_,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,setReconnecting:v,setUpdateHover:b}){const y=tt(),w=(D,I)=>{if(D.button!==0)return;const{autoPanOnConnect:z,domNode:P,isValidConnection:W,connectionMode:G,connectionRadius:ae,lib:X,onConnectStart:q,onConnectEnd:Y,cancelConnection:A,nodeLookup:H,rfId:M,panBy:B,updateConnection:R}=y.getState(),U=I.type==="target",Q=(ee,te)=>{v(!1),m==null||m(ee,n,I.type,te)},T=ee=>h==null?void 0:h(n,ee),j=(ee,te)=>{v(!0),p==null||p(D,n,I.type),q==null||q(ee,te)};zd.onPointerDown(D.nativeEvent,{autoPanOnConnect:z,connectionMode:G,connectionRadius:ae,domNode:P,handleId:I.id,nodeId:I.nodeId,nodeLookup:H,isTarget:U,edgeUpdaterType:I.type,lib:X,flowId:M,cancelConnection:A,panBy:B,isValidConnection:W,onConnect:T,onConnectStart:j,onConnectEnd:Y,onReconnectEnd:Q,updateConnection:R,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:D.currentTarget})},x=D=>w(D,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=D=>w(D,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),L=()=>b(!0),C=()=>b(!1);return N.jsxs(N.Fragment,{children:[(e===!0||e==="source")&&N.jsx(Y0,{position:f,centerX:r,centerY:a,radius:t,onMouseDown:x,onMouseEnter:L,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&N.jsx(Y0,{position:_,centerX:c,centerY:u,radius:t,onMouseDown:E,onMouseEnter:L,onMouseOut:C,type:"target"})]})}function J5({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:c,onContextMenu:u,onMouseEnter:f,onMouseMove:_,onMouseLeave:h,reconnectRadius:p,onReconnect:m,onReconnectStart:v,onReconnectEnd:b,rfId:y,edgeTypes:w,noPanClassName:x,onError:E,disableKeyboardA11y:L}){let C=He(pe=>pe.edgeLookup.get(e));const D=He(pe=>pe.defaultEdgeOptions);C=D?{...D,...C}:C;let I=C.type||"default",z=(w==null?void 0:w[I])||j0[I];z===void 0&&(E==null||E("011",Qi.error011(I)),I="default",z=(w==null?void 0:w.default)||j0.default);const P=!!(C.focusable||t&&typeof C.focusable>"u"),W=typeof m<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),G=!!(C.selectable||r&&typeof C.selectable>"u"),ae=$.useRef(null),[X,q]=$.useState(!1),[Y,A]=$.useState(!1),H=tt(),{zIndex:M,sourceX:B,sourceY:R,targetX:U,targetY:Q,sourcePosition:T,targetPosition:j}=He($.useCallback(pe=>{const de=pe.nodeLookup.get(C.source),Me=pe.nodeLookup.get(C.target);if(!de||!Me)return{zIndex:C.zIndex,...q0};const qe=VM({id:e,sourceNode:de,targetNode:Me,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:pe.connectionMode,onError:E});return{zIndex:OM({selected:C.selected,zIndex:C.zIndex,sourceNode:de,targetNode:Me,elevateOnSelect:pe.elevateEdgesOnSelect,zIndexMode:pe.zIndexMode}),...qe||q0}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),Je),ee=$.useMemo(()=>C.markerStart?`url('#${Bd(C.markerStart,y)}')`:void 0,[C.markerStart,y]),te=$.useMemo(()=>C.markerEnd?`url('#${Bd(C.markerEnd,y)}')`:void 0,[C.markerEnd,y]);if(C.hidden||B===null||R===null||U===null||Q===null)return null;const le=pe=>{var Be;const{addSelectedEdges:de,unselectNodesAndEdges:Me,multiSelectionActive:qe}=H.getState();G&&(H.setState({nodesSelectionActive:!1}),C.selected&&qe?(Me({nodes:[],edges:[C]}),(Be=ae.current)==null||Be.blur()):de([e])),a&&a(pe,C)},ce=c?pe=>{c(pe,{...C})}:void 0,he=u?pe=>{u(pe,{...C})}:void 0,ue=f?pe=>{f(pe,{...C})}:void 0,_e=_?pe=>{_(pe,{...C})}:void 0,xe=h?pe=>{h(pe,{...C})}:void 0,be=pe=>{var de;if(!L&&DS.includes(pe.key)&&G){const{unselectNodesAndEdges:Me,addSelectedEdges:qe}=H.getState();pe.key==="Escape"?((de=ae.current)==null||de.blur(),Me({edges:[C]})):qe([e])}};return N.jsx("svg",{style:{zIndex:M},children:N.jsxs("g",{className:vt(["react-flow__edge",`react-flow__edge-${I}`,C.className,x,{selected:C.selected,animated:C.animated,inactive:!G&&!a,updating:X,selectable:G}]),onClick:le,onDoubleClick:ce,onContextMenu:he,onMouseEnter:ue,onMouseMove:_e,onMouseLeave:xe,onKeyDown:P?be:void 0,tabIndex:P?0:void 0,role:C.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":P?`${o1}-${y}`:void 0,ref:ae,...C.domAttributes,children:[!Y&&N.jsx(z,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:G,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:B,sourceY:R,targetX:U,targetY:Q,sourcePosition:T,targetPosition:j,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:ee,markerEnd:te,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),W&&N.jsx(Q5,{edge:C,isReconnectable:W,reconnectRadius:p,onReconnect:m,onReconnectStart:v,onReconnectEnd:b,sourceX:B,sourceY:R,targetX:U,targetY:Q,sourcePosition:T,targetPosition:j,setUpdateHover:q,setReconnecting:A})]})})}var ek=$.memo(J5);const tk=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function R1({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:_,onEdgeMouseLeave:h,onEdgeClick:p,reconnectRadius:m,onEdgeDoubleClick:v,onReconnectStart:b,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:x,edgesReconnectable:E,elementsSelectable:L,onError:C}=He(tk,Je),D=P5(t);return N.jsxs("div",{className:"react-flow__edges",children:[N.jsx(V5,{defaultColor:e,rfId:n}),D.map(I=>N.jsx(ek,{id:I,edgesFocusable:x,edgesReconnectable:E,elementsSelectable:L,noPanClassName:a,onReconnect:c,onContextMenu:u,onMouseEnter:f,onMouseMove:_,onMouseLeave:h,onClick:p,reconnectRadius:m,onDoubleClick:v,onReconnectStart:b,onReconnectEnd:y,rfId:n,onError:C,edgeTypes:r,disableKeyboardA11y:w},I))]})}R1.displayName="EdgeRenderer";const ik=$.memo(R1),sk=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function nk({children:e}){const t=He(sk);return N.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function rk(e){const t=Su(),n=$.useRef(!1);$.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ok=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function ak(e){const t=He(ok),n=tt();return $.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function lk(e){return e.connection.inProgress?{...e.connection,to:$a(e.connection.to,e.transform)}:{...e.connection}}function ck(e){return lk}function uk(e){const t=ck();return He(t,Je)}const hk=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function fk({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:c,height:u,isValid:f,inProgress:_}=He(hk,Je);return!(c&&a&&_)?null:N.jsx("svg",{style:e,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:N.jsx("g",{className:vt(["react-flow__connection",NS(f)]),children:N.jsx(B1,{style:t,type:n,CustomComponent:r,isValid:f})})})}const B1=({style:e,type:t=mn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:c,fromNode:u,fromHandle:f,fromPosition:_,to:h,toNode:p,toHandle:m,toPosition:v,pointer:b}=uk();if(!a)return;if(n)return N.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:c.x,fromY:c.y,toX:h.x,toY:h.y,fromPosition:_,toPosition:v,connectionStatus:NS(r),toNode:p,toHandle:m,pointer:b});let y="";const w={sourceX:c.x,sourceY:c.y,sourcePosition:_,targetX:h.x,targetY:h.y,targetPosition:v};switch(t){case mn.Bezier:[y]=YS(w);break;case mn.SimpleBezier:[y]=S1(w);break;case mn.Step:[y]=Rd({...w,borderRadius:0});break;case mn.SmoothStep:[y]=Rd(w);break;default:[y]=$S(w)}return N.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};B1.displayName="ConnectionLine";const dk={};function V0(e=dk){$.useRef(e),tt(),$.useEffect(()=>{},[e])}function _k(){tt(),$.useRef(!1),$.useEffect(()=>{},[])}function L1({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:_,onNodeMouseLeave:h,onNodeContextMenu:p,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:b,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:E,selectionKeyCode:L,selectionOnDrag:C,selectionMode:D,multiSelectionKeyCode:I,panActivationKeyCode:z,zoomActivationKeyCode:P,deleteKeyCode:W,onlyRenderVisibleElements:G,elementsSelectable:ae,defaultViewport:X,translateExtent:q,minZoom:Y,maxZoom:A,preventScrolling:H,defaultMarkerColor:M,zoomOnScroll:B,zoomOnPinch:R,panOnScroll:U,panOnScrollSpeed:Q,panOnScrollMode:T,zoomOnDoubleClick:j,panOnDrag:ee,onPaneClick:te,onPaneMouseEnter:le,onPaneMouseMove:ce,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:_e,paneClickDistance:xe,nodeClickDistance:be,onEdgeContextMenu:pe,onEdgeMouseEnter:de,onEdgeMouseMove:Me,onEdgeMouseLeave:qe,reconnectRadius:Be,onReconnect:Ct,onReconnectStart:ki,onReconnectEnd:si,noDragClassName:Di,noWheelClassName:ts,noPanClassName:Sn,disableKeyboardA11y:bn,nodeExtent:Nt,rfId:ar,viewport:is,onViewportChange:Bs}){return V0(e),V0(t),_k(),rk(n),ak(is),N.jsx(T5,{onPaneClick:te,onPaneMouseEnter:le,onPaneMouseMove:ce,onPaneMouseLeave:he,onPaneContextMenu:_e,onPaneScroll:ue,paneClickDistance:xe,deleteKeyCode:W,selectionKeyCode:L,selectionOnDrag:C,selectionMode:D,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:I,panActivationKeyCode:z,zoomActivationKeyCode:P,elementsSelectable:ae,zoomOnScroll:B,zoomOnPinch:R,zoomOnDoubleClick:j,panOnScroll:U,panOnScrollSpeed:Q,panOnScrollMode:T,panOnDrag:ee,defaultViewport:X,translateExtent:q,minZoom:Y,maxZoom:A,onSelectionContextMenu:m,preventScrolling:H,noDragClassName:Di,noWheelClassName:ts,noPanClassName:Sn,disableKeyboardA11y:bn,onViewportChange:Bs,isControlledViewport:!!is,children:N.jsxs(nk,{children:[N.jsx(ik,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:Ct,onReconnectStart:ki,onReconnectEnd:si,onlyRenderVisibleElements:G,onEdgeContextMenu:pe,onEdgeMouseEnter:de,onEdgeMouseMove:Me,onEdgeMouseLeave:qe,reconnectRadius:Be,defaultMarkerColor:M,noPanClassName:Sn,disableKeyboardA11y:bn,rfId:ar}),N.jsx(fk,{style:w,type:y,component:x,containerStyle:E}),N.jsx("div",{className:"react-flow__edgelabel-renderer"}),N.jsx(U5,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:_,onNodeMouseLeave:h,onNodeContextMenu:p,nodeClickDistance:be,onlyRenderVisibleElements:G,noPanClassName:Sn,noDragClassName:Di,disableKeyboardA11y:bn,nodeExtent:Nt,rfId:ar}),N.jsx("div",{className:"react-flow__viewport-portal"})]})})}L1.displayName="GraphView";const gk=$.memo(L1),$0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:c,fitView:u,fitViewOptions:f,minZoom:_=.5,maxZoom:h=2,nodeOrigin:p,nodeExtent:m,zIndexMode:v="basic"}={})=>{const b=new Map,y=new Map,w=new Map,x=new Map,E=r??t??[],L=n??e??[],C=p??[0,0],D=m??Aa;KS(w,x,E);const I=Ld(L,b,y,{nodeOrigin:C,nodeExtent:D,zIndexMode:v});let z=[0,0,1];if(u&&a&&c){const P=Ya(b,{filter:X=>!!((X.width||X.initialWidth)&&(X.height||X.initialHeight))}),{x:W,y:G,zoom:ae}=T_(P,a,c,_,h,(f==null?void 0:f.padding)??.1);z=[W,G,ae]}return{rfId:"1",width:a??0,height:c??0,transform:z,nodes:L,nodesInitialized:I,nodeLookup:b,parentLookup:y,edges:E,edgeLookup:x,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:_,maxZoom:h,translateExtent:Aa,nodeExtent:D,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:no.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...AS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:AM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:TS,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},mk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:c,fitView:u,fitViewOptions:f,minZoom:_,maxZoom:h,nodeOrigin:p,nodeExtent:m,zIndexMode:v})=>L3((b,y)=>{async function w(){const{nodeLookup:x,panZoom:E,fitViewOptions:L,fitViewResolver:C,width:D,height:I,minZoom:z,maxZoom:P}=y();E&&(await DM({nodes:x,width:D,height:I,panZoom:E,minZoom:z,maxZoom:P},L),C==null||C.resolve(!0),b({fitViewResolver:null}))}return{...$0({nodes:e,edges:t,width:a,height:c,fitView:u,fitViewOptions:f,minZoom:_,maxZoom:h,nodeOrigin:p,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:v}),setNodes:x=>{const{nodeLookup:E,parentLookup:L,nodeOrigin:C,elevateNodesOnSelect:D,fitViewQueued:I,zIndexMode:z}=y(),P=Ld(x,E,L,{nodeOrigin:C,nodeExtent:m,elevateNodesOnSelect:D,checkEquality:!0,zIndexMode:z});I&&P?(w(),b({nodes:x,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:x,nodesInitialized:P})},setEdges:x=>{const{connectionLookup:E,edgeLookup:L}=y();KS(E,L,x),b({edges:x})},setDefaultNodesAndEdges:(x,E)=>{if(x){const{setNodes:L}=y();L(x),b({hasDefaultNodes:!0})}if(E){const{setEdges:L}=y();L(E),b({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:E,nodeLookup:L,parentLookup:C,domNode:D,nodeOrigin:I,nodeExtent:z,debug:P,fitViewQueued:W,zIndexMode:G}=y(),{changes:ae,updatedInternals:X}=QM(x,L,C,D,I,z,G);X&&(KM(L,C,{nodeOrigin:I,nodeExtent:z,zIndexMode:G}),W?(w(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(ae==null?void 0:ae.length)>0&&(P&&console.log("React Flow: trigger node changes",ae),E==null||E(ae)))},updateNodePositions:(x,E=!1)=>{const L=[];let C=[];const{nodeLookup:D,triggerNodeChanges:I,connection:z,updateConnection:P,onNodesChangeMiddlewareMap:W}=y();for(const[G,ae]of x){const X=D.get(G),q=!!(X!=null&&X.expandParent&&(X!=null&&X.parentId)&&(ae!=null&&ae.position)),Y={id:G,type:"position",position:q?{x:Math.max(0,ae.position.x),y:Math.max(0,ae.position.y)}:ae.position,dragging:E};if(X&&z.inProgress&&z.fromNode.id===X.id){const A=sr(X,z.fromHandle,ye.Left,!0);P({...z,from:A})}q&&X.parentId&&L.push({id:G,parentId:X.parentId,rect:{...ae.internals.positionAbsolute,width:ae.measured.width??0,height:ae.measured.height??0}}),C.push(Y)}if(L.length>0){const{parentLookup:G,nodeOrigin:ae}=y(),X=z_(L,D,G,ae);C.push(...X)}for(const G of W.values())C=G(C);I(C)},triggerNodeChanges:x=>{const{onNodesChange:E,setNodes:L,nodes:C,hasDefaultNodes:D,debug:I}=y();if(x!=null&&x.length){if(D){const z=c1(x,C);L(z)}I&&console.log("React Flow: trigger node changes",x),E==null||E(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:E,setEdges:L,edges:C,hasDefaultEdges:D,debug:I}=y();if(x!=null&&x.length){if(D){const z=u1(x,C);L(z)}I&&console.log("React Flow: trigger edge changes",x),E==null||E(x)}},addSelectedNodes:x=>{const{multiSelectionActive:E,edgeLookup:L,nodeLookup:C,triggerNodeChanges:D,triggerEdgeChanges:I}=y();if(E){const z=x.map(P=>Wn(P,!0));D(z);return}D(Qr(C,new Set([...x]),!0)),I(Qr(L))},addSelectedEdges:x=>{const{multiSelectionActive:E,edgeLookup:L,nodeLookup:C,triggerNodeChanges:D,triggerEdgeChanges:I}=y();if(E){const z=x.map(P=>Wn(P,!0));I(z);return}I(Qr(L,new Set([...x]))),D(Qr(C,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:E}={})=>{const{edges:L,nodes:C,nodeLookup:D,triggerNodeChanges:I,triggerEdgeChanges:z}=y(),P=x||C,W=E||L,G=P.map(X=>{const q=D.get(X.id);return q&&(q.selected=!1),Wn(X.id,!1)}),ae=W.map(X=>Wn(X.id,!1));I(G),z(ae)},setMinZoom:x=>{const{panZoom:E,maxZoom:L}=y();E==null||E.setScaleExtent([x,L]),b({minZoom:x})},setMaxZoom:x=>{const{panZoom:E,minZoom:L}=y();E==null||E.setScaleExtent([L,x]),b({maxZoom:x})},setTranslateExtent:x=>{var E;(E=y().panZoom)==null||E.setTranslateExtent(x),b({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:E,triggerNodeChanges:L,triggerEdgeChanges:C,elementsSelectable:D}=y();if(!D)return;const I=E.reduce((P,W)=>W.selected?[...P,Wn(W.id,!1)]:P,[]),z=x.reduce((P,W)=>W.selected?[...P,Wn(W.id,!1)]:P,[]);L(I),C(z)},setNodeExtent:x=>{const{nodes:E,nodeLookup:L,parentLookup:C,nodeOrigin:D,elevateNodesOnSelect:I,nodeExtent:z,zIndexMode:P}=y();x[0][0]===z[0][0]&&x[0][1]===z[0][1]&&x[1][0]===z[1][0]&&x[1][1]===z[1][1]||(Ld(E,L,C,{nodeOrigin:D,nodeExtent:x,elevateNodesOnSelect:I,checkEquality:!1,zIndexMode:P}),b({nodeExtent:x}))},panBy:x=>{const{transform:E,width:L,height:C,panZoom:D,translateExtent:I}=y();return JM({delta:x,panZoom:D,transform:E,translateExtent:I,width:L,height:C})},setCenter:async(x,E,L)=>{const{width:C,height:D,maxZoom:I,panZoom:z}=y();if(!z)return Promise.resolve(!1);const P=typeof(L==null?void 0:L.zoom)<"u"?L.zoom:I;return await z.setViewport({x:C/2-x*P,y:D/2-E*P,zoom:P},{duration:L==null?void 0:L.duration,ease:L==null?void 0:L.ease,interpolate:L==null?void 0:L.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...AS}})},updateConnection:x=>{b({connection:x})},reset:()=>b({...$0()})}},Object.is);function z1({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:c,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:_,fitView:h,nodeOrigin:p,nodeExtent:m,zIndexMode:v,children:b}){const[y]=$.useState(()=>mk({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:c,fitView:h,minZoom:u,maxZoom:f,fitViewOptions:_,nodeOrigin:p,nodeExtent:m,zIndexMode:v}));return N.jsx(z3,{value:y,children:N.jsx(n5,{children:b})})}function pk({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:c,height:u,fitView:f,fitViewOptions:_,minZoom:h,maxZoom:p,nodeOrigin:m,nodeExtent:v,zIndexMode:b}){return $.useContext(vu)?N.jsx(N.Fragment,{children:e}):N.jsx(z1,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:c,initialHeight:u,fitView:f,initialFitViewOptions:_,initialMinZoom:h,initialMaxZoom:p,nodeOrigin:m,nodeExtent:v,zIndexMode:b,children:e})}const vk={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function yk({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:c,edgeTypes:u,onNodeClick:f,onEdgeClick:_,onInit:h,onMove:p,onMoveStart:m,onMoveEnd:v,onConnect:b,onConnectStart:y,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:E,onNodeMouseEnter:L,onNodeMouseMove:C,onNodeMouseLeave:D,onNodeContextMenu:I,onNodeDoubleClick:z,onNodeDragStart:P,onNodeDrag:W,onNodeDragStop:G,onNodesDelete:ae,onEdgesDelete:X,onDelete:q,onSelectionChange:Y,onSelectionDragStart:A,onSelectionDrag:H,onSelectionDragStop:M,onSelectionContextMenu:B,onSelectionStart:R,onSelectionEnd:U,onBeforeDelete:Q,connectionMode:T,connectionLineType:j=mn.Bezier,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:le,deleteKeyCode:ce="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:_e=Na.Full,panActivationKeyCode:xe="Space",multiSelectionKeyCode:be=Ba()?"Meta":"Control",zoomActivationKeyCode:pe=Ba()?"Meta":"Control",snapToGrid:de,snapGrid:Me,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Be,nodesDraggable:Ct,autoPanOnNodeFocus:ki,nodesConnectable:si,nodesFocusable:Di,nodeOrigin:ts=a1,edgesFocusable:Sn,edgesReconnectable:bn,elementsSelectable:Nt=!0,defaultViewport:ar=K3,minZoom:is=.5,maxZoom:Bs=2,translateExtent:wn=Aa,preventScrolling:ku=!0,nodeExtent:lr,defaultMarkerColor:Du="#b1b1b7",zoomOnScroll:Tu=!0,zoomOnPinch:xn=!0,panOnScroll:qt=!1,panOnScrollSpeed:Pi=.5,panOnScrollMode:It=Qn.Free,zoomOnDoubleClick:Au=!0,panOnDrag:Nu=!0,onPaneClick:Ru,onPaneMouseEnter:cr,onPaneMouseMove:ur,onPaneMouseLeave:hr,onPaneScroll:ss,onPaneContextMenu:fr,paneClickDistance:Cn=1,nodeClickDistance:Bu=0,children:Fa,onReconnect:fo,onReconnectStart:En,onReconnectEnd:Lu,onEdgeContextMenu:Za,onEdgeDoubleClick:Qa,onEdgeMouseEnter:Ja,onEdgeMouseMove:_o,onEdgeMouseLeave:go,reconnectRadius:el=10,onNodesChange:tl,onEdgesChange:ji,noDragClassName:yt="nodrag",noWheelClassName:Ut="nowheel",noPanClassName:ns="nopan",fitView:dr,fitViewOptions:il,connectOnClick:zu,attributionPosition:sl,proOptions:Mn,defaultEdgeOptions:mo,elevateNodesOnSelect:Ls=!0,elevateEdgesOnSelect:zs=!1,disableKeyboardA11y:Os=!1,autoPanOnConnect:Hs,autoPanOnNodeDrag:ht,autoPanSpeed:nl,connectionRadius:rl,isValidConnection:rs,onError:Us,style:Ou,id:po,nodeDragThreshold:ol,connectionDragThreshold:Hu,viewport:_r,onViewportChange:gr,width:Ti,height:Xt,colorMode:al="light",debug:Uu,onScroll:Ps,ariaLabelConfig:ll,zIndexMode:kn="basic",...Pu},Kt){const Dn=po||"1",cl=Q3(al),vo=$.useCallback(os=>{os.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ps==null||Ps(os)},[Ps]);return N.jsx("div",{"data-testid":"rf__wrapper",...Pu,onScroll:vo,style:{...Ou,...vk},ref:Kt,className:vt(["react-flow",a,cl]),id:po,role:"application",children:N.jsxs(pk,{nodes:e,edges:t,width:Ti,height:Xt,fitView:dr,fitViewOptions:il,minZoom:is,maxZoom:Bs,nodeOrigin:ts,nodeExtent:lr,zIndexMode:kn,children:[N.jsx(gk,{onInit:h,onNodeClick:f,onEdgeClick:_,onNodeMouseEnter:L,onNodeMouseMove:C,onNodeMouseLeave:D,onNodeContextMenu:I,onNodeDoubleClick:z,nodeTypes:c,edgeTypes:u,connectionLineType:j,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:le,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:_e,deleteKeyCode:ce,multiSelectionKeyCode:be,panActivationKeyCode:xe,zoomActivationKeyCode:pe,onlyRenderVisibleElements:qe,defaultViewport:ar,translateExtent:wn,minZoom:is,maxZoom:Bs,preventScrolling:ku,zoomOnScroll:Tu,zoomOnPinch:xn,zoomOnDoubleClick:Au,panOnScroll:qt,panOnScrollSpeed:Pi,panOnScrollMode:It,panOnDrag:Nu,onPaneClick:Ru,onPaneMouseEnter:cr,onPaneMouseMove:ur,onPaneMouseLeave:hr,onPaneScroll:ss,onPaneContextMenu:fr,paneClickDistance:Cn,nodeClickDistance:Bu,onSelectionContextMenu:B,onSelectionStart:R,onSelectionEnd:U,onReconnect:fo,onReconnectStart:En,onReconnectEnd:Lu,onEdgeContextMenu:Za,onEdgeDoubleClick:Qa,onEdgeMouseEnter:Ja,onEdgeMouseMove:_o,onEdgeMouseLeave:go,reconnectRadius:el,defaultMarkerColor:Du,noDragClassName:yt,noWheelClassName:Ut,noPanClassName:ns,rfId:Dn,disableKeyboardA11y:Os,nodeExtent:lr,viewport:_r,onViewportChange:gr}),N.jsx(Z3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:y,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:E,nodesDraggable:Ct,autoPanOnNodeFocus:ki,nodesConnectable:si,nodesFocusable:Di,edgesFocusable:Sn,edgesReconnectable:bn,elementsSelectable:Nt,elevateNodesOnSelect:Ls,elevateEdgesOnSelect:zs,minZoom:is,maxZoom:Bs,nodeExtent:lr,onNodesChange:tl,onEdgesChange:ji,snapToGrid:de,snapGrid:Me,connectionMode:T,translateExtent:wn,connectOnClick:zu,defaultEdgeOptions:mo,fitView:dr,fitViewOptions:il,onNodesDelete:ae,onEdgesDelete:X,onDelete:q,onNodeDragStart:P,onNodeDrag:W,onNodeDragStop:G,onSelectionDrag:H,onSelectionDragStart:A,onSelectionDragStop:M,onMove:p,onMoveStart:m,onMoveEnd:v,noPanClassName:ns,nodeOrigin:ts,rfId:Dn,autoPanOnConnect:Hs,autoPanOnNodeDrag:ht,autoPanSpeed:nl,onError:Us,connectionRadius:rl,isValidConnection:rs,selectNodesOnDrag:Be,nodeDragThreshold:ol,connectionDragThreshold:Hu,onBeforeDelete:Q,debug:Uu,ariaLabelConfig:ll,zIndexMode:kn}),N.jsx(X3,{onSelectionChange:Y}),Fa,N.jsx(I3,{proOptions:Mn,position:sl}),N.jsx(q3,{rfId:Dn,disableKeyboardA11y:Os})]})})}var Sk=h1(yk);function bk(e){const[t,n]=$.useState(e),r=$.useCallback(a=>n(c=>c1(a,c)),[]);return[t,n,r]}function wk(e){const[t,n]=$.useState(e),r=$.useCallback(a=>n(c=>u1(a,c)),[]);return[t,n,r]}function xk({dimensions:e,lineWidth:t,variant:n,className:r}){return N.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:vt(["react-flow__background-pattern",n,r])})}function Ck({radius:e,className:t}){return N.jsx("circle",{cx:e,cy:e,r:e,className:vt(["react-flow__background-pattern","dots",t])})}var Ds;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ds||(Ds={}));const Ek={[Ds.Dots]:1,[Ds.Lines]:1,[Ds.Cross]:6},Mk=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function O1({id:e,variant:t=Ds.Dots,gap:n=20,size:r,lineWidth:a=1,offset:c=0,color:u,bgColor:f,style:_,className:h,patternClassName:p}){const m=$.useRef(null),{transform:v,patternId:b}=He(Mk,Je),y=r||Ek[t],w=t===Ds.Dots,x=t===Ds.Cross,E=Array.isArray(n)?n:[n,n],L=[E[0]*v[2]||1,E[1]*v[2]||1],C=y*v[2],D=Array.isArray(c)?c:[c,c],I=x?[C,C]:L,z=[D[0]*v[2]||1+I[0]/2,D[1]*v[2]||1+I[1]/2],P=`${b}${e||""}`;return N.jsxs("svg",{className:vt(["react-flow__background",h]),style:{..._,...bu,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[N.jsx("pattern",{id:P,x:v[0]%L[0],y:v[1]%L[1],width:L[0],height:L[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:w?N.jsx(Ck,{radius:C/2,className:p}):N.jsx(xk,{dimensions:I,lineWidth:a,variant:t,className:p})}),N.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}O1.displayName="Background";const kk=$.memo(O1);function Dk(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:N.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Tk(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:N.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ak(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:N.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Nk(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Rk(){return N.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:N.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function kc({children:e,className:t,...n}){return N.jsx("button",{type:"button",className:vt(["react-flow__controls-button",t]),...n,children:e})}const Bk=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function H1({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:c,onZoomOut:u,onFitView:f,onInteractiveChange:_,className:h,children:p,position:m="bottom-left",orientation:v="vertical","aria-label":b}){const y=tt(),{isInteractive:w,minZoomReached:x,maxZoomReached:E,ariaLabelConfig:L}=He(Bk,Je),{zoomIn:C,zoomOut:D,fitView:I}=Su(),z=()=>{C(),c==null||c()},P=()=>{D(),u==null||u()},W=()=>{I(a),f==null||f()},G=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),_==null||_(!w)},ae=v==="horizontal"?"horizontal":"vertical";return N.jsxs(yu,{className:vt(["react-flow__controls",ae,h]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??L["controls.ariaLabel"],children:[t&&N.jsxs(N.Fragment,{children:[N.jsx(kc,{onClick:z,className:"react-flow__controls-zoomin",title:L["controls.zoomIn.ariaLabel"],"aria-label":L["controls.zoomIn.ariaLabel"],disabled:E,children:N.jsx(Dk,{})}),N.jsx(kc,{onClick:P,className:"react-flow__controls-zoomout",title:L["controls.zoomOut.ariaLabel"],"aria-label":L["controls.zoomOut.ariaLabel"],disabled:x,children:N.jsx(Tk,{})})]}),n&&N.jsx(kc,{className:"react-flow__controls-fitview",onClick:W,title:L["controls.fitView.ariaLabel"],"aria-label":L["controls.fitView.ariaLabel"],children:N.jsx(Ak,{})}),r&&N.jsx(kc,{className:"react-flow__controls-interactive",onClick:G,title:L["controls.interactive.ariaLabel"],"aria-label":L["controls.interactive.ariaLabel"],children:w?N.jsx(Rk,{}):N.jsx(Nk,{})}),p]})}H1.displayName="Controls";const Lk=$.memo(H1);function zk({id:e,x:t,y:n,width:r,height:a,style:c,color:u,strokeColor:f,strokeWidth:_,className:h,borderRadius:p,shapeRendering:m,selected:v,onClick:b}){const{background:y,backgroundColor:w}=c||{},x=u||y||w;return N.jsx("rect",{className:vt(["react-flow__minimap-node",{selected:v},h]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:x,stroke:f,strokeWidth:_},shapeRendering:m,onClick:b?E=>b(E,e):void 0})}const Ok=$.memo(zk),Hk=e=>e.nodes.map(t=>t.id),cd=e=>e instanceof Function?e:()=>e;function Uk({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:c=Ok,onClick:u}){const f=He(Hk,Je),_=cd(t),h=cd(e),p=cd(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return N.jsx(N.Fragment,{children:f.map(v=>N.jsx(jk,{id:v,nodeColorFunc:_,nodeStrokeColorFunc:h,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:c,onClick:u,shapeRendering:m},v))})}function Pk({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:f,onClick:_}){const{node:h,x:p,y:m,width:v,height:b}=He(y=>{const{internals:w}=y.nodeLookup.get(e),x=w.userNode,{x:E,y:L}=w.positionAbsolute,{width:C,height:D}=As(x);return{node:x,x:E,y:L,width:C,height:D}},Je);return!h||h.hidden||!HS(h)?null:N.jsx(f,{x:p,y:m,width:v,height:b,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:c,shapeRendering:u,onClick:_,id:h.id})}const jk=$.memo(Pk);var qk=$.memo(Uk);const Ik=200,Yk=150,Vk=e=>!e.hidden,$k=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?OS(Ya(e.nodeLookup,{filter:Vk}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wk="react-flow__minimap-desc";function U1({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:_,maskColor:h,maskStrokeColor:p,maskStrokeWidth:m,position:v="bottom-right",onClick:b,onNodeClick:y,pannable:w=!1,zoomable:x=!1,ariaLabel:E,inversePan:L,zoomStep:C=1,offsetScale:D=5}){const I=tt(),z=$.useRef(null),{boundingRect:P,viewBB:W,rfId:G,panZoom:ae,translateExtent:X,flowWidth:q,flowHeight:Y,ariaLabelConfig:A}=He($k,Je),H=(e==null?void 0:e.width)??Ik,M=(e==null?void 0:e.height)??Yk,B=P.width/H,R=P.height/M,U=Math.max(B,R),Q=U*H,T=U*M,j=D*U,ee=P.x-(Q-P.width)/2-j,te=P.y-(T-P.height)/2-j,le=Q+j*2,ce=T+j*2,he=`${Wk}-${G}`,ue=$.useRef(0),_e=$.useRef();ue.current=U,$.useEffect(()=>{if(z.current&&ae)return _e.current=l3({domNode:z.current,panZoom:ae,getTransform:()=>I.getState().transform,getViewScale:()=>ue.current}),()=>{var de;(de=_e.current)==null||de.destroy()}},[ae]),$.useEffect(()=>{var de;(de=_e.current)==null||de.update({translateExtent:X,width:q,height:Y,inversePan:L,pannable:w,zoomStep:C,zoomable:x})},[w,x,L,C,X,q,Y]);const xe=b?de=>{var Be;const[Me,qe]=((Be=_e.current)==null?void 0:Be.pointer(de))||[0,0];b(de,{x:Me,y:qe})}:void 0,be=y?$.useCallback((de,Me)=>{const qe=I.getState().nodeLookup.get(Me).internals.userNode;y(de,qe)},[]):void 0,pe=E??A["minimap.ariaLabel"];return N.jsx(yu,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*U:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:vt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:N.jsxs("svg",{width:H,height:M,viewBox:`${ee} ${te} ${le} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:z,onClick:xe,children:[pe&&N.jsx("title",{id:he,children:pe}),N.jsx(qk,{onClick:be,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:c,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:f}),N.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-j},${te-j}h${le+j*2}v${ce+j*2}h${-le-j*2}z
|
|
71
|
+
M${W.x},${W.y}h${W.width}v${W.height}h${-W.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}U1.displayName="MiniMap";const Xk=$.memo(U1),Kk=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Gk={[lo.Line]:"right",[lo.Handle]:"bottom-right"};function Fk({nodeId:e,position:t,variant:n=lo.Handle,className:r,style:a=void 0,children:c,color:u,minWidth:f=10,minHeight:_=10,maxWidth:h=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:v,autoScale:b=!0,shouldResize:y,onResizeStart:w,onResize:x,onResizeEnd:E}){const L=g1(),C=typeof e=="string"?e:L,D=tt(),I=$.useRef(null),z=n===lo.Handle,P=He($.useCallback(Kk(z&&b),[z,b]),Je),W=$.useRef(null),G=t??Gk[n];$.useEffect(()=>{if(!(!I.current||!C))return W.current||(W.current=w3({domNode:I.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:X,transform:q,snapGrid:Y,snapToGrid:A,nodeOrigin:H,domNode:M}=D.getState();return{nodeLookup:X,transform:q,snapGrid:Y,snapToGrid:A,nodeOrigin:H,paneDomNode:M}},onChange:(X,q)=>{const{triggerNodeChanges:Y,nodeLookup:A,parentLookup:H,nodeOrigin:M}=D.getState(),B=[],R={x:X.x,y:X.y},U=A.get(C);if(U&&U.expandParent&&U.parentId){const Q=U.origin??M,T=X.width??U.measured.width??0,j=X.height??U.measured.height??0,ee={id:U.id,parentId:U.parentId,rect:{width:T,height:j,...US({x:X.x??U.position.x,y:X.y??U.position.y},{width:T,height:j},U.parentId,A,Q)}},te=z_([ee],A,H,M);B.push(...te),R.x=X.x?Math.max(Q[0]*T,X.x):void 0,R.y=X.y?Math.max(Q[1]*j,X.y):void 0}if(R.x!==void 0&&R.y!==void 0){const Q={id:C,type:"position",position:{...R}};B.push(Q)}if(X.width!==void 0&&X.height!==void 0){const T={id:C,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:X.width,height:X.height}};B.push(T)}for(const Q of q){const T={...Q,type:"position"};B.push(T)}Y(B)},onEnd:({width:X,height:q})=>{const Y={id:C,type:"dimensions",resizing:!1,dimensions:{width:X,height:q}};D.getState().triggerNodeChanges([Y])}})),W.current.update({controlPosition:G,boundaries:{minWidth:f,minHeight:_,maxWidth:h,maxHeight:p},keepAspectRatio:m,resizeDirection:v,onResizeStart:w,onResize:x,onResizeEnd:E,shouldResize:y}),()=>{var X;(X=W.current)==null||X.destroy()}},[G,f,_,h,p,m,w,x,E,y]);const ae=G.split("-");return N.jsx("div",{className:vt(["react-flow__resize-control","nodrag",...ae,n,r]),ref:I,style:{...a,scale:P,...u&&{[z?"backgroundColor":"borderColor"]:u}},children:c})}$.memo(Fk);const Zk=1e3,Qk=1e4;function Jk(){const[e,t]=$.useState({workflows:[],parseErrors:[]}),[n,r]=$.useState(!1),a=$.useRef(0),c=$.useRef(null),u=$.useRef(new EventTarget),f=$.useCallback(h=>{const p=c.current;p&&p.readyState===WebSocket.OPEN&&p.send(JSON.stringify(h))},[]),_=$.useCallback(()=>{const h=window.location.protocol==="https:"?"wss:":"ws:",p=new WebSocket(`${h}//${window.location.host}`);c.current=p,p.onopen=()=>{r(!0),a.current=0},p.onclose=()=>{r(!1),c.current=null;const m=Math.min(Zk*2**a.current,Qk);a.current++,setTimeout(_,m)},p.onerror=()=>{p.close()},p.onmessage=m=>{try{const v=JSON.parse(m.data);switch(v.type){case"full-sync":t(v.data);break;case"workflow-updated":t(b=>{const y=b.workflows.filter(x=>x.filePath!==v.data.filePath||x.workflowName!==v.data.workflowName);y.push(v.data);const w=b.parseErrors.filter(x=>x.filePath!==v.data.filePath);return{workflows:y,parseErrors:w}});break;case"workflow-removed":t(b=>({workflows:b.workflows.filter(y=>y.filePath!==v.data.filePath),parseErrors:b.parseErrors.filter(y=>y.filePath!==v.data.filePath)}));break;case"parse-error":t(b=>{const y=b.workflows.filter(x=>x.filePath!==v.data.filePath),w=b.parseErrors.filter(x=>x.filePath!==v.data.filePath);return w.push(v.data),{workflows:y,parseErrors:w}});break;case"pty-data":u.current.dispatchEvent(new CustomEvent("data",{detail:v.data}));break;case"pty-exit":u.current.dispatchEvent(new CustomEvent("exit",{detail:v.data.code}));break;case"pty-spawned":u.current.dispatchEvent(new CustomEvent("spawned",{detail:v.data.pid}));break}}catch{}}},[]);return $.useEffect(()=>(_(),()=>{var h;(h=c.current)==null||h.close()}),[_]),{state:e,connected:n,sendMessage:f,ptyEvents:u.current}}function eD(){const[e,t]=$.useState([]),[n,r]=$.useState(!0),[a,c]=$.useState(0),u=$.useCallback(async()=>{try{const p=await fetch("/api/connections");p.ok&&t(await p.json())}catch{}finally{r(!1)}},[]);$.useEffect(()=>{u()},[u]);const f=$.useCallback(async p=>{await fetch("/api/connections",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}),await u(),c(m=>m+1)},[u]),_=$.useCallback(async(p,m,v)=>{await fetch("/api/connections",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflow_name:p,node_name:m,integration_id:v})}),await u(),c(b=>b+1)},[u]),h=$.useCallback((p,m,v)=>e.find(b=>b.workflow_name===p&&b.node_name===m&&b.integration_id===v)??e.find(b=>b.workflow_name==="*"&&b.node_name==="*"&&b.integration_id===v)??null,[e]);return{connections:e,loading:n,upsert:f,remove:_,getForNode:h,refetch:u,mutationVersion:a}}function tD(){const[e,t]=$.useState([]),[n,r]=$.useState(!0);return $.useEffect(()=>{(async()=>{try{const a=await fetch("/api/nango/integrations");a.ok&&t(await a.json())}catch{}finally{r(!1)}})()},[]),{integrations:e,loading:n}}function iD(e,t=0){const[n,r]=$.useState([]),[a,c]=$.useState(!1),u=$.useCallback(async()=>{if(!e)return[];c(!0);try{const f=await fetch(`/api/nango/connections/${encodeURIComponent(e)}`);if(f.ok){const _=await f.json();return r(_),_}}catch{}finally{c(!1)}return[]},[e]);return $.useEffect(()=>{u()},[u,t]),{nangoConnections:n,loading:a,refetch:u}}const sD=5e3;function nD(e){const[t,n]=$.useState([]),[r,a]=$.useState(!0),[c,u]=$.useState(!0),[f,_]=$.useState(null),[h,p]=$.useState(null),[m,v]=$.useState(!1),b=$.useRef(void 0),y=$.useCallback(async()=>{try{const x=new URLSearchParams;e&&x.set("workflow",e),x.set("limit","50");const E=await fetch(`/api/runs?${x}`);E.ok?(n(await E.json()),u(!0)):u(!1)}catch{u(!1)}finally{a(!1)}},[e]);$.useEffect(()=>(a(!0),y(),b.current=setInterval(y,sD),()=>clearInterval(b.current)),[y]);const w=$.useCallback(async x=>{if(_(x),!x){p(null);return}v(!0);try{const E=await fetch(`/api/runs/${x}/trace`);E.ok&&p(await E.json())}catch{}finally{v(!1)}},[]);return{runs:t,loading:r,available:c,selectedRunId:f,trace:h,traceLoading:m,selectRun:w,refresh:y}}/**
|
|
72
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
73
|
+
* @license MIT
|
|
74
|
+
*
|
|
75
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
76
|
+
* @license MIT
|
|
77
|
+
*
|
|
78
|
+
* Originally forked from (with the author's permission):
|
|
79
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
80
|
+
* http://bellard.org/jslinux/
|
|
81
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
82
|
+
*/var P1=Object.defineProperty,rD=Object.getOwnPropertyDescriptor,oD=(e,t)=>{for(var n in t)P1(e,n,{get:t[n],enumerable:!0})},at=(e,t,n,r)=>{for(var a=r>1?void 0:r?rD(t,n):t,c=e.length-1,u;c>=0;c--)(u=e[c])&&(a=(r?u(t,n,a):u(a))||a);return r&&a&&P1(t,n,a),a},ge=(e,t)=>(n,r)=>t(n,r,e),W0="Terminal input",Hd={get:()=>W0,set:e=>W0=e},X0="Too much output to announce, navigate to rows manually to read",Ud={get:()=>X0,set:e=>X0=e};function aD(e){return e.replace(/\r?\n/g,"\r")}function lD(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function cD(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function uD(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");j1(a,t,n,r)}}function j1(e,t,n,r){e=aD(e),e=lD(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function q1(e,t,n){let r=n.getBoundingClientRect(),a=e.clientX-r.left-10,c=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.zIndex="1000",t.focus()}function K0(e,t,n,r,a){q1(e,t,n),a&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function gn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function xu(e,t=0,n=e.length){let r="";for(let a=t;a<n;++a){let c=e[a];c>65535?(c-=65536,r+=String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):r+=String.fromCharCode(c)}return r}var hD=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,a=0;if(this._interim){let c=e.charCodeAt(a++);56320<=c&&c<=57343?t[r++]=(this._interim-55296)*1024+c-56320+65536:(t[r++]=this._interim,t[r++]=c),this._interim=0}for(let c=a;c<n;++c){let u=e.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=n)return this._interim=u,r;let f=e.charCodeAt(c);56320<=f&&f<=57343?t[r++]=(u-55296)*1024+f-56320+65536:(t[r++]=u,t[r++]=f);continue}u!==65279&&(t[r++]=u)}return r}},fD=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,a,c,u,f,_=0,h=0;if(this.interim[0]){let v=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let y=0,w;for(;(w=this.interim[++y]&63)&&y<4;)b<<=6,b|=w;let x=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,E=x-y;for(;h<E;){if(h>=n)return 0;if(w=e[h++],(w&192)!==128){h--,v=!0;break}else this.interim[y++]=w,b<<=6,b|=w&63}v||(x===2?b<128?h--:t[r++]=b:x===3?b<2048||b>=55296&&b<=57343||b===65279||(t[r++]=b):b<65536||b>1114111||(t[r++]=b)),this.interim.fill(0)}let p=n-4,m=h;for(;m<n;){for(;m<p&&!((a=e[m])&128)&&!((c=e[m+1])&128)&&!((u=e[m+2])&128)&&!((f=e[m+3])&128);)t[r++]=a,t[r++]=c,t[r++]=u,t[r++]=f,m+=4;if(a=e[m++],a<128)t[r++]=a;else if((a&224)===192){if(m>=n)return this.interim[0]=a,r;if(c=e[m++],(c&192)!==128){m--;continue}if(_=(a&31)<<6|c&63,_<128){m--;continue}t[r++]=_}else if((a&240)===224){if(m>=n)return this.interim[0]=a,r;if(c=e[m++],(c&192)!==128){m--;continue}if(m>=n)return this.interim[0]=a,this.interim[1]=c,r;if(u=e[m++],(u&192)!==128){m--;continue}if(_=(a&15)<<12|(c&63)<<6|u&63,_<2048||_>=55296&&_<=57343||_===65279)continue;t[r++]=_}else if((a&248)===240){if(m>=n)return this.interim[0]=a,r;if(c=e[m++],(c&192)!==128){m--;continue}if(m>=n)return this.interim[0]=a,this.interim[1]=c,r;if(u=e[m++],(u&192)!==128){m--;continue}if(m>=n)return this.interim[0]=a,this.interim[1]=c,this.interim[2]=u,r;if(f=e[m++],(f&192)!==128){m--;continue}if(_=(a&7)<<18|(c&63)<<12|(u&63)<<6|f&63,_<65536||_>1114111)continue;t[r++]=_}}return r}},I1="",pn=" ",Wa=class Y1{constructor(){this.fg=0,this.bg=0,this.extended=new su}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Y1;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},su=class V1{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new V1(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Mi=class $1 extends Wa{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new su,this.combinedData=""}static fromCharData(t){let n=new $1;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?gn(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(r-55296)*1024+a-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},G0="di$target",Pd="di$dependencies",ud=new Map;function dD(e){return e[Pd]||[]}function At(e){if(ud.has(e))return ud.get(e);let t=function(n,r,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_D(t,n,a)};return t._id=e,ud.set(e,t),t}function _D(e,t,n){t[G0]===t?t[Pd].push({id:e,index:n}):(t[Pd]=[{id:e,index:n}],t[G0]=t)}var $t=At("BufferService"),W1=At("CoreMouseService"),or=At("CoreService"),gD=At("CharsetService"),H_=At("InstantiationService"),X1=At("LogService"),Wt=At("OptionsService"),K1=At("OscLinkService"),mD=At("UnicodeService"),Xa=At("DecorationService"),jd=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],a=this._optionsService.rawOptions.linkHandler,c=new Mi,u=n.getTrimmedLength(),f=-1,_=-1,h=!1;for(let m=0;m<u;m++)if(!(_===-1&&!n.hasContent(m))){if(n.loadCell(m,c),c.hasExtendedAttrs()&&c.extended.urlId)if(_===-1){_=m,f=c.extended.urlId;continue}else h=c.extended.urlId!==f;else _!==-1&&(h=!0);if(h||_!==-1&&m===u-1){let v=(p=this._oscLinkService.getLinkData(f))==null?void 0:p.uri;if(v){let b={start:{x:_+1,y:e},end:{x:m+(!h&&m===u-1?1:0),y:e}},y=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{let w=new URL(v);["http:","https:"].includes(w.protocol)||(y=!0)}catch{y=!0}y||r.push({text:v,range:b,activate:(w,x)=>a?a.activate(w,x,b):pD(w,x),hover:(w,x)=>{var E;return(E=a==null?void 0:a.hover)==null?void 0:E.call(a,w,x,b)},leave:(w,x)=>{var E;return(E=a==null?void 0:a.leave)==null?void 0:E.call(a,w,x,b)}})}h=!1,c.hasExtendedAttrs()&&c.extended.urlId?(_=m,f=c.extended.urlId):(_=-1,f=-1)}}t(r)}};jd=at([ge(0,$t),ge(1,Wt),ge(2,K1)],jd);function pD(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
83
|
+
|
|
84
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Cu=At("CharSizeService"),Ns=At("CoreBrowserService"),U_=At("MouseService"),Rs=At("RenderService"),vD=At("SelectionService"),G1=At("CharacterJoinerService"),uo=At("ThemeService"),F1=At("LinkProviderService"),yD=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?F0.isErrorNoTelemetry(e)?new F0(e.message+`
|
|
85
|
+
|
|
86
|
+
`+e.stack):new Error(e.message+`
|
|
87
|
+
|
|
88
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},SD=new yD;function Pc(e){bD(e)||SD.onUnexpectedError(e)}var qd="Canceled";function bD(e){return e instanceof wD?!0:e instanceof Error&&e.name===qd&&e.message===qd}var wD=class extends Error{constructor(){super(qd),this.name=this.message}};function xD(e){return new Error(`Illegal argument: ${e}`)}var F0=class Id extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Id)return t;let n=new Id;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Yd=class Z1 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Z1.prototype)}};function hi(e,t=0){return e[e.length-(1+t)]}var CD;(e=>{function t(c){return c<0}e.isLessThan=t;function n(c){return c<=0}e.isLessThanOrEqual=n;function r(c){return c>0}e.isGreaterThan=r;function a(c){return c===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(CD||(CD={}));function ED(e,t){let n=this,r=!1,a;return function(){return r||(r=!0,t||(a=e.apply(n,arguments))),a}}var Q1;(e=>{function t(D){return D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*a(D){yield D}e.single=a;function c(D){return t(D)?D:a(D)}e.wrap=c;function u(D){return D||n}e.from=u;function*f(D){for(let I=D.length-1;I>=0;I--)yield D[I]}e.reverse=f;function _(D){return!D||D[Symbol.iterator]().next().done===!0}e.isEmpty=_;function h(D){return D[Symbol.iterator]().next().value}e.first=h;function p(D,I){let z=0;for(let P of D)if(I(P,z++))return!0;return!1}e.some=p;function m(D,I){for(let z of D)if(I(z))return z}e.find=m;function*v(D,I){for(let z of D)I(z)&&(yield z)}e.filter=v;function*b(D,I){let z=0;for(let P of D)yield I(P,z++)}e.map=b;function*y(D,I){let z=0;for(let P of D)yield*I(P,z++)}e.flatMap=y;function*w(...D){for(let I of D)yield*I}e.concat=w;function x(D,I,z){let P=z;for(let W of D)P=I(P,W);return P}e.reduce=x;function*E(D,I,z=D.length){for(I<0&&(I+=D.length),z<0?z+=D.length:z>D.length&&(z=D.length);I<z;I++)yield D[I]}e.slice=E;function L(D,I=Number.POSITIVE_INFINITY){let z=[];if(I===0)return[z,D];let P=D[Symbol.iterator]();for(let W=0;W<I;W++){let G=P.next();if(G.done)return[z,e.empty()];z.push(G.value)}return[z,{[Symbol.iterator](){return P}}]}e.consume=L;async function C(D){let I=[];for await(let z of D)I.push(z);return Promise.resolve(I)}e.asyncToArray=C})(Q1||(Q1={}));function nr(e){if(Q1.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function MD(...e){return et(()=>nr(e))}function et(e){return{dispose:ED(()=>{e()})}}var J1=class eb{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{nr(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?eb.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};J1.DISABLE_DISPOSED_WARNING=!1;var vn=J1,Ae=class{constructor(){this._store=new vn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ae.None=Object.freeze({dispose(){}});var co=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},ks=typeof window=="object"?window:globalThis,Vd=class $d{constructor(t){this.element=t,this.next=$d.Undefined,this.prev=$d.Undefined}};Vd.Undefined=new Vd(void 0);var it=Vd,Z0=class{constructor(){this._first=it.Undefined,this._last=it.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===it.Undefined}clear(){let e=this._first;for(;e!==it.Undefined;){let t=e.next;e.prev=it.Undefined,e.next=it.Undefined,e=t}this._first=it.Undefined,this._last=it.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new it(e);if(this._first===it.Undefined)this._first=n,this._last=n;else if(t){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==it.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==it.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==it.Undefined&&e.next!==it.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===it.Undefined&&e.next===it.Undefined?(this._first=it.Undefined,this._last=it.Undefined):e.next===it.Undefined?(this._last=this._last.prev,this._last.next=it.Undefined):e.prev===it.Undefined&&(this._first=this._first.next,this._first.prev=it.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==it.Undefined;)yield e.element,e=e.next}},kD=globalThis.performance&&typeof globalThis.performance.now=="function",DD=class tb{static create(t){return new tb(t)}constructor(t){this._now=kD&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Ht;(e=>{e.None=()=>Ae.None;function t(q,Y){return m(q,()=>{},0,void 0,!0,void 0,Y)}e.defer=t;function n(q){return(Y,A=null,H)=>{let M=!1,B;return B=q(R=>{if(!M)return B?B.dispose():M=!0,Y.call(A,R)},null,H),M&&B.dispose(),B}}e.once=n;function r(q,Y,A){return h((H,M=null,B)=>q(R=>H.call(M,Y(R)),null,B),A)}e.map=r;function a(q,Y,A){return h((H,M=null,B)=>q(R=>{Y(R),H.call(M,R)},null,B),A)}e.forEach=a;function c(q,Y,A){return h((H,M=null,B)=>q(R=>Y(R)&&H.call(M,R),null,B),A)}e.filter=c;function u(q){return q}e.signal=u;function f(...q){return(Y,A=null,H)=>{let M=MD(...q.map(B=>B(R=>Y.call(A,R))));return p(M,H)}}e.any=f;function _(q,Y,A,H){let M=A;return r(q,B=>(M=Y(M,B),M),H)}e.reduce=_;function h(q,Y){let A,H={onWillAddFirstListener(){A=q(M.fire,M)},onDidRemoveLastListener(){A==null||A.dispose()}},M=new fe(H);return Y==null||Y.add(M),M.event}function p(q,Y){return Y instanceof Array?Y.push(q):Y&&Y.add(q),q}function m(q,Y,A=100,H=!1,M=!1,B,R){let U,Q,T,j=0,ee,te={leakWarningThreshold:B,onWillAddFirstListener(){U=q(ce=>{j++,Q=Y(Q,ce),H&&!T&&(le.fire(Q),Q=void 0),ee=()=>{let he=Q;Q=void 0,T=void 0,(!H||j>1)&&le.fire(he),j=0},typeof A=="number"?(clearTimeout(T),T=setTimeout(ee,A)):T===void 0&&(T=0,queueMicrotask(ee))})},onWillRemoveListener(){M&&j>0&&(ee==null||ee())},onDidRemoveLastListener(){ee=void 0,U.dispose()}},le=new fe(te);return R==null||R.add(le),le.event}e.debounce=m;function v(q,Y=0,A){return e.debounce(q,(H,M)=>H?(H.push(M),H):[M],Y,void 0,!0,void 0,A)}e.accumulate=v;function b(q,Y=(H,M)=>H===M,A){let H=!0,M;return c(q,B=>{let R=H||!Y(B,M);return H=!1,M=B,R},A)}e.latch=b;function y(q,Y,A){return[e.filter(q,Y,A),e.filter(q,H=>!Y(H),A)]}e.split=y;function w(q,Y=!1,A=[],H){let M=A.slice(),B=q(Q=>{M?M.push(Q):U.fire(Q)});H&&H.add(B);let R=()=>{M==null||M.forEach(Q=>U.fire(Q)),M=null},U=new fe({onWillAddFirstListener(){B||(B=q(Q=>U.fire(Q)),H&&H.add(B))},onDidAddFirstListener(){M&&(Y?setTimeout(R):R())},onDidRemoveLastListener(){B&&B.dispose(),B=null}});return H&&H.add(U),U.event}e.buffer=w;function x(q,Y){return(A,H,M)=>{let B=Y(new L);return q(function(R){let U=B.evaluate(R);U!==E&&A.call(H,U)},void 0,M)}}e.chain=x;let E=Symbol("HaltChainable");class L{constructor(){this.steps=[]}map(Y){return this.steps.push(Y),this}forEach(Y){return this.steps.push(A=>(Y(A),A)),this}filter(Y){return this.steps.push(A=>Y(A)?A:E),this}reduce(Y,A){let H=A;return this.steps.push(M=>(H=Y(H,M),H)),this}latch(Y=(A,H)=>A===H){let A=!0,H;return this.steps.push(M=>{let B=A||!Y(M,H);return A=!1,H=M,B?M:E}),this}evaluate(Y){for(let A of this.steps)if(Y=A(Y),Y===E)break;return Y}}function C(q,Y,A=H=>H){let H=(...U)=>R.fire(A(...U)),M=()=>q.on(Y,H),B=()=>q.removeListener(Y,H),R=new fe({onWillAddFirstListener:M,onDidRemoveLastListener:B});return R.event}e.fromNodeEventEmitter=C;function D(q,Y,A=H=>H){let H=(...U)=>R.fire(A(...U)),M=()=>q.addEventListener(Y,H),B=()=>q.removeEventListener(Y,H),R=new fe({onWillAddFirstListener:M,onDidRemoveLastListener:B});return R.event}e.fromDOMEventEmitter=D;function I(q){return new Promise(Y=>n(q)(Y))}e.toPromise=I;function z(q){let Y=new fe;return q.then(A=>{Y.fire(A)},()=>{Y.fire(void 0)}).finally(()=>{Y.dispose()}),Y.event}e.fromPromise=z;function P(q,Y){return q(A=>Y.fire(A))}e.forward=P;function W(q,Y,A){return Y(A),q(H=>Y(H))}e.runAndSubscribe=W;class G{constructor(Y,A){this._observable=Y,this._counter=0,this._hasChanged=!1;let H={onWillAddFirstListener:()=>{Y.addObserver(this)},onDidRemoveLastListener:()=>{Y.removeObserver(this)}};this.emitter=new fe(H),A&&A.add(this.emitter)}beginUpdate(Y){this._counter++}handlePossibleChange(Y){}handleChange(Y,A){this._hasChanged=!0}endUpdate(Y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function ae(q,Y){return new G(q,Y).emitter.event}e.fromObservable=ae;function X(q){return(Y,A,H)=>{let M=0,B=!1,R={beginUpdate(){M++},endUpdate(){M--,M===0&&(q.reportChanges(),B&&(B=!1,Y.call(A)))},handlePossibleChange(){},handleChange(){B=!0}};q.addObserver(R),q.reportChanges();let U={dispose(){q.removeObserver(R)}};return H instanceof vn?H.add(U):Array.isArray(H)&&H.push(U),U}}e.fromObservableLight=X})(Ht||(Ht={}));var Wd=class Xd{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Xd._idPool++}`,Xd.all.add(this)}start(t){this._stopWatch=new DD,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Wd.all=new Set,Wd._idPool=0;var TD=Wd,AD=-1,ib=class sb{constructor(t,n,r=(sb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[c,u]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${u}):`;console.warn(f),console.warn(c);let _=new BD(f,c);this._errorHandler(_)}return()=>{let c=this._stacks.get(t.value)||0;this._stacks.set(t.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,a]of this._stacks)(!t||n<a)&&(t=[r,a],n=a);return t}};ib._idPool=1;var ND=ib,RD=class nb{constructor(t){this.value=t}static create(){let t=new Error;return new nb(t.stack??"")}print(){console.warn(this.value.split(`
|
|
89
|
+
`).slice(2).join(`
|
|
90
|
+
`))}},BD=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},LD=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},zD=0,hd=class{constructor(e){this.value=e,this.id=zD++}},OD=2,HD,fe=class{constructor(t){var n,r,a,c;this._size=0,this._options=t,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new ND((t==null?void 0:t.onListenerError)??Pc,((r=this._options)==null?void 0:r.leakWarningThreshold)??AD):void 0,this._perfMon=(a=this._options)!=null&&a._profName?new TD(this._options._profName):void 0,this._deliveryQueue=(c=this._options)==null?void 0:c.deliveryQueue}dispose(){var t,n,r,a;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||r.call(n),(a=this._leakageMon)==null||a.dispose())}get event(){return this._event??(this._event=(t,n,r)=>{var f,_,h,p,m;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let v=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(v);let b=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new LD(`${v}. HINT: Stack shows most frequent listener (${b[1]}-times)`,b[0]);return(((f=this._options)==null?void 0:f.onListenerError)||Pc)(y),Ae.None}if(this._disposed)return Ae.None;n&&(t=t.bind(n));let a=new hd(t),c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=RD.create(),c=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof hd?(this._deliveryQueue??(this._deliveryQueue=new UD),this._listeners=[this._listeners,a]):this._listeners.push(a):((h=(_=this._options)==null?void 0:_.onWillAddFirstListener)==null||h.call(_,this),this._listeners=a,(m=(p=this._options)==null?void 0:p.onDidAddFirstListener)==null||m.call(p,this)),this._size++;let u=et(()=>{c==null||c(),this._removeListener(a)});return r instanceof vn?r.add(u):Array.isArray(r)&&r.push(u),u}),this._event}_removeListener(t){var c,u,f,_;if((u=(c=this._options)==null?void 0:c.onWillRemoveListener)==null||u.call(c,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(_=(f=this._options)==null?void 0:f.onDidRemoveLastListener)==null||_.call(f,this),this._size=0;return}let n=this._listeners,r=n.indexOf(t);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let a=this._deliveryQueue.current===this;if(this._size*OD<=n.length){let h=0;for(let p=0;p<n.length;p++)n[p]?n[h++]=n[p]:a&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=h}}_deliver(t,n){var a;if(!t)return;let r=((a=this._options)==null?void 0:a.onListenerError)||Pc;if(!r){t.value(n);return}try{t.value(n)}catch(c){r(c)}}_deliverQueue(t){let n=t.current._listeners;for(;t.i<t.end;)this._deliver(n[t.i++],t.value);t.reset()}fire(t){var n,r,a,c;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(a=this._perfMon)==null||a.start(this._size),this._listeners)if(this._listeners instanceof hd)this._deliver(this._listeners,t);else{let u=this._deliveryQueue;u.enqueue(this,t,this._listeners.length),this._deliverQueue(u)}(c=this._perfMon)==null||c.stop()}hasListeners(){return this._size>0}},UD=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Kd=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new fe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new fe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Kd.INSTANCE=new Kd;var P_=Kd;function PD(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}P_.INSTANCE.onDidChangeZoomLevel;function jD(e){return P_.INSTANCE.getZoomFactor(e)}P_.INSTANCE.onDidChangeFullscreen;var ho=typeof navigator=="object"?navigator.userAgent:"",Gd=ho.indexOf("Firefox")>=0,qD=ho.indexOf("AppleWebKit")>=0,j_=ho.indexOf("Chrome")>=0,ID=!j_&&ho.indexOf("Safari")>=0;ho.indexOf("Electron/")>=0;ho.indexOf("Android")>=0;var fd=!1;if(typeof ks.matchMedia=="function"){let e=ks.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ks.matchMedia("(display-mode: fullscreen)");fd=e.matches,PD(ks,e,({matches:n})=>{fd&&t.matches||(fd=n)})}var Jr="en",Fd=!1,Zd=!1,jc=!1,rb=!1,Dc,qc=Jr,Q0=Jr,YD,Bi,Jn=globalThis,Ot,Xy;typeof Jn.vscode<"u"&&typeof Jn.vscode.process<"u"?Ot=Jn.vscode.process:typeof process<"u"&&typeof((Xy=process==null?void 0:process.versions)==null?void 0:Xy.node)=="string"&&(Ot=process);var Ky,VD=typeof((Ky=Ot==null?void 0:Ot.versions)==null?void 0:Ky.electron)=="string",$D=VD&&(Ot==null?void 0:Ot.type)==="renderer",Gy;if(typeof Ot=="object"){Fd=Ot.platform==="win32",Zd=Ot.platform==="darwin",jc=Ot.platform==="linux",jc&&Ot.env.SNAP&&Ot.env.SNAP_REVISION,Ot.env.CI||Ot.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Dc=Jr,qc=Jr;let e=Ot.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Dc=t.userLocale,Q0=t.osLocale,qc=t.resolvedLanguage||Jr,YD=(Gy=t.languagePack)==null?void 0:Gy.translationsConfigFile}catch{}rb=!0}else typeof navigator=="object"&&!$D?(Bi=navigator.userAgent,Fd=Bi.indexOf("Windows")>=0,Zd=Bi.indexOf("Macintosh")>=0,(Bi.indexOf("Macintosh")>=0||Bi.indexOf("iPad")>=0||Bi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,jc=Bi.indexOf("Linux")>=0,(Bi==null?void 0:Bi.indexOf("Mobi"))>=0,qc=globalThis._VSCODE_NLS_LANGUAGE||Jr,Dc=navigator.language.toLowerCase(),Q0=Dc):console.error("Unable to resolve platform.");var ob=Fd,Zi=Zd,WD=jc,J0=rb,Ji=Bi,fn=qc,XD;(e=>{function t(){return fn}e.value=t;function n(){return fn.length===2?fn==="en":fn.length>=3?fn[0]==="e"&&fn[1]==="n"&&fn[2]==="-":!1}e.isDefaultVariant=n;function r(){return fn==="en"}e.isDefault=r})(XD||(XD={}));var KD=typeof Jn.postMessage=="function"&&!Jn.importScripts;(()=>{if(KD){let e=[];Jn.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,a=e.length;r<a;r++){let c=e[r];if(c.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),c.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Jn.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var GD=!!(Ji&&Ji.indexOf("Chrome")>=0);Ji&&Ji.indexOf("Firefox")>=0;!GD&&Ji&&Ji.indexOf("Safari")>=0;Ji&&Ji.indexOf("Edg/")>=0;Ji&&Ji.indexOf("Android")>=0;var Gr=typeof navigator=="object"?navigator:{};J0||document.queryCommandSupported&&document.queryCommandSupported("copy")||Gr&&Gr.clipboard&&Gr.clipboard.writeText,J0||Gr&&Gr.clipboard&&Gr.clipboard.readText;var q_=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},dd=new q_,ey=new q_,ty=new q_,FD=new Array(230),ab;(e=>{function t(f){return dd.keyCodeToStr(f)}e.toString=t;function n(f){return dd.strToKeyCode(f)}e.fromString=n;function r(f){return ey.keyCodeToStr(f)}e.toUserSettingsUS=r;function a(f){return ty.keyCodeToStr(f)}e.toUserSettingsGeneral=a;function c(f){return ey.strToKeyCode(f)||ty.strToKeyCode(f)}e.fromUserSettings=c;function u(f){if(f>=98&&f<=113)return null;switch(f){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return dd.keyCodeToStr(f)}e.toElectronAccelerator=u})(ab||(ab={}));var ZD=class lb{constructor(t,n,r,a,c){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=a,this.keyCode=c}equals(t){return t instanceof lb&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${n}${r}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new QD([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},QD=class{constructor(e){if(e.length===0)throw xD("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function JD(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return ab.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Gd)switch(t){case 59:return 85;case 60:if(WD)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Zi)return 57;break}else if(qD&&(Zi&&t===93||!Zi&&t===92))return 57;return FD[t]||0}var eT=Zi?256:2048,tT=512,iT=1024,sT=Zi?2048:256,iy=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=JD(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=eT),this.altKey&&(t|=tT),this.shiftKey&&(t|=iT),this.metaKey&&(t|=sT),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new ZD(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},sy=new WeakMap;function nT(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var rT=class{static getSameOriginWindowChain(e){let t=sy.get(e);if(!t){t=[],sy.set(e,t);let n=e,r;do r=nT(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,a=this.getSameOriginWindowChain(e);for(let c of a){let u=c.window.deref();if(n+=(u==null?void 0:u.scrollY)??0,r+=(u==null?void 0:u.scrollX)??0,u===t||!c.iframeElement)break;let f=c.iframeElement.getBoundingClientRect();n+=f.top,r+=f.left}return{top:n,left:r}}},Tc=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=rT.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ny=class{constructor(e,t=0,n=0){var a;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(j_){let c=navigator.userAgent.match(/Chrome\/(\d+)/);r=(c?parseInt(c[1]):123)<=122}if(e){let c=e,u=e,f=((a=e.view)==null?void 0:a.devicePixelRatio)||1;if(typeof c.wheelDeltaY<"u")r?this.deltaY=c.wheelDeltaY/(120*f):this.deltaY=c.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?Gd&&!Zi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof c.wheelDeltaX<"u")ID&&ob?this.deltaX=-(c.wheelDeltaX/120):r?this.deltaX=c.wheelDeltaX/(120*f):this.deltaX=c.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?Gd&&!Zi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*f):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},cb=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),oT;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof aT?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ht.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:cb})})(oT||(oT={}));var aT=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?cb:(this._emitter||(this._emitter=new fe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},I_=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Yd("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Yd("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},lT=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Yd("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=et(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},cT;(e=>{async function t(r){let a,c=await Promise.all(r.map(u=>u.then(f=>f,f=>{a||(a=f)})));if(typeof a<"u")throw a;return c}e.settled=t;function n(r){return new Promise(async(a,c)=>{try{await r(a,c)}catch(u){c(u)}})}e.withAsyncBody=n})(cT||(cT={}));var ry=class Ci{static fromArray(t){return new Ci(n=>{n.emitMany(t)})}static fromPromise(t){return new Ci(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Ci(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Ci(async n=>{await Promise.all(t.map(async r=>{for await(let a of r)n.emitOne(a)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new fe,queueMicrotask(async()=>{let r={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(r)),this.resolve()}catch(a){this.reject(a)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ht.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new Ci(async r=>{for await(let a of t)r.emitOne(n(a))})}map(t){return Ci.map(this,t)}static filter(t,n){return new Ci(async r=>{for await(let a of t)n(a)&&r.emitOne(a)})}filter(t){return Ci.filter(this,t)}static coalesce(t){return Ci.filter(t,n=>!!n)}coalesce(){return Ci.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Ci.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};ry.EMPTY=ry.fromArray([]);var{getWindow:Gi,getWindowId:uT,onDidRegisterWindow:hT}=(function(){let e=new Map,t={window:ks,disposables:new vn};e.set(ks.vscodeWindowId,t);let n=new fe,r=new fe,a=new fe;function c(u,f){return(typeof u=="number"?e.get(u):void 0)??(f?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:r.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Ae.None;let f=new vn,_={window:u,disposables:f.add(new vn)};return e.set(u.vscodeWindowId,_),f.add(et(()=>{e.delete(u.vscodeWindowId),r.fire(u)})),f.add(Ce(u,Mt.BEFORE_UNLOAD,()=>{a.fire(u)})),n.fire(_),f},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:c,getWindow(u){var h;let f=u;if((h=f==null?void 0:f.ownerDocument)!=null&&h.defaultView)return f.ownerDocument.defaultView.window;let _=u;return _!=null&&_.view?_.view.window:ks},getDocument(u){return Gi(u).document}}})(),fT=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ce(e,t,n,r){return new fT(e,t,n,r)}var oy=function(e,t,n,r){return Ce(e,t,n,r)},Y_,dT=class extends lT{constructor(e){super(),this.defaultTarget=e&&Gi(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},ay=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Pc(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,a=c=>{n.set(c,!1);let u=e.get(c)??[];for(t.set(c,u),e.set(c,[]),r.set(c,!0);u.length>0;)u.sort(ay.sort),u.shift().execute();r.set(c,!1)};Y_=(c,u,f=0)=>{let _=uT(c),h=new ay(u,f),p=e.get(_);return p||(p=[],e.set(_,p)),p.push(h),n.get(_)||(n.set(_,!0),c.requestAnimationFrame(()=>a(_))),h}})();function _T(e){let t=e.getBoundingClientRect(),n=Gi(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Mt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},gT=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=ti(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ti(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ti(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ti(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ti(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ti(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ti(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ti(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ti(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ti(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ti(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=ti(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=ti(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ti(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function ti(e){return typeof e=="number"?`${e}px`:e}function Ea(e){return new gT(e)}var ub=class{constructor(){this._hooks=new vn,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=a;let c=e;try{e.setPointerCapture(t),this._hooks.add(et(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{c=Gi(e)}this._hooks.add(Ce(c,Mt.POINTER_MOVE,u=>{if(u.buttons!==n){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ce(c,Mt.POINTER_UP,u=>this.stopMonitoring(!0)))}};function mT(e,t,n){let r=null,a=null;if(typeof n.value=="function"?(r="value",a=n.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",a=n.get),!a)throw new Error("not supported");let c=`$memoize$${t}`;n[r]=function(...u){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[c]}}var Xi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Xi||(Xi={}));var va=class jt extends Ae{constructor(){super(),this.dispatched=!1,this.targets=new Z0,this.ignoreTargets=new Z0,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ht.runAndSubscribe(hT,({window:t,disposables:n})=>{n.add(Ce(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Ce(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Ce(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:ks,disposables:this._store}))}static addTarget(t){if(!jt.isTouchDevice())return Ae.None;jt.INSTANCE||(jt.INSTANCE=new jt);let n=jt.INSTANCE.targets.push(t);return et(n)}static ignoreTarget(t){if(!jt.isTouchDevice())return Ae.None;jt.INSTANCE||(jt.INSTANCE=new jt);let n=jt.INSTANCE.ignoreTargets.push(t);return et(n)}static isTouchDevice(){return"ontouchstart"in ks||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,a=t.targetTouches.length;r<a;r++){let c=t.targetTouches.item(r);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:n,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[n],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let u=this.newGestureEvent(Xi.Start,c.target);u.pageX=c.pageX,u.pageY=c.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),a=Object.keys(this.activeTouches).length;for(let c=0,u=n.changedTouches.length;c<u;c++){let f=n.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(f.identifier))){console.warn("move of an UNKNOWN touch",f);continue}let _=this.activeTouches[f.identifier],h=Date.now()-_.initialTimeStamp;if(h<jt.HOLD_DELAY&&Math.abs(_.initialPageX-hi(_.rollingPageX))<30&&Math.abs(_.initialPageY-hi(_.rollingPageY))<30){let p=this.newGestureEvent(Xi.Tap,_.initialTarget);p.pageX=hi(_.rollingPageX),p.pageY=hi(_.rollingPageY),this.dispatchEvent(p)}else if(h>=jt.HOLD_DELAY&&Math.abs(_.initialPageX-hi(_.rollingPageX))<30&&Math.abs(_.initialPageY-hi(_.rollingPageY))<30){let p=this.newGestureEvent(Xi.Contextmenu,_.initialTarget);p.pageX=hi(_.rollingPageX),p.pageY=hi(_.rollingPageY),this.dispatchEvent(p)}else if(a===1){let p=hi(_.rollingPageX),m=hi(_.rollingPageY),v=hi(_.rollingTimestamps)-_.rollingTimestamps[0],b=p-_.rollingPageX[0],y=m-_.rollingPageY[0],w=[...this.targets].filter(x=>_.initialTarget instanceof Node&&x.contains(_.initialTarget));this.inertia(t,w,r,Math.abs(b)/v,b>0?1:-1,p,Math.abs(y)/v,y>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Xi.End,_.initialTarget)),delete this.activeTouches[f.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===Xi.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>jt.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Xi.Change||t.type===Xi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let a=0,c=t.initialTarget;for(;c&&c!==r;)a++,c=c.parentElement;n.push([a,r])}n.sort((r,a)=>r[0]-a[0]);for(let[r,a]of n)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,a,c,u,f,_,h){this.handle=Y_(t,()=>{let p=Date.now(),m=p-r,v=0,b=0,y=!0;a+=jt.SCROLL_FRICTION*m,f+=jt.SCROLL_FRICTION*m,a>0&&(y=!1,v=c*a*m),f>0&&(y=!1,b=_*f*m);let w=this.newGestureEvent(Xi.Change);w.translationX=v,w.translationY=b,n.forEach(x=>x.dispatchEvent(w)),y||this.inertia(t,n,p,a,c,u+v,f,_,h+b)})}onTouchMove(t){let n=Date.now();for(let r=0,a=t.changedTouches.length;r<a;r++){let c=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let u=this.activeTouches[c.identifier],f=this.newGestureEvent(Xi.Change,u.initialTarget);f.translationX=c.pageX-hi(u.rollingPageX),f.translationY=c.pageY-hi(u.rollingPageY),f.pageX=c.pageX,f.pageY=c.pageY,this.dispatchEvent(f),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(c.pageX),u.rollingPageY.push(c.pageY),u.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};va.SCROLL_FRICTION=-.005,va.HOLD_DELAY=700,va.CLEAR_TAP_COUNT_TIME=400,at([mT],va,"isTouchDevice",1);var pT=va,V_=class extends Ae{onclick(e,t){this._register(Ce(e,Mt.CLICK,n=>t(new Tc(Gi(e),n))))}onmousedown(e,t){this._register(Ce(e,Mt.MOUSE_DOWN,n=>t(new Tc(Gi(e),n))))}onmouseover(e,t){this._register(Ce(e,Mt.MOUSE_OVER,n=>t(new Tc(Gi(e),n))))}onmouseleave(e,t){this._register(Ce(e,Mt.MOUSE_LEAVE,n=>t(new Tc(Gi(e),n))))}onkeydown(e,t){this._register(Ce(e,Mt.KEY_DOWN,n=>t(new iy(n))))}onkeyup(e,t){this._register(Ce(e,Mt.KEY_UP,n=>t(new iy(n))))}oninput(e,t){this._register(Ce(e,Mt.INPUT,t))}onblur(e,t){this._register(Ce(e,Mt.BLUR,t))}onfocus(e,t){this._register(Ce(e,Mt.FOCUS,t))}onchange(e,t){this._register(Ce(e,Mt.CHANGE,t))}ignoreGesture(e){return pT.ignoreTarget(e)}},ly=11,vT=class extends V_{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=ly+"px",this.domNode.style.height=ly+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new ub),this._register(oy(this.bgDomNode,Mt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(oy(this.domNode,Mt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new dT),this._pointerdownScheduleRepeatTimer=this._register(new I_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Gi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},yT=class Qd{constructor(t,n,r,a,c,u,f){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,a=a|0,c=c|0,u=u|0,f=f|0),this.rawScrollLeft=a,this.rawScrollTop=f,n<0&&(n=0),a+n>r&&(a=r-n),a<0&&(a=0),c<0&&(c=0),f+c>u&&(f=u-c),f<0&&(f=0),this.width=n,this.scrollWidth=r,this.scrollLeft=a,this.height=c,this.scrollHeight=u,this.scrollTop=f}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new Qd(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Qd(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,c=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,f=this.scrollHeight!==t.scrollHeight,_=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:a,scrollLeftChanged:c,heightChanged:u,scrollHeightChanged:f,scrollTopChanged:_}}},ST=class extends Ae{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new yT(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new uy(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=uy.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},cy=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function _d(e,t){let n=t-e;return function(r){return e+n*xT(r)}}function bT(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var uy=class Jd{constructor(t,n,r,a){this.from=t,this.to=n,this.duration=a,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let a,c;return t<n?(a=t+.75*r,c=n-.75*r):(a=t-.75*r,c=n+.75*r),bT(_d(t,a),_d(c,n),.33)}return _d(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),a=this.scrollTop(n);return new cy(r,a,!1)}return new cy(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return Jd.start(t,n,r)}static start(t,n,r){r=r+10;let a=Date.now()-10;return new Jd(t,n,a,r)}};function wT(e){return Math.pow(e,3)}function xT(e){return 1-wT(1-e)}var CT=class extends Ae{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new I_)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},ET=140,hb=class extends V_{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new CT(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new ub),this._shouldRender=!0,this.domNode=Ea(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ce(this.domNode.domNode,Mt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new vT(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Ea(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ce(this.slider.domNode,Mt.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);n<=a&&a<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let a=_T(this.domNode.domNode);t=e.pageX-a.left,n=e.pageY-a.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let c=this._sliderOrthogonalPointerPosition(a),u=Math.abs(c-n);if(ob&&u>ET){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let f=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(f))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},fb=class e_{constructor(t,n,r,a,c,u){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=c,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,a,c){let u=Math.max(0,r-t),f=Math.max(0,u-2*n),_=a>0&&a>r;if(!_)return{computedAvailableSize:Math.round(u),computedIsNeeded:_,computedSliderSize:Math.round(f),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(r*f/a))),p=(f-h)/(a-r),m=c*p;return{computedAvailableSize:Math.round(u),computedIsNeeded:_,computedSliderSize:Math.round(h),computedSliderRatio:p,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=e_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},MT=class extends hb{constructor(e,t,n){let r=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new fb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},kT=class extends hb{constructor(e,t,n){let r=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new fb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},DT=500,hy=50,TT=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},t_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,a=this._rear;do{let c=a===this._front?t:Math.pow(2,-r);if(t-=c,n+=this._memory[a].score*c,a===this._front)break;a=(this._capacity+a-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(j_){let n=Gi(t.browserEvent),r=jD(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let a=null,c=new TT(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=c,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=c),c.score=this._computeScore(c,a)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let a=Math.abs(t.deltaX),c=Math.abs(t.deltaY),u=Math.abs(n.deltaX),f=Math.abs(n.deltaY),_=Math.max(Math.min(a,u),1),h=Math.max(Math.min(c,f),1),p=Math.max(a,u),m=Math.max(c,f);p%_===0&&m%h===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};t_.INSTANCE=new t_;var AT=t_,NT=class extends V_{constructor(e,t,n){super(),this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new fe),this.onWillScroll=this._onWillScroll.event,this._options=BT(t),this._scrollable=n,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let r={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new kT(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new MT(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Ea(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Ea(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Ea(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new I_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=nr(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Zi&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ny(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=nr(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new ny(n))};this._mouseWheelToDispose.push(Ce(this._listenOnDomNode,Mt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var a;if((a=e.browserEvent)!=null&&a.defaultPrevented)return;let t=AT.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let c=e.deltaY*this._options.mouseWheelScrollSensitivity,u=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+c===0?u=c=0:Math.abs(c)>=Math.abs(u)?u=0:c=0),this._options.flipAxes&&([c,u]=[u,c]);let f=!Zi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||f)&&!u&&(u=c,c=0),e.browserEvent&&e.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,c=c*this._options.fastScrollSensitivity);let _=this._scrollable.getFutureScrollPosition(),h={};if(c){let p=hy*c,m=_.scrollTop-(p<0?Math.floor(p):Math.ceil(p));this._verticalScrollbar.writeScrollPosition(h,m)}if(u){let p=hy*u,m=_.scrollLeft-(p<0?Math.floor(p):Math.ceil(p));this._horizontalScrollbar.writeScrollPosition(h,m)}h=this._scrollable.validateScrollPosition(h),(_.scrollLeft!==h.scrollLeft||_.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",a=t?" top":"",c=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${a}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),DT)}},RT=class extends NT{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function BT(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Zi&&(t.className+=" mac"),t}var i_=class extends Ae{constructor(e,t,n,r,a,c,u,f){super(),this._bufferService=n,this._optionsService=u,this._renderService=f,this._onRequestScrollLines=this._register(new fe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let _=this._register(new ST({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>Y_(r.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{_.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new RT(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},_)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ht.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(et(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(et(()=>this._styleElement.remove())),this._register(Ht.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
91
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};i_=at([ge(2,$t),ge(3,Ns),ge(4,W1),ge(5,uo),ge(6,Wt),ge(7,Rs)],i_);var s_=class extends Ae{constructor(e,t,n,r,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=a,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(this._coreBrowserService.onDprChange(()=>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(c=>this._removeDecoration(c))),this._register(et(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};s_=at([ge(1,$t),ge(2,Ns),ge(3,Xa),ge(4,Rs)],s_);var LT=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},$i={full:0,left:0,center:0,right:0},dn={full:0,left:0,center:0,right:0},ua={full:0,left:0,center:0,right:0},nu=class extends Ae{constructor(e,t,n,r,a,c,u,f){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=a,this._optionsService=c,this._themeService=u,this._coreBrowserService=f,this._colorZoneStore=new LT,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(et(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let _=this._canvas.getContext("2d");if(_)this._ctx=_;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);dn.full=this._canvas.width,dn.left=e,dn.center=t,dn.right=e,this._refreshDrawHeightConstants(),ua.full=1,ua.left=1,ua.center=1+dn.left,ua.right=1+dn.left+dn.center}_refreshDrawHeightConstants(){$i.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);$i.left=t,$i.center=t,$i.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$i.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$i.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$i.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$i.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._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(ua[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-$i[e.position||"full"]/2),dn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+$i[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};nu=at([ge(2,$t),ge(3,Xa),ge(4,Rs),ge(5,Wt),ge(6,uo),ge(7,Ns)],nu);var oe;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
92
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(oe||(oe={}));var Ic;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Ic||(Ic={}));var db;(e=>e.ST=`${oe.ESC}\\`)(db||(db={}));var n_=class{constructor(e,t,n,r,a,c){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=a,this._renderService=c,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${oe.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n_=at([ge(2,$t),ge(3,Wt),ge(4,or),ge(5,Rs)],n_);var kt=0,Dt=0,Tt=0,ot=0,fy={css:"#00000000",rgba:0},pt;(e=>{function t(a,c,u,f){return f!==void 0?`#${$n(a)}${$n(c)}${$n(u)}${$n(f)}`:`#${$n(a)}${$n(c)}${$n(u)}`}e.toCss=t;function n(a,c,u,f=255){return(a<<24|c<<16|u<<8|f)>>>0}e.toRgba=n;function r(a,c,u,f){return{css:e.toCss(a,c,u,f),rgba:e.toRgba(a,c,u,f)}}e.toColor=r})(pt||(pt={}));var Ze;(e=>{function t(_,h){if(ot=(h.rgba&255)/255,ot===1)return{css:h.css,rgba:h.rgba};let p=h.rgba>>24&255,m=h.rgba>>16&255,v=h.rgba>>8&255,b=_.rgba>>24&255,y=_.rgba>>16&255,w=_.rgba>>8&255;kt=b+Math.round((p-b)*ot),Dt=y+Math.round((m-y)*ot),Tt=w+Math.round((v-w)*ot);let x=pt.toCss(kt,Dt,Tt),E=pt.toRgba(kt,Dt,Tt);return{css:x,rgba:E}}e.blend=t;function n(_){return(_.rgba&255)===255}e.isOpaque=n;function r(_,h,p){let m=Yc.ensureContrastRatio(_.rgba,h.rgba,p);if(m)return pt.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=r;function a(_){let h=(_.rgba|255)>>>0;return[kt,Dt,Tt]=Yc.toChannels(h),{css:pt.toCss(kt,Dt,Tt),rgba:h}}e.opaque=a;function c(_,h){return ot=Math.round(h*255),[kt,Dt,Tt]=Yc.toChannels(_.rgba),{css:pt.toCss(kt,Dt,Tt,ot),rgba:pt.toRgba(kt,Dt,Tt,ot)}}e.opacity=c;function u(_,h){return ot=_.rgba&255,c(_,ot*h/255)}e.multiplyOpacity=u;function f(_){return[_.rgba>>24&255,_.rgba>>16&255,_.rgba>>8&255]}e.toColorRGB=f})(Ze||(Ze={}));var st;(e=>{let t,n;try{let a=document.createElement("canvas");a.width=1,a.height=1;let c=a.getContext("2d",{willReadFrequently:!0});c&&(t=c,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return kt=parseInt(a.slice(1,2).repeat(2),16),Dt=parseInt(a.slice(2,3).repeat(2),16),Tt=parseInt(a.slice(3,4).repeat(2),16),pt.toColor(kt,Dt,Tt);case 5:return kt=parseInt(a.slice(1,2).repeat(2),16),Dt=parseInt(a.slice(2,3).repeat(2),16),Tt=parseInt(a.slice(3,4).repeat(2),16),ot=parseInt(a.slice(4,5).repeat(2),16),pt.toColor(kt,Dt,Tt,ot);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let c=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return kt=parseInt(c[1]),Dt=parseInt(c[2]),Tt=parseInt(c[3]),ot=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),pt.toColor(kt,Dt,Tt,ot);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[kt,Dt,Tt,ot]=t.getImageData(0,0,1,1).data,ot!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:pt.toRgba(kt,Dt,Tt,ot),css:a}}e.toColor=r})(st||(st={}));var Vt;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,a,c){let u=r/255,f=a/255,_=c/255,h=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),m=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4);return h*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(Vt||(Vt={}));var Yc;(e=>{function t(u,f){if(ot=(f&255)/255,ot===1)return f;let _=f>>24&255,h=f>>16&255,p=f>>8&255,m=u>>24&255,v=u>>16&255,b=u>>8&255;return kt=m+Math.round((_-m)*ot),Dt=v+Math.round((h-v)*ot),Tt=b+Math.round((p-b)*ot),pt.toRgba(kt,Dt,Tt)}e.blend=t;function n(u,f,_){let h=Vt.relativeLuminance(u>>8),p=Vt.relativeLuminance(f>>8);if(Es(h,p)<_){if(p<h){let b=r(u,f,_),y=Es(h,Vt.relativeLuminance(b>>8));if(y<_){let w=a(u,f,_),x=Es(h,Vt.relativeLuminance(w>>8));return y>x?b:w}return b}let m=a(u,f,_),v=Es(h,Vt.relativeLuminance(m>>8));if(v<_){let b=r(u,f,_),y=Es(h,Vt.relativeLuminance(b>>8));return v>y?m:b}return m}}e.ensureContrastRatio=n;function r(u,f,_){let h=u>>24&255,p=u>>16&255,m=u>>8&255,v=f>>24&255,b=f>>16&255,y=f>>8&255,w=Es(Vt.relativeLuminance2(v,b,y),Vt.relativeLuminance2(h,p,m));for(;w<_&&(v>0||b>0||y>0);)v-=Math.max(0,Math.ceil(v*.1)),b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),w=Es(Vt.relativeLuminance2(v,b,y),Vt.relativeLuminance2(h,p,m));return(v<<24|b<<16|y<<8|255)>>>0}e.reduceLuminance=r;function a(u,f,_){let h=u>>24&255,p=u>>16&255,m=u>>8&255,v=f>>24&255,b=f>>16&255,y=f>>8&255,w=Es(Vt.relativeLuminance2(v,b,y),Vt.relativeLuminance2(h,p,m));for(;w<_&&(v<255||b<255||y<255);)v=Math.min(255,v+Math.ceil((255-v)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),w=Es(Vt.relativeLuminance2(v,b,y),Vt.relativeLuminance2(h,p,m));return(v<<24|b<<16|y<<8|255)>>>0}e.increaseLuminance=a;function c(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=c})(Yc||(Yc={}));function $n(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Es(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var zT=class extends Wa{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ru=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Mi}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),a=0,c=0,u=0,f=t.getFg(0),_=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==_){if(h-a>1){let p=this._getJoinedRanges(r,u,c,t,a);for(let m=0;m<p.length;m++)n.push(p[m])}a=h,u=c,f=this._workCell.fg,_=this._workCell.bg}c+=this._workCell.getChars().length||pn.length}if(this._bufferService.cols-a>1){let h=this._getJoinedRanges(r,u,c,t,a);for(let p=0;p<h.length;p++)n.push(h[p])}return n}_getJoinedRanges(e,t,n,r,a){let c=e.substring(t,n),u=[];try{u=this._characterJoiners[0].handler(c)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let _=this._characterJoiners[f].handler(c);for(let h=0;h<_.length;h++)ru._mergeRanges(u,_[h])}catch(_){console.error(_)}return this._stringRangesToCellRanges(u,r,a),u}_stringRangesToCellRanges(e,t,n){let r=0,a=!1,c=0,u=e[r];if(u){for(let f=n;f<this._bufferService.cols;f++){let _=t.getWidth(f),h=t.getString(f).length||pn.length;if(_!==0){if(!a&&u[0]<=c&&(u[0]=f,a=!0),u[1]<=c){if(u[1]=f,u=e[++r],!u)break;u[0]<=c?(u[0]=f,a=!0):a=!1}c+=h}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let a=e[r];if(n){if(t[1]<=a[0])return e[r-1][1]=t[1],e;if(t[1]<=a[1])return e[r-1][1]=Math.max(t[1],a[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=a[0])return e.splice(r,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};ru=at([ge(0,$t)],ru);function OT(e){return 57508<=e&&e<=57558}function HT(e){return 9472<=e&&e<=9631}function UT(e){return OT(e)||HT(e)}function PT(){return{css:{canvas:Ac(),cell:Ac()},device:{canvas:Ac(),cell:Ac(),char:{width:0,height:0,left:0,top:0}}}}function Ac(){return{width:0,height:0}}var r_=class{constructor(e,t,n,r,a,c,u){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=a,this._decorationService=c,this._themeService=u,this._workCell=new Mi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,a,c,u,f,_,h,p){let m=[],v=this._characterJoinerService.getJoinedCharacters(t),b=this._themeService.colors,y=e.getNoBgTrimmedLength();n&&y<c+1&&(y=c+1);let w,x=0,E="",L=0,C=0,D=0,I=0,z=!1,P=0,W=!1,G=0,ae=0,X=[],q=h!==-1&&p!==-1;for(let Y=0;Y<y;Y++){e.loadCell(Y,this._workCell);let A=this._workCell.getWidth();if(A===0)continue;let H=!1,M=Y>=ae,B=Y,R=this._workCell;if(v.length>0&&Y===v[0][0]&&M){let de=v.shift(),Me=this._isCellInSelection(de[0],t);for(L=de[0]+1;L<de[1];L++)M&&(M=Me===this._isCellInSelection(L,t));M&&(M=!n||c<de[0]||c>=de[1]),M?(H=!0,R=new zT(this._workCell,e.translateToString(!0,de[0],de[1]),de[1]-de[0]),B=de[1]-1,A=R.getWidth()):ae=de[1]}let U=this._isCellInSelection(Y,t),Q=n&&Y===c,T=q&&Y>=h&&Y<=p,j=!1;this._decorationService.forEachDecorationAtCell(Y,t,void 0,de=>{j=!0});let ee=R.getChars()||pn;if(ee===" "&&(R.isUnderline()||R.isOverline())&&(ee=" "),G=A*f-_.get(ee,R.isBold(),R.isItalic()),!w)w=this._document.createElement("span");else if(x&&(U&&W||!U&&!W&&R.bg===C)&&(U&&W&&b.selectionForeground||R.fg===D)&&R.extended.ext===I&&T===z&&G===P&&!Q&&!H&&!j&&M){R.isInvisible()?E+=pn:E+=ee,x++;continue}else x&&(w.textContent=E),w=this._document.createElement("span"),x=0,E="";if(C=R.bg,D=R.fg,I=R.extended.ext,z=T,P=G,W=U,H&&c>=Y&&c<=B&&(c=Y),!this._coreService.isCursorHidden&&Q&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&X.push("xterm-cursor-blink"),X.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline");break}}if(R.isBold()&&X.push("xterm-bold"),R.isItalic()&&X.push("xterm-italic"),R.isDim()&&X.push("xterm-dim"),R.isInvisible()?E=pn:E=R.getChars()||pn,R.isUnderline()&&(X.push(`xterm-underline-${R.extended.underlineStyle}`),E===" "&&(E=" "),!R.isUnderlineColorDefault()))if(R.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${Wa.toColorRGB(R.getUnderlineColor()).join(",")})`;else{let de=R.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&R.isBold()&&de<8&&(de+=8),w.style.textDecorationColor=b.ansi[de].css}R.isOverline()&&(X.push("xterm-overline"),E===" "&&(E=" ")),R.isStrikethrough()&&X.push("xterm-strikethrough"),T&&(w.style.textDecoration="underline");let te=R.getFgColor(),le=R.getFgColorMode(),ce=R.getBgColor(),he=R.getBgColorMode(),ue=!!R.isInverse();if(ue){let de=te;te=ce,ce=de;let Me=le;le=he,he=Me}let _e,xe,be=!1;this._decorationService.forEachDecorationAtCell(Y,t,void 0,de=>{de.options.layer!=="top"&&be||(de.backgroundColorRGB&&(he=50331648,ce=de.backgroundColorRGB.rgba>>8&16777215,_e=de.backgroundColorRGB),de.foregroundColorRGB&&(le=50331648,te=de.foregroundColorRGB.rgba>>8&16777215,xe=de.foregroundColorRGB),be=de.options.layer==="top")}),!be&&U&&(_e=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,ce=_e.rgba>>8&16777215,he=50331648,be=!0,b.selectionForeground&&(le=50331648,te=b.selectionForeground.rgba>>8&16777215,xe=b.selectionForeground)),be&&X.push("xterm-decoration-top");let pe;switch(he){case 16777216:case 33554432:pe=b.ansi[ce],X.push(`xterm-bg-${ce}`);break;case 50331648:pe=pt.toColor(ce>>16,ce>>8&255,ce&255),this._addStyle(w,`background-color:#${dy((ce>>>0).toString(16),"0",6)}`);break;case 0:default:ue?(pe=b.foreground,X.push("xterm-bg-257")):pe=b.background}switch(_e||R.isDim()&&(_e=Ze.multiplyOpacity(pe,.5)),le){case 16777216:case 33554432:R.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(w,pe,b.ansi[te],R,_e,void 0)||X.push(`xterm-fg-${te}`);break;case 50331648:let de=pt.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(w,pe,de,R,_e,xe)||this._addStyle(w,`color:#${dy(te.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,pe,b.foreground,R,_e,xe)||ue&&X.push("xterm-fg-257")}X.length&&(w.className=X.join(" "),X.length=0),!Q&&!H&&!j&&M?x++:w.textContent=E,G!==this.defaultSpacing&&(w.style.letterSpacing=`${G}px`),m.push(w),Y=B}return w&&x&&(w.textContent=E),m}_applyMinimumContrast(e,t,n,r,a,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||UT(r.getCode()))return!1;let u=this._getContrastCache(r),f;if(!a&&!c&&(f=u.getColor(t.rgba,n.rgba)),f===void 0){let _=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);f=Ze.ensureContrastRatio(a||t,c||n,_),u.setColor((a||t).rgba,(c||n).rgba,f??null)}return f?(this._addStyle(e,`color:${f.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};r_=at([ge(1,G1),ge(2,Wt),ge(3,Ns),ge(4,or),ge(5,Xa),ge(6,uo)],r_);function dy(e,t,n){for(;e.length<n;)e=t+e;return e}var jT=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[n,r,a,c],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(a),this._container.appendChild(c),t.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(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let u=this._measure(e,0);return u>0&&(this._flat[r]=u),u}let a=e;t&&(a+="B"),n&&(a+="I");let c=this._holey.get(a);if(c===void 0){let u=0;t&&(u|=1),n&&(u|=2),c=this._measure(e,u),c>0&&this._holey.set(a,c)}return c}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},qT=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let a=e.buffers.active.ydisp,c=t[1]-a,u=n[1]-a,f=Math.max(c,0),_=Math.min(u,e.rows-1);if(f>=e.rows||_<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=c,this.viewportEndRow=u,this.viewportCappedStartRow=f,this.viewportCappedEndRow=_,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function IT(){return new qT}var gd="xterm-dom-renderer-owner-",xi="xterm-rows",Nc="xterm-fg-",_y="xterm-bg-",ha="xterm-focus",Rc="xterm-selection",YT=1,o_=class extends Ae{constructor(e,t,n,r,a,c,u,f,_,h,p,m,v,b){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=a,this._helperContainer=c,this._linkifier2=u,this._charSizeService=_,this._optionsService=h,this._bufferService=p,this._coreService=m,this._coreBrowserService=v,this._themeService=b,this._terminalClass=YT++,this._rowElements=[],this._selectionRenderModel=IT(),this.onRequestRedraw=this._register(new fe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(xi),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Rc),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=PT(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(y=>this._injectCss(y))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance(r_,document),this._element.classList.add(gd+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(y=>this._handleLinkHover(y))),this._register(this._linkifier2.onHideLinkUnderline(y=>this._handleLinkLeave(y))),this._register(et(()=>{this._element.classList.remove(gd+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new jT(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${xi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${xi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${xi} .xterm-dim { color: ${Ze.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${xi}.${ha} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${xi}.${ha} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${xi}.${ha} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${xi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${xi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${xi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${xi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${xi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Rc} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Rc} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Rc} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,u]of e.ansi.entries())t+=`${this._terminalSelector} .${Nc}${c} { color: ${u.css}; }${this._terminalSelector} .${Nc}${c}.xterm-dim { color: ${Ze.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${_y}${c} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${Nc}257 { color: ${Ze.opaque(e.background).css}; }${this._terminalSelector} .${Nc}257.xterm-dim { color: ${Ze.multiplyOpacity(Ze.opaque(e.background),.5).css}; }${this._terminalSelector} .${_y}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(ha),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ha),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(n){let _=e[0]>t[0];f.appendChild(this._createSelectionElement(c,_?t[0]:e[0],_?e[0]:t[0],u-c+1))}else{let _=r===c?e[0]:0,h=c===a?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(c,_,h));let p=u-c-1;if(f.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,p)),c!==u){let m=a===u?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(u,0,m))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,n,r=1){let a=this._document.createElement("div"),c=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(n-t);return c+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-c),a.style.height=`${r*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${c}px`,a.style.width=`${u}px`,a}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,a=Math.min(n.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=e;_<=t;_++){let h=_+n.ydisp,p=this._rowElements[_],m=n.lines.get(h);if(!p||!m)break;p.replaceChildren(...this._rowFactory.createRow(m,h,h===r,u,f,a,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${gd}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,a,c){n<0&&(e=0),r<0&&(t=0);let u=this._bufferService.rows-1;n=Math.max(Math.min(n,u),0),r=Math.max(Math.min(r,u),0),a=Math.min(a,this._bufferService.cols);let f=this._bufferService.buffer,_=f.ybase+f.y,h=Math.min(f.x,a-1),p=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,v=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=r;++b){let y=b+f.ydisp,w=this._rowElements[b],x=f.lines.get(y);if(!w||!x)break;w.replaceChildren(...this._rowFactory.createRow(x,y,y===_,m,v,h,p,this.dimensions.css.cell.width,this._widthCache,c?b===n?e:0:-1,c?(b===r?t:a)-1:-1))}}};o_=at([ge(7,H_),ge(8,Cu),ge(9,Wt),ge(10,$t),ge(11,or),ge(12,Ns),ge(13,uo)],o_);var a_=class extends Ae{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new fe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new $T(this._optionsService))}catch{this._measureStrategy=this._register(new VT(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};a_=at([ge(2,Wt)],a_);var _b=class extends Ae{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},VT=class extends _b{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},$T=class extends _b{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},WT=class extends Ae{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new XT(this._window)),this._onDprChange=this._register(new fe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new fe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Ht.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ce(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ce(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}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}},XT=class extends Ae{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new co),this._onDprChange=this._register(new fe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(et(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ce(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},KT=class extends Ae{constructor(){super(),this.linkProviders=[],this._register(et(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function $_(e,t,n){let r=n.getBoundingClientRect(),a=e.getComputedStyle(n),c=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-r.left-c,t.clientY-r.top-u]}function GT(e,t,n,r,a,c,u,f,_){if(!c)return;let h=$_(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(_?u/2:0))/u),h[1]=Math.ceil(h[1]/f),h[0]=Math.min(Math.max(h[0],1),r+(_?1:0)),h[1]=Math.min(Math.max(h[1],1),a),h}var l_=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,a){return GT(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let n=$_(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};l_=at([ge(0,Rs),ge(1,Cu)],l_);var FT=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},gb={};oD(gb,{getSafariVersion:()=>QT,isChromeOS:()=>yb,isFirefox:()=>mb,isIpad:()=>JT,isIphone:()=>eA,isLegacyEdge:()=>ZT,isLinux:()=>W_,isMac:()=>ou,isNode:()=>Eu,isSafari:()=>pb,isWindows:()=>vb});var Eu=typeof process<"u"&&"title"in process,Ka=Eu?"node":navigator.userAgent,Ga=Eu?"node":navigator.platform,mb=Ka.includes("Firefox"),ZT=Ka.includes("Edge"),pb=/^((?!chrome|android).)*safari/i.test(Ka);function QT(){if(!pb)return 0;let e=Ka.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ou=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ga),JT=Ga==="iPad",eA=Ga==="iPhone",vb=["Windows","Win16","Win32","WinCE"].includes(Ga),W_=Ga.indexOf("Linux")>=0,yb=/\bCrOS\b/.test(Ka),Sb=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),a=e.timeRemaining(),n*1.5>a){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=a}this.clear()}},tA=class extends Sb{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},iA=class extends Sb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},au=!Eu&&"requestIdleCallback"in window?iA:tA,sA=class{constructor(){this._queue=new au}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},c_=class extends Ae{constructor(e,t,n,r,a,c,u,f,_){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=a,this._coreBrowserService=f,this._renderer=this._register(new co),this._pausedResizeTask=new sA,this._observerDisposable=this._register(new co),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 fe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new fe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new fe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new fe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new FT((h,p)=>this._renderRows(h,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new nA(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(et(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(_.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=et(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};c_=at([ge(2,Wt),ge(3,Cu),ge(4,or),ge(5,Xa),ge(6,$t),ge(7,Ns),ge(8,uo)],c_);var nA=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function rA(e,t,n,r){let a=n.buffer.x,c=n.buffer.y;if(!n.buffer.hasScrollback)return lA(a,c,e,t,n,r)+Mu(c,t,n,r)+cA(a,c,e,t,n,r);let u;if(c===t)return u=a>e?"D":"C",Oa(Math.abs(a-e),za(u,r));u=c>t?"D":"C";let f=Math.abs(c-t),_=aA(c>t?e:a,n)+(f-1)*n.cols+1+oA(c>t?a:e);return Oa(_,za(u,r))}function oA(e,t){return e-1}function aA(e,t){return t.cols-e}function lA(e,t,n,r,a,c){return Mu(t,r,a,c).length===0?"":Oa(wb(e,t,e,t-rr(t,a),!1,a).length,za("D",c))}function Mu(e,t,n,r){let a=e-rr(e,n),c=t-rr(t,n),u=Math.abs(a-c)-uA(e,t,n);return Oa(u,za(bb(e,t),r))}function cA(e,t,n,r,a,c){let u;Mu(t,r,a,c).length>0?u=r-rr(r,a):u=t;let f=r,_=hA(e,t,n,r,a,c);return Oa(wb(e,u,n,f,_==="C",a).length,za(_,c))}function uA(e,t,n){var u;let r=0,a=e-rr(e,n),c=t-rr(t,n);for(let f=0;f<Math.abs(a-c);f++){let _=bb(e,t)==="A"?-1:1;(u=n.buffer.lines.get(a+_*f))!=null&&u.isWrapped&&r++}return r}function rr(e,t){let n=0,r=t.buffer.lines.get(e),a=r==null?void 0:r.isWrapped;for(;a&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),a=r==null?void 0:r.isWrapped;return n}function hA(e,t,n,r,a,c){let u;return Mu(n,r,a,c).length>0?u=r-rr(r,a):u=t,e<n&&u<=r||e>=n&&u<r?"C":"D"}function bb(e,t){return e>t?"A":"B"}function wb(e,t,n,r,a,c){let u=e,f=t,_="";for(;(u!==n||f!==r)&&f>=0&&f<c.buffer.lines.length;)u+=a?1:-1,a&&u>c.cols-1?(_+=c.buffer.translateBufferLineToString(f,!1,e,u),u=0,e=0,f++):!a&&u<0&&(_+=c.buffer.translateBufferLineToString(f,!1,0,e+1),u=c.cols-1,e=u,f--);return _+c.buffer.translateBufferLineToString(f,!1,e,u)}function za(e,t){let n=t?"O":"[";return oe.ESC+n+e}function Oa(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var fA=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function gy(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var md=50,dA=15,_A=50,gA=500,mA=" ",pA=new RegExp(mA,"g"),u_=class extends Ae{constructor(e,t,n,r,a,c,u,f,_){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=a,this._mouseService=c,this._optionsService=u,this._renderService=f,this._coreBrowserService=_,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Mi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new fe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new fe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new fe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new fe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new fA(this._bufferService),this._activeSelectionMode=0,this._register(et(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],c=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let f=n.translateBufferLineToString(u,!0,a,c);r.push(f)}}else{let a=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],a));for(let c=e[1]+1;c<=t[1]-1;c++){let u=n.lines.get(c),f=n.translateBufferLineToString(c,!0);u!=null&&u.isWrapped?r[r.length-1]+=f:r.push(f)}if(e[1]!==t[1]){let c=n.lines.get(t[1]),u=n.translateBufferLineToString(t[1],!0,0,t[0]);c&&c.isWrapped?r[r.length-1]+=u:r.push(u)}}return r.map(a=>a.replace(pA," ")).join(vb?`\r
|
|
93
|
+
`:`
|
|
94
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),W_&&e&&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(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var a,c;let n=(c=(a=this._linkifier.currentLink)==null?void 0:a.link)==null?void 0:c.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=gy(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=$_(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-md),md),t/=md,t/Math.abs(t)+Math.round(t*(dA-1)))}shouldForceSelection(e){return ou?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),_A)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(ou&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<gA&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=rA(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let a=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:a>1&&t!==r&&(n+=a-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,c=a.lines.get(e[1]);if(!c)return;let u=a.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(c,e[0]),_=f,h=e[0]-f,p=0,m=0,v=0,b=0;if(u.charAt(f)===" "){for(;f>0&&u.charAt(f-1)===" ";)f--;for(;_<u.length&&u.charAt(_+1)===" ";)_++}else{let x=e[0],E=e[0];c.getWidth(x)===0&&(p++,x--),c.getWidth(E)===2&&(m++,E++);let L=c.getString(E).length;for(L>1&&(b+=L-1,_+=L-1);x>0&&f>0&&!this._isCharWordSeparator(c.loadCell(x-1,this._workCell));){c.loadCell(x-1,this._workCell);let C=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,x--):C>1&&(v+=C-1,f-=C-1),f--,x--}for(;E<c.length&&_+1<u.length&&!this._isCharWordSeparator(c.loadCell(E+1,this._workCell));){c.loadCell(E+1,this._workCell);let C=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,E++):C>1&&(b+=C-1,_+=C-1),_++,E++}}_++;let y=f+h-p+v,w=Math.min(this._bufferService.cols,_-f+p+m-v-b);if(!(!t&&u.slice(f,_).trim()==="")){if(n&&y===0&&c.getCodePoint(0)!==32){let x=a.lines.get(e[1]-1);if(x&&c.isWrapped&&x.getCodePoint(this._bufferService.cols-1)!==32){let E=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(E){let L=this._bufferService.cols-E.start;y-=L,w+=L}}}if(r&&y+w===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let x=a.lines.get(e[1]+1);if(x!=null&&x.isWrapped&&x.getCodePoint(0)!==32){let E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(w+=E.length)}}return{start:y,length:w}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=gy(n,this._bufferService.cols)}};u_=at([ge(3,$t),ge(4,or),ge(5,U_),ge(6,Wt),ge(7,Rs),ge(8,Ns)],u_);var my=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},py=class{constructor(){this._color=new my,this._css=new my}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},bt=Object.freeze((()=>{let e=[st.toColor("#2e3436"),st.toColor("#cc0000"),st.toColor("#4e9a06"),st.toColor("#c4a000"),st.toColor("#3465a4"),st.toColor("#75507b"),st.toColor("#06989a"),st.toColor("#d3d7cf"),st.toColor("#555753"),st.toColor("#ef2929"),st.toColor("#8ae234"),st.toColor("#fce94f"),st.toColor("#729fcf"),st.toColor("#ad7fa8"),st.toColor("#34e2e2"),st.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],a=t[n/6%6|0],c=t[n%6];e.push({css:pt.toCss(r,a,c),rgba:pt.toRgba(r,a,c)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:pt.toCss(r,r,r),rgba:pt.toRgba(r,r,r)})}return e})()),Xn=st.toColor("#ffffff"),ya=st.toColor("#000000"),vy=st.toColor("#ffffff"),yy=ya,fa={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},vA=Xn,h_=class extends Ae{constructor(e){super(),this._optionsService=e,this._contrastCache=new py,this._halfContrastCache=new py,this._onChangeColors=this._register(new fe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Xn,background:ya,cursor:vy,cursorAccent:yy,selectionForeground:void 0,selectionBackgroundTransparent:fa,selectionBackgroundOpaque:Ze.blend(ya,fa),selectionInactiveBackgroundTransparent:fa,selectionInactiveBackgroundOpaque:Ze.blend(ya,fa),scrollbarSliderBackground:Ze.opacity(Xn,.2),scrollbarSliderHoverBackground:Ze.opacity(Xn,.4),scrollbarSliderActiveBackground:Ze.opacity(Xn,.5),overviewRulerBorder:Xn,ansi:bt.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=Xe(e.foreground,Xn),t.background=Xe(e.background,ya),t.cursor=Ze.blend(t.background,Xe(e.cursor,vy)),t.cursorAccent=Ze.blend(t.background,Xe(e.cursorAccent,yy)),t.selectionBackgroundTransparent=Xe(e.selectionBackground,fa),t.selectionBackgroundOpaque=Ze.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Xe(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ze.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Xe(e.selectionForeground,fy):void 0,t.selectionForeground===fy&&(t.selectionForeground=void 0),Ze.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ze.opacity(t.selectionBackgroundTransparent,.3)),Ze.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ze.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Xe(e.scrollbarSliderBackground,Ze.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Xe(e.scrollbarSliderHoverBackground,Ze.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Xe(e.scrollbarSliderActiveBackground,Ze.opacity(t.foreground,.5)),t.overviewRulerBorder=Xe(e.overviewRulerBorder,vA),t.ansi=bt.slice(),t.ansi[0]=Xe(e.black,bt[0]),t.ansi[1]=Xe(e.red,bt[1]),t.ansi[2]=Xe(e.green,bt[2]),t.ansi[3]=Xe(e.yellow,bt[3]),t.ansi[4]=Xe(e.blue,bt[4]),t.ansi[5]=Xe(e.magenta,bt[5]),t.ansi[6]=Xe(e.cyan,bt[6]),t.ansi[7]=Xe(e.white,bt[7]),t.ansi[8]=Xe(e.brightBlack,bt[8]),t.ansi[9]=Xe(e.brightRed,bt[9]),t.ansi[10]=Xe(e.brightGreen,bt[10]),t.ansi[11]=Xe(e.brightYellow,bt[11]),t.ansi[12]=Xe(e.brightBlue,bt[12]),t.ansi[13]=Xe(e.brightMagenta,bt[13]),t.ansi[14]=Xe(e.brightCyan,bt[14]),t.ansi[15]=Xe(e.brightWhite,bt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=Xe(e.extendedAnsi[r],bt[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};h_=at([ge(0,Wt)],h_);function Xe(e,t){if(e!==void 0)try{return st.toColor(e)}catch{}return t}var yA=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},SA=class{constructor(){this._services=new yA,this._services.set(H_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=dD(e).sort((c,u)=>c.index-u.index),r=[];for(let c of n){let u=this._services.get(c.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);r.push(u)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},bA={trace:0,debug:1,info:2,warn:3,error:4,off:5},wA="xterm.js: ",f_=class extends Ae{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=bA[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":wA)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};f_=at([ge(0,Wt)],f_);var Sy=class extends Ae{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new fe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new fe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new fe),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let a=t-1;a>=0;a--)this.set(e+a+n,this.get(e+a));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Te=3,mt=Object.freeze(new Wa),Bc=0,pd=2,Sa=class xb{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Te);let a=n||Mi.fromCharData([0,I1,1,0]);for(let c=0;c<t;++c)this.setCell(c,a);this.length=t}get(t){let n=this._data[t*Te+0],r=n&2097151;return[this._data[t*Te+1],n&2097152?this._combined[t]:r?gn(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*Te+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Te+0]=t|2097152|n[2]<<22):this._data[t*Te+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Te+0]>>22}hasWidth(t){return this._data[t*Te+0]&12582912}getFg(t){return this._data[t*Te+1]}getBg(t){return this._data[t*Te+2]}hasContent(t){return this._data[t*Te+0]&4194303}getCodePoint(t){let n=this._data[t*Te+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Te+0]&2097152}getString(t){let n=this._data[t*Te+0];return n&2097152?this._combined[t]:n&2097151?gn(n&2097151):""}isProtected(t){return this._data[t*Te+2]&536870912}loadCell(t,n){return Bc=t*Te,n.content=this._data[Bc+0],n.fg=this._data[Bc+1],n.bg=this._data[Bc+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Te+0]=n.content,this._data[t*Te+1]=n.fg,this._data[t*Te+2]=n.bg}setCellFromCodepoint(t,n,r,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Te+0]=n|r<<22,this._data[t*Te+1]=a.fg,this._data[t*Te+2]=a.bg}addCodepointToCell(t,n,r){let a=this._data[t*Te+0];a&2097152?this._combined[t]+=gn(n):a&2097151?(this._combined[t]=gn(a&2097151)+gn(n),a&=-2097152,a|=2097152):a=n|1<<22,r&&(a&=-12582913,a|=r<<22),this._data[t*Te+0]=a}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let a=new Mi;for(let c=this.length-t-n-1;c>=0;--c)this.setCell(t+n+c,this.loadCell(t+c,a));for(let c=0;c<n;++c)this.setCell(t+c,r)}else for(let a=t;a<this.length;++a)this.setCell(a,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let a=new Mi;for(let c=0;c<this.length-t-n;++c)this.setCell(t+c,this.loadCell(t+n+c,a));for(let c=this.length-n;c<this.length;++c)this.setCell(c,r)}else for(let a=t;a<this.length;++a)this.setCell(a,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*pd<this._data.buffer.byteLength;let r=t*Te;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let a=new Uint32Array(r);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,n)}else{this._data=this._data.subarray(0,r);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let f=parseInt(a[u],10);f>=t&&delete this._combined[f]}let c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){let f=parseInt(c[u],10);f>=t&&delete this._extendedAttrs[f]}}return this.length=t,r*4*pd<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*pd<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new xb(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Te+0]&4194303)return t+(this._data[t*Te+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Te+0]&4194303||this._data[t*Te+2]&50331648)return t+(this._data[t*Te+0]>>22);return 0}copyCellsFrom(t,n,r,a,c){let u=t._data;if(c)for(let _=a-1;_>=0;_--){for(let h=0;h<Te;h++)this._data[(r+_)*Te+h]=u[(n+_)*Te+h];u[(n+_)*Te+2]&268435456&&(this._extendedAttrs[r+_]=t._extendedAttrs[n+_])}else for(let _=0;_<a;_++){for(let h=0;h<Te;h++)this._data[(r+_)*Te+h]=u[(n+_)*Te+h];u[(n+_)*Te+2]&268435456&&(this._extendedAttrs[r+_]=t._extendedAttrs[n+_])}let f=Object.keys(t._combined);for(let _=0;_<f.length;_++){let h=parseInt(f[_],10);h>=n&&(this._combined[h-n+r]=t._combined[h])}}translateToString(t,n,r,a){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),a&&(a.length=0);let c="";for(;n<r;){let u=this._data[n*Te+0],f=u&2097151,_=u&2097152?this._combined[n]:f?gn(f):pn;if(c+=_,a)for(let h=0;h<_.length;++h)a.push(n);n+=u>>22||1}return a&&a.push(n),c}};function xA(e,t,n,r,a,c){let u=[];for(let f=0;f<e.length-1;f++){let _=f,h=e.get(++_);if(!h.isWrapped)continue;let p=[e.get(f)];for(;_<e.length&&h.isWrapped;)p.push(h),h=e.get(++_);if(!c&&r>=f&&r<_){f+=p.length-1;continue}let m=0,v=Ha(p,m,t),b=1,y=0;for(;b<p.length;){let x=Ha(p,b,t),E=x-y,L=n-v,C=Math.min(E,L);p[m].copyCellsFrom(p[b],y,v,C,!1),v+=C,v===n&&(m++,v=0),y+=C,y===x&&(b++,y=0),v===0&&m!==0&&p[m-1].getWidth(n-1)===2&&(p[m].copyCellsFrom(p[m-1],n-1,v++,1,!1),p[m-1].setCell(n-1,a))}p[m].replaceCells(v,n,a);let w=0;for(let x=p.length-1;x>0&&(x>m||p[x].getTrimmedLength()===0);x--)w++;w>0&&(u.push(f+p.length-w),u.push(w)),f+=p.length-1}return u}function CA(e,t){let n=[],r=0,a=t[r],c=0;for(let u=0;u<e.length;u++)if(a===u){let f=t[++r];e.onDeleteEmitter.fire({index:u-c,amount:f}),u+=f-1,c+=f,a=t[++r]}else n.push(u);return{layout:n,countRemoved:c}}function EA(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function MA(e,t,n){let r=[],a=e.map((_,h)=>Ha(e,h,t)).reduce((_,h)=>_+h),c=0,u=0,f=0;for(;f<a;){if(a-f<n){r.push(a-f);break}c+=n;let _=Ha(e,u,t);c>_&&(c-=_,u++);let h=e[u].getWidth(c-1)===2;h&&c--;let p=h?n-1:n;r.push(p),f+=p}return r}function Ha(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,a=e[t+1].getWidth(0)===2;return r&&a?n-1:n}var Cb=class Eb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Eb._nextId++,this._onDispose=this.register(new fe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),nr(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Cb._nextId=1;var kA=Cb,xt={},Kn=xt.B;xt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};xt.A={"#":"£"};xt.B=void 0;xt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};xt.C=xt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};xt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};xt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};xt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};xt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};xt.E=xt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};xt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};xt.H=xt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};xt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var by=4294967295,wy=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=mt.clone(),this.savedCharset=Kn,this.markers=[],this._nullCell=Mi.fromCharData([0,I1,1,0]),this._whitespaceCell=Mi.fromCharData([0,pn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new au,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Sy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new su),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new su),this._whitespaceCell}getBlankLine(e,t){return new Sa(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>by?by:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=mt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Sy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(mt),r=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)r+=+this.lines.get(u).resize(e,n);let c=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Sa(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new Sa(e,n)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let c=0;c<this.lines.length;c++)r+=+this.lines.get(c).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=xA(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(mt),n);if(r.length>0){let a=CA(this.lines,r);EA(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(mt),a=n;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Sa(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(mt),a=[],c=0;for(let u=this.lines.length-1;u>=0;u--){let f=this.lines.get(u);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;let _=[f];for(;f.isWrapped&&u>0;)f=this.lines.get(--u),_.unshift(f);if(!n){let C=this.ybase+this.y;if(C>=u&&C<u+_.length)continue}let h=_[_.length-1].getTrimmedLength(),p=MA(_,this._cols,e),m=p.length-_.length,v;this.ybase===0&&this.y!==this.lines.length-1?v=Math.max(0,this.y-this.lines.maxLength+m):v=Math.max(0,this.lines.length-this.lines.maxLength+m);let b=[];for(let C=0;C<m;C++){let D=this.getBlankLine(mt,!0);b.push(D)}b.length>0&&(a.push({start:u+_.length+c,newLines:b}),c+=b.length),_.push(...b);let y=p.length-1,w=p[y];w===0&&(y--,w=p[y]);let x=_.length-m-1,E=h;for(;x>=0;){let C=Math.min(E,w);if(_[y]===void 0)break;if(_[y].copyCellsFrom(_[x],E-C,w-C,C,!0),w-=C,w===0&&(y--,w=p[y]),E-=C,E===0){x--;let D=Math.max(x,0);E=Ha(_,D,this._cols)}}for(let C=0;C<_.length;C++)p[C]<e&&_[C].setCell(p[C],r);let L=m-v;for(;L-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(a.length>0){let u=[],f=[];for(let w=0;w<this.lines.length;w++)f.push(this.lines.get(w));let _=this.lines.length,h=_-1,p=0,m=a[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let v=0;for(let w=Math.min(this.lines.maxLength-1,_+c-1);w>=0;w--)if(m&&m.start>h+v){for(let x=m.newLines.length-1;x>=0;x--)this.lines.set(w--,m.newLines[x]);w++,u.push({index:h+1,amount:m.newLines.length}),v+=m.newLines.length,m=a[++p]}else this.lines.set(w,f[h--]);let b=0;for(let w=u.length-1;w>=0;w--)u[w].index+=b,this.lines.onInsertEmitter.fire(u[w]),b+=u[w].amount;let y=Math.max(0,_+c-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}translateBufferLineToString(e,t,n=0,r){let a=this.lines.get(e);return a?a.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new kA(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},DA=class extends Ae{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new fe),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 wy(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new wy(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Mb=2,kb=1,d_=class extends Ae{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new fe),this.onResize=this._onResize.event,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Mb),this.rows=Math.max(e.rawOptions.rows||0,kb),this.buffers=this._register(new DA(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let a=n.ybase+n.scrollTop,c=n.ybase+n.scrollBottom;if(n.scrollTop===0){let u=n.lines.isFull;c===n.lines.length-1?u?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(c+1,0,r.clone()),u?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let u=c-a+1;n.lines.shiftElements(a+1,u-1,-1),n.lines.set(c,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};d_=at([ge(0,Wt)],d_);var Fr={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:ou,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},TA=["normal","bold","100","200","300","400","500","600","700","800","900"],AA=class extends Ae{constructor(e){super(),this._onOptionChange=this._register(new fe),this.onOptionChange=this._onOptionChange.event;let t={...Fr};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(et(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Fr))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Fr))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Fr[e]),!NA(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Fr[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=TA.includes(t)?t:Fr[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function NA(e){return e==="block"||e==="underline"||e==="bar"}function ba(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&ba(e[r],t-1);return n}var xy=Object.freeze({insertMode:!1}),Cy=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),__=class extends Ae{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new fe),this.onData=this._onData.event,this._onUserInput=this._register(new fe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new fe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new fe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ba(xy),this.decPrivateModes=ba(Cy)}reset(){this.modes=ba(xy),this.decPrivateModes=ba(Cy)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};__=at([ge(0,$t),ge(1,X1),ge(2,Wt)],__);var Ey={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function vd(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var yd=String.fromCharCode,My={DEFAULT:e=>{let t=[vd(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${yd(t[0])}${yd(t[1])}${yd(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${vd(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${vd(e,!0)};${e.x};${e.y}${t}`}},g_=class extends Ae{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new fe),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(Ey))this.addProtocol(r,Ey[r]);for(let r of Object.keys(My))this.addEncoding(r,My[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=r+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};g_=at([ge(0,$t),ge(1,or),ge(2,Wt)],g_);var Sd=[[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]],RA=[[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]],wt;function BA(e,t){let n=0,r=t.length-1,a;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(a=n+r>>1,e>t[a][1])n=a+1;else if(e<t[a][0])r=a-1;else return!0;return!1}var LA=class{constructor(){if(this.version="6",!wt){wt=new Uint8Array(65536),wt.fill(1),wt[0]=0,wt.fill(0,1,32),wt.fill(0,127,160),wt.fill(2,4352,4448),wt[9001]=2,wt[9002]=2,wt.fill(2,11904,42192),wt[12351]=1,wt.fill(2,44032,55204),wt.fill(2,63744,64256),wt.fill(2,65040,65050),wt.fill(2,65072,65136),wt.fill(2,65280,65377),wt.fill(2,65504,65511);for(let e=0;e<Sd.length;++e)wt.fill(0,Sd[e][0],Sd[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?wt[e]:BA(e,RA)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let a=Fn.extractWidth(t);a===0?r=!1:a>n&&(n=a)}return Fn.createPropertyValue(0,n,r)}},Fn=class Vc{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new fe,this.onChange=this._onChange.event;let t=new LA;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,a=t.length;for(let c=0;c<a;++c){let u=t.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=a)return n+this.wcwidth(u);let h=t.charCodeAt(c);56320<=h&&h<=57343?u=(u-55296)*1024+h-56320+65536:n+=this.wcwidth(h)}let f=this.charProperties(u,r),_=Vc.extractWidth(f);Vc.extractShouldJoin(f)&&(_-=Vc.extractWidth(r)),n+=_,r=f}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},zA=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function ky(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var da=2147483647,OA=256,Db=class m_{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>OA)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new m_;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let a=t[r];if(Array.isArray(a))for(let c=0;c<a.length;++c)n.addSubParam(a[c]);else n.addParam(a)}return n}clone(){let t=new m_(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,a=this._subParamsIdx[n]&255;a-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>da?da:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>da?da:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,a=this._subParamsIdx[n]&255;a-r>0&&(t[n]=this._subParams.slice(r,a))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,a=r[n-1];r[n-1]=~a?Math.min(a*10+t,da):t}},_a=[],HA=class{constructor(){this._state=0,this._active=_a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_a}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=_a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||_a,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",xu(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,a=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=_a,this._id=-1,this._state=0}}},fi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=xu(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},ga=[],UA=class{constructor(){this._handlers=Object.create(null),this._active=ga,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ga}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=ga,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ga,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",xu(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,a=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=ga,this._ident=0}},wa=new Db;wa.addParam(0);var Dy=class{constructor(e){this._handler=e,this._data="",this._params=wa,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():wa,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=xu(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=wa,this._data="",this._hitLimit=!1,n));return this._params=wa,this._data="",this._hitLimit=!1,t}},PA=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=n<<4|r}},Ei=160,jA=(function(){let e=new PA(4095),t=Array.apply(null,Array(256)).map((f,_)=>_),n=(f,_)=>t.slice(f,_),r=n(32,127),a=n(0,24);a.push(25),a.push.apply(a,n(28,32));let c=n(0,14),u;e.setDefault(1,0),e.addMany(r,0,2,0);for(u in c)e.addMany([24,26,153,154],u,3,0),e.addMany(n(128,144),u,3,0),e.addMany(n(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ei,0,2,0),e.add(Ei,8,5,8),e.add(Ei,6,0,6),e.add(Ei,11,0,11),e.add(Ei,13,13,13),e})(),qA=class extends Ae{constructor(e=jA){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Db,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(et(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new HA),this._dcsParser=this._register(new UA),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let c=e.intermediates.charCodeAt(a);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let a=r.indexOf(t);a!==-1&&r.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let a=r.indexOf(t);a!==-1&&r.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=a}parse(e,t,n){let r=0,a=0,c=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,_=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&_>-1){for(;_>=0&&(u=f[_](this._params),u!==!0);_--)if(u instanceof Promise)return this._parseStack.handlerPos=_,u}this._parseStack.handlers=[];break;case 4:if(n===!1&&_>-1){for(;_>=0&&(u=f[_](),u!==!0);_--)if(u instanceof Promise)return this._parseStack.handlerPos=_,u}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(r!==24&&r!==26,n),u)return u;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],u=this._oscParser.end(r!==24&&r!==26,n),u)return u;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=c;f<t;++f){switch(r=e[f],a=this._transitions.table[this.currentState<<8|(r<160?r:Ei)],a>>4){case 2:for(let v=f+1;;++v){if(v>=t||(r=e[v])<32||r>126&&r<Ei){this._printHandler(e,f,v),f=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ei){this._printHandler(e,f,v),f=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ei){this._printHandler(e,f,v),f=v-1;break}if(++v>=t||(r=e[v])<32||r>126&&r<Ei){this._printHandler(e,f,v),f=v-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let _=this._csiHandlers[this._collect<<8|r],h=_?_.length-1:-1;for(;h>=0&&(u=_[h](this._params),u!==!0);h--)if(u instanceof Promise)return this._preserveStack(3,_,h,a,f),u;h<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++f<t&&(r=e[f])>47&&r<60);f--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let p=this._escHandlers[this._collect<<8|r],m=p?p.length-1:-1;for(;m>=0&&(u=p[m](),u!==!0);m--)if(u instanceof Promise)return this._preserveStack(4,p,m,a,f),u;m<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let v=f+1;;++v)if(v>=t||(r=e[v])===24||r===26||r===27||r>127&&r<Ei){this._dcsParser.put(e,f,v),f=v-1;break}break;case 14:if(u=this._dcsParser.unhook(r!==24&&r!==26),u)return this._preserveStack(6,[],0,a,f),u;r===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let v=f+1;;v++)if(v>=t||(r=e[v])<32||r>127&&r<Ei){this._oscParser.put(e,f,v),f=v-1;break}break;case 6:if(u=this._oscParser.end(r!==24&&r!==26),u)return this._preserveStack(5,[],0,a,f),u;r===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},IA=/^([\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})$/,YA=/^[\da-f]+$/;function Ty(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=IA.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),YA.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let a=0;a<3;++a){let c=parseInt(t.slice(n*a,n*a+n),16);r[a]=n===1?c<<4:n===2?c:n===3?c>>4:c>>8}return r}}function bd(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function VA(e,t=16){let[n,r,a]=e;return`rgb:${bd(n,t)}/${bd(r,t)}/${bd(a,t)}`}var $A={"(":0,")":1,"*":2,"+":3,"-":1,".":2},_n=131072,Ay=10;function Ny(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Ry=5e3,By=0,WA=class extends Ae{constructor(e,t,n,r,a,c,u,f,_=new qA){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=a,this._oscLinkService=c,this._coreMouseService=u,this._unicodeService=f,this._parser=_,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new hD,this._utf8Decoder=new fD,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=mt.clone(),this._eraseAttrDataInternal=mt.clone(),this._onRequestBell=this._register(new fe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new fe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new fe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new fe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new fe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new fe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new fe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new fe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new fe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new fe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new fe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new fe),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 p_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:p.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,p,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:p,data:m})}),this._parser.setDcsHandlerFallback((h,p,m)=>{p==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:p,payload:m})}),this._parser.setPrintHandler((h,p,m)=>this.print(h,p,m)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(oe.BEL,()=>this.bell()),this._parser.setExecuteHandler(oe.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(oe.BS,()=>this.backspace()),this._parser.setExecuteHandler(oe.HT,()=>this.tab()),this._parser.setExecuteHandler(oe.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(oe.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ic.IND,()=>this.index()),this._parser.setExecuteHandler(Ic.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ic.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new fi(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new fi(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new fi(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new fi(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new fi(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new fi(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new fi(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new fi(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new fi(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new fi(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new fi(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new fi(h=>this.restoreCursorColor(h))),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(let h in xt)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Dy((h,p)=>this.requestStatusString(h,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Ry))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Ry} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,a=this._activeBuffer.y,c=0,u=this._parseStack.paused;if(u){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>_n&&(c=this._parseStack.position+_n)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<_n&&(this._parseBuffer=new Uint32Array(Math.min(e.length,_n))),u||this._dirtyRowTracker.clearRange(),e.length>_n)for(let h=c;h<e.length;h+=_n){let p=h+_n<e.length?h+_n:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(h,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(r,a,m,h),this._logSlowResolvingAsync(n),n}else if(!u){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,h))return this._preserveStack(r,a,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let f=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),_=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);_<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(_,this._bufferService.rows-1),end:Math.min(f,this._bufferService.rows-1)})}print(e,t,n){let r,a,c=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,f=this._bufferService.cols,_=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let v=this._parser.precedingJoinState;for(let b=t;b<n;++b){if(r=e[b],r<127&&c){let E=c[String.fromCharCode(r)];E&&(r=E.charCodeAt(0))}let y=this._unicodeService.charProperties(r,v);a=Fn.extractWidth(y);let w=Fn.extractShouldJoin(y),x=w?Fn.extractWidth(v):0;if(v=y,u&&this._onA11yChar.fire(gn(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-x>f){if(_){let E=m,L=this._activeBuffer.x-x;for(this._activeBuffer.x=x,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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),x>0&&m instanceof Sa&&m.copyCellsFrom(E,L,0,x,!1);L<f;)E.setCellFromCodepoint(L++,0,1,p)}else if(this._activeBuffer.x=f-1,a===2)continue}if(w&&this._activeBuffer.x){let E=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-E,r,a);for(let L=a-x;--L>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(h&&(m.insertCells(this._activeBuffer.x,a-x,this._activeBuffer.getNullCell(p)),m.getWidth(f-1)===2&&m.setCellFromCodepoint(f-1,0,1,p)),m.setCellFromCodepoint(this._activeBuffer.x++,r,a,p),a>0)for(;--a;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=v,this._activeBuffer.x<f&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>Ny(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Dy(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new fi(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,a=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),a),r&&(c.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let a=this._activeBuffer.lines.length-this._bufferService.rows;a>0&&(this._activeBuffer.lines.trimStart(a),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-a,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-a,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(mt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=Fn.extractWidth(t),a=this._activeBuffer.x-r,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(c.length*n),f=0;for(let h=0;h<c.length;){let p=c.codePointAt(h)||0;u[f++]=p,h+=p>65535?2:1}let _=f;for(let h=1;h<n;++h)u.copyWithin(_,0,f),_+=f;return this.print(u,0,_),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(oe.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(oe.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(oe.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(oe.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(oe.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Kn),this._charsetService.setgCharset(1,Kn),this._charsetService.setgCharset(2,Kn),this._charsetService.setgCharset(3,Kn);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:c}=this._coreMouseService,u=this._coreService,{buffers:f,cols:_}=this._bufferService,{active:h,alt:p}=f,m=this._optionsService.rawOptions,v=(w,x)=>(u.triggerDataEvent(`${oe.ESC}[${t?"":"?"}${w};${x}$y`),!0),b=w=>w?1:2,y=e.params[0];return t?y===2?v(y,4):y===4?v(y,b(u.modes.insertMode)):y===12?v(y,3):y===20?v(y,b(m.convertEol)):v(y,0):y===1?v(y,b(r.applicationCursorKeys)):y===3?v(y,m.windowOptions.setWinLines?_===80?2:_===132?1:0:0):y===6?v(y,b(r.origin)):y===7?v(y,b(r.wraparound)):y===8?v(y,3):y===9?v(y,b(a==="X10")):y===12?v(y,b(m.cursorBlink)):y===25?v(y,b(!u.isCursorHidden)):y===45?v(y,b(r.reverseWraparound)):y===66?v(y,b(r.applicationKeypad)):y===67?v(y,4):y===1e3?v(y,b(a==="VT200")):y===1002?v(y,b(a==="DRAG")):y===1003?v(y,b(a==="ANY")):y===1004?v(y,b(r.sendFocus)):y===1005?v(y,4):y===1006?v(y,b(c==="SGR")):y===1015?v(y,4):y===1016?v(y,b(c==="SGR_PIXELS")):y===1048?v(y,1):y===47||y===1047||y===1049?v(y,b(h===p)):y===2004?v(y,b(r.bracketedPasteMode)):y===2026?v(y,b(r.synchronizedOutput)):v(y,0)}_updateAttrColor(e,t,n,r,a){return t===2?(e|=50331648,e&=-16777216,e|=Wa.fromColorRGB([n,r,a])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],a=0,c=0;do{if(r[c+a]=e.params[t+c],e.hasSubParams(t+c)){let u=e.getSubParams(t+c),f=0;do r[1]===5&&(a=1),r[c+f+1+a]=u[f];while(++f<u.length&&f+c+1+a<r.length);break}if(r[1]===5&&c+a>=2||r[1]===2&&c+a>=5)break;r[1]&&(a=1)}while(++c+t<e.length&&c+a<r.length);for(let u=2;u<r.length;++u)r[u]===-1&&(r[u]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return c}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=mt.fg,e.bg=mt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let a=0;a<t;a++)n=e.params[a],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=mt.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=mt.bg&16777215):n===38||n===48||n===58?a+=this._extractColor(e,a,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=mt.fg&16777215,r.bg&=-67108864,r.bg|=mt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${oe.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=mt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Ny(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${oe.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Ay&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Ay&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),a=n.shift();if(/^\d+$/.exec(r)){let c=parseInt(r);if(Ly(c))if(a==="?")t.push({type:0,index:c});else{let u=Ty(a);u&&t.push({type:1,index:c,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,a=n.findIndex(c=>c.startsWith("id="));return a!==-1&&(r=n[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=Ty(n[r]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let a=parseInt(n[r]);Ly(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Kn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset($A[e[0]],xt[e[1]]||Kn),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=mt.clone(),this._eraseAttrDataInternal=mt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Mi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=u=>(this._coreService.triggerDataEvent(`${oe.ESC}${u}${oe.ESC}\\`),!0),r=this._bufferService.buffer,a=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},p_=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(By=e,e=t,t=By),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};p_=at([ge(0,$t)],p_);function Ly(e){return 0<=e&&e<256}var XA=5e7,zy=12,KA=50,GA=class extends Ae{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new fe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>XA)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],a=this._action(r,t);if(a){let u=f=>performance.now()-n>=zy?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(n,f);a.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(u);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=zy)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>KA&&(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()}},v_=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let f=t.addMarker(t.ybase+t.y),_={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(_,f)),this._dataByLinkId.set(_.id,_),_.id}let n=e,r=this._getEntryIdKey(n),a=this._entriesWithId.get(r);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let c=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};v_=at([ge(0,$t)],v_);var Oy=!1,FA=class extends Ae{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new co),this._onBinary=this._register(new fe),this.onBinary=this._onBinary.event,this._onData=this._register(new fe),this.onData=this._onData.event,this._onLineFeed=this._register(new fe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new fe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new fe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new fe),this._instantiationService=new SA,this.optionsService=this._register(new AA(e)),this._instantiationService.setService(Wt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(d_)),this._instantiationService.setService($t,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(f_)),this._instantiationService.setService(X1,this._logService),this.coreService=this._register(this._instantiationService.createInstance(__)),this._instantiationService.setService(or,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(g_)),this._instantiationService.setService(W1,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Fn)),this._instantiationService.setService(mD,this.unicodeService),this._charsetService=this._instantiationService.createInstance(zA),this._instantiationService.setService(gD,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(v_),this._instantiationService.setService(K1,this._oscLinkService),this._inputHandler=this._register(new WA(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ht.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ht.forward(this._bufferService.onResize,this._onResize)),this._register(Ht.forward(this.coreService.onData,this._onData)),this._register(Ht.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new GA((t,n)=>this._inputHandler.parse(t,n))),this._register(Ht.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new fe),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Oy&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Oy=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Mb),t=Math.max(t,kb),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(ky.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(ky(this._bufferService),!1))),this._windowsWrappingHeuristics.value=et(()=>{for(let t of e)t.dispose()})}}},ZA={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:["'",'"']};function QA(e,t,n,r){var u;let a={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=oe.ESC+"OA":a.key=oe.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=oe.ESC+"OD":a.key=oe.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=oe.ESC+"OC":a.key=oe.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=oe.ESC+"OB":a.key=oe.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":oe.DEL,e.altKey&&(a.key=oe.ESC+a.key);break;case 9:if(e.shiftKey){a.key=oe.ESC+"[Z";break}a.key=oe.HT,a.cancel=!0;break;case 13:a.key=e.altKey?oe.ESC+oe.CR:oe.CR,a.cancel=!0;break;case 27:a.key=oe.ESC,e.altKey&&(a.key=oe.ESC+oe.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"D":t?a.key=oe.ESC+"OD":a.key=oe.ESC+"[D";break;case 39:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"C":t?a.key=oe.ESC+"OC":a.key=oe.ESC+"[C";break;case 38:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"A":t?a.key=oe.ESC+"OA":a.key=oe.ESC+"[A";break;case 40:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"B":t?a.key=oe.ESC+"OB":a.key=oe.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=oe.ESC+"[2~");break;case 46:c?a.key=oe.ESC+"[3;"+(c+1)+"~":a.key=oe.ESC+"[3~";break;case 36:c?a.key=oe.ESC+"[1;"+(c+1)+"H":t?a.key=oe.ESC+"OH":a.key=oe.ESC+"[H";break;case 35:c?a.key=oe.ESC+"[1;"+(c+1)+"F":t?a.key=oe.ESC+"OF":a.key=oe.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=oe.ESC+"[5;"+(c+1)+"~":a.key=oe.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=oe.ESC+"[6;"+(c+1)+"~":a.key=oe.ESC+"[6~";break;case 112:c?a.key=oe.ESC+"[1;"+(c+1)+"P":a.key=oe.ESC+"OP";break;case 113:c?a.key=oe.ESC+"[1;"+(c+1)+"Q":a.key=oe.ESC+"OQ";break;case 114:c?a.key=oe.ESC+"[1;"+(c+1)+"R":a.key=oe.ESC+"OR";break;case 115:c?a.key=oe.ESC+"[1;"+(c+1)+"S":a.key=oe.ESC+"OS";break;case 116:c?a.key=oe.ESC+"[15;"+(c+1)+"~":a.key=oe.ESC+"[15~";break;case 117:c?a.key=oe.ESC+"[17;"+(c+1)+"~":a.key=oe.ESC+"[17~";break;case 118:c?a.key=oe.ESC+"[18;"+(c+1)+"~":a.key=oe.ESC+"[18~";break;case 119:c?a.key=oe.ESC+"[19;"+(c+1)+"~":a.key=oe.ESC+"[19~";break;case 120:c?a.key=oe.ESC+"[20;"+(c+1)+"~":a.key=oe.ESC+"[20~";break;case 121:c?a.key=oe.ESC+"[21;"+(c+1)+"~":a.key=oe.ESC+"[21~";break;case 122:c?a.key=oe.ESC+"[23;"+(c+1)+"~":a.key=oe.ESC+"[23~";break;case 123:c?a.key=oe.ESC+"[24;"+(c+1)+"~":a.key=oe.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=oe.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=oe.DEL:e.keyCode===219?a.key=oe.ESC:e.keyCode===220?a.key=oe.FS:e.keyCode===221&&(a.key=oe.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let f=(u=ZA[e.keyCode])==null?void 0:u[e.shiftKey?1:0];if(f)a.key=oe.ESC+f;else if(e.keyCode>=65&&e.keyCode<=90){let _=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(_);e.shiftKey&&(h=h.toUpperCase()),a.key=oe.ESC+h}else if(e.keyCode===32)a.key=oe.ESC+(e.ctrlKey?oe.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let _=e.code.slice(3,4);e.shiftKey||(_=_.toLowerCase()),a.key=oe.ESC+_,a.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=oe.US),e.key==="@"&&(a.key=oe.NUL));break}return a}var ut=0,JA=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new au,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new au,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((a,c)=>this._getKey(a)-this._getKey(c)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<r.length;a++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[a]=e[t],t++):r[a]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ut=this._search(t),ut===-1)||this._getKey(this._array[ut])!==t)return!1;do if(this._array[ut]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ut),!0;while(++ut<this._array.length&&this._getKey(this._array[ut])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,c)=>a-c),t=0,n=new Array(this._array.length-e.length),r=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:n[r++]=this._array[a];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ut=this._search(e),!(ut<0||ut>=this._array.length)&&this._getKey(this._array[ut])===e))do yield this._array[ut];while(++ut<this._array.length&&this._getKey(this._array[ut])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ut=this._search(e),!(ut<0||ut>=this._array.length)&&this._getKey(this._array[ut])===e))do t(this._array[ut]);while(++ut<this._array.length&&this._getKey(this._array[ut])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,a=this._getKey(this._array[r]);if(a>e)n=r-1;else if(a<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},wd=0,Hy=0,eN=class extends Ae{constructor(){super(),this._decorations=new JA(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new fe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new fe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(et(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new tN(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,a=0;for(let c of this._decorations.getKeyIterator(t))r=c.options.x??0,a=r+(c.options.width??1),e>=r&&e<a&&(!n||(c.options.layer??"bottom")===n)&&(yield c)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,a=>{wd=a.options.x??0,Hy=wd+(a.options.width??1),e>=wd&&e<Hy&&(!n||(a.options.layer??"bottom")===n)&&r(a)})}},tN=class extends vn{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new fe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new fe),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=st.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=st.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},iN=1e3,sN=class{constructor(e,t=iN){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=r-this._lastRefreshMs,c=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Uy=20,lu=class extends Ae{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new sN(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(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
95
|
+
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ce(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(et(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Uy+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
96
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Uy+1&&(this._liveRegion.textContent+=Ud.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let a=e;a<=t;a++){let c=n.lines.get(n.ydisp+a),u=[],f=(c==null?void 0:c.translateToString(!0,void 0,void 0,u))||"",_=(n.ydisp+a+1).toString(),h=this._rowElements[a];h&&(f.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=f,this._rowColumns.set(h,u)),h.setAttribute("aria-posinset",_),h.setAttribute("aria-setsize",r),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],a=n.getAttribute("aria-posinset"),c=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===c||e.relatedTarget!==r)return;let u,f;if(t===0?(u=n,f=this._rowElements.pop(),this._rowContainer.removeChild(f)):(u=this._rowElements.shift(),f=n,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),f.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{let _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var f;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((f=r.textContent)==null?void 0:f.length)??0}),!this._rowContainer.contains(n.node))return;let a=({node:_,offset:h})=>{let p=_ instanceof Text?_.parentNode:_,m=parseInt(p==null?void 0:p.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(p);if(!v)return console.warn("columns is null. Race condition?"),null;let b=h<v.length?v[h]:v.slice(-1)[0]+1;return b>=this._terminal.cols&&(++m,b=0),{row:m,column:b}},c=a(t),u=a(n);if(!(!c||!u)){if(c.row>u.row||c.row===u.row&&c.column>=u.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(u.row-c.row)*this._terminal.cols-c.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var a,c;e.style.transform="";let t=e.getBoundingClientRect().width,n=(c=(a=this._rowColumns.get(e))==null?void 0:a.slice(-1))==null?void 0:c[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};lu=at([ge(1,H_),ge(2,Ns),ge(3,Rs)],lu);var y_=class extends Ae{constructor(e,t,n,r,a){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new fe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new fe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(et(()=>{var c;nr(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(c=this._activeProviderReplies)==null||c.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ce(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ce(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ce(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ce(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let a=n[r];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,a;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(c=>{c==null||c.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[c,u]of this._linkProviderService.linkProviders.entries())t?(a=this._activeProviderReplies)!=null&&a.get(c)&&(n=this._checkLinkProviderResult(c,e,n)):u.provideLinks(e.y,f=>{var h,p;if(this._isMouseOut)return;let _=f==null?void 0:f.map(m=>({link:m}));(h=this._activeProviderReplies)==null||h.set(c,_),n=this._checkLinkProviderResult(c,e,n),((p=this._activeProviderReplies)==null?void 0:p.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let a=t.get(r);if(a)for(let c=0;c<a.length;c++){let u=a[c],f=u.link.range.start.y<e?0:u.link.range.start.x,_=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let h=f;h<=_;h++){if(n.has(h)){a.splice(c--,1);break}n.add(h)}}}}_checkLinkProviderResult(e,t,n){var c;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),a=!1;for(let u=0;u<e;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(a=!0);if(!a&&r){let u=r.find(f=>this._linkAtPosition(f.link,t));u&&(n=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let u=0;u<this._activeProviderReplies.size;u++){let f=(c=this._activeProviderReplies.get(u))==null?void 0:c.find(_=>this._linkAtPosition(_.link,t));if(f){n=!0,this._handleNewLink(f);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&nN(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,nr(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,a,c;(r=this._currentLink)!=null&&r.state&&((c=(a=this._currentLink)==null?void 0:a.state)==null?void 0:c.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(r,a),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return n<=a&&a<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,a){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:a}}};y_=at([ge(1,U_),ge(2,Rs),ge(3,$t),ge(4,F1)],y_);function nN(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var rN=class extends FA{constructor(e={}){super(e),this._linkifier=this._register(new co),this.browser=gb,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new co),this._onCursorMove=this._register(new fe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new fe),this.onKey=this._onKey.event,this._onRender=this._register(new fe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new fe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new fe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new fe),this.onBell=this._onBell.event,this._onFocus=this._register(new fe),this._onBlur=this._register(new fe),this._onA11yCharEmitter=this._register(new fe),this._onA11yTabEmitter=this._register(new fe),this._onWillOpen=this._register(new fe),this._setup(),this._decorationService=this._instantiationService.createInstance(eN),this._instantiationService.setService(Xa,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(KT),this._instantiationService.setService(F1,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(jd)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Ht.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ht.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ht.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ht.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(et(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let a=Ze.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${oe.ESC}]${r};${VA(a)}${db.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(c=>c.ansi[t.index]=pt.toColor(...t.color));else{let c=n;this._themeService.modifyColors(u=>u[c]=pt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(lu,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(oe.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(oe.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,a=t.getWidth(n),c=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,f=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=u+"px",this.textarea.style.width=c+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ce(this.element,"copy",t=>{this.hasSelection()&&cD(t,this._selectionService)}));let e=t=>uD(t,this.textarea,this.coreService,this.optionsService);this._register(Ce(this.textarea,"paste",e)),this._register(Ce(this.element,"paste",e)),mb?this._register(Ce(this.element,"mousedown",t=>{t.button===2&&K0(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ce(this.element,"contextmenu",t=>{K0(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W_&&this._register(Ce(this.element,"auxclick",t=>{t.button===1&&q1(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ce(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ce(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ce(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ce(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ce(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ce(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ce(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var a;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((a=this.element)==null?void 0:a.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ce(this.screenElement,"mousemove",c=>this.updateCursorStyle(c))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Hd.get()),yb||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(WT,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Ns,this._coreBrowserService),this._register(Ce(this.textarea,"focus",c=>this._handleTextAreaFocus(c))),this._register(Ce(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(a_,this._document,this._helperContainer),this._instantiationService.setService(Cu,this._charSizeService),this._themeService=this._instantiationService.createInstance(h_),this._instantiationService.setService(uo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ru),this._instantiationService.setService(G1,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(c_,this.rows,this.screenElement)),this._instantiationService.setService(Rs,this._renderService),this._register(this._renderService.onRenderedViewportChange(c=>this._onRender.fire(c))),this.onResize(c=>this._renderService.resize(c.cols,c.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(n_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(l_),this._instantiationService.setService(U_,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(y_,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(i_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(c=>{super.scrollLines(c,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(u_,this.element,this.screenElement,r)),this._instantiationService.setService(vD,this._selectionService),this._register(this._selectionService.onRequestScrollLines(c=>this.scrollLines(c.amount,c.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(c=>this._renderService.handleSelectionChanged(c.start,c.end,c.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(c=>{this.textarea.value=c,this.textarea.focus(),this.textarea.select()})),this._register(Ht.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var c;this._selectionService.refresh(),(c=this._viewport)==null||c.queueSync()})),this._register(this._instantiationService.createInstance(s_,this.screenElement)),this._register(Ce(this.element,"mousedown",c=>this._selectionService.handleMouseDown(c))),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(lu,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",c=>this._handleScreenReaderModeOptionChange(c))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(nu,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",c=>{!this._overviewRulerRenderer&&c&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(nu,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(c){var h,p,m,v,b;let u=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!u)return!1;let f,_;switch(c.overrideType||c.type){case"mousemove":_=32,c.buttons===void 0?(f=3,c.button!==void 0&&(f=c.button<3?c.button:3)):f=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":_=0,f=c.button<3?c.button:3;break;case"mousedown":_=1,f=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let y=c.deltaY;if(y===0||e.coreMouseService.consumeWheelEvent(c,(v=(m=(p=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:p.device)==null?void 0:m.cell)==null?void 0:v.height,(b=e._coreBrowserService)==null?void 0:b.dpr)===0)return!1;_=y<0?0:1,f=4;break;default:return!1}return _===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:f,action:_,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:c=>(n(c),c.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(c)),wheel:c=>(n(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&n(c)},mousemove:c=>{c.buttons||n(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),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()),c&8?r.mousemove||(t.addEventListener("mousemove",a.mousemove),r.mousemove=a.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),c&16?r.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),r.wheel=a.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),c&2?r.mouseup||(r.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),c&4?r.mousedrag||(r.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ce(t,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return n(c),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(c)})),this._register(Ce(t,"wheel",c=>{var u,f,_,h,p;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,(h=(_=(f=(u=e._renderService)==null?void 0:u.dimensions)==null?void 0:f.device)==null?void 0:_.cell)==null?void 0:h.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(c,!0);let m=oe.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){j1(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=QA(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===oe.ETX||n.key===oe.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(oN(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(mt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(oe.ESC+"[I"):this.coreService.triggerDataEvent(oe.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[6;${a};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function oN(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var aN=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},lN=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Mi)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},Py=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new lN(t)}getNullCell(){return new Mi}},cN=class extends Ae{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new fe),this.onBufferChange=this._onBufferChange.event,this._normal=new Py(this._core.buffers.normal,"normal"),this._alternate=new Py(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)}},uN=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},hN=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},fN=["cols","rows"],Wi=0,dN=class extends Ae{constructor(e){super(),this._core=this._register(new rN(e)),this._addonManager=this._register(new aN),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,a)=>{this._checkReadonlyOptions(r),this._core.options[r]=a};for(let r in this._core.options){let a={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,a)}}_checkReadonlyOptions(e){if(fN.includes(e))throw new Error(`Option "${e}" 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 uN(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new hN(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 cN(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
97
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Hd.get()},set promptLabel(e){Hd.set(e)},get tooMuchOutput(){return Ud.get()},set tooMuchOutput(e){Ud.set(e)}}}_verifyIntegers(...e){for(Wi of e)if(Wi===1/0||isNaN(Wi)||Wi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Wi of e)if(Wi&&(Wi===1/0||isNaN(Wi)||Wi%1!==0||Wi<0))throw new Error("This API only accepts positive integers")}};/**
|
|
98
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
99
|
+
* @license MIT
|
|
100
|
+
*
|
|
101
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
102
|
+
* @license MIT
|
|
103
|
+
*
|
|
104
|
+
* Originally forked from (with the author's permission):
|
|
105
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
106
|
+
* http://bellard.org/jslinux/
|
|
107
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
108
|
+
*/var _N=2,gN=1,mN=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),a=Math.max(0,parseInt(n.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),u={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},f=u.top+u.bottom,_=u.right+u.left,h=r-f,p=a-_-t;return{cols:Math.max(_N,Math.floor(p/e.css.cell.width)),rows:Math.max(gN,Math.floor(h/e.css.cell.height))}}};/**
|
|
109
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
110
|
+
* @license MIT
|
|
111
|
+
*
|
|
112
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
113
|
+
* @license MIT
|
|
114
|
+
*
|
|
115
|
+
* Originally forked from (with the author's permission):
|
|
116
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
117
|
+
* http://bellard.org/jslinux/
|
|
118
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
119
|
+
*/var pN=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=yN.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(n,r)=>{if(this._options.hover){let{range:a}=t;this._options.hover(n,r,a)}},t))}};function vN(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var yN=class $c{static computeLink(t,n,r,a){let c=new RegExp(n.source,(n.flags||"")+"g"),[u,f]=$c._getWindowedLineStrings(t-1,r),_=u.join(""),h,p=[];for(;h=c.exec(_);){let m=h[0];if(!vN(m))continue;let[v,b]=$c._mapStrIdx(r,f,0,h.index),[y,w]=$c._mapStrIdx(r,v,b,m.length);if(v===-1||b===-1||y===-1||w===-1)continue;let x={start:{x:b+1,y:v+1},end:{x:w,y:y+1}};p.push({range:x,text:m,activate:a})}return p}static _getWindowedLineStrings(t,n){let r,a=t,c=t,u=0,f="",_=[];if(r=n.buffer.active.getLine(t)){let h=r.translateToString(!0);if(r.isWrapped&&h[0]!==" "){for(u=0;(r=n.buffer.active.getLine(--a))&&u<2048&&(f=r.translateToString(!0),u+=f.length,_.push(f),!(!r.isWrapped||f.indexOf(" ")!==-1)););_.reverse()}for(_.push(h),u=0;(r=n.buffer.active.getLine(++c))&&r.isWrapped&&u<2048&&(f=r.translateToString(!0),u+=f.length,_.push(f),f.indexOf(" ")===-1););}return[_,a]}static _mapStrIdx(t,n,r,a){let c=t.buffer.active,u=c.getNullCell(),f=r;for(;a;){let _=c.getLine(n);if(!_)return[-1,-1];for(let h=f;h<_.length;++h){_.getCell(h,u);let p=u.getChars();if(u.getWidth()&&(a-=p.length||1,h===_.length-1&&p==="")){let m=c.getLine(n+1);m&&m.isWrapped&&(m.getCell(0,u),u.getWidth()===2&&(a+=1))}if(a<0)return[n,h]}n++,f=0}return[n,f]}},SN=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function bN(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var wN=class{constructor(e=bN,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||SN;this._linkProvider=this._terminal.registerLinkProvider(new pN(this._terminal,n,this._handler,t))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};function xN(e){const t=new dN({fontFamily:"'SF Mono', Menlo, Monaco, 'Courier New', monospace",fontSize:12,lineHeight:1.2,theme:{background:"#1a1a1a",foreground:"#e8e4df",cursor:"#1a1a1a",cursorAccent:"#1a1a1a",selectionBackground:"rgba(255, 255, 255, 0.15)",black:"#1a1a1a",brightBlack:"#787068",white:"#e8e4df",brightWhite:"#faf9f7",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee"},cursorBlink:!1,cursorInactiveStyle:"none",scrollback:1e4,convertEol:!0}),n=new mN;return t.loadAddon(n),t.loadAddon(new wN),t.onData(r=>{e.current({type:"pty-input",data:r})}),{term:t,fitAddon:n}}function CN({sendMessage:e,ptyEvents:t}){const[n,r]=$.useState(!1),[a,c]=$.useState(!1),u=$.useRef(e);u.current=e;const f=$.useRef(null);f.current||(f.current=xN(u));const{term:_,fitAddon:h}=f.current,p=$.useRef(!1),m=$.useRef([]);$.useEffect(()=>()=>{_.dispose(),f.current=null},[_]),$.useEffect(()=>{const w=L=>{const C=L.detail;p.current?(_.write(C),c(!0)):m.current.push(C)},x=L=>{r(!1);const C=`\r
|
|
120
|
+
\x1B[90m[Process exited with code ${L.detail}. Press Enter to restart.]\x1B[0m`;p.current?_.writeln(C):m.current.push(C+`\r
|
|
121
|
+
`)},E=()=>{r(!0)};return t.addEventListener("data",w),t.addEventListener("exit",x),t.addEventListener("spawned",E),()=>{t.removeEventListener("data",w),t.removeEventListener("exit",x),t.removeEventListener("spawned",E)}},[t,_]);const v=$.useCallback(w=>{if(w){if(p.current)_.element&&w.appendChild(_.element);else if(_.open(w),p.current=!0,m.current.length>0){for(const x of m.current)_.write(x);m.current=[],c(!0)}h.fit(),_.focus(),u.current({type:"pty-resize",data:{cols:_.cols,rows:_.rows}})}},[_,h]),b=$.useCallback(()=>{h.fit(),u.current({type:"pty-resize",data:{cols:_.cols,rows:_.rows}})},[_,h]),y=$.useCallback(()=>{_.clear(),u.current({type:"pty-spawn"})},[_]);return{attachTo:v,fit:b,ptyAlive:n,hasData:a,restart:y}}const jy={node:{accent:"bg-emerald-500",iconBg:"bg-emerald-50 text-emerald-600"},agent:{accent:"bg-purple-500",iconBg:"bg-purple-50 text-purple-600"},workflow:{accent:"bg-emerald-500",iconBg:"bg-emerald-50 text-emerald-600"},input:{accent:"bg-[#d4cfc8]",iconBg:"bg-[#f5f3f0] text-[#a8a099]"},output:{accent:"bg-[#d4cfc8]",iconBg:"bg-[#f5f3f0] text-[#a8a099]"},condition:{accent:"bg-amber-400",iconBg:"bg-amber-50 text-amber-600"}},EN={node:"fn",agent:"AI",workflow:"wf",input:"IN",output:"OUT",condition:"?"};function MN({data:e}){const t=e.type??"node",n=e.label??"",r=e.fields??void 0,a=jy[t]??jy.node,c=EN[t]??"fn",u=t==="input"||t==="output",f=t==="condition";return N.jsxs("div",{className:`
|
|
122
|
+
bg-card border border-border rounded-lg shadow-sm relative
|
|
123
|
+
${f?"border-amber-200 border-dashed border-2":""}
|
|
124
|
+
`,style:{minWidth:u?120:160,maxWidth:260},children:[N.jsx("div",{className:`absolute left-0 top-2 bottom-2 w-[3px] rounded-full ${a.accent}`}),N.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 pl-4",children:[N.jsx("div",{className:`w-7 h-7 rounded-md flex items-center justify-center shrink-0 ${a.iconBg}`,children:N.jsx("span",{className:"text-[10px] font-bold",children:c})}),N.jsx("span",{className:`font-medium ${u?"text-xs text-muted-foreground":"text-sm text-card-foreground"}`,children:n})]}),u&&r&&r.length>0&&N.jsx("div",{className:"border-t border-border px-3 py-1.5 pl-4 flex flex-wrap gap-x-2 gap-y-0.5",children:r.map(_=>N.jsx("span",{className:"text-[10px] text-[#a8a099] font-mono",children:_},_))}),t!=="input"&&N.jsx(yn,{type:"target",position:ye.Left,className:"!bg-[#d4cfc8] !w-2 !h-2 !border-0"}),t!=="output"&&N.jsx(yn,{type:"source",position:ye.Right,className:"!bg-[#d4cfc8] !w-2 !h-2 !border-0"})]})}function kN({data:e}){const t=e.label??"";return N.jsxs("div",{className:"rounded-lg border-2 border-dashed border-[#d4cfc8] bg-background/50 relative",style:{width:e.width,height:e.height},children:[N.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 border-b border-dashed border-border",children:[N.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"shrink-0 text-[#a8a099]",children:[N.jsx("path",{d:"M3 4C2 4 1 5 1 6.5C1 8 2 9 3 9H11C12 9 13 8 13 6.5C13 5 12 4 11 4",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),N.jsx("path",{d:"M9.5 3L11 4L9.5 5",fill:"currentColor"})]}),N.jsx("span",{className:"text-[11px] font-medium text-muted-foreground truncate",children:t})]}),N.jsx(yn,{type:"target",position:ye.Left,className:"!bg-transparent !w-0 !h-0 !border-0"}),N.jsx(yn,{type:"source",position:ye.Right,className:"!bg-transparent !w-0 !h-0 !border-0"})]})}const DN="modulepreload",TN=function(e){return"/"+e},qy={},AN=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let u=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),_=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));a=u(n.map(h=>{if(h=TN(h),h in qy)return;qy[h]=!0;const p=h.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":DN,p||(v.as="script"),v.crossOrigin="",v.href=h,_&&v.setAttribute("nonce",_),document.head.appendChild(v),p)return new Promise((b,y)=>{v.addEventListener("load",b),v.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${h}`)))})}))}function c(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return a.then(u=>{for(const f of u||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function Tb({integrationId:e,workflowName:t,nodeName:n,connectionsApi:r}){const{nangoConnections:a,loading:c,refetch:u}=iD(e,r.mutationVersion),[f,_]=$.useState(!1),h=r.getForNode(t,n,e),p=$.useCallback(async v=>{await r.upsert({workflow_name:t,node_name:n,integration_id:e,connection_id:v})},[r,t,n,e]),m=$.useCallback(async()=>{_(!0);try{const v=await fetch("/api/nango/connect-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({integration_id:e})});if(!v.ok)return;const{token:b}=await v.json(),w=(await AN(()=>import("./index-DAKTQEvj.js"),[])).default;new w().openConnectUI({sessionToken:b,onEvent:async E=>{if(E.type==="connect"){u();const L=E.payload.connectionId;L&&(await p(L),t!=="*"&&await r.upsert({workflow_name:"*",node_name:"*",integration_id:e,connection_id:L}))}else E.type==="close"&&u()}})}catch{}finally{_(!1)}},[e,u,p,t,r]);return N.jsxs("div",{className:"flex flex-col gap-1.5",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsx("span",{className:"text-[12px] font-medium text-popover-foreground capitalize",children:e}),N.jsx("button",{onClick:m,disabled:f,className:"text-[10px] px-2 py-0.5 rounded-md bg-accent text-popover-foreground hover:bg-accent/80 transition-colors cursor-pointer disabled:opacity-50",children:f?"...":"Connect"})]}),c?N.jsx("p",{className:"text-[11px] text-[#a8a099] italic",children:"Loading connections..."}):a.length===0?N.jsx("p",{className:"text-[11px] text-[#a8a099] italic",children:"No connections. Click Connect to add one."}):N.jsxs("select",{value:(h==null?void 0:h.connection_id)??"",onChange:v=>p(v.target.value),className:"text-[12px] px-2 py-1 rounded-md border border-border bg-background text-foreground",children:[N.jsx("option",{value:"",children:"Select a connection..."}),a.map(v=>N.jsx("option",{value:v.connection_id,children:v.connection_id},v.connection_id))]})]})}const NN={node:"fn",agent:"AI",workflow:"wf",input:"IN",output:"OUT",condition:"?"},Iy={node:{iconBg:"bg-emerald-50 text-emerald-600"},agent:{iconBg:"bg-purple-50 text-purple-600"},workflow:{iconBg:"bg-emerald-50 text-emerald-600"},input:{iconBg:"bg-[#f5f3f0] text-[#a8a099]"},output:{iconBg:"bg-[#f5f3f0] text-[#a8a099]"},condition:{iconBg:"bg-amber-50 text-amber-600"}},RN={node:"Node",agent:"Agent",workflow:"Workflow",input:"Input",output:"Output",condition:"Condition"};function BN({node:e,position:t,onClose:n,workflowName:r,connectionsApi:a}){const c=$.useRef(null),u=NN[e.type]??"fn",f=Iy[e.type]??Iy.node,_=RN[e.type]??e.type;$.useEffect(()=>{const w=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),$.useEffect(()=>{const w=E=>{c.current&&!c.current.contains(E.target)&&n()},x=setTimeout(()=>{document.addEventListener("mousedown",w)},0);return()=>{clearTimeout(x),document.removeEventListener("mousedown",w)}},[n]);const h=300,p=400,m=12,[v,b]=$.useState({left:t.x+12,top:t.y-20});$.useLayoutEffect(()=>{const w=c.current;if(!w)return;const x=w.offsetParent,E=(x==null?void 0:x.clientWidth)??window.innerWidth,L=(x==null?void 0:x.clientHeight)??window.innerHeight;b({left:Math.max(m,Math.min(t.x+12,E-h-m)),top:Math.max(m,Math.min(t.y-20,L-p-m))})},[t.x,t.y]);const y=e.integrations&&e.integrations.length>0&&e.nodeName&&r&&a;return N.jsxs("div",{ref:c,style:{left:v.left,top:v.top},className:"absolute z-50 w-[300px] bg-popover rounded-xl border border-border shadow-lg",children:[N.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-accent",children:[N.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[N.jsx("div",{className:`w-7 h-7 rounded-md flex items-center justify-center shrink-0 ${f.iconBg}`,children:N.jsx("span",{className:"text-[10px] font-bold",children:u})}),N.jsxs("div",{className:"min-w-0",children:[N.jsx("p",{className:"text-[13px] font-medium text-popover-foreground truncate",children:e.label}),N.jsx("p",{className:"text-[10px] text-[#a8a099] uppercase tracking-wide",children:_})]})]}),N.jsx("button",{onClick:n,"aria-label":"Close node details",className:"p-1 rounded-md text-[#a8a099] hover:text-popover-foreground hover:bg-accent transition-colors cursor-pointer",children:N.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),N.jsxs("div",{className:"px-4 py-3",children:[N.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[#a8a099] mb-1.5",children:"Description"}),e.description?N.jsx("p",{className:"text-[13px] text-muted-foreground whitespace-pre-line leading-relaxed",children:e.description}):N.jsx("p",{className:"text-[13px] text-[#a8a099] italic",children:"No description available"})]}),y&&N.jsxs("div",{className:"px-4 py-3 border-t border-accent",children:[N.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[#a8a099] mb-2",children:"Integrations"}),N.jsx("div",{className:"flex flex-col gap-3",children:e.integrations.map(w=>N.jsx(Tb,{integrationId:w,workflowName:r,nodeName:e.nodeName,connectionsApi:a},w))})]})]})}const cu=220,Ua=50,LN=80,Yy=40,Vy=20,$y=16,Wy=28;function zN(e,t){if(e.length===0)return new Map;const n=new Map,r=new Map,a=new Set(e);for(const h of e)n.set(h,[]),r.set(h,[]);for(const h of t)a.has(h.source)&&a.has(h.target)&&(n.get(h.source).push(h.target),r.get(h.target).push(h.source));const c=ON(e,n,r),u=new Map;for(const[h,p]of c)u.has(p)||u.set(p,[]),u.get(p).push(h);HN(u,c,n);const f=Math.max(...u.keys()),_=new Map;for(let h=0;h<=f;h++){const p=u.get(h)||[],v=-(p.length*Ua+(p.length-1)*Yy)/2;for(let b=0;b<p.length;b++)_.set(p[b],{x:Math.round(h*(cu+LN)),y:Math.round(v+b*(Ua+Yy))})}return _}function ON(e,t,n){const r=new Map,a=e.filter(f=>n.get(f).length===0),c=a.length>0?a:[e[0]],u=[...c];for(const f of c)r.set(f,0);for(const f of e)r.has(f)||(r.set(f,0),u.push(f));for(;u.length>0;){const f=u.shift(),_=r.get(f);for(const h of t.get(f)||[]){const p=r.get(h),m=_+1;(p===void 0||m>p)&&(r.set(h,m),u.push(h))}}return r}function HN(e,t,n){const r=Math.max(...e.keys()),a=new Map;for(const[c,u]of n)for(const f of u)a.has(f)||a.set(f,[]),a.get(f).push(c);for(let c=1;c<=r;c++){const u=e.get(c);if(!u||u.length<=1)continue;const f=e.get(c-1)||[],_=new Map;f.forEach((h,p)=>_.set(h,p)),u.sort((h,p)=>{const m=(a.get(h)||[]).filter(w=>t.get(w)===c-1),v=(a.get(p)||[]).filter(w=>t.get(w)===c-1),b=m.length>0?m.reduce((w,x)=>w+(_.get(x)||0),0)/m.length:0,y=v.length>0?v.reduce((w,x)=>w+(_.get(x)||0),0)/v.length:0;return b-y}),e.set(c,u)}}function UN(e,t){const n=[];for(const r of t){const a=new Map;let c=1/0,u=1/0,f=-1/0,_=-1/0;for(const b of r.nodeIds){const y=e.get(b);y&&(c=Math.min(c,y.x),u=Math.min(u,y.y),f=Math.max(f,y.x+cu),_=Math.max(_,y.y+Ua))}if(c===1/0)continue;const h=c-Vy,p=u-Wy-$y,m=f-c+2*Vy,v=_-u+Wy+2*$y;for(const b of r.nodeIds){const y=e.get(b);y&&a.set(b,{x:y.x-h,y:y.y-p})}n.push({id:r.id,position:{x:h,y:p},width:m,height:v,childPositions:a})}return n}const PN={workflowNode:MN,loopGroup:kN};function jN({dag:e,connectionsApi:t}){const{fitView:n}=Su(),[r,a]=$.useState(null),[c,u]=$.useState(null),{flowNodes:f,flowEdges:_}=$.useMemo(()=>{const L=zN(e.nodes.map(W=>W.id),e.edges.map(W=>({source:W.source,target:W.target}))),C=e.loopGroups??[],D=UN(L,C),I=new Map;for(const W of D){const G=C.find(ae=>ae.id===W.id);if(G)for(const ae of G.nodeIds)I.set(ae,W)}const z=[];for(const W of D){const G=C.find(ae=>ae.id===W.id);z.push({id:W.id,type:"loopGroup",position:W.position,data:{label:(G==null?void 0:G.label)??"",width:W.width,height:W.height},draggable:!1,style:{width:W.width,height:W.height}})}for(const W of e.nodes){const G=I.get(W.id);if(G){const ae=G.childPositions.get(W.id)??{x:0,y:0};z.push({id:W.id,type:"workflowNode",position:ae,parentId:G.id,extent:"parent",data:{...W},draggable:!1,width:cu,height:Ua})}else{const ae=L.get(W.id)??{x:0,y:0};z.push({id:W.id,type:"workflowNode",position:ae,data:{...W},draggable:!1,width:cu,height:Ua})}}const P=e.edges.map(W=>({id:W.id,source:W.source,target:W.target,label:W.label,type:"smoothstep",animated:!1,style:{stroke:"#d4cfc8",strokeWidth:1.5},labelStyle:{fontSize:10,fill:"#787068"}}));return{flowNodes:z,flowEdges:P}},[e]),[h,p,m]=bk(f),[v,b,y]=wk(_);$.useEffect(()=>{p(f),b(_),setTimeout(()=>n({padding:.2,duration:300}),50)},[f,_,p,b,n]);const w=$.useCallback((L,C)=>{const D=C.data;if(D.type==="input"||D.type==="output"||D.type==="condition")return;const z=L.currentTarget.closest(".react-flow"),P=(z==null?void 0:z.getBoundingClientRect())??{left:0,top:0};a(D),u({x:L.clientX-P.left,y:L.clientY-P.top})},[]),x=$.useCallback(()=>{a(null),u(null)},[]),E=$.useCallback(()=>{setTimeout(()=>n({padding:.2,duration:200}),50)},[n]);return N.jsxs("div",{className:"relative w-full h-full",children:[N.jsxs(Sk,{nodes:h,edges:v,onNodesChange:m,onEdgesChange:y,nodeTypes:PN,onInit:E,onNodeClick:w,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[N.jsx(kk,{variant:Ds.Dots,color:"#d4cfc8",gap:20,size:1.5}),N.jsx(Lk,{showInteractive:!1}),N.jsx(Xk,{nodeStrokeWidth:3,pannable:!0,zoomable:!0,style:{width:120,height:80}})]}),r&&c&&N.jsx(BN,{node:r,position:c,onClose:x,workflowName:e.workflowName,connectionsApi:t})]})}function qN({workflows:e,parseErrors:t,selected:n,onSelect:r}){return N.jsxs("div",{className:"flex flex-col gap-1",children:[N.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-1",children:"Workflows"}),e.length===0&&t.length===0&&N.jsx("p",{className:"text-xs text-[#a8a099] italic",children:"No workflows found"}),e.map(a=>N.jsxs("button",{onClick:()=>r(a.workflowName),className:`
|
|
125
|
+
text-left px-2.5 py-1.5 rounded-md text-sm transition-colors
|
|
126
|
+
${n===a.workflowName?"bg-accent text-foreground font-medium":"text-muted-foreground hover:bg-accent/60"}
|
|
127
|
+
`,children:[N.jsx("div",{className:"font-medium truncate",children:a.workflowName}),N.jsx("div",{className:"text-[10px] text-[#a8a099] truncate",children:a.filePath})]},`${a.filePath}:${a.workflowName}`)),t.length>0&&N.jsxs(N.Fragment,{children:[N.jsx("h2",{className:"text-xs font-semibold text-amber-600 uppercase tracking-wider mt-3 mb-1",children:"Parse Errors"}),t.map(a=>N.jsxs("div",{className:"px-2.5 py-1.5 rounded-md text-xs bg-amber-50 text-amber-700 border border-amber-200",children:[N.jsx("div",{className:"font-medium truncate",children:a.filePath}),N.jsx("div",{className:"truncate mt-0.5 text-amber-600",children:a.error})]},a.filePath))]})]})}function IN({workflows:e,connectionsApi:t}){const{integrations:n,loading:r}=tD(),a=$.useMemo(()=>{const u=new Set;for(const f of e)for(const _ of f.nodes)if(_.integrations)for(const h of _.integrations)u.add(h);return u},[e]),c=$.useMemo(()=>{const u=new Set(a);for(const f of n)u.add(f.id);return Array.from(u).sort((f,_)=>{const h=a.has(f)?0:1,p=a.has(_)?0:1;return h-p||f.localeCompare(_)})},[n,a]);return r||c.length===0?null:N.jsxs("div",{className:"border-t border-border pt-3",children:[N.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[#a8a099] mb-2 px-1",children:"Global Connections"}),N.jsx("div",{className:"flex flex-col gap-3",children:c.map(u=>N.jsx(Tb,{integrationId:u,workflowName:"*",nodeName:"*",connectionsApi:t},u))})]})}const YN=150,VN=400;function $N({tabs:e,defaultTab:t,onClose:n}){var v,b;const[r,a]=$.useState(t??((v=e[0])==null?void 0:v.id)??""),[c,u]=$.useState(VN),f=$.useRef(!1),_=$.useRef(0),h=$.useRef(0),p=$.useCallback(y=>{y.preventDefault(),f.current=!0,_.current=y.clientY,h.current=c},[c]);$.useEffect(()=>{const y=x=>{if(!f.current)return;const E=window.innerHeight*.6,L=_.current-x.clientY;u(Math.max(YN,Math.min(E,h.current+L)))},w=()=>{f.current=!1};return window.addEventListener("mousemove",y),window.addEventListener("mouseup",w),()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",w)}},[]);const m=(b=e.find(y=>y.id===r))==null?void 0:b.content;return N.jsxs("div",{className:"border-t border-border flex flex-col bg-background",style:{height:c},children:[N.jsx("div",{onMouseDown:p,className:"h-1 cursor-ns-resize hover:bg-accent shrink-0"}),N.jsxs("div",{className:"shrink-0 px-3 flex items-center gap-0 border-b border-border",children:[e.map(y=>N.jsxs("button",{onClick:()=>a(y.id),className:`relative text-[12px] tracking-wide px-3 py-2 cursor-pointer transition-colors ${r===y.id?"text-foreground":"text-muted-foreground hover:text-foreground/70"}`,children:[y.label,r===y.id&&N.jsx("span",{className:"absolute bottom-0 left-3 right-3 h-[1.5px] bg-foreground"})]},y.id)),N.jsx("div",{className:"flex-1"}),N.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground text-sm px-1.5 py-0.5 cursor-pointer",title:"Close panel",children:"×"})]}),N.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:m})]})}const WN={SUCCESS:{bg:"bg-emerald-50",text:"text-emerald-700",label:"Success"},ERROR:{bg:"bg-red-50",text:"text-red-700",label:"Failed"},PENDING:{bg:"bg-amber-50",text:"text-amber-700",label:"Pending"},RETRIES_EXCEEDED:{bg:"bg-red-50",text:"text-red-700",label:"Retries Exceeded"}};function XN({runs:e,loading:t,selectedRunId:n,trace:r,traceLoading:a,selectRun:c,refresh:u}){return t&&e.length===0?N.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Loading runs..."}):e.length===0?N.jsx("div",{className:"flex items-center justify-center h-full",children:N.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center",children:[N.jsx("p",{className:"text-[13px] text-foreground/60",children:"No runs yet"}),N.jsx("p",{className:"text-[11px] text-muted-foreground mt-1 leading-relaxed max-w-[240px]",children:"Workflow runs will appear here with their status, duration, and step-by-step trace."})]})}):N.jsxs("div",{className:"h-full flex flex-col",children:[N.jsxs("div",{className:"shrink-0 px-3 py-1.5 flex items-center justify-between border-b border-border",children:[N.jsxs("span",{className:"text-[11px] uppercase tracking-wider text-muted-foreground font-medium",children:[e.length," run",e.length!==1?"s":""]}),N.jsx("button",{onClick:u,className:"text-[11px] text-muted-foreground hover:text-foreground cursor-pointer transition-colors",children:"Refresh"})]}),N.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-3 py-2 space-y-1",children:e.map(f=>N.jsx(KN,{run:f,isExpanded:n===f.workflow_uuid,trace:n===f.workflow_uuid?r:null,traceLoading:n===f.workflow_uuid&&a,onToggle:()=>c(n===f.workflow_uuid?null:f.workflow_uuid)},f.workflow_uuid))})]})}function KN({run:e,isExpanded:t,trace:n,traceLoading:r,onToggle:a}){var _;const c=WN[e.status]??{bg:"bg-gray-50",text:"text-gray-700",label:e.status},u=(_=n==null?void 0:n.workflow)==null?void 0:_.duration_ms,f=ZN(e.created_at);return N.jsxs("div",{className:`rounded-lg border transition-colors ${e.status==="PENDING"?"border-amber-200":"border-border"} bg-muted`,children:[N.jsxs("button",{onClick:a,className:"w-full flex items-center gap-2 px-3 py-2 text-left cursor-pointer",children:[N.jsx("span",{className:"text-muted-foreground text-[10px] shrink-0",children:t?"▾":"▸"}),N.jsx("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] font-medium ${c.bg} ${c.text}`,children:c.label}),N.jsx("span",{className:"text-[12px] font-medium text-foreground truncate",children:e.name}),N.jsx("div",{className:"flex-1"}),u!=null&&N.jsx("span",{className:"text-[11px] font-mono text-muted-foreground shrink-0",children:X_(u)}),N.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:QN(f)})]}),t&&N.jsxs("div",{className:"border-t border-border px-3 py-2",children:[r?N.jsx("p",{className:"text-[11px] text-muted-foreground text-center py-3",children:"Loading trace..."}):n&&n.operations.length>0?N.jsx(GN,{operations:n.operations,rootWorkflowId:e.workflow_uuid}):N.jsx("p",{className:"text-[11px] text-muted-foreground text-center py-3 italic",children:"No operations recorded."}),e.error&&N.jsx("div",{className:"mt-2",children:N.jsx("pre",{className:"text-[10px] font-mono text-red-600 bg-red-50 rounded p-1.5 whitespace-pre-wrap break-all",children:e.error})})]})]})}function GN({operations:e,rootWorkflowId:t}){const[n,r]=$.useState(new Set),a=$.useCallback(h=>{r(p=>{const m=new Set(p);return m.has(h)?m.delete(h):m.add(h),m})},[]),c=new Map;for(const h of e){const p=c.get(h.workflow_uuid)??[];p.push(h),c.set(h.workflow_uuid,p)}const u=c.get(t)??[],f=new Set;for(const h of u)h.function_name==="DBOS.getResult"&&h.child_workflow_id&&f.add(h.child_workflow_id);const _=u.filter(h=>!h.child_workflow_id||h.function_name==="DBOS.getResult"?!0:!f.has(h.child_workflow_id));return N.jsx("div",{className:"space-y-0.5",children:_.map(h=>{let p=h.function_name;if(h.function_name==="DBOS.getResult"&&h.child_workflow_id){const w=u.find(x=>x.child_workflow_id===h.child_workflow_id&&x.function_name!=="DBOS.getResult");w&&(p=w.function_name)}const m=!!(h.output_preview||h.error||h.child_workflow_id),v=`${h.workflow_uuid}-${h.function_id}`,b=n.has(v),y=h.child_workflow_id?c.get(h.child_workflow_id)??[]:[];return N.jsxs("div",{children:[N.jsxs("button",{onClick:()=>m&&a(v),className:`w-full flex items-center gap-2 px-2 py-1 rounded text-left transition-colors ${m?"cursor-pointer hover:bg-accent":"cursor-default"} ${h.error?"bg-red-50/30":""}`,children:[m?N.jsx("span",{className:"text-muted-foreground text-[9px] w-3 shrink-0",children:b?"▾":"▸"}):N.jsx("span",{className:"w-3 shrink-0"}),N.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${h.error?"bg-red-500":h.duration_ms!=null?"bg-emerald-500":"bg-amber-400"}`}),N.jsx("span",{className:`text-[12px] font-medium truncate flex-1 ${h.error?"text-red-700":"text-foreground"}`,children:p}),h.duration_ms!=null&&N.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:X_(h.duration_ms)})]}),b&&N.jsxs("div",{className:"ml-7 mt-0.5 mb-1 space-y-1",children:[h.error&&N.jsx("pre",{className:"text-[10px] font-mono text-red-600 bg-red-50 rounded p-1.5 whitespace-pre-wrap break-all",children:h.error}),y.length>0&&N.jsx("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:y.map(w=>N.jsx(FN,{op:w},`${w.workflow_uuid}-${w.function_id}`))}),h.output_preview&&!h.error&&N.jsx("pre",{className:"text-[10px] font-mono text-muted-foreground bg-background rounded p-1.5 whitespace-pre-wrap break-all max-h-[100px] overflow-auto",children:JN(h.output_preview)})]})]},v)})})}function FN({op:e}){return N.jsxs("div",{className:`flex items-center gap-2 px-2 py-0.5 rounded text-[11px] ${e.error?"bg-red-50/30":""}`,children:[N.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.error?"bg-red-500":e.duration_ms!=null?"bg-emerald-500":"bg-amber-400"}`}),N.jsx("span",{className:`truncate flex-1 ${e.error?"text-red-700":"text-foreground/80"}`,children:e.function_name}),e.duration_ms!=null&&N.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:X_(e.duration_ms)})]})}function ZN(e){if(typeof e=="number")return e;if(typeof e=="string"){if(/^\d+$/.test(e))return parseInt(e,10);const t=new Date(e).getTime();if(!isNaN(t))return t}return Date.now()}function X_(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t}m ${n}s`}function QN(e){const t=Date.now()-e;return t<0?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:t<6048e5?`${Math.floor(t/864e5)}d ago`:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function JN(e){if(!e)return"";try{const t=JSON.parse(e),n=JSON.stringify(t,null,2);return n.length>200?n.slice(0,197)+"...":n}catch{return e.length>200?e.slice(0,197)+"...":e}}function e4({attachTo:e,fit:t,ptyAlive:n,hasData:r,restart:a}){const c=$.useRef(null);return $.useEffect(()=>(c.current&&e(c.current),()=>e(null)),[e]),$.useEffect(()=>{if(!c.current)return;const u=new ResizeObserver(()=>{requestAnimationFrame(t)});return u.observe(c.current),()=>u.disconnect()},[t]),$.useEffect(()=>{const u=setTimeout(t,50);return()=>clearTimeout(u)},[t]),$.useEffect(()=>{if(n)return;const u=c.current;if(!u)return;const f=_=>{_.key==="Enter"&&a()};return u.addEventListener("keydown",f),()=>u.removeEventListener("keydown",f)},[n,a]),N.jsxs("div",{className:"relative h-full w-full overflow-hidden bg-[#1a1a1a] px-4 py-2",children:[N.jsx("div",{ref:c,className:"h-full w-full"}),!r&&N.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:N.jsxs("div",{className:"flex items-center gap-3 text-zinc-500",children:[N.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),N.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),N.jsx("span",{children:"Starting Claude Code..."})]})})]})}function t4(){const{state:e,connected:t,sendMessage:n,ptyEvents:r}=Jk(),a=CN({sendMessage:n,ptyEvents:r}),c=eD(),[u,f]=$.useState(null),[_,h]=$.useState(!0),p=nD(u);$.useEffect(()=>{!u&&e.workflows.length>0&&f(e.workflows[0].workflowName)},[e.workflows,u]);const m=e.workflows.find(b=>b.workflowName===u),v=$.useMemo(()=>[{id:"terminal",label:"Terminal",content:N.jsx(e4,{attachTo:a.attachTo,fit:a.fit,ptyAlive:a.ptyAlive,hasData:a.hasData,restart:a.restart})},...p.available?[{id:"history",label:"History",content:N.jsx(XN,{runs:p.runs,loading:p.loading,selectedRunId:p.selectedRunId,trace:p.trace,traceLoading:p.traceLoading,selectRun:p.selectRun,refresh:p.refresh})}]:[]],[a,p]);return N.jsxs("div",{className:"h-screen w-screen flex bg-background",children:[N.jsxs("div",{className:"w-56 border-r border-border flex flex-col",children:[N.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[N.jsx("h1",{className:"text-sm font-bold text-foreground font-serif",children:"0pflow"}),N.jsx("span",{className:`w-2 h-2 rounded-full ${t?"bg-green-400":"bg-red-400"}`,title:t?"Connected":"Disconnected"})]}),N.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[N.jsx(qN,{workflows:e.workflows,parseErrors:e.parseErrors,selected:u,onSelect:f}),N.jsx(IN,{workflows:e.workflows,connectionsApi:c})]})]}),N.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[N.jsxs("div",{className:"flex-1 relative min-h-0",children:[m?N.jsxs(z1,{children:[N.jsx("div",{className:"absolute inset-0",children:N.jsx(jN,{dag:m,connectionsApi:c})}),N.jsxs("div",{className:"absolute top-3 left-3 bg-card/80 backdrop-blur-sm px-3 py-1.5 rounded-md shadow-sm border border-border",children:[N.jsx("span",{className:"text-sm font-medium text-foreground",children:m.workflowName}),N.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["v",m.version]})]})]},m.workflowName):N.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:e.workflows.length===0?"No workflow files found. Create a workflow to get started.":"Select a workflow from the sidebar."}),N.jsx("button",{onClick:()=>h(!_),className:`absolute top-3 right-3 bg-card/80 backdrop-blur-sm px-3 py-1.5 rounded-md shadow-sm border border-border text-[12px] cursor-pointer transition-colors ${_?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Terminal"})]}),_&&N.jsx($N,{tabs:v,defaultTab:"terminal",onClose:()=>h(!1)})]})]})}Vx.createRoot(document.getElementById("root")).render(N.jsx($.StrictMode,{children:N.jsx(t4,{})}));
|