@caoruhua/open-claude-remote 0.1.7 → 0.2.3

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.
Files changed (132) hide show
  1. package/README.md +514 -11
  2. package/dist/backend/src/api/config-routes.d.ts +2 -2
  3. package/dist/backend/src/api/config-routes.d.ts.map +1 -1
  4. package/dist/backend/src/api/config-routes.js +21 -6
  5. package/dist/backend/src/api/config-routes.js.map +1 -1
  6. package/dist/backend/src/api/health-routes.d.ts +4 -1
  7. package/dist/backend/src/api/health-routes.d.ts.map +1 -1
  8. package/dist/backend/src/api/health-routes.js +20 -2
  9. package/dist/backend/src/api/health-routes.js.map +1 -1
  10. package/dist/backend/src/api/hook-routes.d.ts +2 -2
  11. package/dist/backend/src/api/hook-routes.d.ts.map +1 -1
  12. package/dist/backend/src/api/hook-routes.js +10 -3
  13. package/dist/backend/src/api/hook-routes.js.map +1 -1
  14. package/dist/backend/src/api/instance-routes.d.ts +5 -3
  15. package/dist/backend/src/api/instance-routes.d.ts.map +1 -1
  16. package/dist/backend/src/api/instance-routes.js +48 -45
  17. package/dist/backend/src/api/instance-routes.js.map +1 -1
  18. package/dist/backend/src/api/router.d.ts +4 -12
  19. package/dist/backend/src/api/router.d.ts.map +1 -1
  20. package/dist/backend/src/api/router.js +28 -20
  21. package/dist/backend/src/api/router.js.map +1 -1
  22. package/dist/backend/src/api/status-routes.d.ts +2 -2
  23. package/dist/backend/src/api/status-routes.d.ts.map +1 -1
  24. package/dist/backend/src/api/status-routes.js +11 -6
  25. package/dist/backend/src/api/status-routes.js.map +1 -1
  26. package/dist/backend/src/attach.d.ts +1 -1
  27. package/dist/backend/src/attach.d.ts.map +1 -1
  28. package/dist/backend/src/attach.js +25 -71
  29. package/dist/backend/src/attach.js.map +1 -1
  30. package/dist/backend/src/cli-utils.d.ts +24 -1
  31. package/dist/backend/src/cli-utils.d.ts.map +1 -1
  32. package/dist/backend/src/cli-utils.js +73 -37
  33. package/dist/backend/src/cli-utils.js.map +1 -1
  34. package/dist/backend/src/cli.d.ts +22 -2
  35. package/dist/backend/src/cli.d.ts.map +1 -1
  36. package/dist/backend/src/cli.js +328 -23
  37. package/dist/backend/src/cli.js.map +1 -1
  38. package/dist/backend/src/config.d.ts +48 -15
  39. package/dist/backend/src/config.d.ts.map +1 -1
  40. package/dist/backend/src/config.js +124 -24
  41. package/dist/backend/src/config.js.map +1 -1
  42. package/dist/backend/src/daemon/daemon-client.d.ts +69 -0
  43. package/dist/backend/src/daemon/daemon-client.d.ts.map +1 -0
  44. package/dist/backend/src/daemon/daemon-client.js +209 -0
  45. package/dist/backend/src/daemon/daemon-client.js.map +1 -0
  46. package/dist/backend/src/daemon/daemon-entry.d.ts +8 -0
  47. package/dist/backend/src/daemon/daemon-entry.d.ts.map +1 -0
  48. package/dist/backend/src/daemon/daemon-entry.js +37 -0
  49. package/dist/backend/src/daemon/daemon-entry.js.map +1 -0
  50. package/dist/backend/src/daemon/daemon-launcher.d.ts +13 -0
  51. package/dist/backend/src/daemon/daemon-launcher.d.ts.map +1 -0
  52. package/dist/backend/src/daemon/daemon-launcher.js +62 -0
  53. package/dist/backend/src/daemon/daemon-launcher.js.map +1 -0
  54. package/dist/backend/src/index.d.ts.map +1 -1
  55. package/dist/backend/src/index.js +115 -251
  56. package/dist/backend/src/index.js.map +1 -1
  57. package/dist/backend/src/instance/index.d.ts +4 -0
  58. package/dist/backend/src/instance/index.d.ts.map +1 -0
  59. package/dist/backend/src/instance/index.js +3 -0
  60. package/dist/backend/src/instance/index.js.map +1 -0
  61. package/dist/backend/src/instance/instance-manager.d.ts +62 -0
  62. package/dist/backend/src/instance/instance-manager.d.ts.map +1 -0
  63. package/dist/backend/src/instance/instance-manager.js +194 -0
  64. package/dist/backend/src/instance/instance-manager.js.map +1 -0
  65. package/dist/backend/src/instance/instance-session.d.ts +87 -0
  66. package/dist/backend/src/instance/instance-session.d.ts.map +1 -0
  67. package/dist/backend/src/instance/instance-session.js +359 -0
  68. package/dist/backend/src/instance/instance-session.js.map +1 -0
  69. package/dist/backend/src/instance/types.d.ts +39 -0
  70. package/dist/backend/src/instance/types.d.ts.map +1 -0
  71. package/dist/backend/src/instance/types.js +2 -0
  72. package/dist/backend/src/instance/types.js.map +1 -0
  73. package/dist/backend/src/notification/notification-manager.js +1 -1
  74. package/dist/backend/src/notification/notification-manager.js.map +1 -1
  75. package/dist/backend/src/notification/notification-service-factory.js +1 -1
  76. package/dist/backend/src/notification/notification-service-factory.js.map +1 -1
  77. package/dist/backend/src/pty/virtual-pty.d.ts.map +1 -1
  78. package/dist/backend/src/pty/virtual-pty.js +6 -0
  79. package/dist/backend/src/pty/virtual-pty.js.map +1 -1
  80. package/dist/backend/src/registry/shared-token.d.ts +2 -2
  81. package/dist/backend/src/registry/shared-token.js +11 -11
  82. package/dist/backend/src/registry/shared-token.js.map +1 -1
  83. package/dist/backend/src/registry/stop-instances.d.ts +0 -25
  84. package/dist/backend/src/registry/stop-instances.d.ts.map +1 -1
  85. package/dist/backend/src/registry/stop-instances.js +6 -206
  86. package/dist/backend/src/registry/stop-instances.js.map +1 -1
  87. package/dist/backend/src/skills/index.d.ts +4 -0
  88. package/dist/backend/src/skills/index.d.ts.map +1 -0
  89. package/dist/backend/src/skills/index.js +4 -0
  90. package/dist/backend/src/skills/index.js.map +1 -0
  91. package/dist/backend/src/skills/skill-command-merger.d.ts +32 -0
  92. package/dist/backend/src/skills/skill-command-merger.d.ts.map +1 -0
  93. package/dist/backend/src/skills/skill-command-merger.js +78 -0
  94. package/dist/backend/src/skills/skill-command-merger.js.map +1 -0
  95. package/dist/backend/src/skills/skill-commands.d.ts +25 -0
  96. package/dist/backend/src/skills/skill-commands.d.ts.map +1 -0
  97. package/dist/backend/src/skills/skill-commands.js +56 -0
  98. package/dist/backend/src/skills/skill-commands.js.map +1 -0
  99. package/dist/backend/src/skills/skill-scanner.d.ts +36 -0
  100. package/dist/backend/src/skills/skill-scanner.d.ts.map +1 -0
  101. package/dist/backend/src/skills/skill-scanner.js +143 -0
  102. package/dist/backend/src/skills/skill-scanner.js.map +1 -0
  103. package/dist/backend/src/terminal/terminal-relay.d.ts +1 -0
  104. package/dist/backend/src/terminal/terminal-relay.d.ts.map +1 -1
  105. package/dist/backend/src/terminal/terminal-relay.js +6 -0
  106. package/dist/backend/src/terminal/terminal-relay.js.map +1 -1
  107. package/dist/backend/src/update.d.ts.map +1 -1
  108. package/dist/backend/src/update.js +46 -1
  109. package/dist/backend/src/update.js.map +1 -1
  110. package/dist/backend/src/utils/banner.d.ts +15 -0
  111. package/dist/backend/src/utils/banner.d.ts.map +1 -0
  112. package/dist/backend/src/utils/banner.js +95 -0
  113. package/dist/backend/src/utils/banner.js.map +1 -0
  114. package/dist/backend/src/ws/ws-server.d.ts +13 -54
  115. package/dist/backend/src/ws/ws-server.d.ts.map +1 -1
  116. package/dist/backend/src/ws/ws-server.js +57 -155
  117. package/dist/backend/src/ws/ws-server.js.map +1 -1
  118. package/dist/shared/constants.d.ts +2 -1
  119. package/dist/shared/constants.d.ts.map +1 -1
  120. package/dist/shared/constants.js +2 -1
  121. package/dist/shared/constants.js.map +1 -1
  122. package/dist/shared/defaults.d.ts.map +1 -1
  123. package/dist/shared/defaults.js +1 -5
  124. package/dist/shared/defaults.js.map +1 -1
  125. package/dist/shared/instance.d.ts +4 -9
  126. package/dist/shared/instance.d.ts.map +1 -1
  127. package/dist/shared/instance.js +0 -2
  128. package/dist/shared/instance.js.map +1 -1
  129. package/frontend-dist/assets/index-CM2xfmS8.js +152 -0
  130. package/frontend-dist/index.html +1 -1
  131. package/package.json +2 -2
  132. package/frontend-dist/assets/index-Cfhr3h3e.js +0 -152
@@ -0,0 +1,152 @@
1
+ (function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const z of document.querySelectorAll('link[rel="modulepreload"]'))A(z);new MutationObserver(z=>{for(const U of z)if(U.type==="childList")for(const B of U.addedNodes)B.tagName==="LINK"&&B.rel==="modulepreload"&&A(B)}).observe(document,{childList:!0,subtree:!0});function D(z){const U={};return z.integrity&&(U.integrity=z.integrity),z.referrerPolicy&&(U.referrerPolicy=z.referrerPolicy),z.crossOrigin==="use-credentials"?U.credentials="include":z.crossOrigin==="anonymous"?U.credentials="omit":U.credentials="same-origin",U}function A(z){if(z.ep)return;z.ep=!0;const U=D(z);fetch(z.href,U)}})();function qp(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Cc={exports:{}},wn={};/**
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 $f;function Wp(){if($f)return wn;$f=1;var f=Symbol.for("react.transitional.element"),C=Symbol.for("react.fragment");function D(A,z,U){var B=null;if(U!==void 0&&(B=""+U),z.key!==void 0&&(B=""+z.key),"key"in z){U={};for(var s in z)s!=="key"&&(U[s]=z[s])}else U=z;return z=U.ref,{$$typeof:f,type:A,key:B,ref:z!==void 0?z:null,props:U}}return wn.Fragment=C,wn.jsx=D,wn.jsxs=D,wn}var Yf;function Gp(){return Yf||(Yf=1,Cc.exports=Wp()),Cc.exports}var V=Gp(),wc={exports:{}},Re={};/**
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 Vf;function $p(){if(Vf)return Re;Vf=1;var f=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),B=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),o=Symbol.for("react.activity"),p=Symbol.iterator;function m(O){return O===null||typeof O!="object"?null:(O=p&&O[p]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,n={};function l(O,N,Z){this.props=O,this.context=N,this.refs=n,this.updater=Z||w}l.prototype.isReactComponent={},l.prototype.setState=function(O,N){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,N,"setState")},l.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function a(){}a.prototype=l.prototype;function c(O,N,Z){this.props=O,this.context=N,this.refs=n,this.updater=Z||w}var S=c.prototype=new a;S.constructor=c,_(S,l.prototype),S.isPureReactComponent=!0;var x=Array.isArray;function b(){}var E={H:null,A:null,T:null,S:null},y=Object.prototype.hasOwnProperty;function R(O,N,Z){var ee=Z.ref;return{$$typeof:f,type:O,key:N,ref:ee!==void 0?ee:null,props:Z}}function T(O,N){return R(O.type,N,O.props)}function I(O){return typeof O=="object"&&O!==null&&O.$$typeof===f}function M(O){var N={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Z){return N[Z]})}var H=/\/+/g;function q(O,N){return typeof O=="object"&&O!==null&&O.key!=null?M(""+O.key):N.toString(36)}function Q(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(b,b):(O.status="pending",O.then(function(N){O.status==="pending"&&(O.status="fulfilled",O.value=N)},function(N){O.status==="pending"&&(O.status="rejected",O.reason=N)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function G(O,N,Z,ee,he){var ce=typeof O;(ce==="undefined"||ce==="boolean")&&(O=null);var X=!1;if(O===null)X=!0;else switch(ce){case"bigint":case"string":case"number":X=!0;break;case"object":switch(O.$$typeof){case f:case C:X=!0;break;case g:return X=O._init,G(X(O._payload),N,Z,ee,he)}}if(X)return he=he(O),X=ee===""?"."+q(O,0):ee,x(he)?(Z="",X!=null&&(Z=X.replace(H,"$&/")+"/"),G(he,N,Z,"",function(ie){return ie})):he!=null&&(I(he)&&(he=T(he,Z+(he.key==null||O&&O.key===he.key?"":(""+he.key).replace(H,"$&/")+"/")+X)),N.push(he)),1;X=0;var P=ee===""?".":ee+":";if(x(O))for(var ne=0;ne<O.length;ne++)ee=O[ne],ce=P+q(ee,ne),X+=G(ee,N,Z,ce,he);else if(ne=m(O),typeof ne=="function")for(O=ne.call(O),ne=0;!(ee=O.next()).done;)ee=ee.value,ce=P+q(ee,ne++),X+=G(ee,N,Z,ce,he);else if(ce==="object"){if(typeof O.then=="function")return G(Q(O),N,Z,ee,he);throw N=String(O),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return X}function $(O,N,Z){if(O==null)return O;var ee=[],he=0;return G(O,ee,"","",function(ce){return N.call(Z,ce,he++)}),ee}function Y(O){if(O._status===-1){var N=O._result;N=N(),N.then(function(Z){(O._status===0||O._status===-1)&&(O._status=1,O._result=Z)},function(Z){(O._status===0||O._status===-1)&&(O._status=2,O._result=Z)}),O._status===-1&&(O._status=0,O._result=N)}if(O._status===1)return O._result.default;throw O._result}var k=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},F={map:$,forEach:function(O,N,Z){$(O,function(){N.apply(this,arguments)},Z)},count:function(O){var N=0;return $(O,function(){N++}),N},toArray:function(O){return $(O,function(N){return N})||[]},only:function(O){if(!I(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Re.Activity=o,Re.Children=F,Re.Component=l,Re.Fragment=D,Re.Profiler=z,Re.PureComponent=c,Re.StrictMode=A,Re.Suspense=u,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Re.__COMPILER_RUNTIME={__proto__:null,c:function(O){return E.H.useMemoCache(O)}},Re.cache=function(O){return function(){return O.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(O,N,Z){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=_({},O.props),he=O.key;if(N!=null)for(ce in N.key!==void 0&&(he=""+N.key),N)!y.call(N,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&N.ref===void 0||(ee[ce]=N[ce]);var ce=arguments.length-2;if(ce===1)ee.children=Z;else if(1<ce){for(var X=Array(ce),P=0;P<ce;P++)X[P]=arguments[P+2];ee.children=X}return R(O.type,he,ee)},Re.createContext=function(O){return O={$$typeof:B,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:U,_context:O},O},Re.createElement=function(O,N,Z){var ee,he={},ce=null;if(N!=null)for(ee in N.key!==void 0&&(ce=""+N.key),N)y.call(N,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(he[ee]=N[ee]);var X=arguments.length-2;if(X===1)he.children=Z;else if(1<X){for(var P=Array(X),ne=0;ne<X;ne++)P[ne]=arguments[ne+2];he.children=P}if(O&&O.defaultProps)for(ee in X=O.defaultProps,X)he[ee]===void 0&&(he[ee]=X[ee]);return R(O,ce,he)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(O){return{$$typeof:s,render:O}},Re.isValidElement=I,Re.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:Y}},Re.memo=function(O,N){return{$$typeof:h,type:O,compare:N===void 0?null:N}},Re.startTransition=function(O){var N=E.T,Z={};E.T=Z;try{var ee=O(),he=E.S;he!==null&&he(Z,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(b,k)}catch(ce){k(ce)}finally{N!==null&&Z.types!==null&&(N.types=Z.types),E.T=N}},Re.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Re.use=function(O){return E.H.use(O)},Re.useActionState=function(O,N,Z){return E.H.useActionState(O,N,Z)},Re.useCallback=function(O,N){return E.H.useCallback(O,N)},Re.useContext=function(O){return E.H.useContext(O)},Re.useDebugValue=function(){},Re.useDeferredValue=function(O,N){return E.H.useDeferredValue(O,N)},Re.useEffect=function(O,N){return E.H.useEffect(O,N)},Re.useEffectEvent=function(O){return E.H.useEffectEvent(O)},Re.useId=function(){return E.H.useId()},Re.useImperativeHandle=function(O,N,Z){return E.H.useImperativeHandle(O,N,Z)},Re.useInsertionEffect=function(O,N){return E.H.useInsertionEffect(O,N)},Re.useLayoutEffect=function(O,N){return E.H.useLayoutEffect(O,N)},Re.useMemo=function(O,N){return E.H.useMemo(O,N)},Re.useOptimistic=function(O,N){return E.H.useOptimistic(O,N)},Re.useReducer=function(O,N,Z){return E.H.useReducer(O,N,Z)},Re.useRef=function(O){return E.H.useRef(O)},Re.useState=function(O){return E.H.useState(O)},Re.useSyncExternalStore=function(O,N,Z){return E.H.useSyncExternalStore(O,N,Z)},Re.useTransition=function(){return E.H.useTransition()},Re.version="19.2.4",Re}var Xf;function Gc(){return Xf||(Xf=1,wc.exports=$p()),wc.exports}var W=Gc();const xt=qp(W);var xc={exports:{}},xn={},Ec={exports:{}},Rc={};/**
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 Kf;function Yp(){return Kf||(Kf=1,(function(f){function C(G,$){var Y=G.length;G.push($);e:for(;0<Y;){var k=Y-1>>>1,F=G[k];if(0<z(F,$))G[k]=$,G[Y]=F,Y=k;else break e}}function D(G){return G.length===0?null:G[0]}function A(G){if(G.length===0)return null;var $=G[0],Y=G.pop();if(Y!==$){G[0]=Y;e:for(var k=0,F=G.length,O=F>>>1;k<O;){var N=2*(k+1)-1,Z=G[N],ee=N+1,he=G[ee];if(0>z(Z,Y))ee<F&&0>z(he,Z)?(G[k]=he,G[ee]=Y,k=ee):(G[k]=Z,G[N]=Y,k=N);else if(ee<F&&0>z(he,Y))G[k]=he,G[ee]=Y,k=ee;else break e}}return $}function z(G,$){var Y=G.sortIndex-$.sortIndex;return Y!==0?Y:G.id-$.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var U=performance;f.unstable_now=function(){return U.now()}}else{var B=Date,s=B.now();f.unstable_now=function(){return B.now()-s}}var u=[],h=[],g=1,o=null,p=3,m=!1,w=!1,_=!1,n=!1,l=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var $=D(h);$!==null;){if($.callback===null)A(h);else if($.startTime<=G)A(h),$.sortIndex=$.expirationTime,C(u,$);else break;$=D(h)}}function x(G){if(_=!1,S(G),!w)if(D(u)!==null)w=!0,b||(b=!0,M());else{var $=D(h);$!==null&&Q(x,$.startTime-G)}}var b=!1,E=-1,y=5,R=-1;function T(){return n?!0:!(f.unstable_now()-R<y)}function I(){if(n=!1,b){var G=f.unstable_now();R=G;var $=!0;try{e:{w=!1,_&&(_=!1,a(E),E=-1),m=!0;var Y=p;try{t:{for(S(G),o=D(u);o!==null&&!(o.expirationTime>G&&T());){var k=o.callback;if(typeof k=="function"){o.callback=null,p=o.priorityLevel;var F=k(o.expirationTime<=G);if(G=f.unstable_now(),typeof F=="function"){o.callback=F,S(G),$=!0;break t}o===D(u)&&A(u),S(G)}else A(u);o=D(u)}if(o!==null)$=!0;else{var O=D(h);O!==null&&Q(x,O.startTime-G),$=!1}}break e}finally{o=null,p=Y,m=!1}$=void 0}}finally{$?M():b=!1}}}var M;if(typeof c=="function")M=function(){c(I)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=I,M=function(){q.postMessage(null)}}else M=function(){l(I,0)};function Q(G,$){E=l(function(){G(f.unstable_now())},$)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(G){G.callback=null},f.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<G?Math.floor(1e3/G):5},f.unstable_getCurrentPriorityLevel=function(){return p},f.unstable_next=function(G){switch(p){case 1:case 2:case 3:var $=3;break;default:$=p}var Y=p;p=$;try{return G()}finally{p=Y}},f.unstable_requestPaint=function(){n=!0},f.unstable_runWithPriority=function(G,$){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Y=p;p=G;try{return $()}finally{p=Y}},f.unstable_scheduleCallback=function(G,$,Y){var k=f.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?k+Y:k):Y=k,G){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=Y+F,G={id:g++,callback:$,priorityLevel:G,startTime:Y,expirationTime:F,sortIndex:-1},Y>k?(G.sortIndex=Y,C(h,G),D(u)===null&&G===D(h)&&(_?(a(E),E=-1):_=!0,Q(x,Y-k))):(G.sortIndex=F,C(u,G),w||m||(w=!0,b||(b=!0,M()))),G},f.unstable_shouldYield=T,f.unstable_wrapCallback=function(G){var $=p;return function(){var Y=p;p=$;try{return G.apply(this,arguments)}finally{p=Y}}}})(Rc)),Rc}var Zf;function Vp(){return Zf||(Zf=1,Ec.exports=Yp()),Ec.exports}var Ac={exports:{}},Ot={};/**
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 Qf;function Xp(){if(Qf)return Ot;Qf=1;var f=Gc();function C(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function D(){}var A={d:{f:D,r:function(){throw Error(C(522))},D,C:D,L:D,m:D,X:D,S:D,M:D},p:0,findDOMNode:null},z=Symbol.for("react.portal");function U(u,h,g){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:z,key:o==null?null:""+o,children:u,containerInfo:h,implementation:g}}var B=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ot.createPortal=function(u,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(C(299));return U(u,h,null,g)},Ot.flushSync=function(u){var h=B.T,g=A.p;try{if(B.T=null,A.p=2,u)return u()}finally{B.T=h,A.p=g,A.d.f()}},Ot.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,A.d.C(u,h))},Ot.prefetchDNS=function(u){typeof u=="string"&&A.d.D(u)},Ot.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var g=h.as,o=s(g,h.crossOrigin),p=typeof h.integrity=="string"?h.integrity:void 0,m=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?A.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:o,integrity:p,fetchPriority:m}):g==="script"&&A.d.X(u,{crossOrigin:o,integrity:p,fetchPriority:m,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ot.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=s(h.as,h.crossOrigin);A.d.M(u,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&A.d.M(u)},Ot.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,o=s(g,h.crossOrigin);A.d.L(u,g,{crossOrigin:o,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})}},Ot.preloadModule=function(u,h){if(typeof u=="string")if(h){var g=s(h.as,h.crossOrigin);A.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else A.d.m(u)},Ot.requestFormReset=function(u){A.d.r(u)},Ot.unstable_batchedUpdates=function(u,h){return u(h)},Ot.useFormState=function(u,h,g){return B.H.useFormState(u,h,g)},Ot.useFormStatus=function(){return B.H.useHostTransitionStatus()},Ot.version="19.2.4",Ot}var Jf;function U_(){if(Jf)return Ac.exports;Jf=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(C){console.error(C)}}return f(),Ac.exports=Xp(),Ac.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 e_;function Kp(){if(e_)return xn;e_=1;var f=Vp(),C=Gc(),D=U_();function A(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function z(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function U(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function B(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function s(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(U(e)!==e)throw Error(A(188))}function h(e){var t=e.alternate;if(!t){if(t=U(e),t===null)throw Error(A(188));return t!==e?null:e}for(var i=e,r=t;;){var d=i.return;if(d===null)break;var v=d.alternate;if(v===null){if(r=d.return,r!==null){i=r;continue}break}if(d.child===v.child){for(v=d.child;v;){if(v===i)return u(d),e;if(v===r)return u(d),t;v=v.sibling}throw Error(A(188))}if(i.return!==r.return)i=d,r=v;else{for(var L=!1,j=d.child;j;){if(j===i){L=!0,i=d,r=v;break}if(j===r){L=!0,r=d,i=v;break}j=j.sibling}if(!L){for(j=v.child;j;){if(j===i){L=!0,i=v,r=d;break}if(j===r){L=!0,r=v,i=d;break}j=j.sibling}if(!L)throw Error(A(189))}}if(i.alternate!==r)throw Error(A(190))}if(i.tag!==3)throw Error(A(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var o=Object.assign,p=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function M(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var H=Symbol.for("react.client.reference");function q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===H?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case l:return"Profiler";case n:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case c:return e.displayName||"Context";case a:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case E:return t=e.displayName||null,t!==null?t:q(e.type)||"Memo";case y:t=e._payload,e=e._init;try{return q(e(t))}catch{}}return null}var Q=Array.isArray,G=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},k=[],F=-1;function O(e){return{current:e}}function N(e){0>F||(e.current=k[F],k[F]=null,F--)}function Z(e,t){F++,k[F]=e.current,e.current=t}var ee=O(null),he=O(null),ce=O(null),X=O(null);function P(e,t){switch(Z(ce,t),Z(he,e),Z(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gf(t),e=vf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}N(ee),Z(ee,e)}function ne(){N(ee),N(he),N(ce)}function ie(e){e.memoizedState!==null&&Z(X,e);var t=ee.current,i=vf(t,e.type);t!==i&&(Z(he,e),Z(ee,i))}function _e(e){he.current===e&&(N(ee),N(he)),X.current===e&&(N(X),Sn._currentValue=Y)}var fe,ye;function ve(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",ye=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+fe+e+ye}var Te=!1;function Pe(e,t){if(!e||Te)return"";Te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var ae=oe}Reflect.construct(e,[],de)}else{try{de.call()}catch(oe){ae=oe}e.call(de.prototype)}}else{try{throw Error()}catch(oe){ae=oe}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&ae&&typeof oe.stack=="string")return[oe.stack,ae.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=r.DetermineComponentFrameRoot(),L=v[0],j=v[1];if(L&&j){var K=L.split(`
44
+ `),se=j.split(`
45
+ `);for(d=r=0;r<K.length&&!K[r].includes("DetermineComponentFrameRoot");)r++;for(;d<se.length&&!se[d].includes("DetermineComponentFrameRoot");)d++;if(r===K.length||d===se.length)for(r=K.length-1,d=se.length-1;1<=r&&0<=d&&K[r]!==se[d];)d--;for(;1<=r&&0<=d;r--,d--)if(K[r]!==se[d]){if(r!==1||d!==1)do if(r--,d--,0>d||K[r]!==se[d]){var le=`
46
+ `+K[r].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=r&&0<=d);break}}}finally{Te=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ve(i):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve("Lazy");case 13:return e.child!==t&&t!==null?ve("Suspense Fallback"):ve("Suspense");case 19:return ve("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return ve("Activity");default:return""}}function Mt(e){try{var t="",i=null;do t+=Se(e,i),i=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var zt=Object.prototype.hasOwnProperty,xe=f.unstable_scheduleCallback,Ee=f.unstable_cancelCallback,Ae=f.unstable_shouldYield,ge=f.unstable_requestPaint,we=f.unstable_now,Ke=f.unstable_getCurrentPriorityLevel,qe=f.unstable_ImmediatePriority,gt=f.unstable_UserBlockingPriority,Ze=f.unstable_NormalPriority,ct=f.unstable_LowPriority,Qe=f.unstable_IdlePriority,ke=f.log,De=f.unstable_setDisableYieldValue,Xt=null,ut=null;function Et(e){if(typeof ke=="function"&&De(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(Xt,e)}catch{}}var vt=Math.clz32?Math.clz32:ks,Qi=Math.log,Fr=Math.LN2;function ks(e){return e>>>=0,e===0?32:31-(Qi(e)/Fr|0)|0}var Ei=256,Mi=262144,tt=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bt(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var d=0,v=e.suspendedLanes,L=e.pingedLanes;e=e.warmLanes;var j=r&134217727;return j!==0?(r=j&~v,r!==0?d=st(r):(L&=j,L!==0?d=st(L):i||(i=j&~e,i!==0&&(d=st(i))))):(j=r&~v,j!==0?d=st(j):L!==0?d=st(L):i||(i=r&~e,i!==0&&(d=st(i)))),d===0?0:t!==0&&t!==d&&(t&v)===0&&(v=d&-d,i=t&-t,v>=i||v===32&&(i&4194048)!==0)?t:d}function It(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Nt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kt(){var e=tt;return tt<<=1,(tt&62914560)===0&&(tt=4194304),e}function Ut(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function si(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(e,t,i,r,d,v){var L=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var j=e.entanglements,K=e.expirationTimes,se=e.hiddenUpdates;for(i=L&~i;0<i;){var le=31-vt(i),de=1<<le;j[le]=0,K[le]=-1;var ae=se[le];if(ae!==null)for(se[le]=null,le=0;le<ae.length;le++){var oe=ae[le];oe!==null&&(oe.lane&=-536870913)}i&=~de}r!==0&&Si(e,r,0),v!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=v&~(L&~t))}function Si(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-vt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&261930}function Kt(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-vt(i),d=1<<r;d&t|e[r]&t&&(e[r]|=t),i&=~d}}function ni(e,t){var i=t&-t;return i=(i&42)!==0?1:ki(i),(i&(e.suspendedLanes|t))!==0?0:i}function ki(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function bi(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Uf(e.type))}function Ji(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var ai=Math.random().toString(36).slice(2),Rt="__reactFiber$"+ai,jt="__reactProps$"+ai,qr="__reactContainer$"+ai,fo="__reactEvents$"+ai,kg="__reactListeners$"+ai,Og="__reactHandles$"+ai,tu="__reactResources$"+ai,Os="__reactMarker$"+ai;function _o(e){delete e[Rt],delete e[jt],delete e[fo],delete e[kg],delete e[Og]}function Wr(e){var t=e[Rt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[qr]||i[Rt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=wf(e);e!==null;){if(i=e[Rt])return i;e=wf(e)}return t}e=i,i=e.parentNode}return null}function Gr(e){if(e=e[Rt]||e[qr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(A(33))}function $r(e){var t=e[tu];return t||(t=e[tu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Os]=!0}var iu=new Set,ru={};function Er(e,t){Yr(e,t),Yr(e+"Capture",t)}function Yr(e,t){for(ru[e]=t,e=0;e<t.length;e++)iu.add(t[e])}var Bg=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]*$"),su={},nu={};function Hg(e){return zt.call(nu,e)?!0:zt.call(su,e)?!1:Bg.test(e)?nu[e]=!0:(su[e]=!0,!1)}function Un(e,t,i){if(Hg(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function jn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Bi(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}function oi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function au(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zg(e,t,i){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var d=r.get,v=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(L){i=""+L,v.call(this,L)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(L){i=""+L},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function go(e){if(!e._valueTracker){var t=au(e)?"checked":"value";e._valueTracker=zg(e,t,""+e[t])}}function ou(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=au(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function Pn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ig=/[\n"\\]/g;function li(e){return e.replace(Ig,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vo(e,t,i,r,d,v,L,j){e.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.type=L:e.removeAttribute("type"),t!=null?L==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+oi(t)):e.value!==""+oi(t)&&(e.value=""+oi(t)):L!=="submit"&&L!=="reset"||e.removeAttribute("value"),t!=null?po(e,L,oi(t)):i!=null?po(e,L,oi(i)):r!=null&&e.removeAttribute("value"),d==null&&v!=null&&(e.defaultChecked=!!v),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+oi(j):e.removeAttribute("name")}function lu(e,t,i,r,d,v,L,j){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.type=v),t!=null||i!=null){if(!(v!=="submit"&&v!=="reset"||t!=null)){go(e);return}i=i!=null?""+oi(i):"",t=t!=null?""+oi(t):i,j||t===e.value||(e.value=t),e.defaultValue=t}r=r??d,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=j?e.checked:!!r,e.defaultChecked=!!r,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(e.name=L),go(e)}function po(e,t,i){t==="number"&&Pn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Vr(e,t,i,r){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&r&&(e[i].defaultSelected=!0)}else{for(i=""+oi(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,r&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function cu(e,t,i){if(t!=null&&(t=""+oi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+oi(i):""}function uu(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(A(92));if(Q(r)){if(1<r.length)throw Error(A(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=oi(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r),go(e)}function Xr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ng=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 hu(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||Ng.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function du(e,t,i){if(t!=null&&typeof t!="object")throw Error(A(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var d in t)r=t[d],t.hasOwnProperty(d)&&i[d]!==r&&hu(e,d,r)}else for(var v in t)t.hasOwnProperty(v)&&hu(e,v,t[v])}function mo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ug=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"]]),jg=/^[\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 Fn(e){return jg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Hi(){}var So=null;function bo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kr=null,Zr=null;function fu(e){var t=Gr(e);if(t&&(e=t.stateNode)){var i=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(vo(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+li(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var d=r[jt]||null;if(!d)throw Error(A(90));vo(r,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&ou(r)}break e;case"textarea":cu(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Vr(e,!!i.multiple,t,!1)}}}var yo=!1;function _u(e,t,i){if(yo)return e(t,i);yo=!0;try{var r=e(t);return r}finally{if(yo=!1,(Kr!==null||Zr!==null)&&(La(),Kr&&(t=Kr,e=Zr,Zr=Kr=null,fu(t),e)))for(t=0;t<e.length;t++)fu(e[t])}}function Hs(e,t){var i=e.stateNode;if(i===null)return null;var r=i[jt]||null;if(r===null)return null;i=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(A(231,t,typeof i));return i}var zi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Co=!1;if(zi)try{var zs={};Object.defineProperty(zs,"passive",{get:function(){Co=!0}}),window.addEventListener("test",zs,zs),window.removeEventListener("test",zs,zs)}catch{Co=!1}var er=null,wo=null,qn=null;function gu(){if(qn)return qn;var e,t=wo,i=t.length,r,d="value"in er?er.value:er.textContent,v=d.length;for(e=0;e<i&&t[e]===d[e];e++);var L=i-e;for(r=1;r<=L&&t[i-r]===d[v-r];r++);return qn=d.slice(e,1<r?1-r:void 0)}function Wn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Gn(){return!0}function vu(){return!1}function Pt(e){function t(i,r,d,v,L){this._reactName=i,this._targetInst=d,this.type=r,this.nativeEvent=v,this.target=L,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(i=e[j],this[j]=i?i(v):v[j]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Gn:vu,this.isPropagationStopped=vu,this}return o(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Gn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Gn)},persist:function(){},isPersistent:Gn}),t}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$n=Pt(Rr),Is=o({},Rr,{view:0,detail:0}),Pg=Pt(Is),xo,Eo,Ns,Yn=o({},Is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ao,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ns&&(Ns&&e.type==="mousemove"?(xo=e.screenX-Ns.screenX,Eo=e.screenY-Ns.screenY):Eo=xo=0,Ns=e),xo)},movementY:function(e){return"movementY"in e?e.movementY:Eo}}),pu=Pt(Yn),Fg=o({},Yn,{dataTransfer:0}),qg=Pt(Fg),Wg=o({},Is,{relatedTarget:0}),Ro=Pt(Wg),Gg=o({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),$g=Pt(Gg),Yg=o({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vg=Pt(Yg),Xg=o({},Rr,{data:0}),mu=Pt(Xg),Kg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zg={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"},Qg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qg[e])?!!t[e]:!1}function Ao(){return Jg}var ev=o({},Is,{key:function(e){if(e.key){var t=Kg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ao,charCode:function(e){return e.type==="keypress"?Wn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tv=Pt(ev),iv=o({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Su=Pt(iv),rv=o({},Is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ao}),sv=Pt(rv),nv=o({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),av=Pt(nv),ov=o({},Yn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),lv=Pt(ov),cv=o({},Rr,{newState:0,oldState:0}),uv=Pt(cv),hv=[9,13,27,32],Do=zi&&"CompositionEvent"in window,Us=null;zi&&"documentMode"in document&&(Us=document.documentMode);var dv=zi&&"TextEvent"in window&&!Us,bu=zi&&(!Do||Us&&8<Us&&11>=Us),yu=" ",Cu=!1;function wu(e,t){switch(e){case"keyup":return hv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qr=!1;function fv(e,t){switch(e){case"compositionend":return xu(t);case"keypress":return t.which!==32?null:(Cu=!0,yu);case"textInput":return e=t.data,e===yu&&Cu?null:e;default:return null}}function _v(e,t){if(Qr)return e==="compositionend"||!Do&&wu(e,t)?(e=gu(),qn=wo=er=null,Qr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bu&&t.locale!=="ko"?null:t.data;default:return null}}var gv={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 Eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gv[e.type]:t==="textarea"}function Ru(e,t,i,r){Kr?Zr?Zr.push(r):Zr=[r]:Kr=r,t=za(t,"onChange"),0<t.length&&(i=new $n("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var js=null,Ps=null;function vv(e){cf(e,0)}function Vn(e){var t=Bs(e);if(ou(t))return e}function Au(e,t){if(e==="change")return t}var Du=!1;if(zi){var Lo;if(zi){var To="oninput"in document;if(!To){var Lu=document.createElement("div");Lu.setAttribute("oninput","return;"),To=typeof Lu.oninput=="function"}Lo=To}else Lo=!1;Du=Lo&&(!document.documentMode||9<document.documentMode)}function Tu(){js&&(js.detachEvent("onpropertychange",Mu),Ps=js=null)}function Mu(e){if(e.propertyName==="value"&&Vn(Ps)){var t=[];Ru(t,Ps,e,bo(e)),_u(vv,t)}}function pv(e,t,i){e==="focusin"?(Tu(),js=t,Ps=i,js.attachEvent("onpropertychange",Mu)):e==="focusout"&&Tu()}function mv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vn(Ps)}function Sv(e,t){if(e==="click")return Vn(t)}function bv(e,t){if(e==="input"||e==="change")return Vn(t)}function yv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:yv;function Fs(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var d=i[r];if(!zt.call(t,d)||!Zt(e[d],t[d]))return!1}return!0}function ku(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ou(e,t){var i=ku(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=ku(i)}}function Bu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pn(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Pn(e.document)}return t}function Mo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Cv=zi&&"documentMode"in document&&11>=document.documentMode,Jr=null,ko=null,qs=null,Oo=!1;function zu(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Oo||Jr==null||Jr!==Pn(r)||(r=Jr,"selectionStart"in r&&Mo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qs&&Fs(qs,r)||(qs=r,r=za(ko,"onSelect"),0<r.length&&(t=new $n("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=Jr)))}function Ar(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var es={animationend:Ar("Animation","AnimationEnd"),animationiteration:Ar("Animation","AnimationIteration"),animationstart:Ar("Animation","AnimationStart"),transitionrun:Ar("Transition","TransitionRun"),transitionstart:Ar("Transition","TransitionStart"),transitioncancel:Ar("Transition","TransitionCancel"),transitionend:Ar("Transition","TransitionEnd")},Bo={},Iu={};zi&&(Iu=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function Dr(e){if(Bo[e])return Bo[e];if(!es[e])return e;var t=es[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Iu)return Bo[e]=t[i];return e}var Nu=Dr("animationend"),Uu=Dr("animationiteration"),ju=Dr("animationstart"),wv=Dr("transitionrun"),xv=Dr("transitionstart"),Ev=Dr("transitioncancel"),Pu=Dr("transitionend"),Fu=new Map,Ho="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(" ");Ho.push("scrollEnd");function yi(e,t){Fu.set(e,t),Er(t,[e])}var Xn=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ci=[],ts=0,zo=0;function Kn(){for(var e=ts,t=zo=ts=0;t<e;){var i=ci[t];ci[t++]=null;var r=ci[t];ci[t++]=null;var d=ci[t];ci[t++]=null;var v=ci[t];if(ci[t++]=null,r!==null&&d!==null){var L=r.pending;L===null?d.next=d:(d.next=L.next,L.next=d),r.pending=d}v!==0&&qu(i,d,v)}}function Zn(e,t,i,r){ci[ts++]=e,ci[ts++]=t,ci[ts++]=i,ci[ts++]=r,zo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Io(e,t,i,r){return Zn(e,t,i,r),Qn(e)}function Lr(e,t){return Zn(e,null,null,t),Qn(e)}function qu(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var d=!1,v=e.return;v!==null;)v.childLanes|=i,r=v.alternate,r!==null&&(r.childLanes|=i),v.tag===22&&(e=v.stateNode,e===null||e._visibility&1||(d=!0)),e=v,v=v.return;return e.tag===3?(v=e.stateNode,d&&t!==null&&(d=31-vt(i),e=v.hiddenUpdates,r=e[d],r===null?e[d]=[t]:r.push(t),t.lane=i|536870912),v):null}function Qn(e){if(50<dn)throw dn=0,$l=null,Error(A(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var is={};function Rv(e,t,i,r){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,i,r){return new Rv(e,t,i,r)}function No(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var i=e.alternate;return i===null?(i=Qt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Wu(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,i,r,d,v){var L=0;if(r=e,typeof e=="function")No(e)&&(L=1);else if(typeof e=="string")L=Mp(e,i,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Qt(31,i,t,d),e.elementType=R,e.lanes=v,e;case _:return Tr(i.children,d,v,t);case n:L=8,d|=24;break;case l:return e=Qt(12,i,t,d|2),e.elementType=l,e.lanes=v,e;case x:return e=Qt(13,i,t,d),e.elementType=x,e.lanes=v,e;case b:return e=Qt(19,i,t,d),e.elementType=b,e.lanes=v,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case c:L=10;break e;case a:L=9;break e;case S:L=11;break e;case E:L=14;break e;case y:L=16,r=null;break e}L=29,i=Error(A(130,e===null?"null":typeof e,"")),r=null}return t=Qt(L,i,t,d),t.elementType=e,t.type=r,t.lanes=v,t}function Tr(e,t,i,r){return e=Qt(7,e,r,t),e.lanes=i,e}function Uo(e,t,i){return e=Qt(6,e,null,t),e.lanes=i,e}function Gu(e){var t=Qt(18,null,null,0);return t.stateNode=e,t}function jo(e,t,i){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var $u=new WeakMap;function ui(e,t){if(typeof e=="object"&&e!==null){var i=$u.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Mt(t)},$u.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var rs=[],ss=0,ea=null,Ws=0,hi=[],di=0,tr=null,Ri=1,Ai="";function Ni(e,t){rs[ss++]=Ws,rs[ss++]=ea,ea=e,Ws=t}function Yu(e,t,i){hi[di++]=Ri,hi[di++]=Ai,hi[di++]=tr,tr=e;var r=Ri;e=Ai;var d=32-vt(r)-1;r&=~(1<<d),i+=1;var v=32-vt(t)+d;if(30<v){var L=d-d%5;v=(r&(1<<L)-1).toString(32),r>>=L,d-=L,Ri=1<<32-vt(t)+d|i<<d|r,Ai=v+e}else Ri=1<<v|i<<d|r,Ai=e}function Po(e){e.return!==null&&(Ni(e,1),Yu(e,1,0))}function Fo(e){for(;e===ea;)ea=rs[--ss],rs[ss]=null,Ws=rs[--ss],rs[ss]=null;for(;e===tr;)tr=hi[--di],hi[di]=null,Ai=hi[--di],hi[di]=null,Ri=hi[--di],hi[di]=null}function Vu(e,t){hi[di++]=Ri,hi[di++]=Ai,hi[di++]=tr,Ri=t.id,Ai=t.overflow,tr=e}var At=null,Je=null,Ie=!1,ir=null,fi=!1,qo=Error(A(519));function rr(e){var t=Error(A(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gs(ui(t,e)),qo}function Xu(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[Rt]=e,t[jt]=r,i){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(i=0;i<_n.length;i++)Be(_n[i],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),lu(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),uu(t,r.value,r.defaultValue,r.children)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||ff(t.textContent,i)?(r.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),r.onScroll!=null&&Be("scroll",t),r.onScrollEnd!=null&&Be("scrollend",t),r.onClick!=null&&(t.onclick=Hi),t=!0):t=!1,t||rr(e,!0)}function Ku(e){for(At=e.return;At;)switch(At.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:At=At.return}}function ns(e){if(e!==At)return!1;if(!Ie)return Ku(e),Ie=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||oc(e.type,e.memoizedProps)),i=!i),i&&Je&&rr(e),Ku(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));Je=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));Je=Cf(e)}else t===27?(t=Je,pr(e.type)?(e=dc,dc=null,Je=e):Je=t):Je=At?gi(e.stateNode.nextSibling):null;return!0}function Mr(){Je=At=null,Ie=!1}function Wo(){var e=ir;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),ir=null),e}function Gs(e){ir===null?ir=[e]:ir.push(e)}var Go=O(null),kr=null,Ui=null;function sr(e,t,i){Z(Go,t._currentValue),t._currentValue=i}function ji(e){e._currentValue=Go.current,N(Go)}function $o(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function Yo(e,t,i,r){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var v=d.dependencies;if(v!==null){var L=d.child;v=v.firstContext;e:for(;v!==null;){var j=v;v=d;for(var K=0;K<t.length;K++)if(j.context===t[K]){v.lanes|=i,j=v.alternate,j!==null&&(j.lanes|=i),$o(v.return,i,e),r||(L=null);break e}v=j.next}}else if(d.tag===18){if(L=d.return,L===null)throw Error(A(341));L.lanes|=i,v=L.alternate,v!==null&&(v.lanes|=i),$o(L,i,e),L=null}else L=d.child;if(L!==null)L.return=d;else for(L=d;L!==null;){if(L===e){L=null;break}if(d=L.sibling,d!==null){d.return=L.return,L=d;break}L=L.return}d=L}}function as(e,t,i,r){e=null;for(var d=t,v=!1;d!==null;){if(!v){if((d.flags&524288)!==0)v=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var L=d.alternate;if(L===null)throw Error(A(387));if(L=L.memoizedProps,L!==null){var j=d.type;Zt(d.pendingProps.value,L.value)||(e!==null?e.push(j):e=[j])}}else if(d===X.current){if(L=d.alternate,L===null)throw Error(A(387));L.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Sn):e=[Sn])}d=d.return}e!==null&&Yo(t,e,i,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Or(e){kr=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return Zu(kr,e)}function ia(e,t){return kr===null&&Or(e),Zu(e,t)}function Zu(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ui===null){if(e===null)throw Error(A(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return i}var Av=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Dv=f.unstable_scheduleCallback,Lv=f.unstable_NormalPriority,ht={$$typeof:c,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vo(){return{controller:new Av,data:new Map,refCount:0}}function $s(e){e.refCount--,e.refCount===0&&Dv(Lv,function(){e.controller.abort()})}var Ys=null,Xo=0,os=0,ls=null;function Tv(e,t){if(Ys===null){var i=Ys=[];Xo=0,os=Ql(),ls={status:"pending",value:void 0,then:function(r){i.push(r)}}}return Xo++,t.then(Qu,Qu),t}function Qu(){if(--Xo===0&&Ys!==null){ls!==null&&(ls.status="fulfilled");var e=Ys;Ys=null,os=0,ls=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Mv(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var d=0;d<i.length;d++)(0,i[d])(t)},function(d){for(r.status="rejected",r.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),r}var Ju=G.S;G.S=function(e,t){zd=we(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Tv(e,t),Ju!==null&&Ju(e,t)};var Br=O(null);function Ko(){var e=Br.current;return e!==null?e:Xe.pooledCache}function ra(e,t){t===null?Z(Br,Br.current):Z(Br,t.pool)}function eh(){var e=Ko();return e===null?null:{parent:ht._currentValue,pool:e}}var cs=Error(A(460)),Zo=Error(A(474)),sa=Error(A(542)),na={then:function(){}};function th(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ih(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Hi,Hi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sh(e),e;default:if(typeof t.status=="string")t.then(Hi,Hi);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(A(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=r}},function(r){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,sh(e),e}throw zr=t,cs}}function Hr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(zr=i,cs):i}}var zr=null;function rh(){if(zr===null)throw Error(A(459));var e=zr;return zr=null,e}function sh(e){if(e===cs||e===sa)throw Error(A(483))}var us=null,Vs=0;function aa(e){var t=Vs;return Vs+=1,us===null&&(us=[]),ih(us,e,t)}function Xs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function oa(e,t){throw t.$$typeof===p?Error(A(525)):(e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nh(e){function t(te,J){if(e){var re=te.deletions;re===null?(te.deletions=[J],te.flags|=16):re.push(J)}}function i(te,J){if(!e)return null;for(;J!==null;)t(te,J),J=J.sibling;return null}function r(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function d(te,J){return te=Ii(te,J),te.index=0,te.sibling=null,te}function v(te,J,re){return te.index=re,e?(re=te.alternate,re!==null?(re=re.index,re<J?(te.flags|=67108866,J):re):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function L(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function j(te,J,re,ue){return J===null||J.tag!==6?(J=Uo(re,te.mode,ue),J.return=te,J):(J=d(J,re),J.return=te,J)}function K(te,J,re,ue){var be=re.type;return be===_?le(te,J,re.props.children,ue,re.key):J!==null&&(J.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===y&&Hr(be)===J.type)?(J=d(J,re.props),Xs(J,re),J.return=te,J):(J=Jn(re.type,re.key,re.props,null,te.mode,ue),Xs(J,re),J.return=te,J)}function se(te,J,re,ue){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=jo(re,te.mode,ue),J.return=te,J):(J=d(J,re.children||[]),J.return=te,J)}function le(te,J,re,ue,be){return J===null||J.tag!==7?(J=Tr(re,te.mode,ue,be),J.return=te,J):(J=d(J,re),J.return=te,J)}function de(te,J,re){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Uo(""+J,te.mode,re),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case m:return re=Jn(J.type,J.key,J.props,null,te.mode,re),Xs(re,J),re.return=te,re;case w:return J=jo(J,te.mode,re),J.return=te,J;case y:return J=Hr(J),de(te,J,re)}if(Q(J)||M(J))return J=Tr(J,te.mode,re,null),J.return=te,J;if(typeof J.then=="function")return de(te,aa(J),re);if(J.$$typeof===c)return de(te,ia(te,J),re);oa(te,J)}return null}function ae(te,J,re,ue){var be=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return be!==null?null:j(te,J,""+re,ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case m:return re.key===be?K(te,J,re,ue):null;case w:return re.key===be?se(te,J,re,ue):null;case y:return re=Hr(re),ae(te,J,re,ue)}if(Q(re)||M(re))return be!==null?null:le(te,J,re,ue,null);if(typeof re.then=="function")return ae(te,J,aa(re),ue);if(re.$$typeof===c)return ae(te,J,ia(te,re),ue);oa(te,re)}return null}function oe(te,J,re,ue,be){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return te=te.get(re)||null,j(J,te,""+ue,be);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case m:return te=te.get(ue.key===null?re:ue.key)||null,K(J,te,ue,be);case w:return te=te.get(ue.key===null?re:ue.key)||null,se(J,te,ue,be);case y:return ue=Hr(ue),oe(te,J,re,ue,be)}if(Q(ue)||M(ue))return te=te.get(re)||null,le(J,te,ue,be,null);if(typeof ue.then=="function")return oe(te,J,re,aa(ue),be);if(ue.$$typeof===c)return oe(te,J,re,ia(J,ue),be);oa(J,ue)}return null}function pe(te,J,re,ue){for(var be=null,Ue=null,me=J,Me=J=0,ze=null;me!==null&&Me<re.length;Me++){me.index>Me?(ze=me,me=null):ze=me.sibling;var je=ae(te,me,re[Me],ue);if(je===null){me===null&&(me=ze);break}e&&me&&je.alternate===null&&t(te,me),J=v(je,J,Me),Ue===null?be=je:Ue.sibling=je,Ue=je,me=ze}if(Me===re.length)return i(te,me),Ie&&Ni(te,Me),be;if(me===null){for(;Me<re.length;Me++)me=de(te,re[Me],ue),me!==null&&(J=v(me,J,Me),Ue===null?be=me:Ue.sibling=me,Ue=me);return Ie&&Ni(te,Me),be}for(me=r(me);Me<re.length;Me++)ze=oe(me,te,Me,re[Me],ue),ze!==null&&(e&&ze.alternate!==null&&me.delete(ze.key===null?Me:ze.key),J=v(ze,J,Me),Ue===null?be=ze:Ue.sibling=ze,Ue=ze);return e&&me.forEach(function(Cr){return t(te,Cr)}),Ie&&Ni(te,Me),be}function Ce(te,J,re,ue){if(re==null)throw Error(A(151));for(var be=null,Ue=null,me=J,Me=J=0,ze=null,je=re.next();me!==null&&!je.done;Me++,je=re.next()){me.index>Me?(ze=me,me=null):ze=me.sibling;var Cr=ae(te,me,je.value,ue);if(Cr===null){me===null&&(me=ze);break}e&&me&&Cr.alternate===null&&t(te,me),J=v(Cr,J,Me),Ue===null?be=Cr:Ue.sibling=Cr,Ue=Cr,me=ze}if(je.done)return i(te,me),Ie&&Ni(te,Me),be;if(me===null){for(;!je.done;Me++,je=re.next())je=de(te,je.value,ue),je!==null&&(J=v(je,J,Me),Ue===null?be=je:Ue.sibling=je,Ue=je);return Ie&&Ni(te,Me),be}for(me=r(me);!je.done;Me++,je=re.next())je=oe(me,te,Me,je.value,ue),je!==null&&(e&&je.alternate!==null&&me.delete(je.key===null?Me:je.key),J=v(je,J,Me),Ue===null?be=je:Ue.sibling=je,Ue=je);return e&&me.forEach(function(Fp){return t(te,Fp)}),Ie&&Ni(te,Me),be}function Ve(te,J,re,ue){if(typeof re=="object"&&re!==null&&re.type===_&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case m:e:{for(var be=re.key;J!==null;){if(J.key===be){if(be=re.type,be===_){if(J.tag===7){i(te,J.sibling),ue=d(J,re.props.children),ue.return=te,te=ue;break e}}else if(J.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===y&&Hr(be)===J.type){i(te,J.sibling),ue=d(J,re.props),Xs(ue,re),ue.return=te,te=ue;break e}i(te,J);break}else t(te,J);J=J.sibling}re.type===_?(ue=Tr(re.props.children,te.mode,ue,re.key),ue.return=te,te=ue):(ue=Jn(re.type,re.key,re.props,null,te.mode,ue),Xs(ue,re),ue.return=te,te=ue)}return L(te);case w:e:{for(be=re.key;J!==null;){if(J.key===be)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){i(te,J.sibling),ue=d(J,re.children||[]),ue.return=te,te=ue;break e}else{i(te,J);break}else t(te,J);J=J.sibling}ue=jo(re,te.mode,ue),ue.return=te,te=ue}return L(te);case y:return re=Hr(re),Ve(te,J,re,ue)}if(Q(re))return pe(te,J,re,ue);if(M(re)){if(be=M(re),typeof be!="function")throw Error(A(150));return re=be.call(re),Ce(te,J,re,ue)}if(typeof re.then=="function")return Ve(te,J,aa(re),ue);if(re.$$typeof===c)return Ve(te,J,ia(te,re),ue);oa(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,J!==null&&J.tag===6?(i(te,J.sibling),ue=d(J,re),ue.return=te,te=ue):(i(te,J),ue=Uo(re,te.mode,ue),ue.return=te,te=ue),L(te)):i(te,J)}return function(te,J,re,ue){try{Vs=0;var be=Ve(te,J,re,ue);return us=null,be}catch(me){if(me===cs||me===sa)throw me;var Ue=Qt(29,me,null,te.mode);return Ue.lanes=ue,Ue.return=te,Ue}finally{}}}var Ir=nh(!0),ah=nh(!1),nr=!1;function Qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ar(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function or(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Fe&2)!==0){var d=r.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),r.pending=t,t=Qn(e),qu(e,null,i),t}return Zn(e,r,t,i),Qn(e)}function Ks(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Kt(e,i)}}function el(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var d=null,v=null;if(i=i.firstBaseUpdate,i!==null){do{var L={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};v===null?d=v=L:v=v.next=L,i=i.next}while(i!==null);v===null?d=v=t:v=v.next=t}else d=v=t;i={baseState:r.baseState,firstBaseUpdate:d,lastBaseUpdate:v,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var tl=!1;function Zs(){if(tl){var e=ls;if(e!==null)throw e}}function Qs(e,t,i,r){tl=!1;var d=e.updateQueue;nr=!1;var v=d.firstBaseUpdate,L=d.lastBaseUpdate,j=d.shared.pending;if(j!==null){d.shared.pending=null;var K=j,se=K.next;K.next=null,L===null?v=se:L.next=se,L=K;var le=e.alternate;le!==null&&(le=le.updateQueue,j=le.lastBaseUpdate,j!==L&&(j===null?le.firstBaseUpdate=se:j.next=se,le.lastBaseUpdate=K))}if(v!==null){var de=d.baseState;L=0,le=se=K=null,j=v;do{var ae=j.lane&-536870913,oe=ae!==j.lane;if(oe?(He&ae)===ae:(r&ae)===ae){ae!==0&&ae===os&&(tl=!0),le!==null&&(le=le.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var pe=e,Ce=j;ae=t;var Ve=i;switch(Ce.tag){case 1:if(pe=Ce.payload,typeof pe=="function"){de=pe.call(Ve,de,ae);break e}de=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ce.payload,ae=typeof pe=="function"?pe.call(Ve,de,ae):pe,ae==null)break e;de=o({},de,ae);break e;case 2:nr=!0}}ae=j.callback,ae!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=d.callbacks,oe===null?d.callbacks=[ae]:oe.push(ae))}else oe={lane:ae,tag:j.tag,payload:j.payload,callback:j.callback,next:null},le===null?(se=le=oe,K=de):le=le.next=oe,L|=ae;if(j=j.next,j===null){if(j=d.shared.pending,j===null)break;oe=j,j=oe.next,oe.next=null,d.lastBaseUpdate=oe,d.shared.pending=null}}while(!0);le===null&&(K=de),d.baseState=K,d.firstBaseUpdate=se,d.lastBaseUpdate=le,v===null&&(d.shared.lanes=0),dr|=L,e.lanes=L,e.memoizedState=de}}function oh(e,t){if(typeof e!="function")throw Error(A(191,e));e.call(t)}function lh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)oh(i[e],t)}var hs=O(null),la=O(0);function ch(e,t){e=Xi,Z(la,e),Z(hs,t),Xi=e|t.baseLanes}function il(){Z(la,Xi),Z(hs,hs.current)}function rl(){Xi=la.current,N(hs),N(la)}var Jt=O(null),_i=null;function lr(e){var t=e.alternate;Z(ot,ot.current&1),Z(Jt,e),_i===null&&(t===null||hs.current!==null||t.memoizedState!==null)&&(_i=e)}function sl(e){Z(ot,ot.current),Z(Jt,e),_i===null&&(_i=e)}function uh(e){e.tag===22?(Z(ot,ot.current),Z(Jt,e),_i===null&&(_i=e)):cr()}function cr(){Z(ot,ot.current),Z(Jt,Jt.current)}function ei(e){N(Jt),_i===e&&(_i=null),N(ot)}var ot=O(0);function ca(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||uc(i)||hc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pi=0,Le=null,$e=null,dt=null,ua=!1,ds=!1,Nr=!1,ha=0,Js=0,fs=null,kv=0;function nt(){throw Error(A(321))}function nl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Zt(e[i],t[i]))return!1;return!0}function al(e,t,i,r,d,v){return Pi=v,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Yh:yl,Nr=!1,v=i(r,d),Nr=!1,ds&&(v=dh(t,i,r,d)),hh(e),v}function hh(e){G.H=rn;var t=$e!==null&&$e.next!==null;if(Pi=0,dt=$e=Le=null,ua=!1,Js=0,fs=null,t)throw Error(A(300));e===null||ft||(e=e.dependencies,e!==null&&ta(e)&&(ft=!0))}function dh(e,t,i,r){Le=e;var d=0;do{if(ds&&(fs=null),Js=0,ds=!1,25<=d)throw Error(A(301));if(d+=1,dt=$e=null,e.updateQueue!=null){var v=e.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}G.H=Vh,v=t(i,r)}while(ds);return v}function Ov(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?en(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(Le.flags|=1024),t}function ol(){var e=ha!==0;return ha=0,e}function ll(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function cl(e){if(ua){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ua=!1}Pi=0,dt=$e=Le=null,ds=!1,Js=ha=0,fs=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Le.memoizedState=dt=e:dt=dt.next=e,dt}function lt(){if($e===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=dt===null?Le.memoizedState:dt.next;if(t!==null)dt=t,$e=e;else{if(e===null)throw Le.alternate===null?Error(A(467)):Error(A(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},dt===null?Le.memoizedState=dt=e:dt=dt.next=e}return dt}function da(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function en(e){var t=Js;return Js+=1,fs===null&&(fs=[]),e=ih(fs,e,t),t=Le,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Yh:yl),e}function fa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return en(e);if(e.$$typeof===c)return Dt(e)}throw Error(A(438,String(e)))}function ul(e){var t=null,i=Le.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=Le.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=da(),Le.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=T;return t.index++,i}function Fi(e,t){return typeof t=="function"?t(e):t}function _a(e){var t=lt();return hl(t,$e,e)}function hl(e,t,i){var r=e.queue;if(r===null)throw Error(A(311));r.lastRenderedReducer=i;var d=e.baseQueue,v=r.pending;if(v!==null){if(d!==null){var L=d.next;d.next=v.next,v.next=L}t.baseQueue=d=v,r.pending=null}if(v=e.baseState,d===null)e.memoizedState=v;else{t=d.next;var j=L=null,K=null,se=t,le=!1;do{var de=se.lane&-536870913;if(de!==se.lane?(He&de)===de:(Pi&de)===de){var ae=se.revertLane;if(ae===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),de===os&&(le=!0);else if((Pi&ae)===ae){se=se.next,ae===os&&(le=!0);continue}else de={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(j=K=de,L=v):K=K.next=de,Le.lanes|=ae,dr|=ae;de=se.action,Nr&&i(v,de),v=se.hasEagerState?se.eagerState:i(v,de)}else ae={lane:de,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(j=K=ae,L=v):K=K.next=ae,Le.lanes|=de,dr|=de;se=se.next}while(se!==null&&se!==t);if(K===null?L=v:K.next=j,!Zt(v,e.memoizedState)&&(ft=!0,le&&(i=ls,i!==null)))throw i;e.memoizedState=v,e.baseState=L,e.baseQueue=K,r.lastRenderedState=v}return d===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function dl(e){var t=lt(),i=t.queue;if(i===null)throw Error(A(311));i.lastRenderedReducer=e;var r=i.dispatch,d=i.pending,v=t.memoizedState;if(d!==null){i.pending=null;var L=d=d.next;do v=e(v,L.action),L=L.next;while(L!==d);Zt(v,t.memoizedState)||(ft=!0),t.memoizedState=v,t.baseQueue===null&&(t.baseState=v),i.lastRenderedState=v}return[v,r]}function fh(e,t,i){var r=Le,d=lt(),v=Ie;if(v){if(i===void 0)throw Error(A(407));i=i()}else i=t();var L=!Zt(($e||d).memoizedState,i);if(L&&(d.memoizedState=i,ft=!0),d=d.queue,gl(vh.bind(null,r,d,e),[e]),d.getSnapshot!==t||L||dt!==null&&dt.memoizedState.tag&1){if(r.flags|=2048,_s(9,{destroy:void 0},gh.bind(null,r,d,i,t),null),Xe===null)throw Error(A(349));v||(Pi&127)!==0||_h(r,t,i)}return i}function _h(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Le.updateQueue,t===null?(t=da(),Le.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function gh(e,t,i,r){t.value=i,t.getSnapshot=r,ph(t)&&mh(e)}function vh(e,t,i){return i(function(){ph(t)&&mh(e)})}function ph(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Zt(e,i)}catch{return!0}}function mh(e){var t=Lr(e,2);t!==null&&$t(t,e,2)}function fl(e){var t=Ht();if(typeof e=="function"){var i=e;if(e=i(),Nr){Et(!0);try{i()}finally{Et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:e},t}function Sh(e,t,i,r){return e.baseState=i,hl(e,$e,typeof r=="function"?r:Fi)}function Bv(e,t,i,r,d){if(pa(e))throw Error(A(485));if(e=t.action,e!==null){var v={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){v.listeners.push(L)}};G.T!==null?i(!0):v.isTransition=!1,r(v),i=t.pending,i===null?(v.next=t.pending=v,bh(t,v)):(v.next=i.next,t.pending=i.next=v)}}function bh(e,t){var i=t.action,r=t.payload,d=e.state;if(t.isTransition){var v=G.T,L={};G.T=L;try{var j=i(d,r),K=G.S;K!==null&&K(L,j),yh(e,t,j)}catch(se){_l(e,t,se)}finally{v!==null&&L.types!==null&&(v.types=L.types),G.T=v}}else try{v=i(d,r),yh(e,t,v)}catch(se){_l(e,t,se)}}function yh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){Ch(e,t,r)},function(r){return _l(e,t,r)}):Ch(e,t,i)}function Ch(e,t,i){t.status="fulfilled",t.value=i,wh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,bh(e,i)))}function _l(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,wh(t),t=t.next;while(t!==r)}e.action=null}function wh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xh(e,t){return t}function Eh(e,t){if(Ie){var i=Xe.formState;if(i!==null){e:{var r=Le;if(Ie){if(Je){t:{for(var d=Je,v=fi;d.nodeType!==8;){if(!v){d=null;break t}if(d=gi(d.nextSibling),d===null){d=null;break t}}v=d.data,d=v==="F!"||v==="F"?d:null}if(d){Je=gi(d.nextSibling),r=d.data==="F!";break e}}rr(r)}r=!1}r&&(t=i[0])}}return i=Ht(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xh,lastRenderedState:t},i.queue=r,i=Wh.bind(null,Le,r),r.dispatch=i,r=fl(!1),v=bl.bind(null,Le,!1,r.queue),r=Ht(),d={state:t,dispatch:null,action:e,pending:null},r.queue=d,i=Bv.bind(null,Le,d,v,i),d.dispatch=i,r.memoizedState=e,[t,i,!1]}function Rh(e){var t=lt();return Ah(t,$e,e)}function Ah(e,t,i){if(t=hl(e,t,xh)[0],e=_a(Fi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=en(t)}catch(L){throw L===cs?sa:L}else r=t;t=lt();var d=t.queue,v=d.dispatch;return i!==t.memoizedState&&(Le.flags|=2048,_s(9,{destroy:void 0},Hv.bind(null,d,i),null)),[r,v,e]}function Hv(e,t){e.action=t}function Dh(e){var t=lt(),i=$e;if(i!==null)return Ah(t,i,e);lt(),t=t.memoizedState,i=lt();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function _s(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Le.updateQueue,t===null&&(t=da(),Le.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function Lh(){return lt().memoizedState}function ga(e,t,i,r){var d=Ht();Le.flags|=e,d.memoizedState=_s(1|t,{destroy:void 0},i,r===void 0?null:r)}function va(e,t,i,r){var d=lt();r=r===void 0?null:r;var v=d.memoizedState.inst;$e!==null&&r!==null&&nl(r,$e.memoizedState.deps)?d.memoizedState=_s(t,v,i,r):(Le.flags|=e,d.memoizedState=_s(1|t,v,i,r))}function Th(e,t){ga(8390656,8,e,t)}function gl(e,t){va(2048,8,e,t)}function zv(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=da(),Le.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Mh(e){var t=lt().memoizedState;return zv({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(A(440));return t.impl.apply(void 0,arguments)}}function kh(e,t){return va(4,2,e,t)}function Oh(e,t){return va(4,4,e,t)}function Bh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hh(e,t,i){i=i!=null?i.concat([e]):null,va(4,4,Bh.bind(null,t,e),i)}function vl(){}function zh(e,t){var i=lt();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&nl(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Ih(e,t){var i=lt();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&nl(t,r[1]))return r[0];if(r=e(),Nr){Et(!0);try{e()}finally{Et(!1)}}return i.memoizedState=[r,t],r}function pl(e,t,i){return i===void 0||(Pi&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Nd(),Le.lanes|=e,dr|=e,i)}function Nh(e,t,i,r){return Zt(i,t)?i:hs.current!==null?(e=pl(e,i,r),Zt(e,t)||(ft=!0),e):(Pi&42)===0||(Pi&1073741824)!==0&&(He&261930)===0?(ft=!0,e.memoizedState=i):(e=Nd(),Le.lanes|=e,dr|=e,t)}function Uh(e,t,i,r,d){var v=$.p;$.p=v!==0&&8>v?v:8;var L=G.T,j={};G.T=j,bl(e,!1,t,i);try{var K=d(),se=G.S;if(se!==null&&se(j,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var le=Mv(K,r);tn(e,t,le,ri(e))}else tn(e,t,r,ri(e))}catch(de){tn(e,t,{then:function(){},status:"rejected",reason:de},ri())}finally{$.p=v,L!==null&&j.types!==null&&(L.types=j.types),G.T=L}}function Iv(){}function ml(e,t,i,r){if(e.tag!==5)throw Error(A(476));var d=jh(e).queue;Uh(e,d,t,Y,i===null?Iv:function(){return Ph(e),i(r)})}function jh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:Y},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ph(e){var t=jh(e);t.next===null&&(t=e.alternate.memoizedState),tn(e,t.next.queue,{},ri())}function Sl(){return Dt(Sn)}function Fh(){return lt().memoizedState}function qh(){return lt().memoizedState}function Nv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ri();e=ar(i);var r=or(t,e,i);r!==null&&($t(r,t,i),Ks(r,t,i)),t={cache:Vo()},e.payload=t;return}t=t.return}}function Uv(e,t,i){var r=ri();i={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pa(e)?Gh(t,i):(i=Io(e,t,i,r),i!==null&&($t(i,e,r),$h(i,t,r)))}function Wh(e,t,i){var r=ri();tn(e,t,i,r)}function tn(e,t,i,r){var d={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(pa(e))Gh(t,d);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=t.lastRenderedReducer,v!==null))try{var L=t.lastRenderedState,j=v(L,i);if(d.hasEagerState=!0,d.eagerState=j,Zt(j,L))return Zn(e,t,d,0),Xe===null&&Kn(),!1}catch{}finally{}if(i=Io(e,t,d,r),i!==null)return $t(i,e,r),$h(i,t,r),!0}return!1}function bl(e,t,i,r){if(r={lane:2,revertLane:Ql(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pa(e)){if(t)throw Error(A(479))}else t=Io(e,i,r,2),t!==null&&$t(t,e,2)}function pa(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Gh(e,t){ds=ua=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function $h(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Kt(e,i)}}var rn={readContext:Dt,use:fa,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};rn.useEffectEvent=nt;var Yh={readContext:Dt,use:fa,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Th,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ga(4194308,4,Bh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ga(4194308,4,e,t)},useInsertionEffect:function(e,t){ga(4,2,e,t)},useMemo:function(e,t){var i=Ht();t=t===void 0?null:t;var r=e();if(Nr){Et(!0);try{e()}finally{Et(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=Ht();if(i!==void 0){var d=i(t);if(Nr){Et(!0);try{i(t)}finally{Et(!1)}}}else d=t;return r.memoizedState=r.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},r.queue=e,e=e.dispatch=Uv.bind(null,Le,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=fl(e);var t=e.queue,i=Wh.bind(null,Le,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:vl,useDeferredValue:function(e,t){var i=Ht();return pl(i,e,t)},useTransition:function(){var e=fl(!1);return e=Uh.bind(null,Le,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Le,d=Ht();if(Ie){if(i===void 0)throw Error(A(407));i=i()}else{if(i=t(),Xe===null)throw Error(A(349));(He&127)!==0||_h(r,t,i)}d.memoizedState=i;var v={value:i,getSnapshot:t};return d.queue=v,Th(vh.bind(null,r,v,e),[e]),r.flags|=2048,_s(9,{destroy:void 0},gh.bind(null,r,v,i,t),null),i},useId:function(){var e=Ht(),t=Xe.identifierPrefix;if(Ie){var i=Ai,r=Ri;i=(r&~(1<<32-vt(r)-1)).toString(32)+i,t="_"+t+"R_"+i,i=ha++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=kv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Sl,useFormState:Eh,useActionState:Eh,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=bl.bind(null,Le,!0,i),i.dispatch=t,[e,t]},useMemoCache:ul,useCacheRefresh:function(){return Ht().memoizedState=Nv.bind(null,Le)},useEffectEvent:function(e){var t=Ht(),i={impl:e};return t.memoizedState=i,function(){if((Fe&2)!==0)throw Error(A(440));return i.impl.apply(void 0,arguments)}}},yl={readContext:Dt,use:fa,useCallback:zh,useContext:Dt,useEffect:gl,useImperativeHandle:Hh,useInsertionEffect:kh,useLayoutEffect:Oh,useMemo:Ih,useReducer:_a,useRef:Lh,useState:function(){return _a(Fi)},useDebugValue:vl,useDeferredValue:function(e,t){var i=lt();return Nh(i,$e.memoizedState,e,t)},useTransition:function(){var e=_a(Fi)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:fh,useId:Fh,useHostTransitionStatus:Sl,useFormState:Rh,useActionState:Rh,useOptimistic:function(e,t){var i=lt();return Sh(i,$e,e,t)},useMemoCache:ul,useCacheRefresh:qh};yl.useEffectEvent=Mh;var Vh={readContext:Dt,use:fa,useCallback:zh,useContext:Dt,useEffect:gl,useImperativeHandle:Hh,useInsertionEffect:kh,useLayoutEffect:Oh,useMemo:Ih,useReducer:dl,useRef:Lh,useState:function(){return dl(Fi)},useDebugValue:vl,useDeferredValue:function(e,t){var i=lt();return $e===null?pl(i,e,t):Nh(i,$e.memoizedState,e,t)},useTransition:function(){var e=dl(Fi)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:en(e),t]},useSyncExternalStore:fh,useId:Fh,useHostTransitionStatus:Sl,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,t){var i=lt();return $e!==null?Sh(i,$e,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ul,useCacheRefresh:qh};Vh.useEffectEvent=Mh;function Cl(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:o({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var wl={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=ri(),d=ar(r);d.payload=t,i!=null&&(d.callback=i),t=or(e,d,r),t!==null&&($t(t,e,r),Ks(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=ri(),d=ar(r);d.tag=1,d.payload=t,i!=null&&(d.callback=i),t=or(e,d,r),t!==null&&($t(t,e,r),Ks(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ri(),r=ar(i);r.tag=2,t!=null&&(r.callback=t),t=or(e,r,i),t!==null&&($t(t,e,i),Ks(t,e,i))}};function Xh(e,t,i,r,d,v,L){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,v,L):t.prototype&&t.prototype.isPureReactComponent?!Fs(i,r)||!Fs(d,v):!0}function Kh(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&wl.enqueueReplaceState(t,t.state,null)}function Ur(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=o({},i));for(var d in e)i[d]===void 0&&(i[d]=e[d])}return i}function Zh(e){Xn(e)}function Qh(e){console.error(e)}function Jh(e){Xn(e)}function ma(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function ed(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function xl(e,t,i){return i=ar(i),i.tag=3,i.payload={element:null},i.callback=function(){ma(e,t)},i}function td(e){return e=ar(e),e.tag=3,e}function id(e,t,i,r){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var v=r.value;e.payload=function(){return d(v)},e.callback=function(){ed(t,i,r)}}var L=i.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(e.callback=function(){ed(t,i,r),typeof d!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var j=r.stack;this.componentDidCatch(r.value,{componentStack:j!==null?j:""})})}function jv(e,t,i,r,d){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&as(t,i,d,!0),i=Jt.current,i!==null){switch(i.tag){case 31:case 13:return _i===null?Ta():i.alternate===null&&at===0&&(at=3),i.flags&=-257,i.flags|=65536,i.lanes=d,r===na?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),Xl(e,r,d)),!1;case 22:return i.flags|=65536,r===na?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),Xl(e,r,d)),!1}throw Error(A(435,i.tag))}return Xl(e,r,d),Ta(),!1}if(Ie)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,r!==qo&&(e=Error(A(422),{cause:r}),Gs(ui(e,i)))):(r!==qo&&(t=Error(A(423),{cause:r}),Gs(ui(t,i))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,r=ui(r,i),d=xl(e.stateNode,r,d),el(e,d),at!==4&&(at=2)),!1;var v=Error(A(520),{cause:r});if(v=ui(v,i),hn===null?hn=[v]:hn.push(v),at!==4&&(at=2),t===null)return!0;r=ui(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=d&-d,i.lanes|=e,e=xl(i.stateNode,r,e),el(i,e),!1;case 1:if(t=i.type,v=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(fr===null||!fr.has(v))))return i.flags|=65536,d&=-d,i.lanes|=d,d=td(d),id(d,e,i,r),el(i,d),!1}i=i.return}while(i!==null);return!1}var El=Error(A(461)),ft=!1;function Lt(e,t,i,r){t.child=e===null?ah(t,null,i,r):Ir(t,e.child,i,r)}function rd(e,t,i,r,d){i=i.render;var v=t.ref;if("ref"in r){var L={};for(var j in r)j!=="ref"&&(L[j]=r[j])}else L=r;return Or(t),r=al(e,t,i,L,v,d),j=ol(),e!==null&&!ft?(ll(e,t,d),qi(e,t,d)):(Ie&&j&&Po(t),t.flags|=1,Lt(e,t,r,d),t.child)}function sd(e,t,i,r,d){if(e===null){var v=i.type;return typeof v=="function"&&!No(v)&&v.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=v,nd(e,t,v,r,d)):(e=Jn(i.type,null,r,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(v=e.child,!Ol(e,d)){var L=v.memoizedProps;if(i=i.compare,i=i!==null?i:Fs,i(L,r)&&e.ref===t.ref)return qi(e,t,d)}return t.flags|=1,e=Ii(v,r),e.ref=t.ref,e.return=t,t.child=e}function nd(e,t,i,r,d){if(e!==null){var v=e.memoizedProps;if(Fs(v,r)&&e.ref===t.ref)if(ft=!1,t.pendingProps=r=v,Ol(e,d))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,qi(e,t,d)}return Rl(e,t,i,r,d)}function ad(e,t,i,r){var d=r.children,v=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(v=v!==null?v.baseLanes|i:i,e!==null){for(r=t.child=e.child,d=0;r!==null;)d=d|r.lanes|r.childLanes,r=r.sibling;r=d&~v}else r=0,t.child=null;return od(e,t,v,i,r)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ra(t,v!==null?v.cachePool:null),v!==null?ch(t,v):il(),uh(t);else return r=t.lanes=536870912,od(e,t,v!==null?v.baseLanes|i:i,i,r)}else v!==null?(ra(t,v.cachePool),ch(t,v),cr(),t.memoizedState=null):(e!==null&&ra(t,null),il(),cr());return Lt(e,t,d,i),t.child}function sn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function od(e,t,i,r,d){var v=Ko();return v=v===null?null:{parent:ht._currentValue,pool:v},t.memoizedState={baseLanes:i,cachePool:v},e!==null&&ra(t,null),il(),uh(t),e!==null&&as(e,t,r,!0),t.childLanes=d,null}function Sa(e,t){return t=ya({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ld(e,t,i){return Ir(t,e.child,null,i),e=Sa(t,t.pendingProps),e.flags|=2,ei(t),t.memoizedState=null,e}function Pv(e,t,i){var r=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(r.mode==="hidden")return e=Sa(t,r),t.lanes=536870912,sn(null,e);if(sl(t),(e=Je)?(e=yf(e,fi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:tr!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},i=Gu(e),i.return=t,t.child=i,At=t,Je=null)):e=null,e===null)throw rr(t);return t.lanes=536870912,null}return Sa(t,r)}var v=e.memoizedState;if(v!==null){var L=v.dehydrated;if(sl(t),d)if(t.flags&256)t.flags&=-257,t=ld(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(A(558));else if(ft||as(e,t,i,!1),d=(i&e.childLanes)!==0,ft||d){if(r=Xe,r!==null&&(L=ni(r,i),L!==0&&L!==v.retryLane))throw v.retryLane=L,Lr(e,L),$t(r,e,L),El;Ta(),t=ld(e,t,i)}else e=v.treeContext,Je=gi(L.nextSibling),At=t,Ie=!0,ir=null,fi=!1,e!==null&&Vu(t,e),t=Sa(t,r),t.flags|=4096;return t}return e=Ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ba(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(A(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Rl(e,t,i,r,d){return Or(t),i=al(e,t,i,r,void 0,d),r=ol(),e!==null&&!ft?(ll(e,t,d),qi(e,t,d)):(Ie&&r&&Po(t),t.flags|=1,Lt(e,t,i,d),t.child)}function cd(e,t,i,r,d,v){return Or(t),t.updateQueue=null,i=dh(t,r,i,d),hh(e),r=ol(),e!==null&&!ft?(ll(e,t,v),qi(e,t,v)):(Ie&&r&&Po(t),t.flags|=1,Lt(e,t,i,v),t.child)}function ud(e,t,i,r,d){if(Or(t),t.stateNode===null){var v=is,L=i.contextType;typeof L=="object"&&L!==null&&(v=Dt(L)),v=new i(r,v),t.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=wl,t.stateNode=v,v._reactInternals=t,v=t.stateNode,v.props=r,v.state=t.memoizedState,v.refs={},Qo(t),L=i.contextType,v.context=typeof L=="object"&&L!==null?Dt(L):is,v.state=t.memoizedState,L=i.getDerivedStateFromProps,typeof L=="function"&&(Cl(t,i,L,r),v.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(L=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),L!==v.state&&wl.enqueueReplaceState(v,v.state,null),Qs(t,r,v,d),Zs(),v.state=t.memoizedState),typeof v.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){v=t.stateNode;var j=t.memoizedProps,K=Ur(i,j);v.props=K;var se=v.context,le=i.contextType;L=is,typeof le=="object"&&le!==null&&(L=Dt(le));var de=i.getDerivedStateFromProps;le=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,le||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(j||se!==L)&&Kh(t,v,r,L),nr=!1;var ae=t.memoizedState;v.state=ae,Qs(t,r,v,d),Zs(),se=t.memoizedState,j||ae!==se||nr?(typeof de=="function"&&(Cl(t,i,de,r),se=t.memoizedState),(K=nr||Xh(t,i,K,r,ae,se,L))?(le||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=se),v.props=r,v.state=se,v.context=L,r=K):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{v=t.stateNode,Jo(e,t),L=t.memoizedProps,le=Ur(i,L),v.props=le,de=t.pendingProps,ae=v.context,se=i.contextType,K=is,typeof se=="object"&&se!==null&&(K=Dt(se)),j=i.getDerivedStateFromProps,(se=typeof j=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L!==de||ae!==K)&&Kh(t,v,r,K),nr=!1,ae=t.memoizedState,v.state=ae,Qs(t,r,v,d),Zs();var oe=t.memoizedState;L!==de||ae!==oe||nr||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof j=="function"&&(Cl(t,i,j,r),oe=t.memoizedState),(le=nr||Xh(t,i,le,r,ae,oe,K)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(se||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(r,oe,K),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(r,oe,K)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=oe),v.props=r,v.state=oe,v.context=K,r=le):(typeof v.componentDidUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),r=!1)}return v=r,ba(e,t),r=(t.flags&128)!==0,v||r?(v=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:v.render(),t.flags|=1,e!==null&&r?(t.child=Ir(t,e.child,null,d),t.child=Ir(t,null,i,d)):Lt(e,t,i,d),t.memoizedState=v.state,e=t.child):e=qi(e,t,d),e}function hd(e,t,i,r){return Mr(),t.flags|=256,Lt(e,t,i,r),t.child}var Al={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dl(e){return{baseLanes:e,cachePool:eh()}}function Ll(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ii),e}function dd(e,t,i){var r=t.pendingProps,d=!1,v=(t.flags&128)!==0,L;if((L=v)||(L=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),L&&(d=!0,t.flags&=-129),L=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(d?lr(t):cr(),(e=Je)?(e=yf(e,fi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:tr!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},i=Gu(e),i.return=t,t.child=i,At=t,Je=null)):e=null,e===null)throw rr(t);return hc(e)?t.lanes=32:t.lanes=536870912,null}var j=r.children;return r=r.fallback,d?(cr(),d=t.mode,j=ya({mode:"hidden",children:j},d),r=Tr(r,d,i,null),j.return=t,r.return=t,j.sibling=r,t.child=j,r=t.child,r.memoizedState=Dl(i),r.childLanes=Ll(e,L,i),t.memoizedState=Al,sn(null,r)):(lr(t),Tl(t,j))}var K=e.memoizedState;if(K!==null&&(j=K.dehydrated,j!==null)){if(v)t.flags&256?(lr(t),t.flags&=-257,t=Ml(e,t,i)):t.memoizedState!==null?(cr(),t.child=e.child,t.flags|=128,t=null):(cr(),j=r.fallback,d=t.mode,r=ya({mode:"visible",children:r.children},d),j=Tr(j,d,i,null),j.flags|=2,r.return=t,j.return=t,r.sibling=j,t.child=r,Ir(t,e.child,null,i),r=t.child,r.memoizedState=Dl(i),r.childLanes=Ll(e,L,i),t.memoizedState=Al,t=sn(null,r));else if(lr(t),hc(j)){if(L=j.nextSibling&&j.nextSibling.dataset,L)var se=L.dgst;L=se,r=Error(A(419)),r.stack="",r.digest=L,Gs({value:r,source:null,stack:null}),t=Ml(e,t,i)}else if(ft||as(e,t,i,!1),L=(i&e.childLanes)!==0,ft||L){if(L=Xe,L!==null&&(r=ni(L,i),r!==0&&r!==K.retryLane))throw K.retryLane=r,Lr(e,r),$t(L,e,r),El;uc(j)||Ta(),t=Ml(e,t,i)}else uc(j)?(t.flags|=192,t.child=e.child,t=null):(e=K.treeContext,Je=gi(j.nextSibling),At=t,Ie=!0,ir=null,fi=!1,e!==null&&Vu(t,e),t=Tl(t,r.children),t.flags|=4096);return t}return d?(cr(),j=r.fallback,d=t.mode,K=e.child,se=K.sibling,r=Ii(K,{mode:"hidden",children:r.children}),r.subtreeFlags=K.subtreeFlags&65011712,se!==null?j=Ii(se,j):(j=Tr(j,d,i,null),j.flags|=2),j.return=t,r.return=t,r.sibling=j,t.child=r,sn(null,r),r=t.child,j=e.child.memoizedState,j===null?j=Dl(i):(d=j.cachePool,d!==null?(K=ht._currentValue,d=d.parent!==K?{parent:K,pool:K}:d):d=eh(),j={baseLanes:j.baseLanes|i,cachePool:d}),r.memoizedState=j,r.childLanes=Ll(e,L,i),t.memoizedState=Al,sn(e.child,r)):(lr(t),i=e.child,e=i.sibling,i=Ii(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(L=t.deletions,L===null?(t.deletions=[e],t.flags|=16):L.push(e)),t.child=i,t.memoizedState=null,i)}function Tl(e,t){return t=ya({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ya(e,t){return e=Qt(22,e,null,t),e.lanes=0,e}function Ml(e,t,i){return Ir(t,e.child,null,i),e=Tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function fd(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$o(e.return,t,i)}function kl(e,t,i,r,d,v){var L=e.memoizedState;L===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:d,treeForkCount:v}:(L.isBackwards=t,L.rendering=null,L.renderingStartTime=0,L.last=r,L.tail=i,L.tailMode=d,L.treeForkCount=v)}function _d(e,t,i){var r=t.pendingProps,d=r.revealOrder,v=r.tail;r=r.children;var L=ot.current,j=(L&2)!==0;if(j?(L=L&1|2,t.flags|=128):L&=1,Z(ot,L),Lt(e,t,r,i),r=Ie?Ws:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fd(e,i,t);else if(e.tag===19)fd(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&ca(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),kl(t,!1,d,i,v,r);break;case"backwards":case"unstable_legacy-backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&ca(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}kl(t,!0,i,null,v,r);break;case"together":kl(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function qi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),dr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(as(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,i=Ii(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ii(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Ol(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ta(e)))}function Fv(e,t,i){switch(t.tag){case 3:P(t,t.stateNode.containerInfo),sr(t,ht,e.memoizedState.cache),Mr();break;case 27:case 5:ie(t);break;case 4:P(t,t.stateNode.containerInfo);break;case 10:sr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,sl(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(lr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?dd(e,t,i):(lr(t),e=qi(e,t,i),e!==null?e.sibling:null);lr(t);break;case 19:var d=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(as(e,t,i,!1),r=(i&t.childLanes)!==0),d){if(r)return _d(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Z(ot,ot.current),r)break;return null;case 22:return t.lanes=0,ad(e,t,i,t.pendingProps);case 24:sr(t,ht,e.memoizedState.cache)}return qi(e,t,i)}function gd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!Ol(e,i)&&(t.flags&128)===0)return ft=!1,Fv(e,t,i);ft=(e.flags&131072)!==0}else ft=!1,Ie&&(t.flags&1048576)!==0&&Yu(t,Ws,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Hr(t.elementType),t.type=e,typeof e=="function")No(e)?(r=Ur(e,r),t.tag=1,t=ud(null,t,e,r,i)):(t.tag=0,t=Rl(null,t,e,r,i));else{if(e!=null){var d=e.$$typeof;if(d===S){t.tag=11,t=rd(null,t,e,r,i);break e}else if(d===E){t.tag=14,t=sd(null,t,e,r,i);break e}}throw t=q(e)||e,Error(A(306,t,""))}}return t;case 0:return Rl(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,d=Ur(r,t.pendingProps),ud(e,t,r,d,i);case 3:e:{if(P(t,t.stateNode.containerInfo),e===null)throw Error(A(387));r=t.pendingProps;var v=t.memoizedState;d=v.element,Jo(e,t),Qs(t,r,null,i);var L=t.memoizedState;if(r=L.cache,sr(t,ht,r),r!==v.cache&&Yo(t,[ht],i,!0),Zs(),r=L.element,v.isDehydrated)if(v={element:r,isDehydrated:!1,cache:L.cache},t.updateQueue.baseState=v,t.memoizedState=v,t.flags&256){t=hd(e,t,r,i);break e}else if(r!==d){d=ui(Error(A(424)),t),Gs(d),t=hd(e,t,r,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Je=gi(e.firstChild),At=t,Ie=!0,ir=null,fi=!0,i=ah(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Mr(),r===d){t=qi(e,t,i);break e}Lt(e,t,r,i)}t=t.child}return t;case 26:return ba(e,t),e===null?(i=Af(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ie||(i=t.type,e=t.pendingProps,r=Ia(ce.current).createElement(i),r[Rt]=t,r[jt]=e,Tt(r,i,e),yt(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ie(t),e===null&&Ie&&(r=t.stateNode=xf(t.type,t.pendingProps,ce.current),At=t,fi=!0,d=Je,pr(t.type)?(dc=d,Je=gi(r.firstChild)):Je=d),Lt(e,t,t.pendingProps.children,i),ba(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((d=r=Je)&&(r=mp(r,t.type,t.pendingProps,fi),r!==null?(t.stateNode=r,At=t,Je=gi(r.firstChild),fi=!1,d=!0):d=!1),d||rr(t)),ie(t),d=t.type,v=t.pendingProps,L=e!==null?e.memoizedProps:null,r=v.children,oc(d,v)?r=null:L!==null&&oc(d,L)&&(t.flags|=32),t.memoizedState!==null&&(d=al(e,t,Ov,null,null,i),Sn._currentValue=d),ba(e,t),Lt(e,t,r,i),t.child;case 6:return e===null&&Ie&&((e=i=Je)&&(i=Sp(i,t.pendingProps,fi),i!==null?(t.stateNode=i,At=t,Je=null,e=!0):e=!1),e||rr(t)),null;case 13:return dd(e,t,i);case 4:return P(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ir(t,null,r,i):Lt(e,t,r,i),t.child;case 11:return rd(e,t,t.type,t.pendingProps,i);case 7:return Lt(e,t,t.pendingProps,i),t.child;case 8:return Lt(e,t,t.pendingProps.children,i),t.child;case 12:return Lt(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,sr(t,t.type,r.value),Lt(e,t,r.children,i),t.child;case 9:return d=t.type._context,r=t.pendingProps.children,Or(t),d=Dt(d),r=r(d),t.flags|=1,Lt(e,t,r,i),t.child;case 14:return sd(e,t,t.type,t.pendingProps,i);case 15:return nd(e,t,t.type,t.pendingProps,i);case 19:return _d(e,t,i);case 31:return Pv(e,t,i);case 22:return ad(e,t,i,t.pendingProps);case 24:return Or(t),r=Dt(ht),e===null?(d=Ko(),d===null&&(d=Xe,v=Vo(),d.pooledCache=v,v.refCount++,v!==null&&(d.pooledCacheLanes|=i),d=v),t.memoizedState={parent:r,cache:d},Qo(t),sr(t,ht,d)):((e.lanes&i)!==0&&(Jo(e,t),Qs(t,null,null,i),Zs()),d=e.memoizedState,v=t.memoizedState,d.parent!==r?(d={parent:r,cache:r},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),sr(t,ht,r)):(r=v.cache,sr(t,ht,r),r!==d.cache&&Yo(t,[ht],i,!0))),Lt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(A(156,t.tag))}function Wi(e){e.flags|=4}function Bl(e,t,i,r,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Fd())e.flags|=8192;else throw zr=na,Zo}else e.flags&=-16777217}function vd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kf(t))if(Fd())e.flags|=8192;else throw zr=na,Zo}function Ca(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?kt():536870912,e.lanes|=t,ms|=t)}function nn(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,r|=d.subtreeFlags&65011712,r|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,r|=d.subtreeFlags,r|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function qv(e,t,i){var r=t.pendingProps;switch(Fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return et(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ji(ht),ne(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ns(t)?Wi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Wo())),et(t),null;case 26:var d=t.type,v=t.memoizedState;return e===null?(Wi(t),v!==null?(et(t),vd(t,v)):(et(t),Bl(t,d,null,r,i))):v?v!==e.memoizedState?(Wi(t),et(t),vd(t,v)):(et(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Wi(t),et(t),Bl(t,d,e,r,i)),null;case 27:if(_e(t),i=ce.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wi(t);else{if(!r){if(t.stateNode===null)throw Error(A(166));return et(t),null}e=ee.current,ns(t)?Xu(t):(e=xf(d,r,i),t.stateNode=e,Wi(t))}return et(t),null;case 5:if(_e(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Wi(t);else{if(!r){if(t.stateNode===null)throw Error(A(166));return et(t),null}if(v=ee.current,ns(t))Xu(t);else{var L=Ia(ce.current);switch(v){case 1:v=L.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:v=L.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":v=L.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":v=L.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":v=L.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof r.is=="string"?L.createElement("select",{is:r.is}):L.createElement("select"),r.multiple?v.multiple=!0:r.size&&(v.size=r.size);break;default:v=typeof r.is=="string"?L.createElement(d,{is:r.is}):L.createElement(d)}}v[Rt]=t,v[jt]=r;e:for(L=t.child;L!==null;){if(L.tag===5||L.tag===6)v.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===t)break e;for(;L.sibling===null;){if(L.return===null||L.return===t)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}t.stateNode=v;e:switch(Tt(v,d,r),d){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Wi(t)}}return et(t),Bl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Wi(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(A(166));if(e=ce.current,ns(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,d=At,d!==null)switch(d.tag){case 27:case 5:r=d.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||ff(e.nodeValue,i)),e||rr(t,!0)}else e=Ia(e).createTextNode(r),e[Rt]=t,t.stateNode=e}return et(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(r=ns(t),i!==null){if(e===null){if(!r)throw Error(A(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(557));e[Rt]=t}else Mr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),e=!1}else i=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ei(t),t):(ei(t),null);if((t.flags&128)!==0)throw Error(A(558))}return et(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ns(t),r!==null&&r.dehydrated!==null){if(e===null){if(!d)throw Error(A(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(A(317));d[Rt]=t}else Mr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),d=!1}else d=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(ei(t),t):(ei(t),null)}return ei(t),(t.flags&128)!==0?(t.lanes=i,t):(i=r!==null,e=e!==null&&e.memoizedState!==null,i&&(r=t.child,d=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(d=r.alternate.memoizedState.cachePool.pool),v=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(v=r.memoizedState.cachePool.pool),v!==d&&(r.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Ca(t,t.updateQueue),et(t),null);case 4:return ne(),e===null&&ic(t.stateNode.containerInfo),et(t),null;case 10:return ji(t.type),et(t),null;case 19:if(N(ot),r=t.memoizedState,r===null)return et(t),null;if(d=(t.flags&128)!==0,v=r.rendering,v===null)if(d)nn(r,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=ca(e),v!==null){for(t.flags|=128,nn(r,!1),e=v.updateQueue,t.updateQueue=e,Ca(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Wu(i,e),i=i.sibling;return Z(ot,ot.current&1|2),Ie&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>Aa&&(t.flags|=128,d=!0,nn(r,!1),t.lanes=4194304)}else{if(!d)if(e=ca(v),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,Ca(t,e),nn(r,!0),r.tail===null&&r.tailMode==="hidden"&&!v.alternate&&!Ie)return et(t),null}else 2*we()-r.renderingStartTime>Aa&&i!==536870912&&(t.flags|=128,d=!0,nn(r,!1),t.lanes=4194304);r.isBackwards?(v.sibling=t.child,t.child=v):(e=r.last,e!==null?e.sibling=v:t.child=v,r.last=v)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,i=ot.current,Z(ot,d?i&1|2:i&1),Ie&&Ni(t,r.treeForkCount),e):(et(t),null);case 22:case 23:return ei(t),rl(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),i=t.updateQueue,i!==null&&Ca(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&N(Br),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ji(ht),et(t),null;case 25:return null;case 30:return null}throw Error(A(156,t.tag))}function Wv(e,t){switch(Fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ji(ht),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(ei(t),t.alternate===null)throw Error(A(340));Mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ei(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Mr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return N(ot),null;case 4:return ne(),null;case 10:return ji(t.type),null;case 22:case 23:return ei(t),rl(),e!==null&&N(Br),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ji(ht),null;case 25:return null;default:return null}}function pd(e,t){switch(Fo(t),t.tag){case 3:ji(ht),ne();break;case 26:case 27:case 5:_e(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&ei(t);break;case 13:ei(t);break;case 19:N(ot);break;case 10:ji(t.type);break;case 22:case 23:ei(t),rl(),e!==null&&N(Br);break;case 24:ji(ht)}}function an(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var d=r.next;i=d;do{if((i.tag&e)===e){r=void 0;var v=i.create,L=i.inst;r=v(),L.destroy=r}i=i.next}while(i!==d)}}catch(j){Ge(t,t.return,j)}}function ur(e,t,i){try{var r=t.updateQueue,d=r!==null?r.lastEffect:null;if(d!==null){var v=d.next;r=v;do{if((r.tag&e)===e){var L=r.inst,j=L.destroy;if(j!==void 0){L.destroy=void 0,d=t;var K=i,se=j;try{se()}catch(le){Ge(d,K,le)}}}r=r.next}while(r!==v)}}catch(le){Ge(t,t.return,le)}}function md(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{lh(t,i)}catch(r){Ge(e,e.return,r)}}}function Sd(e,t,i){i.props=Ur(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){Ge(e,t,r)}}function on(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(d){Ge(e,t,d)}}function Di(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(d){Ge(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){Ge(e,t,d)}else i.current=null}function bd(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(d){Ge(e,e.return,d)}}function Hl(e,t,i){try{var r=e.stateNode;dp(r,e.type,i,t),r[jt]=t}catch(d){Ge(e,e.return,d)}}function yd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pr(e.type)||e.tag===4}function zl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&pr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Il(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Hi));else if(r!==4&&(r===27&&pr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Il(e,t,i),e=e.sibling;e!==null;)Il(e,t,i),e=e.sibling}function wa(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&pr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(wa(e,t,i),e=e.sibling;e!==null;)wa(e,t,i),e=e.sibling}function Cd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);Tt(t,r,i),t[Rt]=e,t[jt]=i}catch(v){Ge(e,e.return,v)}}var Gi=!1,_t=!1,Nl=!1,wd=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Gv(e,t){if(e=e.containerInfo,nc=Wa,e=Hu(e),Mo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var d=r.anchorOffset,v=r.focusNode;r=r.focusOffset;try{i.nodeType,v.nodeType}catch{i=null;break e}var L=0,j=-1,K=-1,se=0,le=0,de=e,ae=null;t:for(;;){for(var oe;de!==i||d!==0&&de.nodeType!==3||(j=L+d),de!==v||r!==0&&de.nodeType!==3||(K=L+r),de.nodeType===3&&(L+=de.nodeValue.length),(oe=de.firstChild)!==null;)ae=de,de=oe;for(;;){if(de===e)break t;if(ae===i&&++se===d&&(j=L),ae===v&&++le===r&&(K=L),(oe=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=oe}i=j===-1||K===-1?null:{start:j,end:K}}else i=null}i=i||{start:0,end:0}}else i=null;for(ac={focusedElem:e,selectionRange:i},Wa=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,v=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)d=e[i],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&v!==null){e=void 0,i=t,d=v.memoizedProps,v=v.memoizedState,r=i.stateNode;try{var pe=Ur(i.type,d);e=r.getSnapshotBeforeUpdate(pe,v),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Ge(i,i.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)cc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(A(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}}function xd(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:Yi(e,i),r&4&&an(5,i);break;case 1:if(Yi(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(L){Ge(i,i.return,L)}else{var d=Ur(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(L){Ge(i,i.return,L)}}r&64&&md(i),r&512&&on(i,i.return);break;case 3:if(Yi(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{lh(e,t)}catch(L){Ge(i,i.return,L)}}break;case 27:t===null&&r&4&&Cd(i);case 26:case 5:Yi(e,i),t===null&&r&4&&bd(i),r&512&&on(i,i.return);break;case 12:Yi(e,i);break;case 31:Yi(e,i),r&4&&Ad(e,i);break;case 13:Yi(e,i),r&4&&Dd(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=ep.bind(null,i),bp(e,i))));break;case 22:if(r=i.memoizedState!==null||Gi,!r){t=t!==null&&t.memoizedState!==null||_t,d=Gi;var v=_t;Gi=r,(_t=t)&&!v?Vi(e,i,(i.subtreeFlags&8772)!==0):Yi(e,i),Gi=d,_t=v}break;case 30:break;default:Yi(e,i)}}function Ed(e){var t=e.alternate;t!==null&&(e.alternate=null,Ed(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_o(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var it=null,Ft=!1;function $i(e,t,i){for(i=i.child;i!==null;)Rd(e,t,i),i=i.sibling}function Rd(e,t,i){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(Xt,i)}catch{}switch(i.tag){case 26:_t||Di(i,t),$i(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:_t||Di(i,t);var r=it,d=Ft;pr(i.type)&&(it=i.stateNode,Ft=!1),$i(e,t,i),vn(i.stateNode),it=r,Ft=d;break;case 5:_t||Di(i,t);case 6:if(r=it,d=Ft,it=null,$i(e,t,i),it=r,Ft=d,it!==null)if(Ft)try{(it.nodeType===9?it.body:it.nodeName==="HTML"?it.ownerDocument.body:it).removeChild(i.stateNode)}catch(v){Ge(i,t,v)}else try{it.removeChild(i.stateNode)}catch(v){Ge(i,t,v)}break;case 18:it!==null&&(Ft?(e=it,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Rs(e)):Sf(it,i.stateNode));break;case 4:r=it,d=Ft,it=i.stateNode.containerInfo,Ft=!0,$i(e,t,i),it=r,Ft=d;break;case 0:case 11:case 14:case 15:ur(2,i,t),_t||ur(4,i,t),$i(e,t,i);break;case 1:_t||(Di(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&Sd(i,t,r)),$i(e,t,i);break;case 21:$i(e,t,i);break;case 22:_t=(r=_t)||i.memoizedState!==null,$i(e,t,i),_t=r;break;default:$i(e,t,i)}}function Ad(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rs(e)}catch(i){Ge(t,t.return,i)}}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rs(e)}catch(i){Ge(t,t.return,i)}}function $v(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new wd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new wd),t;default:throw Error(A(435,e.tag))}}function xa(e,t){var i=$v(e);t.forEach(function(r){if(!i.has(r)){i.add(r);var d=tp.bind(null,e,r);r.then(d,d)}})}function qt(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var d=i[r],v=e,L=t,j=L;e:for(;j!==null;){switch(j.tag){case 27:if(pr(j.type)){it=j.stateNode,Ft=!1;break e}break;case 5:it=j.stateNode,Ft=!1;break e;case 3:case 4:it=j.stateNode.containerInfo,Ft=!0;break e}j=j.return}if(it===null)throw Error(A(160));Rd(v,L,d),it=null,Ft=!1,v=d.alternate,v!==null&&(v.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ld(t,e),t=t.sibling}var Ci=null;function Ld(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qt(t,e),Wt(e),r&4&&(ur(3,e,e.return),an(3,e),ur(5,e,e.return));break;case 1:qt(t,e),Wt(e),r&512&&(_t||i===null||Di(i,i.return)),r&64&&Gi&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var d=Ci;if(qt(t,e),Wt(e),r&512&&(_t||i===null||Di(i,i.return)),r&4){var v=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,d=d.ownerDocument||d;t:switch(r){case"title":v=d.getElementsByTagName("title")[0],(!v||v[Os]||v[Rt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=d.createElement(r),d.head.insertBefore(v,d.querySelector("head > title"))),Tt(v,r,i),v[Rt]=e,yt(v),r=v;break e;case"link":var L=Tf("link","href",d).get(r+(i.href||""));if(L){for(var j=0;j<L.length;j++)if(v=L[j],v.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&v.getAttribute("rel")===(i.rel==null?null:i.rel)&&v.getAttribute("title")===(i.title==null?null:i.title)&&v.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){L.splice(j,1);break t}}v=d.createElement(r),Tt(v,r,i),d.head.appendChild(v);break;case"meta":if(L=Tf("meta","content",d).get(r+(i.content||""))){for(j=0;j<L.length;j++)if(v=L[j],v.getAttribute("content")===(i.content==null?null:""+i.content)&&v.getAttribute("name")===(i.name==null?null:i.name)&&v.getAttribute("property")===(i.property==null?null:i.property)&&v.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&v.getAttribute("charset")===(i.charSet==null?null:i.charSet)){L.splice(j,1);break t}}v=d.createElement(r),Tt(v,r,i),d.head.appendChild(v);break;default:throw Error(A(468,r))}v[Rt]=e,yt(v),r=v}e.stateNode=r}else Mf(d,e.type,e.stateNode);else e.stateNode=Lf(d,r,e.memoizedProps);else v!==r?(v===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):v.count--,r===null?Mf(d,e.type,e.stateNode):Lf(d,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Hl(e,e.memoizedProps,i.memoizedProps)}break;case 27:qt(t,e),Wt(e),r&512&&(_t||i===null||Di(i,i.return)),i!==null&&r&4&&Hl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(qt(t,e),Wt(e),r&512&&(_t||i===null||Di(i,i.return)),e.flags&32){d=e.stateNode;try{Xr(d,"")}catch(pe){Ge(e,e.return,pe)}}r&4&&e.stateNode!=null&&(d=e.memoizedProps,Hl(e,d,i!==null?i.memoizedProps:d)),r&1024&&(Nl=!0);break;case 6:if(qt(t,e),Wt(e),r&4){if(e.stateNode===null)throw Error(A(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(pe){Ge(e,e.return,pe)}}break;case 3:if(ja=null,d=Ci,Ci=Na(t.containerInfo),qt(t,e),Ci=d,Wt(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{Rs(t.containerInfo)}catch(pe){Ge(e,e.return,pe)}Nl&&(Nl=!1,Td(e));break;case 4:r=Ci,Ci=Na(e.stateNode.containerInfo),qt(t,e),Wt(e),Ci=r;break;case 12:qt(t,e),Wt(e);break;case 31:qt(t,e),Wt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xa(e,r)));break;case 13:qt(t,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ra=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xa(e,r)));break;case 22:d=e.memoizedState!==null;var K=i!==null&&i.memoizedState!==null,se=Gi,le=_t;if(Gi=se||d,_t=le||K,qt(t,e),_t=le,Gi=se,Wt(e),r&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(i===null||K||Gi||_t||jr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){K=i=t;try{if(v=K.stateNode,d)L=v.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{j=K.stateNode;var de=K.memoizedProps.style,ae=de!=null&&de.hasOwnProperty("display")?de.display:null;j.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(pe){Ge(K,K.return,pe)}}}else if(t.tag===6){if(i===null){K=t;try{K.stateNode.nodeValue=d?"":K.memoizedProps}catch(pe){Ge(K,K.return,pe)}}}else if(t.tag===18){if(i===null){K=t;try{var oe=K.stateNode;d?bf(oe,!0):bf(K.stateNode,!1)}catch(pe){Ge(K,K.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,xa(e,i))));break;case 19:qt(t,e),Wt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xa(e,r)));break;case 30:break;case 21:break;default:qt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(yd(r)){i=r;break}r=r.return}if(i==null)throw Error(A(160));switch(i.tag){case 27:var d=i.stateNode,v=zl(e);wa(e,v,d);break;case 5:var L=i.stateNode;i.flags&32&&(Xr(L,""),i.flags&=-33);var j=zl(e);wa(e,j,L);break;case 3:case 4:var K=i.stateNode.containerInfo,se=zl(e);Il(e,se,K);break;default:throw Error(A(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Td(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Td(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Yi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xd(e,t.alternate,t),t=t.sibling}function jr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ur(4,t,t.return),jr(t);break;case 1:Di(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Sd(t,t.return,i),jr(t);break;case 27:vn(t.stateNode);case 26:case 5:Di(t,t.return),jr(t);break;case 22:t.memoizedState===null&&jr(t);break;case 30:jr(t);break;default:jr(t)}e=e.sibling}}function Vi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,d=e,v=t,L=v.flags;switch(v.tag){case 0:case 11:case 15:Vi(d,v,i),an(4,v);break;case 1:if(Vi(d,v,i),r=v,d=r.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(se){Ge(r,r.return,se)}if(r=v,d=r.updateQueue,d!==null){var j=r.stateNode;try{var K=d.shared.hiddenCallbacks;if(K!==null)for(d.shared.hiddenCallbacks=null,d=0;d<K.length;d++)oh(K[d],j)}catch(se){Ge(r,r.return,se)}}i&&L&64&&md(v),on(v,v.return);break;case 27:Cd(v);case 26:case 5:Vi(d,v,i),i&&r===null&&L&4&&bd(v),on(v,v.return);break;case 12:Vi(d,v,i);break;case 31:Vi(d,v,i),i&&L&4&&Ad(d,v);break;case 13:Vi(d,v,i),i&&L&4&&Dd(d,v);break;case 22:v.memoizedState===null&&Vi(d,v,i),on(v,v.return);break;case 30:break;default:Vi(d,v,i)}t=t.sibling}}function Ul(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&$s(i))}function jl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$s(e))}function wi(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Md(e,t,i,r),t=t.sibling}function Md(e,t,i,r){var d=t.flags;switch(t.tag){case 0:case 11:case 15:wi(e,t,i,r),d&2048&&an(9,t);break;case 1:wi(e,t,i,r);break;case 3:wi(e,t,i,r),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$s(e)));break;case 12:if(d&2048){wi(e,t,i,r),e=t.stateNode;try{var v=t.memoizedProps,L=v.id,j=v.onPostCommit;typeof j=="function"&&j(L,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(K){Ge(t,t.return,K)}}else wi(e,t,i,r);break;case 31:wi(e,t,i,r);break;case 13:wi(e,t,i,r);break;case 23:break;case 22:v=t.stateNode,L=t.alternate,t.memoizedState!==null?v._visibility&2?wi(e,t,i,r):ln(e,t):v._visibility&2?wi(e,t,i,r):(v._visibility|=2,gs(e,t,i,r,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Ul(L,t);break;case 24:wi(e,t,i,r),d&2048&&jl(t.alternate,t);break;default:wi(e,t,i,r)}}function gs(e,t,i,r,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var v=e,L=t,j=i,K=r,se=L.flags;switch(L.tag){case 0:case 11:case 15:gs(v,L,j,K,d),an(8,L);break;case 23:break;case 22:var le=L.stateNode;L.memoizedState!==null?le._visibility&2?gs(v,L,j,K,d):ln(v,L):(le._visibility|=2,gs(v,L,j,K,d)),d&&se&2048&&Ul(L.alternate,L);break;case 24:gs(v,L,j,K,d),d&&se&2048&&jl(L.alternate,L);break;default:gs(v,L,j,K,d)}t=t.sibling}}function ln(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,d=r.flags;switch(r.tag){case 22:ln(i,r),d&2048&&Ul(r.alternate,r);break;case 24:ln(i,r),d&2048&&jl(r.alternate,r);break;default:ln(i,r)}t=t.sibling}}var cn=8192;function vs(e,t,i){if(e.subtreeFlags&cn)for(e=e.child;e!==null;)kd(e,t,i),e=e.sibling}function kd(e,t,i){switch(e.tag){case 26:vs(e,t,i),e.flags&cn&&e.memoizedState!==null&&kp(i,Ci,e.memoizedState,e.memoizedProps);break;case 5:vs(e,t,i);break;case 3:case 4:var r=Ci;Ci=Na(e.stateNode.containerInfo),vs(e,t,i),Ci=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=cn,cn=16777216,vs(e,t,i),cn=r):vs(e,t,i));break;default:vs(e,t,i)}}function Od(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function un(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Ct=r,Hd(r,e)}Od(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bd(e),e=e.sibling}function Bd(e){switch(e.tag){case 0:case 11:case 15:un(e),e.flags&2048&&ur(9,e,e.return);break;case 3:un(e);break;case 12:un(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ea(e)):un(e);break;default:un(e)}}function Ea(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];Ct=r,Hd(r,e)}Od(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ur(8,t,t.return),Ea(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ea(t));break;default:Ea(t)}e=e.sibling}}function Hd(e,t){for(;Ct!==null;){var i=Ct;switch(i.tag){case 0:case 11:case 15:ur(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:$s(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,Ct=r;else e:for(i=e;Ct!==null;){r=Ct;var d=r.sibling,v=r.return;if(Ed(r),r===i){Ct=null;break e}if(d!==null){d.return=v,Ct=d;break e}Ct=v}}}var Yv={getCacheForType:function(e){var t=Dt(ht),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Dt(ht).controller.signal}},Vv=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Xe=null,Oe=null,He=0,We=0,ti=null,hr=!1,ps=!1,Pl=!1,Xi=0,at=0,dr=0,Pr=0,Fl=0,ii=0,ms=0,hn=null,Gt=null,ql=!1,Ra=0,zd=0,Aa=1/0,Da=null,fr=null,mt=0,_r=null,Ss=null,Ki=0,Wl=0,Gl=null,Id=null,dn=0,$l=null;function ri(){return(Fe&2)!==0&&He!==0?He&-He:G.T!==null?Ql():bi()}function Nd(){if(ii===0)if((He&536870912)===0||Ie){var e=Mi;Mi<<=1,(Mi&3932160)===0&&(Mi=262144),ii=e}else ii=536870912;return e=Jt.current,e!==null&&(e.flags|=32),ii}function $t(e,t,i){(e===Xe&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(bs(e,0),gr(e,He,ii,!1)),si(e,i),((Fe&2)===0||e!==Xe)&&(e===Xe&&((Fe&2)===0&&(Pr|=i),at===4&&gr(e,He,ii,!1)),Li(e))}function Ud(e,t,i){if((Fe&6)!==0)throw Error(A(327));var r=!i&&(t&127)===0&&(t&e.expiredLanes)===0||It(e,t),d=r?Zv(e,t):Vl(e,t,!0),v=r;do{if(d===0){ps&&!r&&gr(e,t,0,!1);break}else{if(i=e.current.alternate,v&&!Xv(i)){d=Vl(e,t,!1),v=!1;continue}if(d===2){if(v=t,e.errorRecoveryDisabledLanes&v)var L=0;else L=e.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){t=L;e:{var j=e;d=hn;var K=j.current.memoizedState.isDehydrated;if(K&&(bs(j,L).flags|=256),L=Vl(j,L,!1),L!==2){if(Pl&&!K){j.errorRecoveryDisabledLanes|=v,Pr|=v,d=4;break e}v=Gt,Gt=d,v!==null&&(Gt===null?Gt=v:Gt.push.apply(Gt,v))}d=L}if(v=!1,d!==2)continue}}if(d===1){bs(e,0),gr(e,t,0,!0);break}e:{switch(r=e,v=d,v){case 0:case 1:throw Error(A(345));case 4:if((t&4194048)!==t)break;case 6:gr(r,t,ii,!hr);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(A(329))}if((t&62914560)===t&&(d=Ra+300-we(),10<d)){if(gr(r,t,ii,!hr),bt(r,0,!0)!==0)break e;Ki=t,r.timeoutHandle=pf(jd.bind(null,r,i,Gt,Da,ql,t,ii,Pr,ms,hr,v,"Throttled",-0,0),d);break e}jd(r,i,Gt,Da,ql,t,ii,Pr,ms,hr,v,null,-0,0)}}break}while(!0);Li(e)}function jd(e,t,i,r,d,v,L,j,K,se,le,de,ae,oe){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},kd(t,v,de);var pe=(v&62914560)===v?Ra-we():(v&4194048)===v?zd-we():0;if(pe=Op(de,pe),pe!==null){Ki=v,e.cancelPendingCommit=pe(Vd.bind(null,e,t,v,i,r,d,L,j,K,le,de,null,ae,oe)),gr(e,v,L,!se);return}}Vd(e,t,v,i,r,d,L,j,K)}function Xv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var d=i[r],v=d.getSnapshot;d=d.value;try{if(!Zt(v(),d))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gr(e,t,i,r){t&=~Fl,t&=~Pr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var d=t;0<d;){var v=31-vt(d),L=1<<v;r[v]=-1,d&=~L}i!==0&&Si(e,i,t)}function La(){return(Fe&6)===0?(fn(0),!1):!0}function Yl(){if(Oe!==null){if(We===0)var e=Oe.return;else e=Oe,Ui=kr=null,cl(e),us=null,Vs=0,e=Oe;for(;e!==null;)pd(e.alternate,e),e=e.return;Oe=null}}function bs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,gp(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ki=0,Yl(),Xe=e,Oe=i=Ii(e.current,null),He=t,We=0,ti=null,hr=!1,ps=It(e,t),Pl=!1,ms=ii=Fl=Pr=dr=at=0,Gt=hn=null,ql=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var d=31-vt(r),v=1<<d;t|=e[d],r&=~v}return Xi=t,Kn(),i}function Pd(e,t){Le=null,G.H=rn,t===cs||t===sa?(t=rh(),We=3):t===Zo?(t=rh(),We=4):We=t===El?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ti=t,Oe===null&&(at=1,ma(e,ui(t,e.current)))}function Fd(){var e=Jt.current;return e===null?!0:(He&4194048)===He?_i===null:(He&62914560)===He||(He&536870912)!==0?e===_i:!1}function qd(){var e=G.H;return G.H=rn,e===null?rn:e}function Wd(){var e=G.A;return G.A=Yv,e}function Ta(){at=4,hr||(He&4194048)!==He&&Jt.current!==null||(ps=!0),(dr&134217727)===0&&(Pr&134217727)===0||Xe===null||gr(Xe,He,ii,!1)}function Vl(e,t,i){var r=Fe;Fe|=2;var d=qd(),v=Wd();(Xe!==e||He!==t)&&(Da=null,bs(e,t)),t=!1;var L=at;e:do try{if(We!==0&&Oe!==null){var j=Oe,K=ti;switch(We){case 8:Yl(),L=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var se=We;if(We=0,ti=null,ys(e,j,K,se),i&&ps){L=0;break e}break;default:se=We,We=0,ti=null,ys(e,j,K,se)}}Kv(),L=at;break}catch(le){Pd(e,le)}while(!0);return t&&e.shellSuspendCounter++,Ui=kr=null,Fe=r,G.H=d,G.A=v,Oe===null&&(Xe=null,He=0,Kn()),L}function Kv(){for(;Oe!==null;)Gd(Oe)}function Zv(e,t){var i=Fe;Fe|=2;var r=qd(),d=Wd();Xe!==e||He!==t?(Da=null,Aa=we()+500,bs(e,t)):ps=It(e,t);e:do try{if(We!==0&&Oe!==null){t=Oe;var v=ti;t:switch(We){case 1:We=0,ti=null,ys(e,t,v,1);break;case 2:case 9:if(th(v)){We=0,ti=null,$d(t);break}t=function(){We!==2&&We!==9||Xe!==e||(We=7),Li(e)},v.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:th(v)?(We=0,ti=null,$d(t)):(We=0,ti=null,ys(e,t,v,7));break;case 5:var L=null;switch(Oe.tag){case 26:L=Oe.memoizedState;case 5:case 27:var j=Oe;if(L?kf(L):j.stateNode.complete){We=0,ti=null;var K=j.sibling;if(K!==null)Oe=K;else{var se=j.return;se!==null?(Oe=se,Ma(se)):Oe=null}break t}}We=0,ti=null,ys(e,t,v,5);break;case 6:We=0,ti=null,ys(e,t,v,6);break;case 8:Yl(),at=6;break e;default:throw Error(A(462))}}Qv();break}catch(le){Pd(e,le)}while(!0);return Ui=kr=null,G.H=r,G.A=d,Fe=i,Oe!==null?0:(Xe=null,He=0,Kn(),at)}function Qv(){for(;Oe!==null&&!Ae();)Gd(Oe)}function Gd(e){var t=gd(e.alternate,e,Xi);e.memoizedProps=e.pendingProps,t===null?Ma(e):Oe=t}function $d(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=cd(i,t,t.pendingProps,t.type,void 0,He);break;case 11:t=cd(i,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:cl(t);default:pd(i,t),t=Oe=Wu(t,Xi),t=gd(i,t,Xi)}e.memoizedProps=e.pendingProps,t===null?Ma(e):Oe=t}function ys(e,t,i,r){Ui=kr=null,cl(t),us=null,Vs=0;var d=t.return;try{if(jv(e,d,t,i,He)){at=1,ma(e,ui(i,e.current)),Oe=null;return}}catch(v){if(d!==null)throw Oe=d,v;at=1,ma(e,ui(i,e.current)),Oe=null;return}t.flags&32768?(Ie||r===1?e=!0:ps||(He&536870912)!==0?e=!1:(hr=e=!0,(r===2||r===9||r===3||r===6)&&(r=Jt.current,r!==null&&r.tag===13&&(r.flags|=16384))),Yd(t,e)):Ma(t)}function Ma(e){var t=e;do{if((t.flags&32768)!==0){Yd(t,hr);return}e=t.return;var i=qv(t.alternate,t,Xi);if(i!==null){Oe=i;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);at===0&&(at=5)}function Yd(e,t){do{var i=Wv(e.alternate,e);if(i!==null){i.flags&=32767,Oe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=i}while(e!==null);at=6,Oe=null}function Vd(e,t,i,r,d,v,L,j,K){e.cancelPendingCommit=null;do ka();while(mt!==0);if((Fe&6)!==0)throw Error(A(327));if(t!==null){if(t===e.current)throw Error(A(177));if(v=t.lanes|t.childLanes,v|=zo,pt(e,i,v,L,j,K),e===Xe&&(Oe=Xe=null,He=0),Ss=t,_r=e,Ki=i,Wl=v,Gl=d,Id=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ip(Ze,function(){return Jd(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=G.T,G.T=null,d=$.p,$.p=2,L=Fe,Fe|=4;try{Gv(e,t,i)}finally{Fe=L,$.p=d,G.T=r}}mt=1,Xd(),Kd(),Zd()}}function Xd(){if(mt===1){mt=0;var e=_r,t=Ss,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var r=$.p;$.p=2;var d=Fe;Fe|=4;try{Ld(t,e);var v=ac,L=Hu(e.containerInfo),j=v.focusedElem,K=v.selectionRange;if(L!==j&&j&&j.ownerDocument&&Bu(j.ownerDocument.documentElement,j)){if(K!==null&&Mo(j)){var se=K.start,le=K.end;if(le===void 0&&(le=se),"selectionStart"in j)j.selectionStart=se,j.selectionEnd=Math.min(le,j.value.length);else{var de=j.ownerDocument||document,ae=de&&de.defaultView||window;if(ae.getSelection){var oe=ae.getSelection(),pe=j.textContent.length,Ce=Math.min(K.start,pe),Ve=K.end===void 0?Ce:Math.min(K.end,pe);!oe.extend&&Ce>Ve&&(L=Ve,Ve=Ce,Ce=L);var te=Ou(j,Ce),J=Ou(j,Ve);if(te&&J&&(oe.rangeCount!==1||oe.anchorNode!==te.node||oe.anchorOffset!==te.offset||oe.focusNode!==J.node||oe.focusOffset!==J.offset)){var re=de.createRange();re.setStart(te.node,te.offset),oe.removeAllRanges(),Ce>Ve?(oe.addRange(re),oe.extend(J.node,J.offset)):(re.setEnd(J.node,J.offset),oe.addRange(re))}}}}for(de=[],oe=j;oe=oe.parentNode;)oe.nodeType===1&&de.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<de.length;j++){var ue=de[j];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Wa=!!nc,ac=nc=null}finally{Fe=d,$.p=r,G.T=i}}e.current=t,mt=2}}function Kd(){if(mt===2){mt=0;var e=_r,t=Ss,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var r=$.p;$.p=2;var d=Fe;Fe|=4;try{xd(e,t.alternate,t)}finally{Fe=d,$.p=r,G.T=i}}mt=3}}function Zd(){if(mt===4||mt===3){mt=0,ge();var e=_r,t=Ss,i=Ki,r=Id;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?mt=5:(mt=0,Ss=_r=null,Qd(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(fr=null),Oi(i),t=t.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=G.T,d=$.p,$.p=2,G.T=null;try{for(var v=e.onRecoverableError,L=0;L<r.length;L++){var j=r[L];v(j.value,{componentStack:j.stack})}}finally{G.T=t,$.p=d}}(Ki&3)!==0&&ka(),Li(e),d=e.pendingLanes,(i&261930)!==0&&(d&42)!==0?e===$l?dn++:(dn=0,$l=e):dn=0,fn(0)}}function Qd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$s(t)))}function ka(){return Xd(),Kd(),Zd(),Jd()}function Jd(){if(mt!==5)return!1;var e=_r,t=Wl;Wl=0;var i=Oi(Ki),r=G.T,d=$.p;try{$.p=32>i?32:i,G.T=null,i=Gl,Gl=null;var v=_r,L=Ki;if(mt=0,Ss=_r=null,Ki=0,(Fe&6)!==0)throw Error(A(331));var j=Fe;if(Fe|=4,Bd(v.current),Md(v,v.current,L,i),Fe=j,fn(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(Xt,v)}catch{}return!0}finally{$.p=d,G.T=r,Qd(e,t)}}function ef(e,t,i){t=ui(i,t),t=xl(e.stateNode,t,2),e=or(e,t,2),e!==null&&(si(e,2),Li(e))}function Ge(e,t,i){if(e.tag===3)ef(e,e,i);else for(;t!==null;){if(t.tag===3){ef(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(fr===null||!fr.has(r))){e=ui(i,e),i=td(2),r=or(t,i,2),r!==null&&(id(i,r,t,e),si(r,2),Li(r));break}}t=t.return}}function Xl(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new Vv;var d=new Set;r.set(t,d)}else d=r.get(t),d===void 0&&(d=new Set,r.set(t,d));d.has(i)||(Pl=!0,d.add(i),e=Jv.bind(null,e,t,i),t.then(e,e))}function Jv(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Xe===e&&(He&i)===i&&(at===4||at===3&&(He&62914560)===He&&300>we()-Ra?(Fe&2)===0&&bs(e,0):Fl|=i,ms===He&&(ms=0)),Li(e)}function tf(e,t){t===0&&(t=kt()),e=Lr(e,t),e!==null&&(si(e,t),Li(e))}function ep(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),tf(e,i)}function tp(e,t){var i=0;switch(e.tag){case 31:case 13:var r=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(A(314))}r!==null&&r.delete(t),tf(e,i)}function ip(e,t){return xe(e,t)}var Oa=null,Cs=null,Kl=!1,Ba=!1,Zl=!1,vr=0;function Li(e){e!==Cs&&e.next===null&&(Cs===null?Oa=Cs=e:Cs=Cs.next=e),Ba=!0,Kl||(Kl=!0,sp())}function fn(e,t){if(!Zl&&Ba){Zl=!0;do for(var i=!1,r=Oa;r!==null;){if(e!==0){var d=r.pendingLanes;if(d===0)var v=0;else{var L=r.suspendedLanes,j=r.pingedLanes;v=(1<<31-vt(42|e)+1)-1,v&=d&~(L&~j),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(i=!0,af(r,v))}else v=He,v=bt(r,r===Xe?v:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(v&3)===0||It(r,v)||(i=!0,af(r,v));r=r.next}while(i);Zl=!1}}function rp(){rf()}function rf(){Ba=Kl=!1;var e=0;vr!==0&&_p()&&(e=vr);for(var t=we(),i=null,r=Oa;r!==null;){var d=r.next,v=sf(r,t);v===0?(r.next=null,i===null?Oa=d:i.next=d,d===null&&(Cs=i)):(i=r,(e!==0||(v&3)!==0)&&(Ba=!0)),r=d}mt!==0&&mt!==5||fn(e),vr!==0&&(vr=0)}function sf(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,d=e.expirationTimes,v=e.pendingLanes&-62914561;0<v;){var L=31-vt(v),j=1<<L,K=d[L];K===-1?((j&i)===0||(j&r)!==0)&&(d[L]=Nt(j,t)):K<=t&&(e.expiredLanes|=j),v&=~j}if(t=Xe,i=He,i=bt(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ee(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||It(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&Ee(r),Oi(i)){case 2:case 8:i=gt;break;case 32:i=Ze;break;case 268435456:i=Qe;break;default:i=Ze}return r=nf.bind(null,e),i=xe(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&Ee(r),e.callbackPriority=2,e.callbackNode=null,2}function nf(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ka()&&e.callbackNode!==i)return null;var r=He;return r=bt(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ud(e,r,t),sf(e,we()),e.callbackNode!=null&&e.callbackNode===i?nf.bind(null,e):null)}function af(e,t){if(ka())return null;Ud(e,t,!0)}function sp(){vp(function(){(Fe&6)!==0?xe(qe,rp):rf()})}function Ql(){if(vr===0){var e=os;e===0&&(e=Ei,Ei<<=1,(Ei&261888)===0&&(Ei=256)),vr=e}return vr}function of(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Fn(""+e)}function lf(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function np(e,t,i,r,d){if(t==="submit"&&i&&i.stateNode===d){var v=of((d[jt]||null).action),L=r.submitter;L&&(t=(t=L[jt]||null)?of(t.formAction):L.getAttribute("formAction"),t!==null&&(v=t,L=null));var j=new $n("action","action",null,r,d);e.push({event:j,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(vr!==0){var K=L?lf(d,L):new FormData(d);ml(i,{pending:!0,data:K,method:d.method,action:v},null,K)}}else typeof v=="function"&&(j.preventDefault(),K=L?lf(d,L):new FormData(d),ml(i,{pending:!0,data:K,method:d.method,action:v},v,K))},currentTarget:d}]})}}for(var Jl=0;Jl<Ho.length;Jl++){var ec=Ho[Jl],ap=ec.toLowerCase(),op=ec[0].toUpperCase()+ec.slice(1);yi(ap,"on"+op)}yi(Nu,"onAnimationEnd"),yi(Uu,"onAnimationIteration"),yi(ju,"onAnimationStart"),yi("dblclick","onDoubleClick"),yi("focusin","onFocus"),yi("focusout","onBlur"),yi(wv,"onTransitionRun"),yi(xv,"onTransitionStart"),yi(Ev,"onTransitionCancel"),yi(Pu,"onTransitionEnd"),Yr("onMouseEnter",["mouseout","mouseover"]),Yr("onMouseLeave",["mouseout","mouseover"]),Yr("onPointerEnter",["pointerout","pointerover"]),Yr("onPointerLeave",["pointerout","pointerover"]),Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Er("onBeforeInput",["compositionend","keypress","textInput","paste"]),Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _n="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(" "),lp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_n));function cf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],d=r.event;r=r.listeners;e:{var v=void 0;if(t)for(var L=r.length-1;0<=L;L--){var j=r[L],K=j.instance,se=j.currentTarget;if(j=j.listener,K!==v&&d.isPropagationStopped())break e;v=j,d.currentTarget=se;try{v(d)}catch(le){Xn(le)}d.currentTarget=null,v=K}else for(L=0;L<r.length;L++){if(j=r[L],K=j.instance,se=j.currentTarget,j=j.listener,K!==v&&d.isPropagationStopped())break e;v=j,d.currentTarget=se;try{v(d)}catch(le){Xn(le)}d.currentTarget=null,v=K}}}}function Be(e,t){var i=t[fo];i===void 0&&(i=t[fo]=new Set);var r=e+"__bubble";i.has(r)||(uf(t,e,2,!1),i.add(r))}function tc(e,t,i){var r=0;t&&(r|=4),uf(i,e,r,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function ic(e){if(!e[Ha]){e[Ha]=!0,iu.forEach(function(i){i!=="selectionchange"&&(lp.has(i)||tc(i,!1,e),tc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,tc("selectionchange",!1,t))}}function uf(e,t,i,r){switch(Uf(t)){case 2:var d=zp;break;case 8:d=Ip;break;default:d=pc}i=d.bind(null,t,i,e),d=void 0,!Co||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),r?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function rc(e,t,i,r,d){var v=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var L=r.tag;if(L===3||L===4){var j=r.stateNode.containerInfo;if(j===d)break;if(L===4)for(L=r.return;L!==null;){var K=L.tag;if((K===3||K===4)&&L.stateNode.containerInfo===d)return;L=L.return}for(;j!==null;){if(L=Wr(j),L===null)return;if(K=L.tag,K===5||K===6||K===26||K===27){r=v=L;continue e}j=j.parentNode}}r=r.return}_u(function(){var se=v,le=bo(i),de=[];e:{var ae=Fu.get(e);if(ae!==void 0){var oe=$n,pe=e;switch(e){case"keypress":if(Wn(i)===0)break e;case"keydown":case"keyup":oe=tv;break;case"focusin":pe="focus",oe=Ro;break;case"focusout":pe="blur",oe=Ro;break;case"beforeblur":case"afterblur":oe=Ro;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=pu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=sv;break;case Nu:case Uu:case ju:oe=$g;break;case Pu:oe=av;break;case"scroll":case"scrollend":oe=Pg;break;case"wheel":oe=lv;break;case"copy":case"cut":case"paste":oe=Vg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Su;break;case"toggle":case"beforetoggle":oe=uv}var Ce=(t&4)!==0,Ve=!Ce&&(e==="scroll"||e==="scrollend"),te=Ce?ae!==null?ae+"Capture":null:ae;Ce=[];for(var J=se,re;J!==null;){var ue=J;if(re=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||re===null||te===null||(ue=Hs(J,te),ue!=null&&Ce.push(gn(J,ue,re))),Ve)break;J=J.return}0<Ce.length&&(ae=new oe(ae,pe,null,i,le),de.push({event:ae,listeners:Ce}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",ae&&i!==So&&(pe=i.relatedTarget||i.fromElement)&&(Wr(pe)||pe[qr]))break e;if((oe||ae)&&(ae=le.window===le?le:(ae=le.ownerDocument)?ae.defaultView||ae.parentWindow:window,oe?(pe=i.relatedTarget||i.toElement,oe=se,pe=pe?Wr(pe):null,pe!==null&&(Ve=U(pe),Ce=pe.tag,pe!==Ve||Ce!==5&&Ce!==27&&Ce!==6)&&(pe=null)):(oe=null,pe=se),oe!==pe)){if(Ce=pu,ue="onMouseLeave",te="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Su,ue="onPointerLeave",te="onPointerEnter",J="pointer"),Ve=oe==null?ae:Bs(oe),re=pe==null?ae:Bs(pe),ae=new Ce(ue,J+"leave",oe,i,le),ae.target=Ve,ae.relatedTarget=re,ue=null,Wr(le)===se&&(Ce=new Ce(te,J+"enter",pe,i,le),Ce.target=re,Ce.relatedTarget=Ve,ue=Ce),Ve=ue,oe&&pe)t:{for(Ce=cp,te=oe,J=pe,re=0,ue=te;ue;ue=Ce(ue))re++;ue=0;for(var be=J;be;be=Ce(be))ue++;for(;0<re-ue;)te=Ce(te),re--;for(;0<ue-re;)J=Ce(J),ue--;for(;re--;){if(te===J||J!==null&&te===J.alternate){Ce=te;break t}te=Ce(te),J=Ce(J)}Ce=null}else Ce=null;oe!==null&&hf(de,ae,oe,Ce,!1),pe!==null&&Ve!==null&&hf(de,Ve,pe,Ce,!0)}}e:{if(ae=se?Bs(se):window,oe=ae.nodeName&&ae.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ae.type==="file")var Ue=Au;else if(Eu(ae))if(Du)Ue=bv;else{Ue=mv;var me=pv}else oe=ae.nodeName,!oe||oe.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?se&&mo(se.elementType)&&(Ue=Au):Ue=Sv;if(Ue&&(Ue=Ue(e,se))){Ru(de,Ue,i,le);break e}me&&me(e,ae,se),e==="focusout"&&se&&ae.type==="number"&&se.memoizedProps.value!=null&&po(ae,"number",ae.value)}switch(me=se?Bs(se):window,e){case"focusin":(Eu(me)||me.contentEditable==="true")&&(Jr=me,ko=se,qs=null);break;case"focusout":qs=ko=Jr=null;break;case"mousedown":Oo=!0;break;case"contextmenu":case"mouseup":case"dragend":Oo=!1,zu(de,i,le);break;case"selectionchange":if(Cv)break;case"keydown":case"keyup":zu(de,i,le)}var Me;if(Do)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Qr?wu(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(bu&&i.locale!=="ko"&&(Qr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Qr&&(Me=gu()):(er=le,wo="value"in er?er.value:er.textContent,Qr=!0)),me=za(se,ze),0<me.length&&(ze=new mu(ze,e,null,i,le),de.push({event:ze,listeners:me}),Me?ze.data=Me:(Me=xu(i),Me!==null&&(ze.data=Me)))),(Me=dv?fv(e,i):_v(e,i))&&(ze=za(se,"onBeforeInput"),0<ze.length&&(me=new mu("onBeforeInput","beforeinput",null,i,le),de.push({event:me,listeners:ze}),me.data=Me)),np(de,e,se,i,le)}cf(de,t)})}function gn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function za(e,t){for(var i=t+"Capture",r=[];e!==null;){var d=e,v=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||v===null||(d=Hs(e,i),d!=null&&r.unshift(gn(e,d,v)),d=Hs(e,t),d!=null&&r.push(gn(e,d,v))),e.tag===3)return r;e=e.return}return[]}function cp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function hf(e,t,i,r,d){for(var v=t._reactName,L=[];i!==null&&i!==r;){var j=i,K=j.alternate,se=j.stateNode;if(j=j.tag,K!==null&&K===r)break;j!==5&&j!==26&&j!==27||se===null||(K=se,d?(se=Hs(i,v),se!=null&&L.unshift(gn(i,se,K))):d||(se=Hs(i,v),se!=null&&L.push(gn(i,se,K)))),i=i.return}L.length!==0&&e.push({event:t,listeners:L})}var up=/\r\n?/g,hp=/\u0000|\uFFFD/g;function df(e){return(typeof e=="string"?e:""+e).replace(up,`
49
+ `).replace(hp,"")}function ff(e,t){return t=df(t),df(e)===t}function Ye(e,t,i,r,d,v){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Xr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Xr(e,""+r);break;case"className":jn(e,"class",r);break;case"tabIndex":jn(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":jn(e,i,r);break;case"style":du(e,r,v);break;case"data":if(t!=="object"){jn(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Fn(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"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 v=="function"&&(i==="formAction"?(t!=="input"&&Ye(e,t,"name",d.name,d,null),Ye(e,t,"formEncType",d.formEncType,d,null),Ye(e,t,"formMethod",d.formMethod,d,null),Ye(e,t,"formTarget",d.formTarget,d,null)):(Ye(e,t,"encType",d.encType,d,null),Ye(e,t,"method",d.method,d,null),Ye(e,t,"target",d.target,d,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Fn(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=Hi);break;case"onScroll":r!=null&&Be("scroll",e);break;case"onScrollEnd":r!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(A(61));if(i=r.__html,i!=null){if(d.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=Fn(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":Be("beforetoggle",e),Be("toggle",e),Un(e,"popover",r);break;case"xlinkActuate":Bi(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Bi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Bi(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Bi(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Bi(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Bi(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Un(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ug.get(i)||i,Un(e,i,r))}}function sc(e,t,i,r,d,v){switch(i){case"style":du(e,r,v);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(A(61));if(i=r.__html,i!=null){if(d.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"children":typeof r=="string"?Xr(e,r):(typeof r=="number"||typeof r=="bigint")&&Xr(e,""+r);break;case"onScroll":r!=null&&Be("scroll",e);break;case"onScrollEnd":r!=null&&Be("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ru.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),t=i.slice(2,d?i.length-7:void 0),v=e[jt]||null,v=v!=null?v[i]:null,typeof v=="function"&&e.removeEventListener(t,v,d),typeof r=="function")){typeof v!="function"&&v!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,d);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):Un(e,i,r)}}}function Tt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var r=!1,d=!1,v;for(v in i)if(i.hasOwnProperty(v)){var L=i[v];if(L!=null)switch(v){case"src":r=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ye(e,t,v,L,i,null)}}d&&Ye(e,t,"srcSet",i.srcSet,i,null),r&&Ye(e,t,"src",i.src,i,null);return;case"input":Be("invalid",e);var j=v=L=d=null,K=null,se=null;for(r in i)if(i.hasOwnProperty(r)){var le=i[r];if(le!=null)switch(r){case"name":d=le;break;case"type":L=le;break;case"checked":K=le;break;case"defaultChecked":se=le;break;case"value":v=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(A(137,t));break;default:Ye(e,t,r,le,i,null)}}lu(e,v,j,K,se,L,d,!1);return;case"select":Be("invalid",e),r=L=v=null;for(d in i)if(i.hasOwnProperty(d)&&(j=i[d],j!=null))switch(d){case"value":v=j;break;case"defaultValue":L=j;break;case"multiple":r=j;default:Ye(e,t,d,j,i,null)}t=v,i=L,e.multiple=!!r,t!=null?Vr(e,!!r,t,!1):i!=null&&Vr(e,!!r,i,!0);return;case"textarea":Be("invalid",e),v=d=r=null;for(L in i)if(i.hasOwnProperty(L)&&(j=i[L],j!=null))switch(L){case"value":r=j;break;case"defaultValue":d=j;break;case"children":v=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(A(91));break;default:Ye(e,t,L,j,i,null)}uu(e,r,d,v);return;case"option":for(K in i)if(i.hasOwnProperty(K)&&(r=i[K],r!=null))switch(K){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ye(e,t,K,r,i,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(r=0;r<_n.length;r++)Be(_n[r],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in i)if(i.hasOwnProperty(se)&&(r=i[se],r!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ye(e,t,se,r,i,null)}return;default:if(mo(t)){for(le in i)i.hasOwnProperty(le)&&(r=i[le],r!==void 0&&sc(e,t,le,r,i,void 0));return}}for(j in i)i.hasOwnProperty(j)&&(r=i[j],r!=null&&Ye(e,t,j,r,i,null))}function dp(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,v=null,L=null,j=null,K=null,se=null,le=null;for(oe in i){var de=i[oe];if(i.hasOwnProperty(oe)&&de!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":K=de;default:r.hasOwnProperty(oe)||Ye(e,t,oe,null,r,de)}}for(var ae in r){var oe=r[ae];if(de=i[ae],r.hasOwnProperty(ae)&&(oe!=null||de!=null))switch(ae){case"type":v=oe;break;case"name":d=oe;break;case"checked":se=oe;break;case"defaultChecked":le=oe;break;case"value":L=oe;break;case"defaultValue":j=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(A(137,t));break;default:oe!==de&&Ye(e,t,ae,oe,r,de)}}vo(e,L,j,K,se,le,v,d);return;case"select":oe=L=j=ae=null;for(v in i)if(K=i[v],i.hasOwnProperty(v)&&K!=null)switch(v){case"value":break;case"multiple":oe=K;default:r.hasOwnProperty(v)||Ye(e,t,v,null,r,K)}for(d in r)if(v=r[d],K=i[d],r.hasOwnProperty(d)&&(v!=null||K!=null))switch(d){case"value":ae=v;break;case"defaultValue":j=v;break;case"multiple":L=v;default:v!==K&&Ye(e,t,d,v,r,K)}t=j,i=L,r=oe,ae!=null?Vr(e,!!i,ae,!1):!!r!=!!i&&(t!=null?Vr(e,!!i,t,!0):Vr(e,!!i,i?[]:"",!1));return;case"textarea":oe=ae=null;for(j in i)if(d=i[j],i.hasOwnProperty(j)&&d!=null&&!r.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ye(e,t,j,null,r,d)}for(L in r)if(d=r[L],v=i[L],r.hasOwnProperty(L)&&(d!=null||v!=null))switch(L){case"value":ae=d;break;case"defaultValue":oe=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(A(91));break;default:d!==v&&Ye(e,t,L,d,r,v)}cu(e,ae,oe);return;case"option":for(var pe in i)if(ae=i[pe],i.hasOwnProperty(pe)&&ae!=null&&!r.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:Ye(e,t,pe,null,r,ae)}for(K in r)if(ae=r[K],oe=i[K],r.hasOwnProperty(K)&&ae!==oe&&(ae!=null||oe!=null))switch(K){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Ye(e,t,K,ae,r,oe)}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 Ce in i)ae=i[Ce],i.hasOwnProperty(Ce)&&ae!=null&&!r.hasOwnProperty(Ce)&&Ye(e,t,Ce,null,r,ae);for(se in r)if(ae=r[se],oe=i[se],r.hasOwnProperty(se)&&ae!==oe&&(ae!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(A(137,t));break;default:Ye(e,t,se,ae,r,oe)}return;default:if(mo(t)){for(var Ve in i)ae=i[Ve],i.hasOwnProperty(Ve)&&ae!==void 0&&!r.hasOwnProperty(Ve)&&sc(e,t,Ve,void 0,r,ae);for(le in r)ae=r[le],oe=i[le],!r.hasOwnProperty(le)||ae===oe||ae===void 0&&oe===void 0||sc(e,t,le,ae,r,oe);return}}for(var te in i)ae=i[te],i.hasOwnProperty(te)&&ae!=null&&!r.hasOwnProperty(te)&&Ye(e,t,te,null,r,ae);for(de in r)ae=r[de],oe=i[de],!r.hasOwnProperty(de)||ae===oe||ae==null&&oe==null||Ye(e,t,de,ae,r,oe)}function _f(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),r=0;r<i.length;r++){var d=i[r],v=d.transferSize,L=d.initiatorType,j=d.duration;if(v&&j&&_f(L)){for(L=0,j=d.responseEnd,r+=1;r<i.length;r++){var K=i[r],se=K.startTime;if(se>j)break;var le=K.transferSize,de=K.initiatorType;le&&_f(de)&&(K=K.responseEnd,L+=le*(K<j?1:(j-se)/(K-se)))}if(--r,t+=8*(v+L)/(d.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nc=null,ac=null;function Ia(e){return e.nodeType===9?e:e.ownerDocument}function gf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var lc=null;function _p(){var e=window.event;return e&&e.type==="popstate"?e===lc?!1:(lc=e,!0):(lc=null,!1)}var pf=typeof setTimeout=="function"?setTimeout:void 0,gp=typeof clearTimeout=="function"?clearTimeout:void 0,mf=typeof Promise=="function"?Promise:void 0,vp=typeof queueMicrotask=="function"?queueMicrotask:typeof mf<"u"?function(e){return mf.resolve(null).then(e).catch(pp)}:pf;function pp(e){setTimeout(function(){throw e})}function pr(e){return e==="head"}function Sf(e,t){var i=t,r=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(r===0){e.removeChild(d),Rs(t);return}r--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")r++;else if(i==="html")vn(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,vn(i);for(var v=i.firstChild;v;){var L=v.nextSibling,j=v.nodeName;v[Os]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&v.rel.toLowerCase()==="stylesheet"||i.removeChild(v),v=L}}else i==="body"&&vn(e.ownerDocument.body);i=d}while(i);Rs(t)}function bf(e,t){var i=e;e=0;do{var r=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),r&&r.nodeType===8)if(i=r.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=r}while(i)}function cc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":cc(i),_o(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function mp(e,t,i,r){for(;e.nodeType===1;){var d=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Os])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(v=e.getAttribute("rel"),v==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(v!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(v=e.getAttribute("src"),(v!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&v&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var v=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===v)return e}else return e;if(e=gi(e.nextSibling),e===null)break}return null}function Sp(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=gi(e.nextSibling),e===null))return null;return e}function yf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gi(e.nextSibling),e===null))return null;return e}function uc(e){return e.data==="$?"||e.data==="$~"}function hc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function bp(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function gi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var dc=null;function Cf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return gi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function wf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function xf(e,t,i){switch(t=Ia(i),e){case"html":if(e=t.documentElement,!e)throw Error(A(452));return e;case"head":if(e=t.head,!e)throw Error(A(453));return e;case"body":if(e=t.body,!e)throw Error(A(454));return e;default:throw Error(A(451))}}function vn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_o(e)}var vi=new Map,Ef=new Set;function Na(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Zi=$.d;$.d={f:yp,r:Cp,D:wp,C:xp,L:Ep,m:Rp,X:Dp,S:Ap,M:Lp};function yp(){var e=Zi.f(),t=La();return e||t}function Cp(e){var t=Gr(e);t!==null&&t.tag===5&&t.type==="form"?Ph(t):Zi.r(e)}var ws=typeof document>"u"?null:document;function Rf(e,t,i){var r=ws;if(r&&typeof t=="string"&&t){var d=li(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),Ef.has(d)||(Ef.add(d),e={rel:e,crossOrigin:i,href:t},r.querySelector(d)===null&&(t=r.createElement("link"),Tt(t,"link",e),yt(t),r.head.appendChild(t)))}}function wp(e){Zi.D(e),Rf("dns-prefetch",e,null)}function xp(e,t){Zi.C(e,t),Rf("preconnect",e,t)}function Ep(e,t,i){Zi.L(e,t,i);var r=ws;if(r&&e&&t){var d='link[rel="preload"][as="'+li(t)+'"]';t==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+li(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+li(i.imageSizes)+'"]')):d+='[href="'+li(e)+'"]';var v=d;switch(t){case"style":v=xs(e);break;case"script":v=Es(e)}vi.has(v)||(e=o({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),vi.set(v,e),r.querySelector(d)!==null||t==="style"&&r.querySelector(pn(v))||t==="script"&&r.querySelector(mn(v))||(t=r.createElement("link"),Tt(t,"link",e),yt(t),r.head.appendChild(t)))}}function Rp(e,t){Zi.m(e,t);var i=ws;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+li(r)+'"][href="'+li(e)+'"]',v=d;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Es(e)}if(!vi.has(v)&&(e=o({rel:"modulepreload",href:e},t),vi.set(v,e),i.querySelector(d)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(mn(v)))return}r=i.createElement("link"),Tt(r,"link",e),yt(r),i.head.appendChild(r)}}}function Ap(e,t,i){Zi.S(e,t,i);var r=ws;if(r&&e){var d=$r(r).hoistableStyles,v=xs(e);t=t||"default";var L=d.get(v);if(!L){var j={loading:0,preload:null};if(L=r.querySelector(pn(v)))j.loading=5;else{e=o({rel:"stylesheet",href:e,"data-precedence":t},i),(i=vi.get(v))&&fc(e,i);var K=L=r.createElement("link");yt(K),Tt(K,"link",e),K._p=new Promise(function(se,le){K.onload=se,K.onerror=le}),K.addEventListener("load",function(){j.loading|=1}),K.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ua(L,t,r)}L={type:"stylesheet",instance:L,count:1,state:j},d.set(v,L)}}}function Dp(e,t){Zi.X(e,t);var i=ws;if(i&&e){var r=$r(i).hoistableScripts,d=Es(e),v=r.get(d);v||(v=i.querySelector(mn(d)),v||(e=o({src:e,async:!0},t),(t=vi.get(d))&&_c(e,t),v=i.createElement("script"),yt(v),Tt(v,"link",e),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},r.set(d,v))}}function Lp(e,t){Zi.M(e,t);var i=ws;if(i&&e){var r=$r(i).hoistableScripts,d=Es(e),v=r.get(d);v||(v=i.querySelector(mn(d)),v||(e=o({src:e,async:!0,type:"module"},t),(t=vi.get(d))&&_c(e,t),v=i.createElement("script"),yt(v),Tt(v,"link",e),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},r.set(d,v))}}function Af(e,t,i,r){var d=(d=ce.current)?Na(d):null;if(!d)throw Error(A(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=xs(i.href),i=$r(d).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=xs(i.href);var v=$r(d).hoistableStyles,L=v.get(e);if(L||(d=d.ownerDocument||d,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(e,L),(v=d.querySelector(pn(e)))&&!v._p&&(L.instance=v,L.state.loading=5),vi.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},vi.set(e,i),v||Tp(d,e,i,L.state))),t&&r===null)throw Error(A(528,""));return L}if(t&&r!==null)throw Error(A(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Es(i),i=$r(d).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(A(444,e))}}function xs(e){return'href="'+li(e)+'"'}function pn(e){return'link[rel="stylesheet"]['+e+"]"}function Df(e){return o({},e,{"data-precedence":e.precedence,precedence:null})}function Tp(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Tt(t,"link",i),yt(t),e.head.appendChild(t))}function Es(e){return'[src="'+li(e)+'"]'}function mn(e){return"script[async]"+e}function Lf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+li(i.href)+'"]');if(r)return t.instance=r,yt(r),r;var d=o({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),yt(r),Tt(r,"style",d),Ua(r,i.precedence,e),t.instance=r;case"stylesheet":d=xs(i.href);var v=e.querySelector(pn(d));if(v)return t.state.loading|=4,t.instance=v,yt(v),v;r=Df(i),(d=vi.get(d))&&fc(r,d),v=(e.ownerDocument||e).createElement("link"),yt(v);var L=v;return L._p=new Promise(function(j,K){L.onload=j,L.onerror=K}),Tt(v,"link",r),t.state.loading|=4,Ua(v,i.precedence,e),t.instance=v;case"script":return v=Es(i.src),(d=e.querySelector(mn(v)))?(t.instance=d,yt(d),d):(r=i,(d=vi.get(v))&&(r=o({},i),_c(r,d)),e=e.ownerDocument||e,d=e.createElement("script"),yt(d),Tt(d,"link",r),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(A(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ua(r,i.precedence,e));return t.instance}function Ua(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=r.length?r[r.length-1]:null,v=d,L=0;L<r.length;L++){var j=r[L];if(j.dataset.precedence===t)v=j;else if(v!==d)break}v?v.parentNode.insertBefore(e,v.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ja=null;function Tf(e,t,i){if(ja===null){var r=new Map,d=ja=new Map;d.set(i,r)}else d=ja,r=d.get(i),r||(r=new Map,d.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),d=0;d<i.length;d++){var v=i[d];if(!(v[Os]||v[Rt]||e==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var L=v.getAttribute(t)||"";L=e+L;var j=r.get(L);j?j.push(v):r.set(L,[v])}}return r}function Mf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Mp(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function kf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kp(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=xs(r.href),v=t.querySelector(pn(d));if(v){t=v._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pa.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=v,yt(v);return}v=t.ownerDocument||t,r=Df(r),(d=vi.get(d))&&fc(r,d),v=v.createElement("link"),yt(v);var L=v;L._p=new Promise(function(j,K){L.onload=j,L.onerror=K}),Tt(v,"link",r),i.instance=v}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Pa.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var gc=0;function Op(e,t){return e.stylesheets&&e.count===0&&qa(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var r=setTimeout(function(){if(e.stylesheets&&qa(e,e.stylesheets),e.unsuspend){var v=e.unsuspend;e.unsuspend=null,v()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*fp());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qa(e,e.stylesheets),e.unsuspend)){var v=e.unsuspend;e.unsuspend=null,v()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(d)}}:null}function Pa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qa(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fa=null;function qa(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fa=new Map,t.forEach(Bp,e),Fa=null,Pa.call(e))}function Bp(e,t){if(!(t.state.loading&4)){var i=Fa.get(e);if(i)var r=i.get(null);else{i=new Map,Fa.set(e,i);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<d.length;v++){var L=d[v];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(i.set(L.dataset.precedence,L),r=L)}r&&i.set(null,r)}d=t.instance,L=d.getAttribute("data-precedence"),v=i.get(L)||r,v===r&&i.set(null,d),i.set(L,d),this.count++,r=Pa.bind(this),d.addEventListener("load",r),d.addEventListener("error",r),v?v.parentNode.insertBefore(d,v.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Sn={$$typeof:c,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function Hp(e,t,i,r,d,v,L,j,K){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.hiddenUpdates=Ut(null),this.identifierPrefix=r,this.onUncaughtError=d,this.onCaughtError=v,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function Of(e,t,i,r,d,v,L,j,K,se,le,de){return e=new Hp(e,t,i,L,K,se,le,de,j),t=1,v===!0&&(t|=24),v=Qt(3,null,null,t),e.current=v,v.stateNode=e,t=Vo(),t.refCount++,e.pooledCache=t,t.refCount++,v.memoizedState={element:r,isDehydrated:i,cache:t},Qo(v),e}function Bf(e){return e?(e=is,e):is}function Hf(e,t,i,r,d,v){d=Bf(d),r.context===null?r.context=d:r.pendingContext=d,r=ar(t),r.payload={element:i},v=v===void 0?null:v,v!==null&&(r.callback=v),i=or(e,r,t),i!==null&&($t(i,e,t),Ks(i,e,t))}function zf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function vc(e,t){zf(e,t),(e=e.alternate)&&zf(e,t)}function If(e){if(e.tag===13||e.tag===31){var t=Lr(e,67108864);t!==null&&$t(t,e,67108864),vc(e,67108864)}}function Nf(e){if(e.tag===13||e.tag===31){var t=ri();t=ki(t);var i=Lr(e,t);i!==null&&$t(i,e,t),vc(e,t)}}var Wa=!0;function zp(e,t,i,r){var d=G.T;G.T=null;var v=$.p;try{$.p=2,pc(e,t,i,r)}finally{$.p=v,G.T=d}}function Ip(e,t,i,r){var d=G.T;G.T=null;var v=$.p;try{$.p=8,pc(e,t,i,r)}finally{$.p=v,G.T=d}}function pc(e,t,i,r){if(Wa){var d=mc(r);if(d===null)rc(e,t,r,Ga,i),jf(e,r);else if(Up(d,e,t,i,r))r.stopPropagation();else if(jf(e,r),t&4&&-1<Np.indexOf(e)){for(;d!==null;){var v=Gr(d);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var L=st(v.pendingLanes);if(L!==0){var j=v;for(j.pendingLanes|=2,j.entangledLanes|=2;L;){var K=1<<31-vt(L);j.entanglements[1]|=K,L&=~K}Li(v),(Fe&6)===0&&(Aa=we()+500,fn(0))}}break;case 31:case 13:j=Lr(v,2),j!==null&&$t(j,v,2),La(),vc(v,2)}if(v=mc(r),v===null&&rc(e,t,r,Ga,i),v===d)break;d=v}d!==null&&r.stopPropagation()}else rc(e,t,r,null,i)}}function mc(e){return e=bo(e),Sc(e)}var Ga=null;function Sc(e){if(Ga=null,e=Wr(e),e!==null){var t=U(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=B(t),e!==null)return e;e=null}else if(i===31){if(e=s(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ga=e,null}function Uf(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ke()){case qe:return 2;case gt:return 8;case Ze:case ct:return 32;case Qe:return 268435456;default:return 32}default:return 32}}var bc=!1,mr=null,Sr=null,br=null,bn=new Map,yn=new Map,yr=[],Np="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 jf(e,t){switch(e){case"focusin":case"focusout":mr=null;break;case"dragenter":case"dragleave":Sr=null;break;case"mouseover":case"mouseout":br=null;break;case"pointerover":case"pointerout":bn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yn.delete(t.pointerId)}}function Cn(e,t,i,r,d,v){return e===null||e.nativeEvent!==v?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:v,targetContainers:[d]},t!==null&&(t=Gr(t),t!==null&&If(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Up(e,t,i,r,d){switch(t){case"focusin":return mr=Cn(mr,e,t,i,r,d),!0;case"dragenter":return Sr=Cn(Sr,e,t,i,r,d),!0;case"mouseover":return br=Cn(br,e,t,i,r,d),!0;case"pointerover":var v=d.pointerId;return bn.set(v,Cn(bn.get(v)||null,e,t,i,r,d)),!0;case"gotpointercapture":return v=d.pointerId,yn.set(v,Cn(yn.get(v)||null,e,t,i,r,d)),!0}return!1}function Pf(e){var t=Wr(e.target);if(t!==null){var i=U(t);if(i!==null){if(t=i.tag,t===13){if(t=B(i),t!==null){e.blockedOn=t,Ji(e.priority,function(){Nf(i)});return}}else if(t===31){if(t=s(i),t!==null){e.blockedOn=t,Ji(e.priority,function(){Nf(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $a(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=mc(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);So=r,i.target.dispatchEvent(r),So=null}else return t=Gr(i),t!==null&&If(t),e.blockedOn=i,!1;t.shift()}return!0}function Ff(e,t,i){$a(e)&&i.delete(t)}function jp(){bc=!1,mr!==null&&$a(mr)&&(mr=null),Sr!==null&&$a(Sr)&&(Sr=null),br!==null&&$a(br)&&(br=null),bn.forEach(Ff),yn.forEach(Ff)}function Ya(e,t){e.blockedOn===t&&(e.blockedOn=null,bc||(bc=!0,f.unstable_scheduleCallback(f.unstable_NormalPriority,jp)))}var Va=null;function qf(e){Va!==e&&(Va=e,f.unstable_scheduleCallback(f.unstable_NormalPriority,function(){Va===e&&(Va=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],d=e[t+2];if(typeof r!="function"){if(Sc(r||i)===null)continue;break}var v=Gr(i);v!==null&&(e.splice(t,3),t-=3,ml(v,{pending:!0,data:d,method:i.method,action:r},r,d))}}))}function Rs(e){function t(K){return Ya(K,e)}mr!==null&&Ya(mr,e),Sr!==null&&Ya(Sr,e),br!==null&&Ya(br,e),bn.forEach(t),yn.forEach(t);for(var i=0;i<yr.length;i++){var r=yr[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<yr.length&&(i=yr[0],i.blockedOn===null);)Pf(i),i.blockedOn===null&&yr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var d=i[r],v=i[r+1],L=d[jt]||null;if(typeof v=="function")L||qf(i);else if(L){var j=null;if(v&&v.hasAttribute("formAction")){if(d=v,L=v[jt]||null)j=L.formAction;else if(Sc(d)!==null)continue}else j=L.action;typeof j=="function"?i[r+1]=j:(i.splice(r,3),r-=3),qf(i)}}}function Wf(){function e(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(L){return d=L})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),r||setTimeout(i,20)}function i(){if(!r&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function yc(e){this._internalRoot=e}Xa.prototype.render=yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));var i=t.current,r=ri();Hf(i,r,e,t,null,null)},Xa.prototype.unmount=yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hf(e.current,2,null,e,null,null),La(),t[qr]=null}};function Xa(e){this._internalRoot=e}Xa.prototype.unstable_scheduleHydration=function(e){if(e){var t=bi();e={blockedOn:null,target:e,priority:t};for(var i=0;i<yr.length&&t!==0&&t<yr[i].priority;i++);yr.splice(i,0,e),i===0&&Pf(e)}};var Gf=C.version;if(Gf!=="19.2.4")throw Error(A(527,Gf,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=h(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Pp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ka=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ka.isDisabled&&Ka.supportsFiber)try{Xt=Ka.inject(Pp),ut=Ka}catch{}}return xn.createRoot=function(e,t){if(!z(e))throw Error(A(299));var i=!1,r="",d=Zh,v=Qh,L=Jh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(v=t.onCaughtError),t.onRecoverableError!==void 0&&(L=t.onRecoverableError)),t=Of(e,1,!1,null,null,i,r,null,d,v,L,Wf),e[qr]=t.current,ic(e),new yc(t)},xn.hydrateRoot=function(e,t,i){if(!z(e))throw Error(A(299));var r=!1,d="",v=Zh,L=Qh,j=Jh,K=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(L=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError),i.formState!==void 0&&(K=i.formState)),t=Of(e,1,!0,t,i??null,r,d,K,v,L,j,Wf),t.context=Bf(null),i=t.current,r=ri(),r=ki(r),d=ar(r),d.callback=null,or(i,d,r),i=r,t.current.lanes=i,si(t,i),Li(t),e[qr]=t.current,ic(e),new Xa(t)},xn.version="19.2.4",xn}var t_;function Zp(){if(t_)return xc.exports;t_=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(C){console.error(C)}}return f(),xc.exports=Kp(),xc.exports}var Qp=Zp();const i_=f=>{let C;const D=new Set,A=(h,g)=>{const o=typeof h=="function"?h(C):h;if(!Object.is(o,C)){const p=C;C=g??(typeof o!="object"||o===null)?o:Object.assign({},C,o),D.forEach(m=>m(C,p))}},z=()=>C,s={setState:A,getState:z,getInitialState:()=>u,subscribe:h=>(D.add(h),()=>D.delete(h))},u=C=f(A,z,s);return s},Jp=(f=>f?i_(f):i_),e0=f=>f;function t0(f,C=e0){const D=xt.useSyncExternalStore(f.subscribe,xt.useCallback(()=>C(f.getState()),[f,C]),xt.useCallback(()=>C(f.getInitialState()),[f,C]));return xt.useDebugValue(D),D}const r_=f=>{const C=Jp(f),D=A=>t0(C,A);return Object.assign(D,C),D},j_=(f=>f?r_(f):r_),rt=j_(f=>({isAuthenticated:!1,isCheckingAuth:!0,setAuthenticated:C=>f({isAuthenticated:C,isCheckingAuth:!1}),setCheckingAuth:C=>f({isCheckingAuth:C}),serverAvailable:null,setServerAvailable:C=>f({serverAvailable:C}),connectionStatus:"disconnected",instanceConnectionStatus:{},setConnectionStatus:C=>f({connectionStatus:C}),setInstanceConnectionStatus:(C,D)=>f(A=>({instanceConnectionStatus:{...A.instanceConnectionStatus,[C]:D}})),removeInstanceConnectionStatus:C=>f(D=>{const{[C]:A,...z}=D.instanceConnectionStatus;return{instanceConnectionStatus:z}}),sessionStatus:"idle",setSessionStatus:C=>f({sessionStatus:C}),cachedToken:null,setCachedToken:C=>f({cachedToken:C}),ipChangeInfo:null,setIpChangeInfo:C=>f({ipChangeInfo:C}),toastMessage:null,showToast:C=>f({toastMessage:C}),hideToast:()=>f({toastMessage:null})})),Hn="/api";async function xr(f){const C=await fetch(`${Hn}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:f})});if(C.status===429)throw new Error("Too many attempts. Try again later.");return C.ok}async function i0(){const f=await fetch(`${Hn}/status`,{credentials:"include"});if(f.status===401)throw new Error("Unauthorized");return f.json()}async function P_(){const f=await fetch(`${Hn}/config`,{credentials:"include"});if(f.status===401)throw new Error("Unauthorized");if(!f.ok)throw new Error(`Config fetch failed: ${f.status}`);return f.json()}async function r0(f){const C=await fetch(`${Hn}/config`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(f)});if(C.status===401)throw new Error("Unauthorized");return C.ok}async function s0(f,C){const D=await fetch(`${Hn}/config/notifications/${f}/enabled`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({enabled:C})});if(D.status===401)throw new Error("Unauthorized");if(!D.ok){const A=await D.json().catch(()=>({}));throw new Error(A.error||`Failed to update channel status: ${D.status}`)}return D.json()}const $c="claude_remote_token";function F_(f){sessionStorage.setItem($c,f)}function Tn(){return sessionStorage.getItem($c)}function q_(){sessionStorage.removeItem($c)}function n0(){const[f,C]=W.useState(null),[D,A]=W.useState(!1),z=rt(u=>u.setAuthenticated),U=rt(u=>u.setCachedToken),B=W.useCallback(async u=>{C(null),A(!0);try{await xr(u)?(z(!0),U(u),F_(u)):C("Invalid token")}catch(h){C(h instanceof Error?h.message:"Authentication failed")}finally{A(!1)}},[z,U]),s=W.useCallback(()=>{z(!1),U(null),q_()},[z,U]);return{login:B,logout:s,error:f,loading:D}}function a0(){const[f,C]=W.useState(""),[D,A]=W.useState(!1),{login:z,error:U,loading:B}=n0();W.useEffect(()=>{const h=sessionStorage.getItem("prefill_token");h&&(C(h),sessionStorage.removeItem("prefill_token"))},[]);const s=h=>{h.preventDefault(),f.trim()&&z(f.trim())},u=h=>{h.key==="Enter"&&f.trim()&&z(f.trim())};return V.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--bg-primary)"},children:V.jsxs("form",{onSubmit:s,autoComplete:"off",style:{width:"100%",maxWidth:400,display:"flex",flexDirection:"column",gap:16},children:[V.jsxs("div",{style:{textAlign:"center",marginBottom:8},children:[V.jsx("h1",{style:{fontSize:24,fontWeight:700,marginBottom:8},children:"Claude Code Remote"}),V.jsx("p",{style:{fontSize:14,color:"var(--text-secondary)"},children:"Enter the token shown on your PC terminal"})]}),V.jsxs("div",{style:{position:"relative"},children:[V.jsx("input",{type:"text",value:f,onChange:h=>C(h.target.value),onKeyDown:u,placeholder:"Paste token here…","aria-label":"Authentication token",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",style:{width:"100%",height:48,padding:"0 48px 0 16px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",fontSize:16,lineHeight:"48px",boxSizing:"border-box",WebkitTextSecurity:D?"none":"disc"}}),V.jsx("button",{type:"button",onClick:()=>A(!D),"aria-label":D?"Hide token":"Show token",style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",padding:8,cursor:"pointer",color:"var(--text-secondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:D?V.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[V.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),V.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):V.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[V.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),V.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),U&&V.jsx("div",{style:{color:"var(--status-error)",fontSize:14,textAlign:"center"},children:U}),V.jsx("button",{type:"submit",disabled:B||!f.trim(),style:{height:48,borderRadius:8,background:f.trim()?"var(--status-running)":"var(--bg-tertiary)",color:f.trim()?"#fff":"var(--text-muted)",fontWeight:600,fontSize:16,transition:"background 0.15s",opacity:B?.7:1},children:B?"Authenticating…":"Connect"})]})})}const Yt=j_(f=>({instances:[],activeInstanceId:null,setInstances:C=>f({instances:C}),setActiveInstanceId:C=>f({activeInstanceId:C})})),o0=[{label:"Esc",data:"\x1B",enabled:!0},{label:"Enter",data:"\r",enabled:!0},{label:"Tab",data:" ",enabled:!0},{label:"↑",data:"\x1B[A",enabled:!0},{label:"↓",data:"\x1B[B",enabled:!0},{label:"←",data:"\x1B[D",enabled:!0},{label:"→",data:"\x1B[C",enabled:!0},{label:"S-Tab",data:"\x1B[Z",enabled:!0,desc:"Shift+Tab, 向前切换"},{label:"Ctrl+O",data:"",enabled:!0},{label:"Ctrl+E",data:"",enabled:!0}],l0=[{label:"/clear",command:"/clear",enabled:!0},{label:"/compact",command:"/compact",enabled:!0},{label:"/resume",command:"/resume",enabled:!0},{label:"/stats",command:"/stats",enabled:!0},{label:"/exit",command:"/exit",enabled:!0},{label:"/rename",command:"/rename",enabled:!0,autoSend:!1}],c0={dingtalk:{displayName:"DingTalk",icon:"dingtalk",description:"Send notifications to DingTalk group via robot webhook",helpUrl:"https://open.dingtalk.com/document/robots/custom-robot-access",implemented:!0},email:{displayName:"Email",icon:"email",description:"Send notifications via email",implemented:!1},slack:{displayName:"Slack",icon:"slack",description:"Send notifications to Slack channel via webhook",implemented:!1},wechat_work:{displayName:"WeChat",icon:"wechat-work",description:"Send notifications to WeChat via Server酱³",helpUrl:"https://sct.ftqq.com/sendkey",implemented:!0}},W_=/^https:\/\/oapi\.dingtalk\.com\/robot\/send\?access_token=/,G_=/^SCT[a-zA-Z0-9]{10,}$/,$_=o0.map(({enabled:f,desc:C,...D})=>D),Y_=l0.map(({enabled:f,desc:C,...D})=>D);function s_(f){return f.filter(C=>C.enabled).map(({enabled:C,desc:D,...A})=>A)}let V_=0;const Nc=new Set;function u0(f){return Nc.add(f),()=>Nc.delete(f)}function h0(){return V_}function X_(){V_++,Nc.forEach(f=>f())}function d0(){const[f,C]=W.useState(null),[D,A]=W.useState(null),[z,U]=W.useState(!0),B=W.useSyncExternalStore(u0,h0),s=W.useCallback(async()=>{U(!0);try{const o=await P_();C(o.config),A(o.configPath)}catch{C(null)}finally{U(!1)}},[]);W.useEffect(()=>{s()},[s,B]);const u=f!=null&&f.shortcuts?s_(f.shortcuts):$_,h=f!=null&&f.commands?s_(f.commands):Y_,g=W.useCallback(()=>{X_()},[]);return{shortcuts:u,commands:h,configPath:D,isLoading:z,reload:g}}var En=U_();function f0(){for(var f=arguments.length,C=new Array(f),D=0;D<f;D++)C[D]=arguments[D];return W.useMemo(()=>A=>{C.forEach(z=>z(A))},C)}const lo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ls(f){const C=Object.prototype.toString.call(f);return C==="[object Window]"||C==="[object global]"}function Yc(f){return"nodeType"in f}function Vt(f){var C,D;return f?Ls(f)?f:Yc(f)&&(C=(D=f.ownerDocument)==null?void 0:D.defaultView)!=null?C:window:window}function Vc(f){const{Document:C}=Vt(f);return f instanceof C}function zn(f){return Ls(f)?!1:f instanceof Vt(f).HTMLElement}function K_(f){return f instanceof Vt(f).SVGElement}function Ts(f){return f?Ls(f)?f.document:Yc(f)?Vc(f)?f:zn(f)||K_(f)?f.ownerDocument:document:document:document}const Ti=lo?W.useLayoutEffect:W.useEffect;function Xc(f){const C=W.useRef(f);return Ti(()=>{C.current=f}),W.useCallback(function(){for(var D=arguments.length,A=new Array(D),z=0;z<D;z++)A[z]=arguments[z];return C.current==null?void 0:C.current(...A)},[])}function _0(){const f=W.useRef(null),C=W.useCallback((A,z)=>{f.current=setInterval(A,z)},[]),D=W.useCallback(()=>{f.current!==null&&(clearInterval(f.current),f.current=null)},[]);return[C,D]}function Mn(f,C){C===void 0&&(C=[f]);const D=W.useRef(f);return Ti(()=>{D.current!==f&&(D.current=f)},C),D}function In(f,C){const D=W.useRef();return W.useMemo(()=>{const A=f(D.current);return D.current=A,A},[...C])}function so(f){const C=Xc(f),D=W.useRef(null),A=W.useCallback(z=>{z!==D.current&&(C==null||C(z,D.current)),D.current=z},[]);return[D,A]}function Uc(f){const C=W.useRef();return W.useEffect(()=>{C.current=f},[f]),C.current}let Dc={};function Nn(f,C){return W.useMemo(()=>{if(C)return C;const D=Dc[f]==null?0:Dc[f]+1;return Dc[f]=D,f+"-"+D},[f,C])}function Z_(f){return function(C){for(var D=arguments.length,A=new Array(D>1?D-1:0),z=1;z<D;z++)A[z-1]=arguments[z];return A.reduce((U,B)=>{const s=Object.entries(B);for(const[u,h]of s){const g=U[u];g!=null&&(U[u]=g+f*h)}return U},{...C})}}const As=Z_(1),kn=Z_(-1);function g0(f){return"clientX"in f&&"clientY"in f}function Kc(f){if(!f)return!1;const{KeyboardEvent:C}=Vt(f.target);return C&&f instanceof C}function v0(f){if(!f)return!1;const{TouchEvent:C}=Vt(f.target);return C&&f instanceof C}function jc(f){if(v0(f)){if(f.touches&&f.touches.length){const{clientX:C,clientY:D}=f.touches[0];return{x:C,y:D}}else if(f.changedTouches&&f.changedTouches.length){const{clientX:C,clientY:D}=f.changedTouches[0];return{x:C,y:D}}}return g0(f)?{x:f.clientX,y:f.clientY}:null}const On=Object.freeze({Translate:{toString(f){if(!f)return;const{x:C,y:D}=f;return"translate3d("+(C?Math.round(C):0)+"px, "+(D?Math.round(D):0)+"px, 0)"}},Scale:{toString(f){if(!f)return;const{scaleX:C,scaleY:D}=f;return"scaleX("+C+") scaleY("+D+")"}},Transform:{toString(f){if(f)return[On.Translate.toString(f),On.Scale.toString(f)].join(" ")}},Transition:{toString(f){let{property:C,duration:D,easing:A}=f;return C+" "+D+"ms "+A}}}),n_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function p0(f){return f.matches(n_)?f:f.querySelector(n_)}const m0={display:"none"};function S0(f){let{id:C,value:D}=f;return xt.createElement("div",{id:C,style:m0},D)}function b0(f){let{id:C,announcement:D,ariaLiveType:A="assertive"}=f;const z={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return xt.createElement("div",{id:C,style:z,role:"status","aria-live":A,"aria-atomic":!0},D)}function y0(){const[f,C]=W.useState("");return{announce:W.useCallback(A=>{A!=null&&C(A)},[]),announcement:f}}const Q_=W.createContext(null);function C0(f){const C=W.useContext(Q_);W.useEffect(()=>{if(!C)throw new Error("useDndMonitor must be used within a children of <DndContext>");return C(f)},[f,C])}function w0(){const[f]=W.useState(()=>new Set),C=W.useCallback(A=>(f.add(A),()=>f.delete(A)),[f]);return[W.useCallback(A=>{let{type:z,event:U}=A;f.forEach(B=>{var s;return(s=B[z])==null?void 0:s.call(B,U)})},[f]),C]}const x0={draggable:`
50
+ To pick up a draggable item, press the space bar.
51
+ While dragging, use the arrow keys to move the item.
52
+ Press space again to drop the item in its new position, or press escape to cancel.
53
+ `},E0={onDragStart(f){let{active:C}=f;return"Picked up draggable item "+C.id+"."},onDragOver(f){let{active:C,over:D}=f;return D?"Draggable item "+C.id+" was moved over droppable area "+D.id+".":"Draggable item "+C.id+" is no longer over a droppable area."},onDragEnd(f){let{active:C,over:D}=f;return D?"Draggable item "+C.id+" was dropped over droppable area "+D.id:"Draggable item "+C.id+" was dropped."},onDragCancel(f){let{active:C}=f;return"Dragging was cancelled. Draggable item "+C.id+" was dropped."}};function R0(f){let{announcements:C=E0,container:D,hiddenTextDescribedById:A,screenReaderInstructions:z=x0}=f;const{announce:U,announcement:B}=y0(),s=Nn("DndLiveRegion"),[u,h]=W.useState(!1);if(W.useEffect(()=>{h(!0)},[]),C0(W.useMemo(()=>({onDragStart(o){let{active:p}=o;U(C.onDragStart({active:p}))},onDragMove(o){let{active:p,over:m}=o;C.onDragMove&&U(C.onDragMove({active:p,over:m}))},onDragOver(o){let{active:p,over:m}=o;U(C.onDragOver({active:p,over:m}))},onDragEnd(o){let{active:p,over:m}=o;U(C.onDragEnd({active:p,over:m}))},onDragCancel(o){let{active:p,over:m}=o;U(C.onDragCancel({active:p,over:m}))}}),[U,C])),!u)return null;const g=xt.createElement(xt.Fragment,null,xt.createElement(S0,{id:A,value:z.draggable}),xt.createElement(b0,{id:s,announcement:B}));return D?En.createPortal(g,D):g}var St;(function(f){f.DragStart="dragStart",f.DragMove="dragMove",f.DragEnd="dragEnd",f.DragCancel="dragCancel",f.DragOver="dragOver",f.RegisterDroppable="registerDroppable",f.SetDroppableDisabled="setDroppableDisabled",f.UnregisterDroppable="unregisterDroppable"})(St||(St={}));function no(){}function a_(f,C){return W.useMemo(()=>({sensor:f,options:C??{}}),[f,C])}function A0(){for(var f=arguments.length,C=new Array(f),D=0;D<f;D++)C[D]=arguments[D];return W.useMemo(()=>[...C].filter(A=>A!=null),[...C])}const xi=Object.freeze({x:0,y:0});function J_(f,C){return Math.sqrt(Math.pow(f.x-C.x,2)+Math.pow(f.y-C.y,2))}function eg(f,C){let{data:{value:D}}=f,{data:{value:A}}=C;return D-A}function D0(f,C){let{data:{value:D}}=f,{data:{value:A}}=C;return A-D}function o_(f){let{left:C,top:D,height:A,width:z}=f;return[{x:C,y:D},{x:C+z,y:D},{x:C,y:D+A},{x:C+z,y:D+A}]}function tg(f,C){if(!f||f.length===0)return null;const[D]=f;return D[C]}function l_(f,C,D){return C===void 0&&(C=f.left),D===void 0&&(D=f.top),{x:C+f.width*.5,y:D+f.height*.5}}const ig=f=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=f;const z=l_(C,C.left,C.top),U=[];for(const B of A){const{id:s}=B,u=D.get(s);if(u){const h=J_(l_(u),z);U.push({id:s,data:{droppableContainer:B,value:h}})}}return U.sort(eg)},L0=f=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=f;const z=o_(C),U=[];for(const B of A){const{id:s}=B,u=D.get(s);if(u){const h=o_(u),g=z.reduce((p,m,w)=>p+J_(h[w],m),0),o=Number((g/4).toFixed(4));U.push({id:s,data:{droppableContainer:B,value:o}})}}return U.sort(eg)};function T0(f,C){const D=Math.max(C.top,f.top),A=Math.max(C.left,f.left),z=Math.min(C.left+C.width,f.left+f.width),U=Math.min(C.top+C.height,f.top+f.height),B=z-A,s=U-D;if(A<z&&D<U){const u=C.width*C.height,h=f.width*f.height,g=B*s,o=g/(u+h-g);return Number(o.toFixed(4))}return 0}const M0=f=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=f;const z=[];for(const U of A){const{id:B}=U,s=D.get(B);if(s){const u=T0(s,C);u>0&&z.push({id:B,data:{droppableContainer:U,value:u}})}}return z.sort(D0)};function k0(f,C,D){return{...f,scaleX:C&&D?C.width/D.width:1,scaleY:C&&D?C.height/D.height:1}}function rg(f,C){return f&&C?{x:f.left-C.left,y:f.top-C.top}:xi}function O0(f){return function(D){for(var A=arguments.length,z=new Array(A>1?A-1:0),U=1;U<A;U++)z[U-1]=arguments[U];return z.reduce((B,s)=>({...B,top:B.top+f*s.y,bottom:B.bottom+f*s.y,left:B.left+f*s.x,right:B.right+f*s.x}),{...D})}}const B0=O0(1);function H0(f){if(f.startsWith("matrix3d(")){const C=f.slice(9,-1).split(/, /);return{x:+C[12],y:+C[13],scaleX:+C[0],scaleY:+C[5]}}else if(f.startsWith("matrix(")){const C=f.slice(7,-1).split(/, /);return{x:+C[4],y:+C[5],scaleX:+C[0],scaleY:+C[3]}}return null}function z0(f,C,D){const A=H0(C);if(!A)return f;const{scaleX:z,scaleY:U,x:B,y:s}=A,u=f.left-B-(1-z)*parseFloat(D),h=f.top-s-(1-U)*parseFloat(D.slice(D.indexOf(" ")+1)),g=z?f.width/z:f.width,o=U?f.height/U:f.height;return{width:g,height:o,top:h,right:u+g,bottom:h+o,left:u}}const I0={ignoreTransform:!1};function Ms(f,C){C===void 0&&(C=I0);let D=f.getBoundingClientRect();if(C.ignoreTransform){const{transform:h,transformOrigin:g}=Vt(f).getComputedStyle(f);h&&(D=z0(D,h,g))}const{top:A,left:z,width:U,height:B,bottom:s,right:u}=D;return{top:A,left:z,width:U,height:B,bottom:s,right:u}}function c_(f){return Ms(f,{ignoreTransform:!0})}function N0(f){const C=f.innerWidth,D=f.innerHeight;return{top:0,left:0,right:C,bottom:D,width:C,height:D}}function U0(f,C){return C===void 0&&(C=Vt(f).getComputedStyle(f)),C.position==="fixed"}function j0(f,C){C===void 0&&(C=Vt(f).getComputedStyle(f));const D=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(z=>{const U=C[z];return typeof U=="string"?D.test(U):!1})}function co(f,C){const D=[];function A(z){if(C!=null&&D.length>=C||!z)return D;if(Vc(z)&&z.scrollingElement!=null&&!D.includes(z.scrollingElement))return D.push(z.scrollingElement),D;if(!zn(z)||K_(z)||D.includes(z))return D;const U=Vt(f).getComputedStyle(z);return z!==f&&j0(z,U)&&D.push(z),U0(z,U)?D:A(z.parentNode)}return f?A(f):D}function sg(f){const[C]=co(f,1);return C??null}function Lc(f){return!lo||!f?null:Ls(f)?f:Yc(f)?Vc(f)||f===Ts(f).scrollingElement?window:zn(f)?f:null:null}function ng(f){return Ls(f)?f.scrollX:f.scrollLeft}function ag(f){return Ls(f)?f.scrollY:f.scrollTop}function Pc(f){return{x:ng(f),y:ag(f)}}var wt;(function(f){f[f.Forward=1]="Forward",f[f.Backward=-1]="Backward"})(wt||(wt={}));function og(f){return!lo||!f?!1:f===document.scrollingElement}function lg(f){const C={x:0,y:0},D=og(f)?{height:window.innerHeight,width:window.innerWidth}:{height:f.clientHeight,width:f.clientWidth},A={x:f.scrollWidth-D.width,y:f.scrollHeight-D.height},z=f.scrollTop<=C.y,U=f.scrollLeft<=C.x,B=f.scrollTop>=A.y,s=f.scrollLeft>=A.x;return{isTop:z,isLeft:U,isBottom:B,isRight:s,maxScroll:A,minScroll:C}}const P0={x:.2,y:.2};function F0(f,C,D,A,z){let{top:U,left:B,right:s,bottom:u}=D;A===void 0&&(A=10),z===void 0&&(z=P0);const{isTop:h,isBottom:g,isLeft:o,isRight:p}=lg(f),m={x:0,y:0},w={x:0,y:0},_={height:C.height*z.y,width:C.width*z.x};return!h&&U<=C.top+_.height?(m.y=wt.Backward,w.y=A*Math.abs((C.top+_.height-U)/_.height)):!g&&u>=C.bottom-_.height&&(m.y=wt.Forward,w.y=A*Math.abs((C.bottom-_.height-u)/_.height)),!p&&s>=C.right-_.width?(m.x=wt.Forward,w.x=A*Math.abs((C.right-_.width-s)/_.width)):!o&&B<=C.left+_.width&&(m.x=wt.Backward,w.x=A*Math.abs((C.left+_.width-B)/_.width)),{direction:m,speed:w}}function q0(f){if(f===document.scrollingElement){const{innerWidth:U,innerHeight:B}=window;return{top:0,left:0,right:U,bottom:B,width:U,height:B}}const{top:C,left:D,right:A,bottom:z}=f.getBoundingClientRect();return{top:C,left:D,right:A,bottom:z,width:f.clientWidth,height:f.clientHeight}}function cg(f){return f.reduce((C,D)=>As(C,Pc(D)),xi)}function W0(f){return f.reduce((C,D)=>C+ng(D),0)}function G0(f){return f.reduce((C,D)=>C+ag(D),0)}function $0(f,C){if(C===void 0&&(C=Ms),!f)return;const{top:D,left:A,bottom:z,right:U}=C(f);sg(f)&&(z<=0||U<=0||D>=window.innerHeight||A>=window.innerWidth)&&f.scrollIntoView({block:"center",inline:"center"})}const Y0=[["x",["left","right"],W0],["y",["top","bottom"],G0]];class Zc{constructor(C,D){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const A=co(D),z=cg(A);this.rect={...C},this.width=C.width,this.height=C.height;for(const[U,B,s]of Y0)for(const u of B)Object.defineProperty(this,u,{get:()=>{const h=s(A),g=z[U]-h;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class An{constructor(C){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(D=>{var A;return(A=this.target)==null?void 0:A.removeEventListener(...D)})},this.target=C}add(C,D,A){var z;(z=this.target)==null||z.addEventListener(C,D,A),this.listeners.push([C,D,A])}}function V0(f){const{EventTarget:C}=Vt(f);return f instanceof C?f:Ts(f)}function Tc(f,C){const D=Math.abs(f.x),A=Math.abs(f.y);return typeof C=="number"?Math.sqrt(D**2+A**2)>C:"x"in C&&"y"in C?D>C.x&&A>C.y:"x"in C?D>C.x:"y"in C?A>C.y:!1}var mi;(function(f){f.Click="click",f.DragStart="dragstart",f.Keydown="keydown",f.ContextMenu="contextmenu",f.Resize="resize",f.SelectionChange="selectionchange",f.VisibilityChange="visibilitychange"})(mi||(mi={}));function u_(f){f.preventDefault()}function X0(f){f.stopPropagation()}var Ne;(function(f){f.Space="Space",f.Down="ArrowDown",f.Right="ArrowRight",f.Left="ArrowLeft",f.Up="ArrowUp",f.Esc="Escape",f.Enter="Enter",f.Tab="Tab"})(Ne||(Ne={}));const ug={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter,Ne.Tab]},K0=(f,C)=>{let{currentCoordinates:D}=C;switch(f.code){case Ne.Right:return{...D,x:D.x+25};case Ne.Left:return{...D,x:D.x-25};case Ne.Down:return{...D,y:D.y+25};case Ne.Up:return{...D,y:D.y-25}}};class Qc{constructor(C){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=C;const{event:{target:D}}=C;this.props=C,this.listeners=new An(Ts(D)),this.windowListeners=new An(Vt(D)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:C,onStart:D}=this.props,A=C.node.current;A&&$0(A),D(xi)}handleKeyDown(C){if(Kc(C)){const{active:D,context:A,options:z}=this.props,{keyboardCodes:U=ug,coordinateGetter:B=K0,scrollBehavior:s="smooth"}=z,{code:u}=C;if(U.end.includes(u)){this.handleEnd(C);return}if(U.cancel.includes(u)){this.handleCancel(C);return}const{collisionRect:h}=A.current,g=h?{x:h.left,y:h.top}:xi;this.referenceCoordinates||(this.referenceCoordinates=g);const o=B(C,{active:D,context:A.current,currentCoordinates:g});if(o){const p=kn(o,g),m={x:0,y:0},{scrollableAncestors:w}=A.current;for(const _ of w){const n=C.code,{isTop:l,isRight:a,isLeft:c,isBottom:S,maxScroll:x,minScroll:b}=lg(_),E=q0(_),y={x:Math.min(n===Ne.Right?E.right-E.width/2:E.right,Math.max(n===Ne.Right?E.left:E.left+E.width/2,o.x)),y:Math.min(n===Ne.Down?E.bottom-E.height/2:E.bottom,Math.max(n===Ne.Down?E.top:E.top+E.height/2,o.y))},R=n===Ne.Right&&!a||n===Ne.Left&&!c,T=n===Ne.Down&&!S||n===Ne.Up&&!l;if(R&&y.x!==o.x){const I=_.scrollLeft+p.x,M=n===Ne.Right&&I<=x.x||n===Ne.Left&&I>=b.x;if(M&&!p.y){_.scrollTo({left:I,behavior:s});return}M?m.x=_.scrollLeft-I:m.x=n===Ne.Right?_.scrollLeft-x.x:_.scrollLeft-b.x,m.x&&_.scrollBy({left:-m.x,behavior:s});break}else if(T&&y.y!==o.y){const I=_.scrollTop+p.y,M=n===Ne.Down&&I<=x.y||n===Ne.Up&&I>=b.y;if(M&&!p.x){_.scrollTo({top:I,behavior:s});return}M?m.y=_.scrollTop-I:m.y=n===Ne.Down?_.scrollTop-x.y:_.scrollTop-b.y,m.y&&_.scrollBy({top:-m.y,behavior:s});break}}this.handleMove(C,As(kn(o,this.referenceCoordinates),m))}}}handleMove(C,D){const{onMove:A}=this.props;C.preventDefault(),A(D)}handleEnd(C){const{onEnd:D}=this.props;C.preventDefault(),this.detach(),D()}handleCancel(C){const{onCancel:D}=this.props;C.preventDefault(),this.detach(),D()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Qc.activators=[{eventName:"onKeyDown",handler:(f,C,D)=>{let{keyboardCodes:A=ug,onActivation:z}=C,{active:U}=D;const{code:B}=f.nativeEvent;if(A.start.includes(B)){const s=U.activatorNode.current;return s&&f.target!==s?!1:(f.preventDefault(),z==null||z({event:f.nativeEvent}),!0)}return!1}}];function h_(f){return!!(f&&"distance"in f)}function d_(f){return!!(f&&"delay"in f)}class Jc{constructor(C,D,A){var z;A===void 0&&(A=V0(C.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=C,this.events=D;const{event:U}=C,{target:B}=U;this.props=C,this.events=D,this.document=Ts(B),this.documentListeners=new An(this.document),this.listeners=new An(A),this.windowListeners=new An(Vt(B)),this.initialCoordinates=(z=jc(U))!=null?z:xi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:C,props:{options:{activationConstraint:D,bypassActivationConstraint:A}}}=this;if(this.listeners.add(C.move.name,this.handleMove,{passive:!1}),this.listeners.add(C.end.name,this.handleEnd),C.cancel&&this.listeners.add(C.cancel.name,this.handleCancel),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.DragStart,u_),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),this.windowListeners.add(mi.ContextMenu,u_),this.documentListeners.add(mi.Keydown,this.handleKeydown),D){if(A!=null&&A({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(d_(D)){this.timeoutId=setTimeout(this.handleStart,D.delay),this.handlePending(D);return}if(h_(D)){this.handlePending(D);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(C,D){const{active:A,onPending:z}=this.props;z(A,C,this.initialCoordinates,D)}handleStart(){const{initialCoordinates:C}=this,{onStart:D}=this.props;C&&(this.activated=!0,this.documentListeners.add(mi.Click,X0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mi.SelectionChange,this.removeTextSelection),D(C))}handleMove(C){var D;const{activated:A,initialCoordinates:z,props:U}=this,{onMove:B,options:{activationConstraint:s}}=U;if(!z)return;const u=(D=jc(C))!=null?D:xi,h=kn(z,u);if(!A&&s){if(h_(s)){if(s.tolerance!=null&&Tc(h,s.tolerance))return this.handleCancel();if(Tc(h,s.distance))return this.handleStart()}if(d_(s)&&Tc(h,s.tolerance))return this.handleCancel();this.handlePending(s,h);return}C.cancelable&&C.preventDefault(),B(u)}handleEnd(){const{onAbort:C,onEnd:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleCancel(){const{onAbort:C,onCancel:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleKeydown(C){C.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var C;(C=this.document.getSelection())==null||C.removeAllRanges()}}const Z0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eu extends Jc{constructor(C){const{event:D}=C,A=Ts(D.target);super(C,Z0,A)}}eu.activators=[{eventName:"onPointerDown",handler:(f,C)=>{let{nativeEvent:D}=f,{onActivation:A}=C;return!D.isPrimary||D.button!==0?!1:(A==null||A({event:D}),!0)}}];const Q0={move:{name:"mousemove"},end:{name:"mouseup"}};var Fc;(function(f){f[f.RightClick=2]="RightClick"})(Fc||(Fc={}));class J0 extends Jc{constructor(C){super(C,Q0,Ts(C.event.target))}}J0.activators=[{eventName:"onMouseDown",handler:(f,C)=>{let{nativeEvent:D}=f,{onActivation:A}=C;return D.button===Fc.RightClick?!1:(A==null||A({event:D}),!0)}}];const Mc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class e1 extends Jc{constructor(C){super(C,Mc)}static setup(){return window.addEventListener(Mc.move.name,C,{capture:!1,passive:!1}),function(){window.removeEventListener(Mc.move.name,C)};function C(){}}}e1.activators=[{eventName:"onTouchStart",handler:(f,C)=>{let{nativeEvent:D}=f,{onActivation:A}=C;const{touches:z}=D;return z.length>1?!1:(A==null||A({event:D}),!0)}}];var Dn;(function(f){f[f.Pointer=0]="Pointer",f[f.DraggableRect=1]="DraggableRect"})(Dn||(Dn={}));var ao;(function(f){f[f.TreeOrder=0]="TreeOrder",f[f.ReversedTreeOrder=1]="ReversedTreeOrder"})(ao||(ao={}));function t1(f){let{acceleration:C,activator:D=Dn.Pointer,canScroll:A,draggingRect:z,enabled:U,interval:B=5,order:s=ao.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:g,delta:o,threshold:p}=f;const m=r1({delta:o,disabled:!U}),[w,_]=_0(),n=W.useRef({x:0,y:0}),l=W.useRef({x:0,y:0}),a=W.useMemo(()=>{switch(D){case Dn.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Dn.DraggableRect:return z}},[D,z,u]),c=W.useRef(null),S=W.useCallback(()=>{const b=c.current;if(!b)return;const E=n.current.x*l.current.x,y=n.current.y*l.current.y;b.scrollBy(E,y)},[]),x=W.useMemo(()=>s===ao.TreeOrder?[...h].reverse():h,[s,h]);W.useEffect(()=>{if(!U||!h.length||!a){_();return}for(const b of x){if((A==null?void 0:A(b))===!1)continue;const E=h.indexOf(b),y=g[E];if(!y)continue;const{direction:R,speed:T}=F0(b,y,a,C,p);for(const I of["x","y"])m[I][R[I]]||(T[I]=0,R[I]=0);if(T.x>0||T.y>0){_(),c.current=b,w(S,B),n.current=T,l.current=R;return}}n.current={x:0,y:0},l.current={x:0,y:0},_()},[C,S,A,_,U,B,JSON.stringify(a),JSON.stringify(m),w,h,x,g,JSON.stringify(p)])}const i1={x:{[wt.Backward]:!1,[wt.Forward]:!1},y:{[wt.Backward]:!1,[wt.Forward]:!1}};function r1(f){let{delta:C,disabled:D}=f;const A=Uc(C);return In(z=>{if(D||!A||!z)return i1;const U={x:Math.sign(C.x-A.x),y:Math.sign(C.y-A.y)};return{x:{[wt.Backward]:z.x[wt.Backward]||U.x===-1,[wt.Forward]:z.x[wt.Forward]||U.x===1},y:{[wt.Backward]:z.y[wt.Backward]||U.y===-1,[wt.Forward]:z.y[wt.Forward]||U.y===1}}},[D,C,A])}function s1(f,C){const D=C!=null?f.get(C):void 0,A=D?D.node.current:null;return In(z=>{var U;return C==null?null:(U=A??z)!=null?U:null},[A,C])}function n1(f,C){return W.useMemo(()=>f.reduce((D,A)=>{const{sensor:z}=A,U=z.activators.map(B=>({eventName:B.eventName,handler:C(B.handler,A)}));return[...D,...U]},[]),[f,C])}var Bn;(function(f){f[f.Always=0]="Always",f[f.BeforeDragging=1]="BeforeDragging",f[f.WhileDragging=2]="WhileDragging"})(Bn||(Bn={}));var qc;(function(f){f.Optimized="optimized"})(qc||(qc={}));const f_=new Map;function a1(f,C){let{dragging:D,dependencies:A,config:z}=C;const[U,B]=W.useState(null),{frequency:s,measure:u,strategy:h}=z,g=W.useRef(f),o=n(),p=Mn(o),m=W.useCallback(function(l){l===void 0&&(l=[]),!p.current&&B(a=>a===null?l:a.concat(l.filter(c=>!a.includes(c))))},[p]),w=W.useRef(null),_=In(l=>{if(o&&!D)return f_;if(!l||l===f_||g.current!==f||U!=null){const a=new Map;for(let c of f){if(!c)continue;if(U&&U.length>0&&!U.includes(c.id)&&c.rect.current){a.set(c.id,c.rect.current);continue}const S=c.node.current,x=S?new Zc(u(S),S):null;c.rect.current=x,x&&a.set(c.id,x)}return a}return l},[f,U,D,o,u]);return W.useEffect(()=>{g.current=f},[f]),W.useEffect(()=>{o||m()},[D,o]),W.useEffect(()=>{U&&U.length>0&&B(null)},[JSON.stringify(U)]),W.useEffect(()=>{o||typeof s!="number"||w.current!==null||(w.current=setTimeout(()=>{m(),w.current=null},s))},[s,o,m,...A]),{droppableRects:_,measureDroppableContainers:m,measuringScheduled:U!=null};function n(){switch(h){case Bn.Always:return!1;case Bn.BeforeDragging:return D;default:return!D}}}function hg(f,C){return In(D=>f?D||(typeof C=="function"?C(f):f):null,[C,f])}function o1(f,C){return hg(f,C)}function l1(f){let{callback:C,disabled:D}=f;const A=Xc(C),z=W.useMemo(()=>{if(D||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:U}=window;return new U(A)},[A,D]);return W.useEffect(()=>()=>z==null?void 0:z.disconnect(),[z]),z}function uo(f){let{callback:C,disabled:D}=f;const A=Xc(C),z=W.useMemo(()=>{if(D||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:U}=window;return new U(A)},[D]);return W.useEffect(()=>()=>z==null?void 0:z.disconnect(),[z]),z}function c1(f){return new Zc(Ms(f),f)}function __(f,C,D){C===void 0&&(C=c1);const[A,z]=W.useState(null);function U(){z(u=>{if(!f)return null;if(f.isConnected===!1){var h;return(h=u??D)!=null?h:null}const g=C(f);return JSON.stringify(u)===JSON.stringify(g)?u:g})}const B=l1({callback(u){if(f)for(const h of u){const{type:g,target:o}=h;if(g==="childList"&&o instanceof HTMLElement&&o.contains(f)){U();break}}}}),s=uo({callback:U});return Ti(()=>{U(),f?(s==null||s.observe(f),B==null||B.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),B==null||B.disconnect())},[f]),A}function u1(f){const C=hg(f);return rg(f,C)}const g_=[];function h1(f){const C=W.useRef(f),D=In(A=>f?A&&A!==g_&&f&&C.current&&f.parentNode===C.current.parentNode?A:co(f):g_,[f]);return W.useEffect(()=>{C.current=f},[f]),D}function d1(f){const[C,D]=W.useState(null),A=W.useRef(f),z=W.useCallback(U=>{const B=Lc(U.target);B&&D(s=>s?(s.set(B,Pc(B)),new Map(s)):null)},[]);return W.useEffect(()=>{const U=A.current;if(f!==U){B(U);const s=f.map(u=>{const h=Lc(u);return h?(h.addEventListener("scroll",z,{passive:!0}),[h,Pc(h)]):null}).filter(u=>u!=null);D(s.length?new Map(s):null),A.current=f}return()=>{B(f),B(U)};function B(s){s.forEach(u=>{const h=Lc(u);h==null||h.removeEventListener("scroll",z)})}},[z,f]),W.useMemo(()=>f.length?C?Array.from(C.values()).reduce((U,B)=>As(U,B),xi):cg(f):xi,[f,C])}function v_(f,C){C===void 0&&(C=[]);const D=W.useRef(null);return W.useEffect(()=>{D.current=null},C),W.useEffect(()=>{const A=f!==xi;A&&!D.current&&(D.current=f),!A&&D.current&&(D.current=null)},[f]),D.current?kn(f,D.current):xi}function f1(f){W.useEffect(()=>{if(!lo)return;const C=f.map(D=>{let{sensor:A}=D;return A.setup==null?void 0:A.setup()});return()=>{for(const D of C)D==null||D()}},f.map(C=>{let{sensor:D}=C;return D}))}function _1(f,C){return W.useMemo(()=>f.reduce((D,A)=>{let{eventName:z,handler:U}=A;return D[z]=B=>{U(B,C)},D},{}),[f,C])}function dg(f){return W.useMemo(()=>f?N0(f):null,[f])}const p_=[];function g1(f,C){C===void 0&&(C=Ms);const[D]=f,A=dg(D?Vt(D):null),[z,U]=W.useState(p_);function B(){U(()=>f.length?f.map(u=>og(u)?A:new Zc(C(u),u)):p_)}const s=uo({callback:B});return Ti(()=>{s==null||s.disconnect(),B(),f.forEach(u=>s==null?void 0:s.observe(u))},[f]),z}function v1(f){if(!f)return null;if(f.children.length>1)return f;const C=f.children[0];return zn(C)?C:f}function p1(f){let{measure:C}=f;const[D,A]=W.useState(null),z=W.useCallback(h=>{for(const{target:g}of h)if(zn(g)){A(o=>{const p=C(g);return o?{...o,width:p.width,height:p.height}:p});break}},[C]),U=uo({callback:z}),B=W.useCallback(h=>{const g=v1(h);U==null||U.disconnect(),g&&(U==null||U.observe(g)),A(g?C(g):null)},[C,U]),[s,u]=so(B);return W.useMemo(()=>({nodeRef:s,rect:D,setRef:u}),[D,s,u])}const m1=[{sensor:eu,options:{}},{sensor:Qc,options:{}}],S1={current:{}},io={draggable:{measure:c_},droppable:{measure:c_,strategy:Bn.WhileDragging,frequency:qc.Optimized},dragOverlay:{measure:Ms}};class Ln extends Map{get(C){var D;return C!=null&&(D=super.get(C))!=null?D:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(C=>{let{disabled:D}=C;return!D})}getNodeFor(C){var D,A;return(D=(A=this.get(C))==null?void 0:A.node.current)!=null?D:void 0}}const b1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ln,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:no},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:io,measureDroppableContainers:no,windowRect:null,measuringScheduled:!1},y1={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:no,draggableNodes:new Map,over:null,measureDroppableContainers:no},ho=W.createContext(y1),fg=W.createContext(b1);function C1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ln}}}function w1(f,C){switch(C.type){case St.DragStart:return{...f,draggable:{...f.draggable,initialCoordinates:C.initialCoordinates,active:C.active}};case St.DragMove:return f.draggable.active==null?f:{...f,draggable:{...f.draggable,translate:{x:C.coordinates.x-f.draggable.initialCoordinates.x,y:C.coordinates.y-f.draggable.initialCoordinates.y}}};case St.DragEnd:case St.DragCancel:return{...f,draggable:{...f.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case St.RegisterDroppable:{const{element:D}=C,{id:A}=D,z=new Ln(f.droppable.containers);return z.set(A,D),{...f,droppable:{...f.droppable,containers:z}}}case St.SetDroppableDisabled:{const{id:D,key:A,disabled:z}=C,U=f.droppable.containers.get(D);if(!U||A!==U.key)return f;const B=new Ln(f.droppable.containers);return B.set(D,{...U,disabled:z}),{...f,droppable:{...f.droppable,containers:B}}}case St.UnregisterDroppable:{const{id:D,key:A}=C,z=f.droppable.containers.get(D);if(!z||A!==z.key)return f;const U=new Ln(f.droppable.containers);return U.delete(D),{...f,droppable:{...f.droppable,containers:U}}}default:return f}}function x1(f){let{disabled:C}=f;const{active:D,activatorEvent:A,draggableNodes:z}=W.useContext(ho),U=Uc(A),B=Uc(D==null?void 0:D.id);return W.useEffect(()=>{if(!C&&!A&&U&&B!=null){if(!Kc(U)||document.activeElement===U.target)return;const s=z.get(B);if(!s)return;const{activatorNode:u,node:h}=s;if(!u.current&&!h.current)return;requestAnimationFrame(()=>{for(const g of[u.current,h.current]){if(!g)continue;const o=p0(g);if(o){o.focus();break}}})}},[A,C,z,B,U]),null}function E1(f,C){let{transform:D,...A}=C;return f!=null&&f.length?f.reduce((z,U)=>U({transform:z,...A}),D):D}function R1(f){return W.useMemo(()=>({draggable:{...io.draggable,...f==null?void 0:f.draggable},droppable:{...io.droppable,...f==null?void 0:f.droppable},dragOverlay:{...io.dragOverlay,...f==null?void 0:f.dragOverlay}}),[f==null?void 0:f.draggable,f==null?void 0:f.droppable,f==null?void 0:f.dragOverlay])}function A1(f){let{activeNode:C,measure:D,initialRect:A,config:z=!0}=f;const U=W.useRef(!1),{x:B,y:s}=typeof z=="boolean"?{x:z,y:z}:z;Ti(()=>{if(!B&&!s||!C){U.current=!1;return}if(U.current||!A)return;const h=C==null?void 0:C.node.current;if(!h||h.isConnected===!1)return;const g=D(h),o=rg(g,A);if(B||(o.x=0),s||(o.y=0),U.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const p=sg(h);p&&p.scrollBy({top:o.y,left:o.x})}},[C,B,s,A,D])}const _g=W.createContext({...xi,scaleX:1,scaleY:1});var wr;(function(f){f[f.Uninitialized=0]="Uninitialized",f[f.Initializing=1]="Initializing",f[f.Initialized=2]="Initialized"})(wr||(wr={}));const gg=W.memo(function(C){var D,A,z,U;let{id:B,accessibility:s,autoScroll:u=!0,children:h,sensors:g=m1,collisionDetection:o=M0,measuring:p,modifiers:m,...w}=C;const _=W.useReducer(w1,void 0,C1),[n,l]=_,[a,c]=w0(),[S,x]=W.useState(wr.Uninitialized),b=S===wr.Initialized,{draggable:{active:E,nodes:y,translate:R},droppable:{containers:T}}=n,I=E!=null?y.get(E):null,M=W.useRef({initial:null,translated:null}),H=W.useMemo(()=>{var tt;return E!=null?{id:E,data:(tt=I==null?void 0:I.data)!=null?tt:S1,rect:M}:null},[E,I]),q=W.useRef(null),[Q,G]=W.useState(null),[$,Y]=W.useState(null),k=Mn(w,Object.values(w)),F=Nn("DndDescribedBy",B),O=W.useMemo(()=>T.getEnabled(),[T]),N=R1(p),{droppableRects:Z,measureDroppableContainers:ee,measuringScheduled:he}=a1(O,{dragging:b,dependencies:[R.x,R.y],config:N.droppable}),ce=s1(y,E),X=W.useMemo(()=>$?jc($):null,[$]),P=Mi(),ne=o1(ce,N.draggable.measure);A1({activeNode:E!=null?y.get(E):null,config:P.layoutShiftCompensation,initialRect:ne,measure:N.draggable.measure});const ie=__(ce,N.draggable.measure,ne),_e=__(ce?ce.parentElement:null),fe=W.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=T.getNodeFor((D=fe.current.over)==null?void 0:D.id),ve=p1({measure:N.dragOverlay.measure}),Te=(A=ve.nodeRef.current)!=null?A:ce,Pe=b?(z=ve.rect)!=null?z:ie:null,Se=!!(ve.nodeRef.current&&ve.rect),Mt=u1(Se?null:ie),zt=dg(Te?Vt(Te):null),xe=h1(b?ye??ce:null),Ee=g1(xe),Ae=E1(m,{transform:{x:R.x-Mt.x,y:R.y-Mt.y,scaleX:1,scaleY:1},activatorEvent:$,active:H,activeNodeRect:ie,containerNodeRect:_e,draggingNodeRect:Pe,over:fe.current.over,overlayNodeRect:ve.rect,scrollableAncestors:xe,scrollableAncestorRects:Ee,windowRect:zt}),ge=X?As(X,R):null,we=d1(xe),Ke=v_(we),qe=v_(we,[ie]),gt=As(Ae,Ke),Ze=Pe?B0(Pe,Ae):null,ct=H&&Ze?o({active:H,collisionRect:Ze,droppableRects:Z,droppableContainers:O,pointerCoordinates:ge}):null,Qe=tg(ct,"id"),[ke,De]=W.useState(null),Xt=Se?Ae:As(Ae,qe),ut=k0(Xt,(U=ke==null?void 0:ke.rect)!=null?U:null,ie),Et=W.useRef(null),vt=W.useCallback((tt,st)=>{let{sensor:bt,options:It}=st;if(q.current==null)return;const Nt=y.get(q.current);if(!Nt)return;const kt=tt.nativeEvent,Ut=new bt({active:q.current,activeNode:Nt,event:kt,options:It,context:fe,onAbort(pt){if(!y.get(pt))return;const{onDragAbort:Kt}=k.current,ni={id:pt};Kt==null||Kt(ni),a({type:"onDragAbort",event:ni})},onPending(pt,Si,Kt,ni){if(!y.get(pt))return;const{onDragPending:Oi}=k.current,bi={id:pt,constraint:Si,initialCoordinates:Kt,offset:ni};Oi==null||Oi(bi),a({type:"onDragPending",event:bi})},onStart(pt){const Si=q.current;if(Si==null)return;const Kt=y.get(Si);if(!Kt)return;const{onDragStart:ni}=k.current,ki={activatorEvent:kt,active:{id:Si,data:Kt.data,rect:M}};En.unstable_batchedUpdates(()=>{ni==null||ni(ki),x(wr.Initializing),l({type:St.DragStart,initialCoordinates:pt,active:Si}),a({type:"onDragStart",event:ki}),G(Et.current),Y(kt)})},onMove(pt){l({type:St.DragMove,coordinates:pt})},onEnd:si(St.DragEnd),onCancel:si(St.DragCancel)});Et.current=Ut;function si(pt){return async function(){const{active:Kt,collisions:ni,over:ki,scrollAdjustedTranslate:Oi}=fe.current;let bi=null;if(Kt&&Oi){const{cancelDrop:Ji}=k.current;bi={activatorEvent:kt,active:Kt,collisions:ni,delta:Oi,over:ki},pt===St.DragEnd&&typeof Ji=="function"&&await Promise.resolve(Ji(bi))&&(pt=St.DragCancel)}q.current=null,En.unstable_batchedUpdates(()=>{l({type:pt}),x(wr.Uninitialized),De(null),G(null),Y(null),Et.current=null;const Ji=pt===St.DragEnd?"onDragEnd":"onDragCancel";if(bi){const ai=k.current[Ji];ai==null||ai(bi),a({type:Ji,event:bi})}})}}},[y]),Qi=W.useCallback((tt,st)=>(bt,It)=>{const Nt=bt.nativeEvent,kt=y.get(It);if(q.current!==null||!kt||Nt.dndKit||Nt.defaultPrevented)return;const Ut={active:kt};tt(bt,st.options,Ut)===!0&&(Nt.dndKit={capturedBy:st.sensor},q.current=It,vt(bt,st))},[y,vt]),Fr=n1(g,Qi);f1(g),Ti(()=>{ie&&S===wr.Initializing&&x(wr.Initialized)},[ie,S]),W.useEffect(()=>{const{onDragMove:tt}=k.current,{active:st,activatorEvent:bt,collisions:It,over:Nt}=fe.current;if(!st||!bt)return;const kt={active:st,activatorEvent:bt,collisions:It,delta:{x:gt.x,y:gt.y},over:Nt};En.unstable_batchedUpdates(()=>{tt==null||tt(kt),a({type:"onDragMove",event:kt})})},[gt.x,gt.y]),W.useEffect(()=>{const{active:tt,activatorEvent:st,collisions:bt,droppableContainers:It,scrollAdjustedTranslate:Nt}=fe.current;if(!tt||q.current==null||!st||!Nt)return;const{onDragOver:kt}=k.current,Ut=It.get(Qe),si=Ut&&Ut.rect.current?{id:Ut.id,rect:Ut.rect.current,data:Ut.data,disabled:Ut.disabled}:null,pt={active:tt,activatorEvent:st,collisions:bt,delta:{x:Nt.x,y:Nt.y},over:si};En.unstable_batchedUpdates(()=>{De(si),kt==null||kt(pt),a({type:"onDragOver",event:pt})})},[Qe]),Ti(()=>{fe.current={activatorEvent:$,active:H,activeNode:ce,collisionRect:Ze,collisions:ct,droppableRects:Z,draggableNodes:y,draggingNode:Te,draggingNodeRect:Pe,droppableContainers:T,over:ke,scrollableAncestors:xe,scrollAdjustedTranslate:gt},M.current={initial:Pe,translated:Ze}},[H,ce,ct,Ze,y,Te,Pe,Z,T,ke,xe,gt]),t1({...P,delta:R,draggingRect:Ze,pointerCoordinates:ge,scrollableAncestors:xe,scrollableAncestorRects:Ee});const ks=W.useMemo(()=>({active:H,activeNode:ce,activeNodeRect:ie,activatorEvent:$,collisions:ct,containerNodeRect:_e,dragOverlay:ve,draggableNodes:y,droppableContainers:T,droppableRects:Z,over:ke,measureDroppableContainers:ee,scrollableAncestors:xe,scrollableAncestorRects:Ee,measuringConfiguration:N,measuringScheduled:he,windowRect:zt}),[H,ce,ie,$,ct,_e,ve,y,T,Z,ke,ee,xe,Ee,N,he,zt]),Ei=W.useMemo(()=>({activatorEvent:$,activators:Fr,active:H,activeNodeRect:ie,ariaDescribedById:{draggable:F},dispatch:l,draggableNodes:y,over:ke,measureDroppableContainers:ee}),[$,Fr,H,ie,l,F,y,ke,ee]);return xt.createElement(Q_.Provider,{value:c},xt.createElement(ho.Provider,{value:Ei},xt.createElement(fg.Provider,{value:ks},xt.createElement(_g.Provider,{value:ut},h)),xt.createElement(x1,{disabled:(s==null?void 0:s.restoreFocus)===!1})),xt.createElement(R0,{...s,hiddenTextDescribedById:F}));function Mi(){const tt=(Q==null?void 0:Q.autoScrollEnabled)===!1,st=typeof u=="object"?u.enabled===!1:u===!1,bt=b&&!tt&&!st;return typeof u=="object"?{...u,enabled:bt}:{enabled:bt}}}),D1=W.createContext(null),m_="button",L1="Draggable";function T1(f){let{id:C,data:D,disabled:A=!1,attributes:z}=f;const U=Nn(L1),{activators:B,activatorEvent:s,active:u,activeNodeRect:h,ariaDescribedById:g,draggableNodes:o,over:p}=W.useContext(ho),{role:m=m_,roleDescription:w="draggable",tabIndex:_=0}=z??{},n=(u==null?void 0:u.id)===C,l=W.useContext(n?_g:D1),[a,c]=so(),[S,x]=so(),b=_1(B,C),E=Mn(D);Ti(()=>(o.set(C,{id:C,key:U,node:a,activatorNode:S,data:E}),()=>{const R=o.get(C);R&&R.key===U&&o.delete(C)}),[o,C]);const y=W.useMemo(()=>({role:m,tabIndex:_,"aria-disabled":A,"aria-pressed":n&&m===m_?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[A,m,_,n,w,g.draggable]);return{active:u,activatorEvent:s,activeNodeRect:h,attributes:y,isDragging:n,listeners:A?void 0:b,node:a,over:p,setNodeRef:c,setActivatorNodeRef:x,transform:l}}function M1(){return W.useContext(fg)}const k1="Droppable",O1={timeout:25};function B1(f){let{data:C,disabled:D=!1,id:A,resizeObserverConfig:z}=f;const U=Nn(k1),{active:B,dispatch:s,over:u,measureDroppableContainers:h}=W.useContext(ho),g=W.useRef({disabled:D}),o=W.useRef(!1),p=W.useRef(null),m=W.useRef(null),{disabled:w,updateMeasurementsFor:_,timeout:n}={...O1,...z},l=Mn(_??A),a=W.useCallback(()=>{if(!o.current){o.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{h(Array.isArray(l.current)?l.current:[l.current]),m.current=null},n)},[n]),c=uo({callback:a,disabled:w||!B}),S=W.useCallback((y,R)=>{c&&(R&&(c.unobserve(R),o.current=!1),y&&c.observe(y))},[c]),[x,b]=so(S),E=Mn(C);return W.useEffect(()=>{!c||!x.current||(c.disconnect(),o.current=!1,c.observe(x.current))},[x,c]),W.useEffect(()=>(s({type:St.RegisterDroppable,element:{id:A,key:U,disabled:D,node:x,rect:p,data:E}}),()=>s({type:St.UnregisterDroppable,key:U,id:A})),[A]),W.useEffect(()=>{D!==g.current.disabled&&(s({type:St.SetDroppableDisabled,id:A,key:U,disabled:D}),g.current.disabled=D)},[A,U,D,s]),{active:B,rect:p,isOver:(u==null?void 0:u.id)===A,node:x,over:u,setNodeRef:b}}function vg(f,C,D){const A=f.slice();return A.splice(D<0?A.length+D:D,0,A.splice(C,1)[0]),A}function H1(f,C){return f.reduce((D,A,z)=>{const U=C.get(A);return U&&(D[z]=U),D},Array(f.length))}function Za(f){return f!==null&&f>=0}function z1(f,C){if(f===C)return!0;if(f.length!==C.length)return!1;for(let D=0;D<f.length;D++)if(f[D]!==C[D])return!1;return!0}function I1(f){return typeof f=="boolean"?{draggable:f,droppable:f}:f}const pg=f=>{let{rects:C,activeIndex:D,overIndex:A,index:z}=f;const U=vg(C,A,D),B=C[z],s=U[z];return!s||!B?null:{x:s.left-B.left,y:s.top-B.top,scaleX:s.width/B.width,scaleY:s.height/B.height}},Qa={scaleX:1,scaleY:1},mg=f=>{var C;let{activeIndex:D,activeNodeRect:A,index:z,rects:U,overIndex:B}=f;const s=(C=U[D])!=null?C:A;if(!s)return null;if(z===D){const h=U[B];return h?{x:0,y:D<B?h.top+h.height-(s.top+s.height):h.top-s.top,...Qa}:null}const u=N1(U,z,D);return z>D&&z<=B?{x:0,y:-s.height-u,...Qa}:z<D&&z>=B?{x:0,y:s.height+u,...Qa}:{x:0,y:0,...Qa}};function N1(f,C,D){const A=f[C],z=f[C-1],U=f[C+1];return A?D<C?z?A.top-(z.top+z.height):U?U.top-(A.top+A.height):0:U?U.top-(A.top+A.height):z?A.top-(z.top+z.height):0:0}const Sg="Sortable",bg=xt.createContext({activeIndex:-1,containerId:Sg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pg,disabled:{draggable:!1,droppable:!1}});function yg(f){let{children:C,id:D,items:A,strategy:z=pg,disabled:U=!1}=f;const{active:B,dragOverlay:s,droppableRects:u,over:h,measureDroppableContainers:g}=M1(),o=Nn(Sg,D),p=s.rect!==null,m=W.useMemo(()=>A.map(b=>typeof b=="object"&&"id"in b?b.id:b),[A]),w=B!=null,_=B?m.indexOf(B.id):-1,n=h?m.indexOf(h.id):-1,l=W.useRef(m),a=!z1(m,l.current),c=n!==-1&&_===-1||a,S=I1(U);Ti(()=>{a&&w&&g(m)},[a,m,w,g]),W.useEffect(()=>{l.current=m},[m]);const x=W.useMemo(()=>({activeIndex:_,containerId:o,disabled:S,disableTransforms:c,items:m,overIndex:n,useDragOverlay:p,sortedRects:H1(m,u),strategy:z}),[_,o,S.draggable,S.droppable,c,m,n,u,p,z]);return xt.createElement(bg.Provider,{value:x},C)}const U1=f=>{let{id:C,items:D,activeIndex:A,overIndex:z}=f;return vg(D,A,z).indexOf(C)},j1=f=>{let{containerId:C,isSorting:D,wasDragging:A,index:z,items:U,newIndex:B,previousItems:s,previousContainerId:u,transition:h}=f;return!h||!A||s!==U&&z===B?!1:D?!0:B!==z&&C===u},P1={duration:200,easing:"ease"},Cg="transform",F1=On.Transition.toString({property:Cg,duration:0,easing:"linear"}),q1={roleDescription:"sortable"};function W1(f){let{disabled:C,index:D,node:A,rect:z}=f;const[U,B]=W.useState(null),s=W.useRef(D);return Ti(()=>{if(!C&&D!==s.current&&A.current){const u=z.current;if(u){const h=Ms(A.current,{ignoreTransform:!0}),g={x:u.left-h.left,y:u.top-h.top,scaleX:u.width/h.width,scaleY:u.height/h.height};(g.x||g.y)&&B(g)}}D!==s.current&&(s.current=D)},[C,D,A,z]),W.useEffect(()=>{U&&B(null)},[U]),U}function G1(f){let{animateLayoutChanges:C=j1,attributes:D,disabled:A,data:z,getNewIndex:U=U1,id:B,strategy:s,resizeObserverConfig:u,transition:h=P1}=f;const{items:g,containerId:o,activeIndex:p,disabled:m,disableTransforms:w,sortedRects:_,overIndex:n,useDragOverlay:l,strategy:a}=W.useContext(bg),c=$1(A,m),S=g.indexOf(B),x=W.useMemo(()=>({sortable:{containerId:o,index:S,items:g},...z}),[o,z,S,g]),b=W.useMemo(()=>g.slice(g.indexOf(B)),[g,B]),{rect:E,node:y,isOver:R,setNodeRef:T}=B1({id:B,data:x,disabled:c.droppable,resizeObserverConfig:{updateMeasurementsFor:b,...u}}),{active:I,activatorEvent:M,activeNodeRect:H,attributes:q,setNodeRef:Q,listeners:G,isDragging:$,over:Y,setActivatorNodeRef:k,transform:F}=T1({id:B,data:x,attributes:{...q1,...D},disabled:c.draggable}),O=f0(T,Q),N=!!I,Z=N&&!w&&Za(p)&&Za(n),ee=!l&&$,he=ee&&Z?F:null,X=Z?he??(s??a)({rects:_,activeNodeRect:H,activeIndex:p,overIndex:n,index:S}):null,P=Za(p)&&Za(n)?U({id:B,items:g,activeIndex:p,overIndex:n}):S,ne=I==null?void 0:I.id,ie=W.useRef({activeId:ne,items:g,newIndex:P,containerId:o}),_e=g!==ie.current.items,fe=C({active:I,containerId:o,isDragging:$,isSorting:N,id:B,index:S,items:g,newIndex:ie.current.newIndex,previousItems:ie.current.items,previousContainerId:ie.current.containerId,transition:h,wasDragging:ie.current.activeId!=null}),ye=W1({disabled:!fe,index:S,node:y,rect:E});return W.useEffect(()=>{N&&ie.current.newIndex!==P&&(ie.current.newIndex=P),o!==ie.current.containerId&&(ie.current.containerId=o),g!==ie.current.items&&(ie.current.items=g)},[N,P,o,g]),W.useEffect(()=>{if(ne===ie.current.activeId)return;if(ne&&!ie.current.activeId){ie.current.activeId=ne;return}const Te=setTimeout(()=>{ie.current.activeId=ne},50);return()=>clearTimeout(Te)},[ne]),{active:I,activeIndex:p,attributes:q,data:x,rect:E,index:S,newIndex:P,items:g,isOver:R,isSorting:N,isDragging:$,listeners:G,node:y,overIndex:n,over:Y,setNodeRef:O,setActivatorNodeRef:k,setDroppableNodeRef:T,setDraggableNodeRef:Q,transform:ye??X,transition:ve()};function ve(){if(ye||_e&&ie.current.newIndex===S)return F1;if(!(ee&&!Kc(M)||!h)&&(N||fe))return On.Transition.toString({...h,property:Cg})}}function $1(f,C){var D,A;return typeof f=="boolean"?{draggable:f,droppable:!1}:{draggable:(D=f==null?void 0:f.draggable)!=null?D:C.draggable,droppable:(A=f==null?void 0:f.droppable)!=null?A:C.droppable}}function oo(f){if(!f)return!1;const C=f.data.current;return!!(C&&"sortable"in C&&typeof C.sortable=="object"&&"containerId"in C.sortable&&"items"in C.sortable&&"index"in C.sortable)}const Y1=[Ne.Down,Ne.Right,Ne.Up,Ne.Left],V1=(f,C)=>{let{context:{active:D,collisionRect:A,droppableRects:z,droppableContainers:U,over:B,scrollableAncestors:s}}=C;if(Y1.includes(f.code)){if(f.preventDefault(),!D||!A)return;const u=[];U.getEnabled().forEach(o=>{if(!o||o!=null&&o.disabled)return;const p=z.get(o.id);if(p)switch(f.code){case Ne.Down:A.top<p.top&&u.push(o);break;case Ne.Up:A.top>p.top&&u.push(o);break;case Ne.Left:A.left>p.left&&u.push(o);break;case Ne.Right:A.left<p.left&&u.push(o);break}});const h=L0({collisionRect:A,droppableRects:z,droppableContainers:u});let g=tg(h,"id");if(g===(B==null?void 0:B.id)&&h.length>1&&(g=h[1].id),g!=null){const o=U.get(D.id),p=U.get(g),m=p?z.get(p.id):null,w=p==null?void 0:p.node.current;if(w&&m&&o&&p){const n=co(w).some((b,E)=>s[E]!==b),l=wg(o,p),a=X1(o,p),c=n||!l?{x:0,y:0}:{x:a?A.width-m.width:0,y:a?A.height-m.height:0},S={x:m.left,y:m.top};return c.x&&c.y?S:kn(S,c)}}}};function wg(f,C){return!oo(f)||!oo(C)?!1:f.data.current.sortable.containerId===C.data.current.sortable.containerId}function X1(f,C){return!oo(f)||!oo(C)||!wg(f,C)?!1:f.data.current.sortable.index<C.data.current.sortable.index}function xg(){var f;return((f=crypto.randomUUID)==null?void 0:f.call(crypto))??`id-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Eg({id:f,enabled:C,onToggle:D,onDelete:A,children:z,isExpandable:U,isExpanded:B,onToggleExpand:s,detailContent:u}){const{attributes:h,listeners:g,setNodeRef:o,transform:p,transition:m,isDragging:w}=G1({id:f}),_={transform:On.Transform.toString(p),opacity:w?.5:1};return V.jsxs("div",{ref:o,style:{..._,borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden"},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",minHeight:"var(--min-touch-target, 44px)",overflow:"hidden"},children:[V.jsx("div",{...h,...g,"aria-label":"Drag to reorder",style:{width:24,color:"var(--text-muted)",cursor:"grab",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,userSelect:"none",touchAction:"none"},children:"⋮⋮"}),V.jsx("button",{role:"switch","aria-checked":C,"aria-label":C?"Enabled, click to disable":"Disabled, click to enable",onClick:D,style:{width:32,height:20,borderRadius:10,border:"none",background:C?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:V.jsx("span",{style:{position:"absolute",top:2,left:C?14:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),z,U&&V.jsx("button",{"aria-label":B?"Collapse details":"Expand details","aria-expanded":B,onClick:s,style:{width:28,height:28,padding:0,borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:V.jsx("span",{style:{display:"inline-block",transform:B?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"},children:"▼"})}),V.jsx("button",{"aria-label":"Delete",onClick:A,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:18,flexShrink:0},children:"×"})]}),U&&B&&V.jsx("div",{style:{padding:"8px 16px 12px 68px",borderTop:"1px solid var(--border-color)",background:"var(--bg-secondary)"},children:u})]})}function Rg(){return A0(a_(eu,{activationConstraint:{distance:8}}),a_(Qc,{coordinateGetter:V1}))}const S_=f=>[...f].sort((C,D)=>Number(D.enabled)-Number(C.enabled));function K1(f){if(["Control","Alt","Shift","Meta"].includes(f.key))return null;let C="",D="";if(f.ctrlKey||f.altKey||f.metaKey){const A=f.key.toUpperCase(),z=f.ctrlKey?"Ctrl":f.altKey?"Alt":"Meta";if(f.key.length===1)if(C=`${z}+${A}`,f.ctrlKey)D=String.fromCharCode(f.key.toUpperCase().charCodeAt(0)-64);else return null;else return null}else if(f.key.startsWith("Arrow")){const z={ArrowUp:{label:"↑",code:"A"},ArrowDown:{label:"↓",code:"B"},ArrowRight:{label:"→",code:"C"},ArrowLeft:{label:"←",code:"D"}}[f.key];if(z)C=z.label,D=`\x1B[${z.code}`;else return null}else if(f.key==="Escape")C="Esc",D="\x1B";else if(f.key==="Enter")C="Enter",D="\r";else if(f.key==="Tab")C=f.shiftKey?"Shift+Tab":"Tab",D=f.shiftKey?"\x1B[Z":" ";else if(f.key==="Backspace")C="Backspace",D="";else if(f.key==="Delete")C="Delete",D="\x1B[3~";else if(f.key==="Home")C="Home",D="\x1B[H";else if(f.key==="End")C="End",D="\x1B[F";else if(f.key==="PageUp")C="PageUp",D="\x1B[5~";else if(f.key==="PageDown")C="PageDown",D="\x1B[6~";else if(f.key.match(/^F([1-9]|1[0-2])$/)){const A={F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"};C=f.key,D=A[f.key]??""}else if(f.key.length===1)C=f.key.toUpperCase(),D=f.key;else return null;return{label:C,data:D}}function Z1({shortcuts:f,onChange:C}){const[D,A]=W.useState(null),z=Rg(),U=(g,o)=>{g.preventDefault(),g.stopPropagation();const p=K1(g);if(p){const m=[...f];m[o]={...m[o],label:p.label,data:p.data},C(m),A(null)}},B=g=>{const o=[...f];o[g]={...o[g],enabled:!o[g].enabled},C(S_(o))},s=()=>{const g=[{label:"New",data:"",enabled:!0,_id:xg()},...f];C(S_(g)),A(0)},u=g=>{const o=f.filter((p,m)=>m!==g);C(o)},h=g=>{const{active:o,over:p}=g;if(p&&o.id!==p.id){const m=f.findIndex(l=>l._id===o.id),w=f.findIndex(l=>l._id===p.id),_=[...f],[n]=_.splice(m,1);_.splice(w,0,n),C(_)}};return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[V.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Shortcuts"}),V.jsx("button",{onClick:s,style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ Add"})]}),f.length===0&&V.jsx("div",{style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No shortcuts yet. Click the button above to add one."}),V.jsx(gg,{sensors:z,collisionDetection:ig,onDragEnd:h,children:V.jsx(yg,{items:f.map(g=>g._id),strategy:mg,children:f.map((g,o)=>V.jsx(Eg,{id:g._id,enabled:g.enabled,onToggle:()=>B(o),onDelete:()=>u(o),children:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[V.jsx("input",{type:"text",value:g.label,readOnly:!0,autoComplete:"off",placeholder:"Press key to capture",onClick:()=>A(o),onKeyDown:p=>U(p,o),onBlur:()=>A(null),"aria-label":`Shortcut ${o+1}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:D===o?"2px solid var(--status-running)":"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",textAlign:"center"}}),V.jsx("span",{title:g.data?g.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)",style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",fontSize:11,color:"var(--text-muted)",fontFamily:"monospace",flexShrink:0,width:35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.data?g.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)"})]})},g._id))})}),D!==null&&V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"center",marginTop:4},children:"Press a key to capture…"})]})}const Q1={width:"100%",padding:"10px 12px",borderRadius:6,fontSize:14,resize:"none",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap",lineHeight:"20px",boxSizing:"border-box"};function Ds(f){return{...Q1,...f}}const b_=f=>[...f].sort((C,D)=>Number(D.enabled)-Number(C.enabled));function J1({commands:f,onChange:C}){const[D,A]=W.useState(null),[z,U]=W.useState(""),[B,s]=W.useState(null),u=Rg(),h=l=>{A(l),U(f[l].command)},g=l=>{if(l<0){A(null),U("");return}let a=z.trim();if(!a){_(l);return}a.startsWith("/")||(a="/"+a);const c=[...f];c[l]={...c[l],label:a,command:a},C(c),A(null),U("")},o=l=>{const a=[...f];a[l]={...a[l],enabled:!a[l].enabled},C(b_(a))},p=l=>{const a=[...f];a[l]={...a[l],autoSend:!(a[l].autoSend??!0)},C(a)},m=l=>{s(a=>a===l?null:l)},w=()=>{const l=[{label:"/new",command:"/new",enabled:!0,autoSend:!0,_id:xg()},...f];C(b_(l)),A(0),U("/new")},_=l=>{const a=f.filter((c,S)=>S!==l);C(a),B===l?s(null):B!==null&&B>l&&s(B-1)},n=l=>{const{active:a,over:c}=l;if(c&&a.id!==c.id){const S=f.findIndex(y=>y._id===a.id),x=f.findIndex(y=>y._id===c.id),b=[...f],[E]=b.splice(S,1);b.splice(x,0,E),C(b),B!==null&&(B===S?s(x):S<B&&x>=B?s(B-1):S>B&&x<=B&&s(B+1))}};return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[V.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Commands"}),V.jsx("button",{onClick:w,style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ Add"})]}),f.length===0&&V.jsx("div",{style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No commands yet. Click the button above to add one."}),V.jsx(gg,{sensors:u,collisionDetection:ig,onDragEnd:n,children:V.jsx(yg,{items:f.map(l=>l._id),strategy:mg,children:f.map((l,a)=>V.jsx(Eg,{id:l._id,enabled:l.enabled,onToggle:()=>o(a),onDelete:()=>_(a),isExpandable:!0,isExpanded:B===a,onToggleExpand:()=>m(a),detailContent:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[V.jsx("button",{role:"switch","aria-checked":l.autoSend??!0,"aria-label":l.autoSend??!0?"Auto-send is on, click to turn off":"Auto-send is off, click to turn on",onClick:()=>p(a),style:{width:36,height:22,borderRadius:11,border:"none",background:l.autoSend??!0?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:V.jsx("span",{style:{position:"absolute",top:2,left:l.autoSend??!0?16:2,width:18,height:18,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),V.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Auto-send on click"})]}),children:D===a?V.jsx("textarea",{value:z,onChange:c=>U(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),g(a)),c.key==="Escape"&&(U(""),g(-1))},onBlur:()=>g(a),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command…","aria-label":`Command ${a+1}`,style:Ds({flex:1,minWidth:0,height:36,padding:"0 12px",border:"2px solid var(--status-running)",background:"var(--bg-primary)",color:"var(--text-primary)",lineHeight:"36px"})}):V.jsx("button",{type:"button",onClick:()=>h(a),"aria-label":`Edit command ${l.label}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,display:"flex",alignItems:"center",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.label})},l._id))})}),V.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:8},children:"Tip: Commands are auto-prefixed with / (e.g., help → /help)"})]})}function em({checked:f,onChange:C,disabled:D=!1,"aria-label":A}){return V.jsx("button",{type:"button",role:"switch","aria-checked":f,"aria-label":A,disabled:D,onClick:()=>!D&&C(!f),style:{position:"relative",width:"44px",height:"24px",borderRadius:"12px",border:"none",padding:0,cursor:D?"not-allowed":"pointer",background:f?"var(--status-running)":"var(--bg-tertiary)",opacity:D?.5:1,transition:"background 150ms ease-out",touchAction:"manipulation",WebkitTapHighlightColor:"transparent"},children:V.jsx("span",{style:{position:"absolute",top:"2px",left:f?"22px":"2px",width:"20px",height:"20px",borderRadius:"50%",background:"#ffffff",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3)",transition:"left 150ms ease-out"}})})}function Ja({channelType:f,status:C,isExpanded:D,onToggle:A,onEnabledChange:z,children:U}){const B=c0[f],s=(B==null?void 0:B.implemented)??!1,u=(C==null?void 0:C.configured)??!1,h=(C==null?void 0:C.enabled)??!0,g={dingtalk:"📱",email:"📧",slack:"💬",wechat_work:"💼"},o=p=>{p.stopPropagation()};return V.jsxs("div",{style:{border:"1px solid var(--border-color)",borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden",opacity:s?1:.6},children:[V.jsxs("button",{onClick:s?A:void 0,style:{width:"100%",padding:"16px",border:"none",background:D?"var(--bg-secondary)":"transparent",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:s?"pointer":"default",textAlign:"left"},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[V.jsx("span",{style:{fontSize:24},children:g[f]??"🔔"}),V.jsxs("div",{children:[V.jsxs("div",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",display:"flex",alignItems:"center",gap:8},children:[(B==null?void 0:B.displayName)??f,u&&V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:h?"var(--status-running)":"var(--text-muted)"},title:h?"Enabled":"Disabled"})]}),V.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:2},children:(B==null?void 0:B.description)??""})]})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[u&&z&&V.jsx("div",{onClick:o,children:V.jsx(em,{checked:h,onChange:z,"aria-label":`Toggle ${(B==null?void 0:B.displayName)??f}`})}),!s&&V.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)",background:"var(--bg-secondary)",padding:"4px 10px",borderRadius:12},children:"Coming"}),s&&V.jsx("svg",{style:{width:16,height:16,transform:D?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:V.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),s&&D&&V.jsx("div",{style:{padding:"16px",borderTop:"1px solid var(--border-color)",background:"var(--bg-primary)"},children:U})]})}function tm({webhookUrl:f,onChange:C,configured:D}){const[A,z]=W.useState(!1),U=f===""||W_.test(f),B=A&&!U&&f!=="";return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{children:[V.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"Webhook URL"}),V.jsx("textarea",{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",value:f,onChange:s=>{C(s.target.value)},onBlur:()=>z(!0),style:Ds({border:`1px solid ${B?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),B&&V.jsx("div",{style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid DingTalk Webhook URL starting with https://oapi.dingtalk.com/robot/send?access_token="})]}),D&&!f&&V.jsx("div",{style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new URL to update."}),V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:V.jsx("a",{href:"https://open.dingtalk.com/document/robots/custom-robot-access",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get DingTalk group bot Webhook?"})})]})}function im({sendKey:f,onChange:C,configured:D}){const[A,z]=W.useState(!1),U=f===""||G_.test(f),B=A&&!U&&f!=="";return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{children:[V.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"SendKey"}),V.jsx("textarea",{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"SCTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",value:f,onChange:s=>{C(s.target.value)},onBlur:()=>z(!0),style:Ds({border:`1px solid ${B?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),B&&V.jsx("div",{style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid SendKey (starts with SCT, at least 13 characters)"})]}),D&&!f&&V.jsx("div",{style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new SendKey to update."}),V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:V.jsx("a",{href:"https://sct.ftqq.com/sendkey",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get SendKey?"})})]})}function rm({notificationStatus:f,dingtalkWebhookUrl:C,onDingtalkWebhookChange:D,wechatWorkSendKey:A,onWechatWorkSendKeyChange:z,onChannelEnabledChange:U}){var h,g,o,p;const[B,s]=W.useState("dingtalk"),u=m=>{s(w=>w===m?null:m)};return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsx("div",{style:{padding:12,background:"var(--bg-tertiary)",borderRadius:8,fontSize:13,color:"var(--text-secondary)"},children:"Configure notification channels to receive alerts when Claude needs your attention."}),V.jsx(Ja,{channelType:"dingtalk",status:f==null?void 0:f.dingtalk,isExpanded:B==="dingtalk",onToggle:()=>u("dingtalk"),onEnabledChange:(h=f==null?void 0:f.dingtalk)!=null&&h.configured?m=>U==null?void 0:U("dingtalk",m):void 0,children:V.jsx(tm,{webhookUrl:C,onChange:D,configured:(g=f==null?void 0:f.dingtalk)==null?void 0:g.configured})}),V.jsx(Ja,{channelType:"wechat_work",status:f==null?void 0:f.wechat_work,isExpanded:B==="wechat_work",onToggle:()=>u("wechat_work"),onEnabledChange:(o=f==null?void 0:f.wechat_work)!=null&&o.configured?m=>U==null?void 0:U("wechat_work",m):void 0,children:V.jsx(im,{sendKey:A,onChange:z,configured:(p=f==null?void 0:f.wechat_work)==null?void 0:p.configured})}),V.jsx(Ja,{channelType:"email",status:f==null?void 0:f.email,isExpanded:B==="email",onToggle:()=>u("email")}),V.jsx(Ja,{channelType:"slack",status:f==null?void 0:f.slack,isExpanded:B==="slack",onToggle:()=>u("slack")})]})}const sm=100,nm=300;var z_;const Rn=typeof window<"u"&&((z_=window.matchMedia)==null?void 0:z_.call(window,"(prefers-reduced-motion: reduce)").matches),kc=Rn?0:300;function Ag({isOpen:f,onClose:C,title:D,children:A,footer:z}){const[U,B]=W.useState(!1),[s,u]=W.useState(!1),[h,g]=W.useState(0),[o,p]=W.useState(!1),m=W.useRef(0),w=W.useRef(0);W.useEffect(()=>{if(f)B(!0),g(0),Rn?u(!0):requestAnimationFrame(()=>{requestAnimationFrame(()=>u(!0))});else if(U)if(u(!1),Rn)B(!1);else{const x=setTimeout(()=>B(!1),kc);return()=>clearTimeout(x)}},[f,U]);const _=W.useCallback(x=>{p(!0),m.current=x,w.current=Date.now(),g(0)},[]),n=W.useCallback(x=>{if(!o)return;const b=x-m.current;b>0&&g(b)},[o]),l=W.useCallback(()=>{if(!o)return;const x=h,b=Date.now()-w.current,E=b>0?x/(b/1e3):0;x>sm||x>50&&E>nm?C():g(0),p(!1)},[o,h,C]);if(!U)return null;const a=Rn||o?"none":`transform ${kc}ms ease-out`,c=Rn?"none":`background ${kc}ms ease-out`,S=o?`translateY(${h}px)`:s?"translateY(0)":"translateY(100%)";return V.jsx("div",{onClick:C,style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:s?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:c,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1e3},children:V.jsxs("div",{onClick:x=>x.stopPropagation(),style:{width:"100%",maxWidth:480,maxHeight:"calc(85vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",transform:S,transition:a,paddingBottom:"var(--safe-bottom)"},children:[V.jsx("div",{style:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2,margin:"12px auto",flexShrink:0,cursor:"pointer"},onTouchStart:x=>_(x.touches[0].clientY),onTouchMove:x=>n(x.touches[0].clientY),onTouchEnd:l,onMouseDown:x=>_(x.clientY),onMouseMove:x=>o&&n(x.clientY),onMouseUp:l,onMouseLeave:l}),V.jsxs("div",{style:{padding:"0 20px 16px 20px",display:"flex",justifyContent:"space-between",alignItems:"center",flexShrink:0},children:[V.jsx("h2",{style:{fontSize:18,fontWeight:600,margin:0},children:D}),V.jsx("button",{onClick:C,"aria-label":"Close",style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",fontSize:20,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:"×"})]}),V.jsx("div",{style:{flex:1,overflow:"auto",overscrollBehavior:"contain",padding:"0 16px"},children:A}),z&&V.jsx("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border-color)",flexShrink:0},children:z})]})})}function am({isOpen:f,onClose:C,onConfigSaved:D}){const[A,z]=W.useState("shortcuts"),[U,B]=W.useState([]),[s,u]=W.useState([]),[h,g]=W.useState(""),[o,p]=W.useState(""),[m,w]=W.useState({}),[_,n]=W.useState(!1),[l,a]=W.useState(null),[c,S]=W.useState(!1),x=W.useRef(0);function b(){return String(++x.current)}function E(I){return{...I,_id:b()}}W.useEffect(()=>{f&&y()},[f]);const y=async()=>{try{const{config:I}=await P_();if(I){B(I.shortcuts.map(H=>E(H))),u(I.commands.map(H=>E(H)));const M=I.notifications||{};w(M),g("")}else B($_.map(M=>E({...M,enabled:!0}))),u(Y_.map(M=>E({...M,enabled:!0}))),w({}),g("")}catch(I){a("Failed to load configuration"),console.error(I)}},R=async(I,M)=>{const H=m;w(q=>({...q,[I]:{...q[I],configured:!0,enabled:M}}));try{await s0(I,M)}catch(q){w(H),console.error("Failed to update channel enabled status:",q),a("Failed to update channel status"),setTimeout(()=>a(null),2e3)}},T=async()=>{var I,M;n(!0),a(null),S(!1);try{const H={shortcuts:U.map(({_id:Y,...k})=>k),commands:s.map(({_id:Y,...k})=>k)},q={},Q=h.trim();if(Q){if(!W_.test(Q)){a("Please enter a valid DingTalk Webhook URL (starting with https://oapi.dingtalk.com/robot/send?access_token=)"),n(!1);return}q.dingtalk={webhookUrl:Q}}const G=o.trim();if(G){if(!G_.test(G)){a("Please enter a valid SendKey (starts with SCT, at least 13 characters)"),n(!1);return}q.wechat_work={sendKey:G}}if(Object.keys(q).length>0&&(H.notifications=q),await r0(H)){S(!0);const Y={...m};Q&&(Y.dingtalk={...m==null?void 0:m.dingtalk,configured:!0,enabled:(I=m==null?void 0:m.dingtalk)==null?void 0:I.enabled},g("")),G&&(Y.wechat_work={...m==null?void 0:m.wechat_work,configured:!0,enabled:(M=m==null?void 0:m.wechat_work)==null?void 0:M.enabled},p("")),w(Y),D==null||D(),setTimeout(()=>S(!1),2e3)}else a("Failed to save")}catch(H){a("Failed to save"),console.error(H)}finally{n(!1)}};return V.jsxs(Ag,{isOpen:f,onClose:C,title:"Settings",footer:V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[V.jsxs("div",{style:{fontSize:13},children:[l&&V.jsx("span",{style:{color:"var(--status-error)"},children:l}),c&&V.jsx("span",{style:{color:"var(--status-running)"},children:"Saved"})]}),V.jsxs("div",{style:{display:"flex",gap:8},children:[V.jsx("button",{onClick:C,style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),V.jsx("button",{onClick:T,disabled:_,style:{padding:"8px 20px",borderRadius:6,border:"none",background:_?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:_?"default":"pointer",opacity:_?.7:1},children:_?"Saving…":"Save"})]})]}),children:[V.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border-color)",margin:"0 -16px",marginBottom:16},children:["shortcuts","commands","notifications"].map(I=>V.jsx("button",{onClick:()=>z(I),style:{flex:1,padding:"12px 16px",border:"none",background:"transparent",color:A===I?"var(--text-primary)":"var(--text-secondary)",borderBottom:A===I?"2px solid var(--status-running)":"2px solid transparent",cursor:"pointer",fontSize:14,fontWeight:A===I?600:400},children:I==="shortcuts"?"Shortcuts":I==="commands"?"Commands":"Notifications"},I))}),A==="shortcuts"?V.jsx(Z1,{shortcuts:U,onChange:B}):A==="commands"?V.jsx(J1,{commands:s,onChange:u}):V.jsx(rm,{notificationStatus:m,dingtalkWebhookUrl:h,onDingtalkWebhookChange:g,wechatWorkSendKey:o,onWechatWorkSendKeyChange:p,onChannelEnabledChange:R})]})}const om={idle:{color:"var(--status-idle)",label:"Idle"},running:{color:"var(--status-running)",label:"Running"},waiting_input:{color:"var(--status-waiting)",label:"Waiting Input"}},lm={connecting:{color:"var(--status-waiting)",label:"Connecting..."},connected:{color:"var(--status-idle)",label:"Connected"},disconnected:{color:"var(--status-error)",label:"Disconnected"}};function cm(){const[f,C]=W.useState(!1),D=rt(s=>s.sessionStatus),A=Yt(s=>s.activeInstanceId),z=rt(s=>A?s.instanceConnectionStatus[A]??"disconnected":s.connectionStatus),U=om[D],B=lm[z];return V.jsxs(V.Fragment,{children:[V.jsxs("div",{style:{height:"var(--statusbar-height)",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",paddingTop:"var(--safe-top)",flexShrink:0},children:[V.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,overflow:"hidden",flex:"1 1 auto"},children:V.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:"Claude Remote"})}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:U.color,display:"inline-block"}}),V.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:U.label})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:B.color,display:"inline-block"}}),V.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:B.label})]}),V.jsx("button",{onClick:()=>C(!0),"aria-label":"Settings",style:{width:44,height:44,marginRight:-12,borderRadius:8,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"⚙"})]})]}),V.jsx(am,{isOpen:f,onClose:()=>C(!1),onConfigSaved:X_})]})}function um({containerRef:f}){return V.jsx("div",{ref:f,style:{flex:1,overflow:"hidden",background:"var(--bg-primary)"}})}const hm=W.forwardRef(function({onSend:C,disabled:D,isKeyboardOpen:A},z){const[U,B]=W.useState(""),s=W.useRef(null);W.useImperativeHandle(z,()=>({setText:g=>{B(g)},focus:()=>{var g;return(g=s.current)==null?void 0:g.focus()}}),[]);const u=W.useCallback(()=>{const g=U.trim();C(g),B("")},[U,C]),h=W.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),u())},[u]);return V.jsx("div",{"data-testid":"input-bar",style:{height:"var(--inputbar-height)",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center",padding:"8px 12px",paddingBottom:A?"8px":"calc(8px + var(--safe-bottom))",transition:"padding-bottom 0.25s ease-out",gap:8,flexShrink:0},children:V.jsx("textarea",{ref:s,"data-testid":"command-input",value:U,onChange:g=>B(g.target.value),onKeyDown:h,disabled:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command or number to select…","aria-label":"Command input",style:Ds({flex:1,height:40,borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:16,fontFamily:"inherit"})})})}),Dg={height:36,borderRadius:6,border:"none",background:"var(--bg-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},dm={...Dg,minWidth:44,flexShrink:0,color:"var(--text-primary)",fontSize:13,padding:"0 12px"},fm={...Dg,minWidth:60,flexShrink:0,color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap",padding:"0 12px"};function eo(){document.activeElement instanceof HTMLElement&&document.activeElement.blur()}function Oc(f,C,D){f.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),C(D);const A=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};requestAnimationFrame(A),setTimeout(A,0)}function _m({onShortcut:f,onCommandSelect:C,onCommandSend:D,visible:A=!0}){const{shortcuts:z,commands:U,isLoading:B}=d0();return!A||B?null:V.jsxs("div",{"data-testid":"command-picker",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",flexShrink:0},children:[V.jsx("div",{"data-testid":"shortcut-bar","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:z.map(s=>V.jsx("button",{type:"button",className:"cmd-picker-btn",onClick:u=>Oc(u,f,s.data),onTouchStart:eo,onMouseDown:u=>{u.preventDefault(),eo()},style:dm,children:s.label},s.label))}),V.jsx("div",{"data-testid":"command-buttons","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:U.map(s=>{const u=s.autoSend??!0;return V.jsx("button",{type:"button",className:"cmd-picker-btn",onClick:h=>{u?Oc(h,D,s.command):Oc(h,C,s.command+" ")},onTouchStart:eo,onMouseDown:h=>{h.preventDefault(),eo()},style:fm,children:s.label},s.label)})}),V.jsx("style",{children:`
54
+ [data-scrollable]::-webkit-scrollbar {
55
+ display: none;
56
+ }
57
+ @media (prefers-reduced-motion: no-preference) {
58
+ .cmd-picker-btn:hover {
59
+ filter: brightness(1.2);
60
+ }
61
+ .cmd-picker-btn:active {
62
+ transform: scale(0.95);
63
+ filter: brightness(0.9);
64
+ }
65
+ }
66
+ @media (prefers-reduced-motion: reduce) {
67
+ .cmd-picker-btn:hover {
68
+ filter: brightness(1.2);
69
+ }
70
+ .cmd-picker-btn:active {
71
+ filter: brightness(0.9);
72
+ }
73
+ }
74
+ `})]})}function gm(){const f=Yt(z=>z.activeInstanceId),C=Yt(z=>z.instances),D=rt(z=>z.serverAvailable),A=rt(z=>f?z.instanceConnectionStatus[f]??"disconnected":z.connectionStatus);return D===!0&&C.length===0?V.jsx("div",{style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:"var(--status-waiting)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:"No instances available"}):D===!1?V.jsx("div",{style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:"Server unavailable"}):A==="connected"?null:V.jsx("div",{style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:A==="connecting"?"var(--status-waiting)":"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:A==="connecting"?"Connecting…":"Disconnected. Reconnecting…"})}function vm(){const f=rt(z=>z.ipChangeInfo),C=rt(z=>z.setIpChangeInfo);if(!f)return null;const D=()=>{navigator.clipboard.writeText(f.newUrl),C(null)},A=()=>{C(null)};return V.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top) + 8px)",left:"50%",transform:"translateX(-50%)",zIndex:100,maxWidth:"calc(100% - 32px)",background:"var(--status-waiting)",color:"#fff",borderRadius:"8px",padding:"12px 16px",fontSize:"14px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",gap:"8px"},children:[V.jsx("div",{style:{fontWeight:500},children:"IP Address Changed"}),V.jsxs("div",{style:{fontSize:"13px",opacity:.9},children:[f.oldIp," → ",f.newIp]}),V.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"4px"},children:[V.jsx("button",{onClick:D,style:{flex:1,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Copy New URL"}),V.jsx("button",{onClick:A,style:{background:"transparent",border:"1px solid rgba(255,255,255,0.3)",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Close"})]})]})}async function Wc(){const f=await fetch("/api/instances",{credentials:"include"});if(f.status===401){const C=Tn();if(console.log("[fetchInstances] got 401, cachedToken =",C?"exists":"null"),C)try{console.log("[fetchInstances] attempting re-authentication...");const D=await xr(C);if(console.log("[fetchInstances] re-auth result:",D),D){const A=await fetch("/api/instances",{credentials:"include"});if(A.ok)return console.log("[fetchInstances] retry succeeded"),A.json()}}catch(D){console.log("[fetchInstances] re-auth error:",D)}throw new Error("Unauthorized")}if(!f.ok)throw new Error(`Failed to fetch instances: ${f.status}`);return f.json()}function pm(f){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/${f}`}async function Lg(f,C){const D=await fetch(f,C);if(D.status===401){const A=Tn();if(A)try{if(await xr(A))return fetch(f,C)}catch{}}return D}async function mm(){const f=await Lg("/api/instances/config",{credentials:"include"});if(f.status===401)throw new Error("Unauthorized");if(!f.ok)throw new Error(`Failed to get instance config: ${f.status}`);return f.json()}async function Sm(f){const C=await Lg("/api/instances/create",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(f)});if(C.status===401)throw new Error("Unauthorized");if(!C.ok){const D=await C.json().catch(()=>({error:"Unknown error"}));throw new Error(D.error||`Failed to create instance: ${C.status}`)}return C.json()}const bm=100,ym=300;var I_;const to=typeof window<"u"&&((I_=window.matchMedia)==null?void 0:I_.call(window,"(prefers-reduced-motion: reduce)").matches),Bc=300;function y_({options:f,value:C,onChange:D,placeholder:A="Select…",disabled:z=!1,id:U,emptyMessage:B="No options available",triggerIcon:s,getDisplayLabel:u}){const[h,g]=W.useState(!1),[o,p]=W.useState(!1),[m,w]=W.useState(-1),[_,n]=W.useState(0),[l,a]=W.useState(!1),c=W.useRef(null),S=W.useRef(0),x=W.useRef(0),b=W.useMemo(()=>f.find($=>$.value===C)??null,[f,C]),E=W.useMemo(()=>u?u(C):(b==null?void 0:b.label)||A,[u,C,b,A]),y=W.useCallback(()=>{z||f.length===0||(g(!0),w(-1))},[z,f.length]),R=W.useCallback(()=>{p(!1),n(0),to?g(!1):setTimeout(()=>g(!1),Bc)},[]),T=W.useCallback($=>{a(!0),S.current=$,x.current=Date.now(),n(0)},[]),I=W.useCallback($=>{if(!l)return;const Y=$-S.current;Y>0&&n(Y)},[l]),M=W.useCallback(()=>{if(!l)return;const $=_,Y=Date.now()-x.current,k=Y>0?$/(Y/1e3):0;$>bm||$>50&&k>ym?R():n(0),a(!1)},[l,_,R]),H=W.useCallback($=>{D($.value),R()},[D,R]);if(W.useEffect(()=>{if(h){const $=setTimeout(()=>{p(!0)},to?0:10);return()=>clearTimeout($)}},[h]),W.useCallback($=>{const Y=f.length;switch($.key){case"ArrowDown":$.preventDefault(),w(k=>k<Y-1?k+1:0);break;case"ArrowUp":$.preventDefault(),w(k=>k>0?k-1:Y-1);break;case"Enter":$.preventDefault(),m>=0&&m<Y&&H(f[m]);break;case"Escape":$.preventDefault(),R();break}},[f,m,H,R]),f.length===0)return V.jsx("div",{style:Bt.emptyState,children:B});const q=to||l?"none":`transform ${Bc}ms ease-out`,Q=to?"none":`background ${Bc}ms ease-out`,G=l?`translateY(${_}px)`:o?"translateY(0)":"translateY(100%)";return V.jsxs(V.Fragment,{children:[V.jsxs("button",{ref:c,type:"button",onClick:y,onTouchStart:()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()},disabled:z,id:U,style:{...Bt.trigger,...z?Bt.triggerDisabled:{}},"aria-haspopup":"listbox","aria-expanded":h,children:[s,V.jsx("span",{style:Bt.triggerText,children:E}),V.jsx("span",{style:Bt.triggerArrow,children:"▼"})]}),h&&V.jsx("div",{onClick:R,style:{...Bt.overlay,background:o?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:Q},children:V.jsxs("div",{"data-testid":"action-sheet-panel",onClick:$=>$.stopPropagation(),style:{...Bt.sheet,transform:G,transition:q},children:[V.jsx("div",{"data-testid":"drag-handle",style:Bt.handle,onTouchStart:$=>T($.touches[0].clientY),onTouchMove:$=>I($.touches[0].clientY),onTouchEnd:M,onMouseDown:$=>T($.clientY),onMouseMove:$=>l&&I($.clientY),onMouseUp:M,onMouseLeave:M}),V.jsx("div",{style:Bt.listContainer,role:"listbox",children:f.length===0?V.jsx("div",{style:Bt.emptyList,children:B}):f.map(($,Y)=>V.jsxs("div",{role:"option","aria-selected":m===Y,onClick:()=>H($),onMouseEnter:()=>w(Y),style:{...Bt.option,...m===Y?Bt.optionHighlighted:{},...C===$.value?Bt.optionSelected:{}},children:[$.icon,V.jsxs("span",{style:Bt.optionLabel,children:[$.label,$.description&&V.jsxs("span",{style:Bt.optionDescriptionInline,children:[" (",$.description,")"]})]}),C===$.value&&V.jsx(Cm,{})]},Y))})]})})]})}function Cm(){return V.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:Bt.checkIcon,children:V.jsx("path",{d:"M3 8L6.5 11.5L13 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Bt={emptyState:{padding:"10px 12px",borderRadius:8,background:"var(--bg-tertiary)",color:"var(--text-secondary)",fontSize:13},trigger:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:8,textAlign:"left",boxSizing:"border-box",transition:"border-color 0.15s ease"},triggerDisabled:{opacity:.6,cursor:"not-allowed"},triggerText:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},triggerArrow:{fontSize:10,color:"var(--text-secondary)",marginLeft:"auto"},overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1100},sheet:{width:"100%",maxWidth:480,maxHeight:"calc(80vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",paddingBottom:"var(--safe-bottom)"},handle:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2,margin:"12px auto",flexShrink:0},listContainer:{flex:"1 1 auto",overflow:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:"8px 0"},emptyList:{padding:"32px 16px",textAlign:"center",color:"var(--text-secondary)",fontSize:14},option:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",cursor:"pointer",transition:"background-color 0.1s ease"},optionHighlighted:{background:"rgba(88, 166, 255, 0.15)"},optionSelected:{background:"rgba(88, 166, 255, 0.08)"},optionLabel:{flex:1,minWidth:0,color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},optionDescriptionInline:{color:"var(--text-secondary)",fontSize:12},checkIcon:{marginLeft:"auto",flexShrink:0,color:"var(--status-running)"}};var N_;const wm=typeof window<"u"&&((N_=window.matchMedia)==null?void 0:N_.call(window,"(prefers-reduced-motion: reduce)").matches);function C_({options:f,value:C,onChange:D,disabled:A=!1,"aria-label":z}){const U=W.useRef(null),B=W.useRef([]),[s,u]=W.useState({}),h=f.findIndex(m=>m.value===C);W.useEffect(()=>{const m=U.current,w=B.current[h],_=()=>{if(w&&m){const n=m.getBoundingClientRect(),l=w.getBoundingClientRect(),a=l.left-n.left+m.scrollLeft-3,c=l.width;u({transform:`translateX(${a}px)`,width:`${c}px`})}};return _(),m==null||m.addEventListener("scroll",_),()=>{m==null||m.removeEventListener("scroll",_)}},[h,f]);const g=m=>{A||D(m)},o=(m,w)=>{var n;if(A)return;let _=w;switch(m.key){case"ArrowLeft":m.preventDefault(),_=w>0?w-1:f.length-1;break;case"ArrowRight":m.preventDefault(),_=w<f.length-1?w+1:0;break;case"Home":m.preventDefault(),_=0;break;case"End":m.preventDefault(),_=f.length-1;break;default:return}D(f[_].value),(n=B.current[_])==null||n.focus()},p={role:"radiogroup","aria-label":z};return V.jsxs("div",{ref:U,style:{...pi.container,...A?pi.containerDisabled:{}},...p,children:[V.jsx("div",{style:{...pi.indicator,...s,...wm?{}:pi.indicatorAnimated,...h===-1?pi.indicatorHidden:{}},"aria-hidden":"true"}),f.map((m,w)=>{const _=w===h;return V.jsxs("button",{ref:n=>{B.current[w]=n},type:"button",role:"radio",title:m.title,"aria-checked":_,disabled:A,onClick:()=>g(m.value),onKeyDown:n=>o(n,w),style:{...pi.option,..._?pi.optionSelected:{}},children:[m.icon&&V.jsx("span",{style:pi.icon,children:m.icon}),V.jsx("span",{style:pi.labelWrapper,children:V.jsx("span",{style:pi.label,children:m.label})}),m.description&&V.jsx("span",{style:pi.descriptionWrapper,children:V.jsx("span",{style:pi.description,children:m.description})})]},String(m.value))})]})}const pi={container:{display:"flex",maxWidth:"100%",overflowX:"auto",background:"var(--bg-tertiary)",borderRadius:10,padding:3,position:"relative",gap:2,scrollbarWidth:"none",msOverflowStyle:"none"},containerDisabled:{opacity:.6,cursor:"not-allowed"},indicator:{position:"absolute",top:3,bottom:3,background:"var(--status-running)",borderRadius:7,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15)",zIndex:0},indicatorAnimated:{transition:"transform 0.2s ease, width 0.2s ease"},indicatorHidden:{opacity:0},option:{flexShrink:0,minWidth:80,minHeight:44,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:"var(--text-secondary)",background:"transparent",border:"none",borderRadius:7,padding:"6px 8px",cursor:"pointer",transition:"color 0.15s ease",fontFamily:"var(--font-sans)",fontSize:14,lineHeight:1.2,overflow:"visible"},optionSelected:{color:"#fff",fontWeight:500},icon:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:2,flexShrink:0},labelWrapper:{textAlign:"center",maxWidth:"100%"},label:{whiteSpace:"nowrap"},descriptionWrapper:{textAlign:"center",maxWidth:"100%"},description:{fontSize:11,opacity:.8,marginTop:1,whiteSpace:"nowrap"}};function w_(f){const C=f.split("/").filter(Boolean);return C[C.length-1]||f}function xm(f){const C=f.split("/").filter(Boolean);return C.length<=1?f:".../"+C[C.length-2]}function x_(){return V.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[V.jsx("path",{d:"M2 4C2 3.44772 2.44772 3 3 3H6.17157C6.43678 3 6.69114 3.10536 6.87868 3.29289L7.58579 4H13C13.5523 4 14 4.44772 14 5V12C14 12.5523 13.5523 13 13 13H3C2.44772 13 2 12.5523 2 12V4Z",fill:"currentColor",opacity:"0.6"}),V.jsx("path",{d:"M2 5.5V12C2 12.5523 2.44772 13 3 13H13C13.5523 13 14 12.5523 14 12V5.5C14 5.22386 13.7761 5 13.5 5H2.5C2.22386 5 2 5.22386 2 5.5Z",fill:"currentColor"})]})}function E_(){return V.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[V.jsx("path",{d:"M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),V.jsx("path",{d:"M12.9247 8.99999C12.9692 8.66999 13 8.33749 13 7.99999C13 7.66249 12.9692 7.32999 12.9247 6.99999L14.3622 5.91249C14.4872 5.81249 14.5197 5.63749 14.4372 5.48749L13.0622 3.01249C12.9797 2.86249 12.8122 2.81249 12.6622 2.86249L10.9247 3.51249C10.4247 3.13749 9.87468 2.82499 9.28718 2.58749L9.01218 0.787487C8.98718 0.624987 8.84968 0.499987 8.68718 0.499987H5.93718C5.77468 0.499987 5.63718 0.624987 5.61218 0.787487L5.33718 2.58749C4.74968 2.82499 4.19968 3.14999 3.69968 3.51249L1.96218 2.86249C1.81218 2.81249 1.64468 2.86249 1.56218 3.01249L0.187178 5.49999C0.099678 5.64999 0.137178 5.82499 0.262178 5.92499L1.69968 6.99999C1.65518 7.32999 1.62468 7.66249 1.62468 7.99999C1.62468 8.33749 1.65518 8.66999 1.69968 8.99999L0.262178 10.0875C0.137178 10.1875 0.104678 10.3625 0.187178 10.5125L1.56218 12.9875C1.64468 13.1375 1.81218 13.1875 1.96218 13.1375L3.69968 12.4875C4.19968 12.8625 4.74968 13.175 5.33718 13.4125L5.61218 15.2125C5.63718 15.375 5.77468 15.5 5.93718 15.5H8.68718C8.84968 15.5 8.98718 15.375 9.01218 15.2125L9.28718 13.4125C9.87468 13.175 10.4247 12.85 10.9247 12.4875L12.6622 13.1375C12.8122 13.1875 12.9797 13.1375 13.0622 12.9875L14.4372 10.5C14.5197 10.35 14.4872 10.175 14.3622 10.075L12.9247 8.99999ZM8 10.5C6.62468 10.5 5.49968 9.37499 5.49968 7.99999C5.49968 6.62499 6.62468 5.49999 8 5.49999C9.37532 5.49999 10.5003 6.62499 10.5003 7.99999C10.5003 9.37499 9.37532 10.5 8 10.5Z",fill:"currentColor",opacity:"0.8"})]})}function Em(){return V.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:V.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})})}function Rm({isOpen:f,onClose:C,onSuccess:D,copySource:A}){const[z,U]=W.useState(null),[B,s]=W.useState(""),[u,h]=W.useState(""),[g,o]=W.useState(""),[p,m]=W.useState(""),[w,_]=W.useState(!1),[n,l]=W.useState(null),a=W.useRef(null),c=W.useMemo(()=>z?z.workspaces.map(M=>({value:M,label:w_(M),description:xm(M),icon:V.jsx(x_,{})})):[],[z]),S=W.useMemo(()=>z?z.workspaces.map(M=>({value:M,label:w_(M)})):[],[z]),x=z?z.workspaces.length<=4:!1,b=W.useMemo(()=>{if(!z)return[];const M=[{value:"",label:"None",title:"No settings file"}];return z.settingsFiles.forEach(H=>{M.push({value:H.filename,label:H.displayName,title:`${H.directoryPath}/${H.filename}`})}),M},[z]),E=z?z.settingsFiles.length+1<=4:!1,y=W.useMemo(()=>{if(!z)return[];const M=[{value:"",label:"None",icon:V.jsx(Em,{})}];return z.settingsFiles.forEach(H=>{M.push({value:H.filename,label:H.displayName,description:H.directory,icon:V.jsx(E_,{})})}),M},[z]);W.useEffect(()=>{if(f&&(R(!!A),s(""),h(""),o(""),m(""),l(null),a.current=null,A&&(s(A.cwd),h(`${A.name}-copy`),A.claudeArgs&&A.claudeArgs.length>0))){const M=[...A.claudeArgs],H=M.indexOf("--settings");H!==-1&&H+1<M.length&&(a.current=M[H+1],M.splice(H,2)),m(M.join(" "))}},[f,A]),W.useEffect(()=>{if(z&&a.current){const M=z.settingsFiles.find(H=>`${H.directoryPath}/${H.filename}`===a.current);M&&o(M.filename),a.current=null}},[z]),W.useEffect(()=>{z&&z.workspaces.length===1&&!B&&s(z.workspaces[0])},[z,B]);const R=async M=>{try{const H=await mm();U(H),!M&&H.claudeArgs.length>0&&m(H.claudeArgs.join(" "))}catch(H){console.error("Failed to load instance config:",H),l("Failed to load configuration")}},T=async()=>{if(!B){l("Please select a working directory");return}_(!0),l(null);try{const M=[];if(g&&z){const q=z.settingsFiles.find(Q=>Q.filename===g);q&&M.push("--settings",`${q.directoryPath}/${q.filename}`)}p.trim()&&M.push(...p.trim().split(/\s+/).filter(Boolean)),await Sm({cwd:B,name:u.trim()||void 0,claudeArgs:M.length>0?M:void 0});const H=u.trim()||B.split("/").pop()||"unknown";D(H),C()}catch(M){console.error("Failed to create instance:",M),l(M instanceof Error?M.message:"Failed to create instance")}finally{_(!1)}},I=z&&z.workspaces.length>0;return V.jsx(Ag,{isOpen:f,onClose:C,title:A?"Copy Instance":"Create New Instance",footer:V.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8},children:[V.jsx("button",{onClick:C,style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),V.jsx("button",{onClick:T,disabled:w||!I,style:{padding:"8px 20px",borderRadius:6,border:"none",background:w||!I?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:w||!I?"default":"pointer",opacity:w||!I?.7:1},children:w?A?"Copying…":"Creating…":A?"Copy":"Create"})]}),children:V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingBottom:16},children:[V.jsxs("div",{children:[V.jsx("label",{htmlFor:"cwd-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Working Directory *"}),x?V.jsx(C_,{options:S,value:B,onChange:s,disabled:!I,"aria-label":"Working directory"}):V.jsx(y_,{id:"cwd-select",options:c,value:B||null,onChange:s,placeholder:"Select working directory…",emptyMessage:"No workspaces available",disabled:!I,triggerIcon:V.jsx(x_,{})}),!I&&V.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:6,opacity:.8},children:"Please configure workspaces in the config file first, or start an instance via CLI."})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"instance-name",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Instance Name (optional)"}),V.jsx("textarea",{id:"instance-name",value:u,onChange:M=>h(M.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Defaults to working directory name",style:Ds({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})})]}),z&&z.settingsFiles.length>0&&V.jsxs("div",{children:[V.jsx("label",{htmlFor:"settings-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Settings File (optional)"}),E?V.jsx(C_,{options:b,value:g,onChange:o,"aria-label":"Settings file"}):V.jsx(y_,{id:"settings-select",options:y,value:g||null,onChange:o,placeholder:"None",triggerIcon:V.jsx(E_,{})}),V.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Custom Claude settings from ~/.claude/ or ~/.claude-remote/settings/"})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"claude-args",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Claude Arguments (optional)"}),V.jsx("textarea",{id:"claude-args",value:p,onChange:M=>m(M.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"e.g., chat --model claude-sonnet-4-6",style:Ds({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})}),V.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Multiple arguments separated by spaces (quoted arguments with spaces not supported)"})]}),n&&V.jsx("div",{style:{padding:"10px 12px",borderRadius:8,background:"rgba(255, 59, 48, 0.1)",color:"var(--status-error)",fontSize:13},children:n})]})})}function R_(f,C,D=140,A=44){const z=window.innerWidth-D-8,U=window.innerHeight-A-8;return{x:Math.max(8,Math.min(f,z)),y:Math.max(8,Math.min(C,U))}}function Am({onSwitch:f,onCopySuccess:C}){const D=Yt(b=>b.instances),A=Yt(b=>b.setInstances),z=Yt(b=>b.activeInstanceId),[U,B]=W.useState(!1),[s,u]=W.useState(null),[h,g]=W.useState(null),[o,p]=W.useState({x:0,y:0}),m=W.useRef(null),w=W.useRef(!1);W.useEffect(()=>{const b=()=>{g(null)};if(h)return document.addEventListener("click",b),()=>document.removeEventListener("click",b)},[h]);const _=(b,E)=>{w.current=!1;const{clientX:y,clientY:R}=E.touches[0];m.current=setTimeout(()=>{w.current=!0,p(R_(y,R)),g(b)},500)},n=()=>{m.current&&(clearTimeout(m.current),m.current=null)},l=W.useCallback(b=>{if(w.current){w.current=!1;return}f(b)},[f]),a=(b,E)=>{E.preventDefault(),p(R_(E.clientX,E.clientY)),g(b)},c=()=>{h&&(u(h),B(!0),g(null))},S=async b=>{for(let y=0;y<5;y++){await new Promise(R=>setTimeout(R,1e3));try{const R=await Wc();if([...R].filter(I=>I.name===b).sort((I,M)=>M.startedAt.localeCompare(I.startedAt))[0]){A(R),s&&C&&C(b);return}}catch(R){console.error("[InstanceTabs] Failed to fetch instances:",R)}}try{const y=await Wc();A(y)}catch{}},x=()=>{B(!1),u(null)};return V.jsxs(V.Fragment,{children:[V.jsxs("div",{"data-testid":"instance-tabs",style:{display:"flex",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[V.jsx("div",{style:{display:"flex",overflowX:"auto",padding:"0 4px 0 16px",flex:1},children:D.map(b=>{const E=b.instanceId===z;return V.jsxs("button",{"data-testid":"instance-tab",onClick:()=>l(b.instanceId),onTouchStart:y=>_(b,y),onTouchEnd:n,onTouchMove:n,onContextMenu:y=>a(b,y),style:{padding:"8px 16px",background:"transparent",border:"none",borderBottom:E?"2px solid var(--accent-color, #007aff)":"2px solid transparent",color:E?"var(--text-primary)":"var(--text-secondary)",fontSize:13,fontWeight:E?600:400,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0},children:[b.name,V.jsxs("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-tertiary, var(--text-secondary))",opacity:.7},children:["#",b.instanceId.substring(0,6)]})]},b.instanceId)})}),V.jsx("button",{onClick:()=>B(!0),"aria-label":"Create new instance",style:{width:44,height:44,padding:0,background:"transparent",border:"none",borderLeft:"1px solid var(--border-color)",color:"var(--text-secondary)",fontSize:22,fontWeight:600,cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:"+"})]}),h&&V.jsx("div",{onClick:b=>b.stopPropagation(),style:{position:"fixed",left:o.x,top:o.y,zIndex:1100,background:"var(--bg-secondary)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3)",overflow:"hidden",minWidth:140},children:V.jsx("button",{onClick:c,style:{display:"block",width:"100%",padding:"12px 16px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:14,textAlign:"left",cursor:"pointer"},children:"Copy Instance"})}),V.jsx(Rm,{isOpen:U,onClose:x,onSuccess:S,copySource:s})]})}function Dm({visible:f,onClick:C}){const[D,A]=W.useState(!1);W.useEffect(()=>{f&&A(!0)},[f]);const z=()=>{f||A(!1)};return D?V.jsx("button",{className:`scroll-to-bottom-btn ${f?"visible":"hidden"}`,onClick:C,onAnimationEnd:z,"aria-label":"Jump to latest output",children:"↓"}):null}const A_="__default__",D_=[1e3,2e3,4e3,8e3,16e3,3e4];function Lm(f,C,D=A_){const A=W.useRef(null),z=W.useRef(0),U=W.useRef(void 0),B=W.useRef(f),s=W.useRef(0),u=W.useRef(!1),h=rt(c=>c.setConnectionStatus),g=W.useRef(h),o=rt(c=>c.setInstanceConnectionStatus),p=W.useRef(o),m=W.useCallback(c=>{D===A_&&g.current(c),p.current(D,c)},[D]);W.useEffect(()=>{B.current=f},[f]),W.useEffect(()=>{g.current=h},[h]),W.useEffect(()=>{p.current=o},[o]);const w=W.useRef(void 0),_=W.useCallback(c=>{const S=D_[Math.min(z.current,D_.length-1)];z.current++,U.current=setTimeout(()=>{var x;u.current||c!==s.current||(x=w.current)==null||x.call(w)},S)},[]),n=W.useCallback(async()=>{if(!C){m("disconnected");return}if(A.current&&A.current.readyState===WebSocket.OPEN)return;const c=C;U.current&&(clearTimeout(U.current),U.current=void 0),u.current=!1;const S=++s.current;m("connecting");const x=new WebSocket(c);A.current=x,x.onopen=()=>{u.current||S!==s.current||A.current!==x||(m("connected"),z.current=0)},x.onmessage=b=>{if(!(u.current||S!==s.current||A.current!==x))try{const E=JSON.parse(b.data);B.current(E)}catch{}},x.onclose=async()=>{if(u.current||S!==s.current||A.current!==x)return;A.current=null,m("disconnected");const b=Tn();if(b)try{await xr(b)}catch{}_(S)},x.onerror=()=>{}},[_,m,C]);W.useEffect(()=>{w.current=n},[n]);const l=W.useCallback(c=>{var S;return((S=A.current)==null?void 0:S.readyState)===WebSocket.OPEN?(A.current.send(JSON.stringify(c)),!0):!1},[]),a=W.useCallback(()=>{u.current=!0,s.current++,U.current&&(clearTimeout(U.current),U.current=void 0);const c=A.current;A.current=null,c==null||c.close()},[]);return W.useEffect(()=>{const c=()=>{var S;(S=A.current)==null||S.close()};return window.addEventListener("offline",c),()=>{u.current=!0,s.current++,window.removeEventListener("offline",c),U.current&&(clearTimeout(U.current),U.current=void 0);const S=A.current;A.current=null,S==null||S.close()}},[]),{connect:n,disconnect:a,send:l}}var Hc={exports:{}},L_;function Tm(){return L_||(L_=1,(function(f,C){(function(D,A){f.exports=A()})(globalThis,(()=>(()=>{var D={4567:function(B,s,u){var h=this&&this.__decorate||function(a,c,S,x){var b,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,c,S,x);else for(var R=a.length-1;R>=0;R--)(b=a[R])&&(y=(E<3?b(y):E>3?b(c,S,y):b(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(a,c){return function(S,x){c(S,x,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const o=u(9042),p=u(9924),m=u(844),w=u(4725),_=u(2585),n=u(3656);let l=s.AccessibilityManager=class extends m.Disposable{constructor(a,c,S,x){super(),this._terminal=a,this._coreBrowserService=S,this._renderService=x,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((b=>this._handleResize(b.rows)))),this.register(this._terminal.onRender((b=>this._refreshRows(b.start,b.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((b=>this._handleChar(b)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
75
+ `)))),this.register(this._terminal.onA11yTab((b=>this._handleTab(b)))),this.register(this._terminal.onKey((b=>this._handleKey(b.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(a){for(let c=0;c<a;c++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
76
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,c){this._liveRegionDebouncer.refresh(a,c,this._terminal.rows)}_renderRows(a,c){const S=this._terminal.buffer,x=S.lines.length.toString();for(let b=a;b<=c;b++){const E=S.lines.get(S.ydisp+b),y=[],R=(E==null?void 0:E.translateToString(!0,void 0,void 0,y))||"",T=(S.ydisp+b+1).toString(),I=this._rowElements[b];I&&(R.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=R,this._rowColumns.set(I,y)),I.setAttribute("aria-posinset",T),I.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,c){const S=a.target,x=this._rowElements[c===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==x)return;let b,E;if(c===0?(b=S,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(b=this._rowElements.shift(),E=S,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const a=document.getSelection();if(!a)return;if(a.isCollapsed)return void(this._rowContainer.contains(a.anchorNode)&&this._terminal.clearSelection());if(!a.anchorNode||!a.focusNode)return void console.error("anchorNode and/or focusNode are null");let c={node:a.anchorNode,offset:a.anchorOffset},S={node:a.focusNode,offset:a.focusOffset};if((c.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===S.node&&c.offset>S.offset)&&([c,S]=[S,c]),c.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(c={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(c.node))return;const x=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:x,offset:((R=x.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(S.node))return;const b=({node:T,offset:I})=>{const M=T instanceof Text?T.parentNode:T;let H=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(H))return console.warn("row is invalid. Race condition?"),null;const q=this._rowColumns.get(M);if(!q)return console.warn("columns is null. Race condition?"),null;let Q=I<q.length?q[I]:q.slice(-1)[0]+1;return Q>=this._terminal.cols&&(++H,Q=0),{row:H,column:Q}},E=b(c),y=b(S);if(E&&y){if(E.row>y.row||E.row===y.row&&E.column>=y.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(y.row-E.row)*this._terminal.cols-E.column+y.column)}}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=this._coreBrowserService.mainDocument.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=l=h([g(1,_.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],l)},3614:(B,s)=>{function u(p){return p.replace(/\r?\n/g,"\r")}function h(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function g(p,m,w,_){p=h(p=u(p),w.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),m.value=""}function o(p,m,w){const _=w.getBoundingClientRect(),n=p.clientX-_.left-10,l=p.clientY-_.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${n}px`,m.style.top=`${l}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=u,s.bracketTextForPaste=h,s.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},s.handlePasteEvent=function(p,m,w,_){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),m,w,_)},s.paste=g,s.moveTextAreaUnderMouseCursor=o,s.rightClickHandler=function(p,m,w,_,n){o(p,m,w),n&&_.rightClickSelect(p),m.value=_.selectionText,m.select()}},7239:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=u(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,o,p){this._css.set(g,o,p)}getCss(g,o){return this._css.get(g,o)}setColor(g,o,p){this._color.set(g,o,p)}getColor(g,o){return this._color.get(g,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(u,h,g,o){u.addEventListener(h,g,o);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(h,g,o))}}}},3551:function(B,s,u){var h=this&&this.__decorate||function(l,a,c,S){var x,b=arguments.length,E=b<3?a:S===null?S=Object.getOwnPropertyDescriptor(a,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,a,c,S);else for(var y=l.length-1;y>=0;y--)(x=l[y])&&(E=(b<3?x(E):b>3?x(a,c,E):x(a,c))||E);return b>3&&E&&Object.defineProperty(a,c,E),E},g=this&&this.__param||function(l,a){return function(c,S){a(c,S,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const o=u(3656),p=u(8460),m=u(844),w=u(2585),_=u(4725);let n=s.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(l,a,c,S,x){super(),this._element=l,this._mouseService=a,this._renderService=c,this._bufferService=S,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){this._lastMouseEvent=l;const a=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const c=l.composedPath();for(let S=0;S<c.length;S++){const x=c[S];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,a){var S,x;this._activeProviderReplies&&a||((S=this._activeProviderReplies)==null||S.forEach((b=>{b==null||b.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=l.y);let c=!1;for(const[b,E]of this._linkProviderService.linkProviders.entries())a?(x=this._activeProviderReplies)!=null&&x.get(b)&&(c=this._checkLinkProviderResult(b,l,c)):E.provideLinks(l.y,(y=>{var T,I;if(this._isMouseOut)return;const R=y==null?void 0:y.map((M=>({link:M})));(T=this._activeProviderReplies)==null||T.set(b,R),c=this._checkLinkProviderResult(b,l,c),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)}))}_removeIntersectingLinks(l,a){const c=new Set;for(let S=0;S<a.size;S++){const x=a.get(S);if(x)for(let b=0;b<x.length;b++){const E=x[b],y=E.link.range.start.y<l?0:E.link.range.start.x,R=E.link.range.end.y>l?this._bufferService.cols:E.link.range.end.x;for(let T=y;T<=R;T++){if(c.has(T)){x.splice(b--,1);break}c.add(T)}}}}_checkLinkProviderResult(l,a,c){var b;if(!this._activeProviderReplies)return c;const S=this._activeProviderReplies.get(l);let x=!1;for(let E=0;E<l;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(x=!0);if(!x&&S){const E=S.find((y=>this._linkAtPosition(y.link,a)));E&&(c=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!c)for(let E=0;E<this._activeProviderReplies.size;E++){const y=(b=this._activeProviderReplies.get(E))==null?void 0:b.find((R=>this._linkAtPosition(R.link,a)));if(y){c=!0,this._handleNewLink(y);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const a=this._positionFromMouseEvent(l,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,a){this._currentLink&&this._lastMouseEvent&&(!l||!a||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(l.link,a)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var c,S;return(S=(c=this._currentLink)==null?void 0:c.state)==null?void 0:S.decorations.pointerCursor},set:c=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",c))}},underline:{get:()=>{var c,S;return(S=(c=this._currentLink)==null?void 0:c.state)==null?void 0:S.decorations.underline},set:c=>{var S,x,b;(S=this._currentLink)!=null&&S.state&&((b=(x=this._currentLink)==null?void 0:x.state)==null?void 0:b.decorations.underline)!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,c))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((c=>{if(!this._currentLink)return;const S=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(S,x),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}}))))}_linkHover(l,a,c){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(c,a.text)}_fireUnderlineEvent(l,a){const c=l.range,S=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-S-1,c.end.x,c.end.y-S-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(l,a,c){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(c,a.text)}_linkAtPosition(l,a){const c=l.range.start.y*this._bufferService.cols+l.range.start.x,S=l.range.end.y*this._bufferService.cols+l.range.end.x,x=a.y*this._bufferService.cols+a.x;return c<=x&&x<=S}_positionFromMouseEvent(l,a,c){const S=c.getCoords(l,a,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,a,c,S,x){return{x1:l,y1:a,x2:c,y2:S,cols:this._bufferService.cols,fg:x}}};s.Linkifier=n=h([g(1,_.IMouseService),g(2,_.IRenderService),g(3,w.IBufferService),g(4,_.ILinkProviderService)],n)},9042:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,s,u){var h=this&&this.__decorate||function(_,n,l,a){var c,S=arguments.length,x=S<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,l):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(_,n,l,a);else for(var b=_.length-1;b>=0;b--)(c=_[b])&&(x=(S<3?c(x):S>3?c(n,l,x):c(n,l))||x);return S>3&&x&&Object.defineProperty(n,l,x),x},g=this&&this.__param||function(_,n){return function(l,a){n(l,a,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const o=u(511),p=u(2585);let m=s.OscLinkProvider=class{constructor(_,n,l){this._bufferService=_,this._optionsService=n,this._oscLinkService=l}provideLinks(_,n){var R;const l=this._bufferService.buffer.lines.get(_-1);if(!l)return void n(void 0);const a=[],c=this._optionsService.rawOptions.linkHandler,S=new o.CellData,x=l.getTrimmedLength();let b=-1,E=-1,y=!1;for(let T=0;T<x;T++)if(E!==-1||l.hasContent(T)){if(l.loadCell(T,S),S.hasExtendedAttrs()&&S.extended.urlId){if(E===-1){E=T,b=S.extended.urlId;continue}y=S.extended.urlId!==b}else E!==-1&&(y=!0);if(y||E!==-1&&T===x-1){const I=(R=this._oscLinkService.getLinkData(b))==null?void 0:R.uri;if(I){const M={start:{x:E+1,y:_},end:{x:T+(y||T!==x-1?0:1),y:_}};let H=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const q=new URL(I);["http:","https:"].includes(q.protocol)||(H=!0)}catch{H=!0}H||a.push({text:I,range:M,activate:(q,Q)=>c?c.activate(q,Q,M):w(0,Q),hover:(q,Q)=>{var G;return(G=c==null?void 0:c.hover)==null?void 0:G.call(c,q,Q,M)},leave:(q,Q)=>{var G;return(G=c==null?void 0:c.leave)==null?void 0:G.call(c,q,Q,M)}})}y=!1,S.hasExtendedAttrs()&&S.extended.urlId?(E=T,b=S.extended.urlId):(E=-1,b=-1)}}n(a)}};function w(_,n){if(confirm(`Do you want to navigate to ${n}?
77
+
78
+ WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=m=h([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],m)},6193:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,g){this._rowCount=g,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=u(3614),g=u(3656),o=u(3551),p=u(9042),m=u(3730),w=u(1680),_=u(3107),n=u(5744),l=u(2950),a=u(1296),c=u(428),S=u(4269),x=u(5114),b=u(8934),E=u(3230),y=u(9312),R=u(4725),T=u(6731),I=u(8055),M=u(8969),H=u(8460),q=u(844),Q=u(6114),G=u(8437),$=u(2584),Y=u(7399),k=u(5941),F=u(9074),O=u(2585),N=u(5435),Z=u(4567),ee=u(779);class he extends M.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=Q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new q.MutableDisposable),this._onCursorMove=this.register(new H.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new H.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new H.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new H.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new H.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new H.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new H.EventEmitter),this._onBlur=this.register(new H.EventEmitter),this._onA11yCharEmitter=this.register(new H.EventEmitter),this._onA11yTabEmitter=this.register(new H.EventEmitter),this._onWillOpen=this.register(new H.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(F.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((P,ne)=>this.refresh(P,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((P=>this._reportWindowsOptions(P)))),this.register(this._inputHandler.onColor((P=>this._handleColorEvent(P)))),this.register((0,H.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,H.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,H.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((P=>this._afterResize(P.cols,P.rows)))),this.register((0,q.toDisposable)((()=>{var P,ne;this._customKeyEventHandler=void 0,(ne=(P=this.element)==null?void 0:P.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const P of X){let ne,ie="";switch(P.index){case 256:ne="foreground",ie="10";break;case 257:ne="background",ie="11";break;case 258:ne="cursor",ie="12";break;default:ne="ansi",ie="4;"+P.index}switch(P.type){case 0:const _e=I.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[P.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${ie};${(0,k.toRgbString)(_e)}${$.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((fe=>fe.ansi[P.index]=I.channels.toColor(...P.color)));else{const fe=ne;this._themeService.modifyColors((ye=>ye[fe]=I.channels.toColor(...P.color)))}break;case 2:this._themeService.restoreColor(P.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,P=this.buffer.lines.get(X);if(!P)return;const ne=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,_e=P.getWidth(ne),fe=this._renderService.dimensions.css.cell.width*_e,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,ve=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ve+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(P=>{this.hasSelection()&&(0,h.copyHandler)(P,this._selectionService)})));const X=P=>(0,h.handlePasteEvent)(P,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,g.addDisposableDomListener)(this.element,"paste",X)),Q.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(P=>{P.button===2&&(0,h.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(P=>{(0,h.rightClickHandler)(P,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Q.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(P=>{P.button===1&&(0,h.moveTextAreaUnderMouseCursor)(P,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var ne;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ne=this.element)==null?void 0:ne.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.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"),X.appendChild(this.element);const P=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),P.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(ie=>this.updateCursorStyle(ie)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),P.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Q.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(ie=>this._handleTextAreaFocus(ie)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ie=>this._onRender.fire(ie)))),this.onResize((ie=>this._renderService.resize(ie.cols,ie.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(o.Linkifier,this.screenElement)),this.element.appendChild(P);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ie=>this.scrollLines(ie.amount,ie.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ie=>this._renderService.handleSelectionChanged(ie.start,ie.end,ie.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ie=>{this.textarea.value=ie,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ie=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ie=>this._selectionService.handleMouseDown(ie)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ie=>this._handleScreenReaderModeOptionChange(ie)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ie=>{!this._overviewRulerRenderer&&ie&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(a.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,P=this.element;function ne(fe){const ye=X._mouseService.getMouseReportCoords(fe,X.screenElement);if(!ye)return!1;let ve,Te;switch(fe.overrideType||fe.type){case"mousemove":Te=32,fe.buttons===void 0?(ve=3,fe.button!==void 0&&(ve=fe.button<3?fe.button:3)):ve=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Te=0,ve=fe.button<3?fe.button:3;break;case"mousedown":Te=1,ve=fe.button<3?fe.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(fe)===!1||X.viewport.getLinesScrolled(fe)===0)return!1;Te=fe.deltaY<0?0:1,ve=4;break;default:return!1}return!(Te===void 0||ve===void 0||ve>4)&&X.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:ve,action:Te,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:fe=>(ne(fe),fe.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(fe)),wheel:fe=>(ne(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ne(fe)},mousemove:fe=>{fe.buttons||ne(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&fe?ie.mousemove||(P.addEventListener("mousemove",_e.mousemove),ie.mousemove=_e.mousemove):(P.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&fe?ie.wheel||(P.addEventListener("wheel",_e.wheel,{passive:!1}),ie.wheel=_e.wheel):(P.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&fe?ie.mouseup||(ie.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&fe?ie.mousedrag||(ie.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(P,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ne(fe),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(fe)}))),this.register((0,g.addDisposableDomListener)(P,"wheel",(fe=>{if(!ie.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(fe);if(ye===0)return;const ve=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Te="";for(let Pe=0;Pe<Math.abs(ye);Pe++)Te+=ve;return this.coreService.triggerDataEvent(Te,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(P,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(P,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(X,P){var ne;(ne=this._renderService)==null||ne.refreshRows(X,P)}updateCursorStyle(X){var P;(P=this._selectionService)!=null&&P.shouldColumnSelect(X)?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(X,P,ne=0){var ie;ne===1?(super.scrollLines(X,P,ne),this.refresh(0,this.rows-1)):(ie=this.viewport)==null||ie.scrollLines(X)}paste(X){(0,h.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const P=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),P}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,P,ne){this._selectionService.setSelection(X,P,ne)}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 X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,P){var ne;(ne=this._selectionService)==null||ne.selectLines(X,P)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const P=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!P&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;P||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,Y.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ne.type===3||ne.type===2){const ie=this.rows-1;return this.scrollLines(ne.type===2?-ie:ie),this.cancel(X,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ne.cancel&&this.cancel(X,!0),!ne.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==$.C0.ETX&&ne.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,P){const ne=X.isMac&&!this.options.macOptionIsMeta&&P.altKey&&!P.ctrlKey&&!P.metaKey||X.isWindows&&P.altKey&&P.ctrlKey&&!P.metaKey||X.isWindows&&P.getModifierState("AltGraph");return P.type==="keypress"?ne:ne&&(!P.keyCode||P.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(P){return P.keyCode===16||P.keyCode===17||P.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let P;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)P=X.charCode;else if(X.which===null||X.which===void 0)P=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;P=X.which}return!(!P||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(P=String.fromCharCode(P),this._onKey.fire({key:P,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(P,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const P=X.data;return this.coreService.triggerDataEvent(P,!0),this.cancel(X),!0}return!1}resize(X,P){X!==this.cols||P!==this.rows?super.resize(X,P):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,P){var ne,ie;(ne=this._charSizeService)==null||ne.measure(),(ie=this.viewport)==null||ie.syncScrollArea(!0)}clear(){var X;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 P=1;P<this.rows;P++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var P,ne;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(P=this._selectionService)==null||P.reset(),this._decorationService.reset(),(ne=this.viewport)==null||ne.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case N.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const P=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${ne};${P}t`);break;case N.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${_e};${ie}t`)}}cancel(X,P){if(this.options.cancelEvents||P)return X.preventDefault(),X.stopPropagation(),!1}}s.Terminal=he},9924:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,g){this._rowCount=g,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const o=Date.now();if(o-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=o,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=o-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(B,s,u){var h=this&&this.__decorate||function(l,a,c,S){var x,b=arguments.length,E=b<3?a:S===null?S=Object.getOwnPropertyDescriptor(a,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,a,c,S);else for(var y=l.length-1;y>=0;y--)(x=l[y])&&(E=(b<3?x(E):b>3?x(a,c,E):x(a,c))||E);return b>3&&E&&Object.defineProperty(a,c,E),E},g=this&&this.__param||function(l,a){return function(c,S){a(c,S,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const o=u(3656),p=u(4725),m=u(8460),w=u(844),_=u(2585);let n=s.Viewport=class extends w.Disposable{constructor(l,a,c,S,x,b,E,y){super(),this._viewportElement=l,this._scrollArea=a,this._bufferService=c,this._optionsService=S,this._charSizeService=x,this._renderService=b,this._coreBrowserService=E,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(l){if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const a=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(l,a){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(a<0&&this._viewportElement.scrollTop!==0||a>0&&c<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const a=this._getPixelsScrolled(l);return a!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+a:this._smoothScrollState.target+=a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=a,this._bubbleScroll(l,a))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const a=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let a=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?a*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._currentRowHeight*this._bufferService.rows),a}getBufferElements(l,a){var y;let c,S="";const x=[],b=a??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let R=l;R<b;R++){const T=E.get(R);if(!T)continue;const I=(y=E.get(R+1))==null?void 0:y.isWrapped;if(S+=T.translateToString(!I),!I||R===E.length-1){const M=document.createElement("div");M.textContent=S,x.push(M),S.length>0&&(c=M),S=""}}return{bufferElements:x,cursorElement:c}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let a=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=this._currentRowHeight+0,this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(l,a){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&a.altKey||c==="ctrl"&&a.ctrlKey||c==="shift"&&a.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const a=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,a!==0&&(this._viewportElement.scrollTop+=a,this._bubbleScroll(l,a))}};s.Viewport=n=h([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],n)},3107:function(B,s,u){var h=this&&this.__decorate||function(_,n,l,a){var c,S=arguments.length,x=S<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,l):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(_,n,l,a);else for(var b=_.length-1;b>=0;b--)(c=_[b])&&(x=(S<3?c(x):S>3?c(n,l,x):c(n,l))||x);return S>3&&x&&Object.defineProperty(n,l,x),x},g=this&&this.__param||function(_,n){return function(l,a){n(l,a,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const o=u(4725),p=u(844),m=u(2585);let w=s.BufferDecorationRenderer=class extends p.Disposable{constructor(_,n,l,a,c){super(),this._screenElement=_,this._bufferService=n,this._coreBrowserService=l,this._decorationService=a,this._renderService=c,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((S=>this._removeDecoration(S)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var a;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((a=_==null?void 0:_.options)==null?void 0:a.layer)==="top"),n.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=_.options.x??0;return l&&l>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(_,n),n}_refreshStyle(_){const n=_.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let l=this._decorationElements.get(_);l||(l=this._createElement(_),_.element=l,this._decorationElements.set(_,l),this._container.appendChild(l),_.onDispose((()=>{this._decorationElements.delete(_),l.remove()}))),l.style.top=n*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(l)}}_refreshXPosition(_,n=_.element){if(!n)return;const l=_.options.x??0;(_.options.anchor||"left")==="right"?n.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var n;(n=this._decorationElements.get(_))==null||n.remove(),this._decorationElements.delete(_),_.dispose()}};s.BufferDecorationRenderer=w=h([g(1,m.IBufferService),g(2,o.ICoreBrowserService),g(3,m.IDecorationService),g(4,o.IRenderService)],w)},5871:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,g){return h>=u.startBufferLine-this._linePadding[g||"full"]&&h<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(B,s,u){var h=this&&this.__decorate||function(c,S,x,b){var E,y=arguments.length,R=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(c,S,x,b);else for(var T=c.length-1;T>=0;T--)(E=c[T])&&(R=(y<3?E(R):y>3?E(S,x,R):E(S,x))||R);return y>3&&R&&Object.defineProperty(S,x,R),R},g=this&&this.__param||function(c,S){return function(x,b){S(x,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const o=u(5871),p=u(4725),m=u(844),w=u(2585),_={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let a=s.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,S,x,b,E,y,R){var I;super(),this._viewportElement=c,this._screenElement=S,this._bufferService=x,this._decorationService=b,this._renderService=E,this._optionsService=y,this._coreBrowserService=R,this._colorZoneStore=new o.ColorZoneStore,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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var M;(M=this._canvas)==null||M.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const c=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=c,n.center=S,n.right=c,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=n.left,l.right=n.left+n.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);_.left=S,_.center=S,_.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.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(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const S of c)S.position!=="full"&&this._renderColorZone(S);for(const S of c)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(l[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-_[c.position||"full"]/2),n[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[c.position||"full"]))}_queueRefresh(c,S){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=a=h([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,p.IRenderService),g(5,w.IOptionsService),g(6,p.ICoreBrowserService)],a)},2950:function(B,s,u){var h=this&&this.__decorate||function(_,n,l,a){var c,S=arguments.length,x=S<3?n:a===null?a=Object.getOwnPropertyDescriptor(n,l):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(_,n,l,a);else for(var b=_.length-1;b>=0;b--)(c=_[b])&&(x=(S<3?c(x):S>3?c(n,l,x):c(n,l))||x);return S>3&&x&&Object.defineProperty(n,l,x),x},g=this&&this.__param||function(_,n){return function(l,a){n(l,a,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const o=u(4725),p=u(2585),m=u(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,n,l,a,c,S){this._textarea=_,this._compositionView=n,this._bufferService=l,this._optionsService=a,this._coreService=c,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,l=n.replace(_,"");this._dataAlreadySent=l,n.length>_.length?this._coreService.triggerDataEvent(l,!0):n.length<_.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):n.length===_.length&&n!==_&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=h([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,o.IRenderService)],w)},9806:(B,s)=>{function u(h,g,o){const p=o.getBoundingClientRect(),m=h.getComputedStyle(o),w=parseInt(m.getPropertyValue("padding-left")),_=parseInt(m.getPropertyValue("padding-top"));return[g.clientX-p.left-w,g.clientY-p.top-_]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=u,s.getCoords=function(h,g,o,p,m,w,_,n,l){if(!w)return;const a=u(h,g,o);return a?(a[0]=Math.ceil((a[0]+(l?_/2:0))/_),a[1]=Math.ceil(a[1]/n),a[0]=Math.min(Math.max(a[0],1),p+(l?1:0)),a[1]=Math.min(Math.max(a[1],1),m),a):void 0}},9504:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=u(2584);function g(n,l,a,c){const S=n-o(n,a),x=l-o(l,a),b=Math.abs(S-x)-(function(E,y,R){let T=0;const I=E-o(E,R),M=y-o(y,R);for(let H=0;H<Math.abs(I-M);H++){const q=p(E,y)==="A"?-1:1,Q=R.buffer.lines.get(I+q*H);Q!=null&&Q.isWrapped&&T++}return T})(n,l,a);return _(b,w(p(n,l),c))}function o(n,l){let a=0,c=l.buffer.lines.get(n),S=c==null?void 0:c.isWrapped;for(;S&&n>=0&&n<l.rows;)a++,c=l.buffer.lines.get(--n),S=c==null?void 0:c.isWrapped;return a}function p(n,l){return n>l?"A":"B"}function m(n,l,a,c,S,x){let b=n,E=l,y="";for(;b!==a||E!==c;)b+=S?1:-1,S&&b>x.cols-1?(y+=x.buffer.translateBufferLineToString(E,!1,n,b),b=0,n=0,E++):!S&&b<0&&(y+=x.buffer.translateBufferLineToString(E,!1,0,n+1),b=x.cols-1,n=b,E--);return y+x.buffer.translateBufferLineToString(E,!1,n,b)}function w(n,l){const a=l?"O":"[";return h.C0.ESC+a+n}function _(n,l){n=Math.floor(n);let a="";for(let c=0;c<n;c++)a+=l;return a}s.moveToCellSequence=function(n,l,a,c){const S=a.buffer.x,x=a.buffer.y;if(!a.buffer.hasScrollback)return(function(y,R,T,I,M,H){return g(R,I,M,H).length===0?"":_(m(y,R,y,R-o(R,M),!1,M).length,w("D",H))})(S,x,0,l,a,c)+g(x,l,a,c)+(function(y,R,T,I,M,H){let q;q=g(R,I,M,H).length>0?I-o(I,M):R;const Q=I,G=(function($,Y,k,F,O,N){let Z;return Z=g(k,F,O,N).length>0?F-o(F,O):Y,$<k&&Z<=F||$>=k&&Z<F?"C":"D"})(y,R,T,I,M,H);return _(m(y,q,T,Q,G==="C",M).length,w(G,H))})(S,x,n,l,a,c);let b;if(x===l)return b=S>n?"D":"C",_(Math.abs(S-n),w(b,c));b=x>l?"D":"C";const E=Math.abs(x-l);return _((function(y,R){return R.cols-y})(x>l?n:S,a)+(E-1)*a.cols+1+((x>l?S:n)-1),w(b,c))}},1296:function(B,s,u){var h=this&&this.__decorate||function(H,q,Q,G){var $,Y=arguments.length,k=Y<3?q:G===null?G=Object.getOwnPropertyDescriptor(q,Q):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(H,q,Q,G);else for(var F=H.length-1;F>=0;F--)($=H[F])&&(k=(Y<3?$(k):Y>3?$(q,Q,k):$(q,Q))||k);return Y>3&&k&&Object.defineProperty(q,Q,k),k},g=this&&this.__param||function(H,q){return function(Q,G){q(Q,G,H)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const o=u(3787),p=u(2550),m=u(2223),w=u(6171),_=u(6052),n=u(4725),l=u(8055),a=u(8460),c=u(844),S=u(2585),x="xterm-dom-renderer-owner-",b="xterm-rows",E="xterm-fg-",y="xterm-bg-",R="xterm-focus",T="xterm-selection";let I=1,M=s.DomRenderer=class extends c.Disposable{constructor(H,q,Q,G,$,Y,k,F,O,N,Z,ee,he){super(),this._terminal=H,this._document=q,this._element=Q,this._screenElement=G,this._viewportElement=$,this._helperContainer=Y,this._linkifier2=k,this._charSizeService=O,this._optionsService=N,this._bufferService=Z,this._coreBrowserService=ee,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ce=>this._injectCss(ce)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ce=>this._handleLinkHover(ce)))),this.register(this._linkifier2.onHideLinkUnderline((ce=>this._handleLinkLeave(ce)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(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(){const H=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*H,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*H),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/H),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/H),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Q of this._rowElements)Q.style.width=`${this.dimensions.css.canvas.width}px`,Q.style.height=`${this.dimensions.css.cell.height}px`,Q.style.lineHeight=`${this.dimensions.css.cell.height}px`,Q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const q=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=q,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(H){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let q=`${this._terminalSelector} .${b} { color: ${H.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;q+=`${this._terminalSelector} .${b} .xterm-dim { color: ${l.color.multiplyOpacity(H.foreground,.5).css};}`,q+=`${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;}`;const Q=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;q+=`@keyframes ${Q} { 50% { border-bottom-style: hidden; }}`,q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,q+=`@keyframes ${$} { 0% { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css}; } 50% { background-color: inherit; color: ${H.cursor.css}; }}`,q+=`${this._terminalSelector} .${b}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${b}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${b}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${H.cursor.css}; color: ${H.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${H.cursor.css} !important; color: ${H.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${H.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${H.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${H.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,q+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${H.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${H.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,k]of H.ansi.entries())q+=`${this._terminalSelector} .${E}${Y} { color: ${k.css}; }${this._terminalSelector} .${E}${Y}.xterm-dim { color: ${l.color.multiplyOpacity(k,.5).css}; }${this._terminalSelector} .${y}${Y} { background-color: ${k.css}; }`;q+=`${this._terminalSelector} .${E}${m.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(H.background).css}; }${this._terminalSelector} .${E}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(H.background),.5).css}; }${this._terminalSelector} .${y}${m.INVERTED_DEFAULT_COLOR} { background-color: ${H.foreground.css}; }`,this._themeStyleElement.textContent=q}_setDefaultSpacing(){const H=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${H}px`,this._rowFactory.defaultSpacing=H}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(H,q){for(let Q=this._rowElements.length;Q<=q;Q++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(H,q){this._refreshRowElements(H,q),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(H,q,Q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(H,q,Q),this.renderRows(0,this._bufferService.rows-1),!H||!q)return;this._selectionRenderModel.update(this._terminal,H,q,Q);const G=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,k=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||k<0)return;const F=this._document.createDocumentFragment();if(Q){const O=H[0]>q[0];F.appendChild(this._createSelectionElement(Y,O?q[0]:H[0],O?H[0]:q[0],k-Y+1))}else{const O=G===Y?H[0]:0,N=Y===$?q[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(Y,O,N));const Z=k-Y-1;if(F.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Z)),Y!==k){const ee=$===k?q[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(k,0,ee))}}this._selectionContainer.appendChild(F)}_createSelectionElement(H,q,Q,G=1){const $=this._document.createElement("div"),Y=q*this.dimensions.css.cell.width;let k=this.dimensions.css.cell.width*(Q-q);return Y+k>this.dimensions.css.canvas.width&&(k=this.dimensions.css.canvas.width-Y),$.style.height=G*this.dimensions.css.cell.height+"px",$.style.top=H*this.dimensions.css.cell.height+"px",$.style.left=`${Y}px`,$.style.width=`${k}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const H of this._rowElements)H.replaceChildren()}renderRows(H,q){const Q=this._bufferService.buffer,G=Q.ybase+Q.y,$=Math.min(Q.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,k=this._optionsService.rawOptions.cursorStyle,F=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=H;O<=q;O++){const N=O+Q.ydisp,Z=this._rowElements[O],ee=Q.lines.get(N);if(!Z||!ee)break;Z.replaceChildren(...this._rowFactory.createRow(ee,N,N===G,k,F,$,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!0)}_handleLinkLeave(H){this._setCellUnderline(H.x1,H.x2,H.y1,H.y2,H.cols,!1)}_setCellUnderline(H,q,Q,G,$,Y){Q<0&&(H=0),G<0&&(q=0);const k=this._bufferService.rows-1;Q=Math.max(Math.min(Q,k),0),G=Math.max(Math.min(G,k),0),$=Math.min($,this._bufferService.cols);const F=this._bufferService.buffer,O=F.ybase+F.y,N=Math.min(F.x,$-1),Z=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let ce=Q;ce<=G;++ce){const X=ce+F.ydisp,P=this._rowElements[ce],ne=F.lines.get(X);if(!P||!ne)break;P.replaceChildren(...this._rowFactory.createRow(ne,X,X===O,ee,he,N,Z,this.dimensions.css.cell.width,this._widthCache,Y?ce===Q?H:0:-1,Y?(ce===G?q:$)-1:-1))}}};s.DomRenderer=M=h([g(7,S.IInstantiationService),g(8,n.ICharSizeService),g(9,S.IOptionsService),g(10,S.IBufferService),g(11,n.ICoreBrowserService),g(12,n.IThemeService)],M)},3787:function(B,s,u){var h=this&&this.__decorate||function(b,E,y,R){var T,I=arguments.length,M=I<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,E,y,R);else for(var H=b.length-1;H>=0;H--)(T=b[H])&&(M=(I<3?T(M):I>3?T(E,y,M):T(E,y))||M);return I>3&&M&&Object.defineProperty(E,y,M),M},g=this&&this.__param||function(b,E){return function(y,R){E(y,R,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const o=u(2223),p=u(643),m=u(511),w=u(2585),_=u(8055),n=u(4725),l=u(4269),a=u(6171),c=u(3734);let S=s.DomRendererRowFactory=class{constructor(b,E,y,R,T,I,M){this._document=b,this._characterJoinerService=E,this._optionsService=y,this._coreBrowserService=R,this._coreService=T,this._decorationService=I,this._themeService=M,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,E,y){this._selectionStart=b,this._selectionEnd=E,this._columnSelectMode=y}createRow(b,E,y,R,T,I,M,H,q,Q,G){const $=[],Y=this._characterJoinerService.getJoinedCharacters(E),k=this._themeService.colors;let F,O=b.getNoBgTrimmedLength();y&&O<I+1&&(O=I+1);let N=0,Z="",ee=0,he=0,ce=0,X=!1,P=0,ne=!1,ie=0;const _e=[],fe=Q!==-1&&G!==-1;for(let ye=0;ye<O;ye++){b.loadCell(ye,this._workCell);let ve=this._workCell.getWidth();if(ve===0)continue;let Te=!1,Pe=ye,Se=this._workCell;if(Y.length>0&&ye===Y[0][0]){Te=!0;const De=Y.shift();Se=new l.JoinedCellData(this._workCell,b.translateToString(!0,De[0],De[1]),De[1]-De[0]),Pe=De[1]-1,ve=Se.getWidth()}const Mt=this._isCellInSelection(ye,E),zt=y&&ye===I,xe=fe&&ye>=Q&&ye<=G;let Ee=!1;this._decorationService.forEachDecorationAtCell(ye,E,void 0,(De=>{Ee=!0}));let Ae=Se.getChars()||p.WHITESPACE_CELL_CHAR;if(Ae===" "&&(Se.isUnderline()||Se.isOverline())&&(Ae=" "),ie=ve*H-q.get(Ae,Se.isBold(),Se.isItalic()),F){if(N&&(Mt&&ne||!Mt&&!ne&&Se.bg===ee)&&(Mt&&ne&&k.selectionForeground||Se.fg===he)&&Se.extended.ext===ce&&xe===X&&ie===P&&!zt&&!Te&&!Ee){Se.isInvisible()?Z+=p.WHITESPACE_CELL_CHAR:Z+=Ae,N++;continue}N&&(F.textContent=Z),F=this._document.createElement("span"),N=0,Z=""}else F=this._document.createElement("span");if(ee=Se.bg,he=Se.fg,ce=Se.extended.ext,X=xe,P=ie,ne=Mt,Te&&I>=ye&&I<=Pe&&(I=ye),!this._coreService.isCursorHidden&&zt&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&_e.push("xterm-cursor-blink"),_e.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Se.isBold()&&_e.push("xterm-bold"),Se.isItalic()&&_e.push("xterm-italic"),Se.isDim()&&_e.push("xterm-dim"),Z=Se.isInvisible()?p.WHITESPACE_CELL_CHAR:Se.getChars()||p.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(_e.push(`xterm-underline-${Se.extended.underlineStyle}`),Z===" "&&(Z=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())F.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let De=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&De<8&&(De+=8),F.style.textDecorationColor=k.ansi[De].css}Se.isOverline()&&(_e.push("xterm-overline"),Z===" "&&(Z=" ")),Se.isStrikethrough()&&_e.push("xterm-strikethrough"),xe&&(F.style.textDecoration="underline");let ge=Se.getFgColor(),we=Se.getFgColorMode(),Ke=Se.getBgColor(),qe=Se.getBgColorMode();const gt=!!Se.isInverse();if(gt){const De=ge;ge=Ke,Ke=De;const Xt=we;we=qe,qe=Xt}let Ze,ct,Qe,ke=!1;switch(this._decorationService.forEachDecorationAtCell(ye,E,void 0,(De=>{De.options.layer!=="top"&&ke||(De.backgroundColorRGB&&(qe=50331648,Ke=De.backgroundColorRGB.rgba>>8&16777215,Ze=De.backgroundColorRGB),De.foregroundColorRGB&&(we=50331648,ge=De.foregroundColorRGB.rgba>>8&16777215,ct=De.foregroundColorRGB),ke=De.options.layer==="top")})),!ke&&Mt&&(Ze=this._coreBrowserService.isFocused?k.selectionBackgroundOpaque:k.selectionInactiveBackgroundOpaque,Ke=Ze.rgba>>8&16777215,qe=50331648,ke=!0,k.selectionForeground&&(we=50331648,ge=k.selectionForeground.rgba>>8&16777215,ct=k.selectionForeground)),ke&&_e.push("xterm-decoration-top"),qe){case 16777216:case 33554432:Qe=k.ansi[Ke],_e.push(`xterm-bg-${Ke}`);break;case 50331648:Qe=_.channels.toColor(Ke>>16,Ke>>8&255,255&Ke),this._addStyle(F,`background-color:#${x((Ke>>>0).toString(16),"0",6)}`);break;default:gt?(Qe=k.foreground,_e.push(`xterm-bg-${o.INVERTED_DEFAULT_COLOR}`)):Qe=k.background}switch(Ze||Se.isDim()&&(Ze=_.color.multiplyOpacity(Qe,.5)),we){case 16777216:case 33554432:Se.isBold()&&ge<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ge+=8),this._applyMinimumContrast(F,Qe,k.ansi[ge],Se,Ze,void 0)||_e.push(`xterm-fg-${ge}`);break;case 50331648:const De=_.channels.toColor(ge>>16&255,ge>>8&255,255&ge);this._applyMinimumContrast(F,Qe,De,Se,Ze,ct)||this._addStyle(F,`color:#${x(ge.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(F,Qe,k.foreground,Se,Ze,ct)||gt&&_e.push(`xterm-fg-${o.INVERTED_DEFAULT_COLOR}`)}_e.length&&(F.className=_e.join(" "),_e.length=0),zt||Te||Ee?F.textContent=Z:N++,ie!==this.defaultSpacing&&(F.style.letterSpacing=`${ie}px`),$.push(F),ye=Pe}return F&&N&&(F.textContent=Z),$}_applyMinimumContrast(b,E,y,R,T,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,a.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const M=this._getContrastCache(R);let H;if(T||I||(H=M.getColor(E.rgba,y.rgba)),H===void 0){const q=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);H=_.color.ensureContrastRatio(T||E,I||y,q),M.setColor((T||E).rgba,(I||y).rgba,H??null)}return!!H&&(this._addStyle(b,`color:${H.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,E){b.setAttribute("style",`${b.getAttribute("style")||""}${E};`)}_isCellInSelection(b,E){const y=this._selectionStart,R=this._selectionEnd;return!(!y||!R)&&(this._columnSelectMode?y[0]<=R[0]?b>=y[0]&&E>=y[1]&&b<R[0]&&E<=R[1]:b<y[0]&&E>=y[1]&&b>=R[0]&&E<=R[1]:E>y[1]&&E<R[1]||y[1]===R[1]&&E===y[1]&&b>=y[0]&&b<R[0]||y[1]<R[1]&&E===R[1]&&b<R[0]||y[1]<R[1]&&E===y[1]&&b>=y[0])}};function x(b,E,y){for(;b.length<y;)b=E+b;return b}s.DomRendererRowFactory=S=h([g(1,n.ICharacterJoinerService),g(2,w.IOptionsService),g(3,n.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,n.IThemeService)],S)},2550:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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";const g=u.createElement("span");g.classList.add("xterm-char-measure-element");const o=u.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold";const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[g,o,p,m],this._container.appendChild(g),this._container.appendChild(o),this._container.appendChild(p),this._container.appendChild(m),h.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(u,h,g,o){u===this._font&&h===this._fontSize&&g===this._weight&&o===this._weightBold||(this._font=u,this._fontSize=h,this._weight=g,this._weightBold=o,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${o}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${o}`,this.clear())}get(u,h,g){let o=0;if(!h&&!g&&u.length===1&&(o=u.charCodeAt(0))<256){if(this._flat[o]!==-9999)return this._flat[o];const w=this._measure(u,0);return w>0&&(this._flat[o]=w),w}let p=u;h&&(p+="B"),g&&(p+="I");let m=this._holey.get(p);if(m===void 0){let w=0;h&&(w|=1),g&&(w|=2),m=this._measure(u,w),m>0&&this._holey.set(p,m)}return m}_measure(u,h){const g=this._measureElements[h];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(B,s)=>{function u(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=u,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=h,s.allowRescaling=function(g,o,p,m){return o===1&&p>Math.ceil(1.5*m)&&g!==void 0&&g>255&&!h(g)&&!u(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(o){return 9472<=o&&o<=9631})(g)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(g,o,p=0){return(g-(2*Math.round(o)-p))%(2*Math.round(o))}},6052:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class u{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(g,o,p,m=!1){if(this.selectionStart=o,this.selectionEnd=p,!o||!p||o[0]===p[0]&&o[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,_=o[1]-w,n=p[1]-w,l=Math.max(_,0),a=Math.min(n,g.rows-1);l>=g.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=l,this.viewportCappedEndRow=a,this.startCol=o[0],this.endCol=p[0])}isCellSelected(g,o,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&p>=this.viewportCappedStartRow&&o<this.endCol&&p<=this.viewportCappedEndRow:o<this.startCol&&p>=this.viewportCappedStartRow&&o>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&o>=this.startCol)}}s.createSelectionRenderModel=function(){return new u}},456:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(B,s,u){var h=this&&this.__decorate||function(a,c,S,x){var b,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,c,S,x);else for(var R=a.length-1;R>=0;R--)(b=a[R])&&(y=(E<3?b(y):E>3?b(c,S,y):b(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(a,c){return function(S,x){c(S,x,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const o=u(2585),p=u(8460),m=u(844);let w=s.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,c,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new n(a,c,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=h([g(2,o.IOptionsService)],w);class _ extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,S){c!==void 0&&c>0&&S!==void 0&&S>0&&(this._result.width=c,this._result.height=S)}}class n extends _{constructor(c,S,x){super(),this._document=c,this._parentElement=S,this._optionsService=x,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}}class l extends _{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const c=this._ctx.measureText("W");return this._validateAndSet(c.width,c.fontBoundingBoxAscent+c.fontBoundingBoxDescent),this._result}}},4269:function(B,s,u){var h=this&&this.__decorate||function(l,a,c,S){var x,b=arguments.length,E=b<3?a:S===null?S=Object.getOwnPropertyDescriptor(a,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,a,c,S);else for(var y=l.length-1;y>=0;y--)(x=l[y])&&(E=(b<3?x(E):b>3?x(a,c,E):x(a,c))||E);return b>3&&E&&Object.defineProperty(a,c,E),E},g=this&&this.__param||function(l,a){return function(c,S){a(c,S,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const o=u(3734),p=u(643),m=u(511),w=u(2585);class _ extends o.AttributeData{constructor(a,c,S){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=c,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=_;let n=s.CharacterJoinerService=class Tg{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(a){const c={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(c),c.id}deregister(a){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===a)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(a);if(!c||c.length===0)return[];const S=[],x=c.translateToString(!0);let b=0,E=0,y=0,R=c.getFg(0),T=c.getBg(0);for(let I=0;I<c.getTrimmedLength();I++)if(c.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==T){if(I-b>1){const M=this._getJoinedRanges(x,y,E,c,b);for(let H=0;H<M.length;H++)S.push(M[H])}b=I,y=E,R=this._workCell.fg,T=this._workCell.bg}E+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const I=this._getJoinedRanges(x,y,E,c,b);for(let M=0;M<I.length;M++)S.push(I[M])}return S}_getJoinedRanges(a,c,S,x,b){const E=a.substring(c,S);let y=[];try{y=this._characterJoiners[0].handler(E)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const T=this._characterJoiners[R].handler(E);for(let I=0;I<T.length;I++)Tg._mergeRanges(y,T[I])}catch(T){console.error(T)}return this._stringRangesToCellRanges(y,x,b),y}_stringRangesToCellRanges(a,c,S){let x=0,b=!1,E=0,y=a[x];if(y){for(let R=S;R<this._bufferService.cols;R++){const T=c.getWidth(R),I=c.getString(R).length||p.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!b&&y[0]<=E&&(y[0]=R,b=!0),y[1]<=E){if(y[1]=R,y=a[++x],!y)break;y[0]<=E?(y[0]=R,b=!0):b=!1}E+=I}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(a,c){let S=!1;for(let x=0;x<a.length;x++){const b=a[x];if(S){if(c[1]<=b[0])return a[x-1][1]=c[1],a;if(c[1]<=b[1])return a[x-1][1]=Math.max(c[1],b[1]),a.splice(x,1),a;a.splice(x,1),x--}else{if(c[1]<=b[0])return a.splice(x,0,c),a;if(c[1]<=b[1])return b[0]=Math.min(c[0],b[0]),a;c[0]<b[1]&&(b[0]=Math.min(c[0],b[0]),S=!0)}}return S?a[a.length-1][1]=c[1]:a.push(c),a}};s.CharacterJoinerService=n=h([g(0,w.IBufferService)],n)},5114:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const h=u(844),g=u(8460),o=u(3656);class p extends h.Disposable{constructor(_,n,l){super(),this._textarea=_,this._window=n,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((a=>this._screenDprMonitor.setWindow(a)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(_){this._window!==_&&(this._window=_,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}}s.CoreBrowserService=p;class m extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,o.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.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)}}},779:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const h=u(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}s.LinkProviderService=g},8934:function(B,s,u){var h=this&&this.__decorate||function(w,_,n,l){var a,c=arguments.length,S=c<3?_:l===null?l=Object.getOwnPropertyDescriptor(_,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,_,n,l);else for(var x=w.length-1;x>=0;x--)(a=w[x])&&(S=(c<3?a(S):c>3?a(_,n,S):a(_,n))||S);return c>3&&S&&Object.defineProperty(_,n,S),S},g=this&&this.__param||function(w,_){return function(n,l){_(n,l,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const o=u(4725),p=u(9806);let m=s.MouseService=class{constructor(w,_){this._renderService=w,this._charSizeService=_}getCoords(w,_,n,l,a){return(0,p.getCoords)(window,w,_,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(w,_){const n=(0,p.getCoordsRelativeToElement)(window,w,_);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])}}};s.MouseService=m=h([g(0,o.IRenderService),g(1,o.ICharSizeService)],m)},3230:function(B,s,u){var h=this&&this.__decorate||function(a,c,S,x){var b,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,c,S,x);else for(var R=a.length-1;R>=0;R--)(b=a[R])&&(y=(E<3?b(y):E>3?b(c,S,y):b(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(a,c){return function(S,x){c(S,x,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const o=u(6193),p=u(4725),m=u(8460),w=u(844),_=u(7226),n=u(2585);let l=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,c,S,x,b,E,y,R){super(),this._rowCount=a,this._charSizeService=x,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer(((T,I)=>this._renderRows(T,I)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(E.onResize((()=>this._fullRefresh()))),this.register(E.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(b.onDecorationRegistered((()=>this._fullRefresh()))),this.register(b.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(E.buffer.y,E.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,c),this.register(y.onWindowChange((T=>this._registerIntersectionObserver(T,c))))}_registerIntersectionObserver(a,c){if("IntersectionObserver"in a){const S=new a.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});S.observe(c),this._observerDisposable.value=(0,w.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,c,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,c,this._rowCount))}_renderRows(a,c){this._renderer.value&&(a=Math.min(a,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(a,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:c}),this._onRender.fire({start:a,end:c}),this._isNextRenderRedrawOnly=!0)}resize(a,c){this._rowCount=c,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(a){this._renderer.value=a,this._renderer.value&&(this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var a,c;this._renderer.value&&((c=(a=this._renderer.value).clearTextureAtlas)==null||c.call(a),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(a,c)})):this._renderer.value.handleResize(a,c),this._fullRefresh())}handleCharSizeChanged(){var a;(a=this._renderer.value)==null||a.handleCharSizeChanged()}handleBlur(){var a;(a=this._renderer.value)==null||a.handleBlur()}handleFocus(){var a;(a=this._renderer.value)==null||a.handleFocus()}handleSelectionChanged(a,c,S){var x;this._selectionState.start=a,this._selectionState.end=c,this._selectionState.columnSelectMode=S,(x=this._renderer.value)==null||x.handleSelectionChanged(a,c,S)}handleCursorMove(){var a;(a=this._renderer.value)==null||a.handleCursorMove()}clear(){var a;(a=this._renderer.value)==null||a.clear()}};s.RenderService=l=h([g(2,n.IOptionsService),g(3,p.ICharSizeService),g(4,n.IDecorationService),g(5,n.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],l)},9312:function(B,s,u){var h=this&&this.__decorate||function(y,R,T,I){var M,H=arguments.length,q=H<3?R:I===null?I=Object.getOwnPropertyDescriptor(R,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(y,R,T,I);else for(var Q=y.length-1;Q>=0;Q--)(M=y[Q])&&(q=(H<3?M(q):H>3?M(R,T,q):M(R,T))||q);return H>3&&q&&Object.defineProperty(R,T,q),q},g=this&&this.__param||function(y,R){return function(T,I){R(T,I,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const o=u(9806),p=u(9504),m=u(456),w=u(4725),_=u(8460),n=u(844),l=u(6114),a=u(4841),c=u(511),S=u(2585),x=" ",b=new RegExp(x,"g");let E=s.SelectionService=class extends n.Disposable{constructor(y,R,T,I,M,H,q,Q,G){super(),this._element=y,this._screenElement=R,this._linkifier=T,this._bufferService=I,this._coreService=M,this._mouseService=H,this._optionsService=q,this._renderService=Q,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!y||!R||y[0]===R[0]&&y[1]===R[1])}get selectionText(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!y||!R)return"";const T=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(y[0]===R[0])return"";const M=y[0]<R[0]?y[0]:R[0],H=y[0]<R[0]?R[0]:y[0];for(let q=y[1];q<=R[1];q++){const Q=T.translateBufferLineToString(q,!0,M,H);I.push(Q)}}else{const M=y[1]===R[1]?R[0]:void 0;I.push(T.translateBufferLineToString(y[1],!0,y[0],M));for(let H=y[1]+1;H<=R[1]-1;H++){const q=T.lines.get(H),Q=T.translateBufferLineToString(H,!0);q!=null&&q.isWrapped?I[I.length-1]+=Q:I.push(Q)}if(y[1]!==R[1]){const H=T.lines.get(R[1]),q=T.translateBufferLineToString(R[1],!0,0,R[0]);H&&H.isWrapped?I[I.length-1]+=q:I.push(q)}}return I.map((M=>M.replace(b," "))).join(l.isWindows?`\r
79
+ `:`
80
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),l.isLinux&&y&&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(y){const R=this._getMouseBufferCoords(y),T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(T&&I&&R)&&this._areCoordsInSelection(R,T,I)}isCellInSelection(y,R){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&this._areCoordsInSelection([y,R],T,I)}_areCoordsInSelection(y,R,T){return y[1]>R[1]&&y[1]<T[1]||R[1]===T[1]&&y[1]===R[1]&&y[0]>=R[0]&&y[0]<T[0]||R[1]<T[1]&&y[1]===T[1]&&y[0]<T[0]||R[1]<T[1]&&y[1]===R[1]&&y[0]>=R[0]}_selectWordAtCursor(y,R){var M,H;const T=(H=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:H.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,a.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(y);return!!I&&(this._selectWordAt(I,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,R){this._model.clearSelection(),y=Math.max(y,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const R=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(y){let R=(0,o.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=T?0:(R>T&&(R-=T),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(y){return l.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const R=this._getMouseBufferCoords(y);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(y){return y.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const I=T.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const R=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const I=(0,p.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,T=!(!y||!R||y[0]===R[0]&&y[1]===R[1]);T?y&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,R,T)):this._oldHasSelection&&this._fireOnSelectionChange(y,R,T)}_fireOnSelectionChange(y,R,T){this._oldSelectionStart=y,this._oldSelectionEnd=R,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(y,R){let T=R;for(let I=0;R>=I;I++){const M=y.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:M>1&&R!==I&&(T+=M-1)}return T}setSelection(y,R,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,R],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,R,T=!0,I=!0){if(y[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,H=M.lines.get(y[1]);if(!H)return;const q=M.translateBufferLineToString(y[1],!1);let Q=this._convertViewportColToCharacterIndex(H,y[0]),G=Q;const $=y[0]-Q;let Y=0,k=0,F=0,O=0;if(q.charAt(Q)===" "){for(;Q>0&&q.charAt(Q-1)===" ";)Q--;for(;G<q.length&&q.charAt(G+1)===" ";)G++}else{let ee=y[0],he=y[0];H.getWidth(ee)===0&&(Y++,ee--),H.getWidth(he)===2&&(k++,he++);const ce=H.getString(he).length;for(ce>1&&(O+=ce-1,G+=ce-1);ee>0&&Q>0&&!this._isCharWordSeparator(H.loadCell(ee-1,this._workCell));){H.loadCell(ee-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ee--):X>1&&(F+=X-1,Q-=X-1),Q--,ee--}for(;he<H.length&&G+1<q.length&&!this._isCharWordSeparator(H.loadCell(he+1,this._workCell));){H.loadCell(he+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(k++,he++):X>1&&(O+=X-1,G+=X-1),G++,he++}}G++;let N=Q+$-Y+F,Z=Math.min(this._bufferService.cols,G-Q+Y+k-F-O);if(R||q.slice(Q,G).trim()!==""){if(T&&N===0&&H.getCodePoint(0)!==32){const ee=M.lines.get(y[1]-1);if(ee&&H.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(he){const ce=this._bufferService.cols-he.start;N-=ce,Z+=ce}}}if(I&&N+Z===this._bufferService.cols&&H.getCodePoint(this._bufferService.cols-1)!==32){const ee=M.lines.get(y[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const he=this._getWordAt([0,y[1]+1],!1,!1,!0);he&&(Z+=he.length)}}return{start:N,length:Z}}}_selectWordAt(y,R){const T=this._getWordAt(y,R);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[T.start,y[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(y){const R=this._getWordAt(y,!0);if(R){let T=y[1];for(;R.start<0;)R.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,T]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const R=this._bufferService.buffer.getWrappedRangeForLine(y),T={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,a.getRangeLength)(T,this._bufferService.cols)}};s.SelectionService=E=h([g(3,S.IBufferService),g(4,S.ICoreService),g(5,w.IMouseService),g(6,S.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],E)},4725:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=u(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService"),s.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(B,s,u){var h=this&&this.__decorate||function(E,y,R,T){var I,M=arguments.length,H=M<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(E,y,R,T);else for(var q=E.length-1;q>=0;q--)(I=E[q])&&(H=(M<3?I(H):M>3?I(y,R,H):I(y,R))||H);return M>3&&H&&Object.defineProperty(y,R,H),H},g=this&&this.__param||function(E,y){return function(R,T){y(R,T,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const o=u(7239),p=u(8055),m=u(8460),w=u(844),_=u(2585),n=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),a=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let R=0;R<216;R++){const T=y[R/36%6|0],I=y[R/6%6|0],M=y[R%6];E.push({css:p.channels.toCss(T,I,M),rgba:p.channels.toRgba(T,I,M)})}for(let R=0;R<24;R++){const T=8+10*R;E.push({css:p.channels.toCss(T,T,T),rgba:p.channels.toRgba(T,T,T)})}return E})());let x=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new o.ColorContrastCache,this._halfContrastCache=new o.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:l,cursor:a,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:p.color.blend(l,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:p.color.blend(l,S),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(E={}){const y=this._colors;if(y.foreground=b(E.foreground,n),y.background=b(E.background,l),y.cursor=b(E.cursor,a),y.cursorAccent=b(E.cursorAccent,c),y.selectionBackgroundTransparent=b(E.selectionBackground,S),y.selectionBackgroundOpaque=p.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=b(E.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=p.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=E.selectionForeground?b(E.selectionForeground,p.NULL_COLOR):void 0,y.selectionForeground===p.NULL_COLOR&&(y.selectionForeground=void 0),p.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=p.color.opacity(y.selectionBackgroundTransparent,.3)),p.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=p.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=s.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=b(E.black,s.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=b(E.red,s.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=b(E.green,s.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=b(E.yellow,s.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=b(E.blue,s.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=b(E.magenta,s.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=b(E.cyan,s.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=b(E.white,s.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=b(E.brightBlack,s.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=b(E.brightRed,s.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=b(E.brightGreen,s.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=b(E.brightYellow,s.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=b(E.brightBlue,s.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=b(E.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=b(E.brightCyan,s.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=b(E.brightWhite,s.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const R=Math.min(y.ansi.length-16,E.extendedAnsi.length);for(let T=0;T<R;T++)y.ansi[T+16]=b(E.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[E]=this._restoreColors.ansi[E]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(E){E(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function b(E,y){if(E!==void 0)try{return p.css.toColor(E)}catch{}return y}s.ThemeService=x=h([g(0,_.IOptionsService)],x)},6349:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=u(8460),g=u(844);class o extends g.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const w=new Array(m);for(let _=0;_<Math.min(m,this.length);_++)w[_]=this._array[this._getCyclicIndex(_)];this._array=w,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let w=this._length;w<m;w++)this._array[w]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,w){this._array[this._getCyclicIndex(m)]=w}push(m){this._array[this._getCyclicIndex(this._length)]=m,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(m,w,..._){if(w){for(let n=m;n<this._length-w;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+w)];this._length-=w,this.onDeleteEmitter.fire({index:m,amount:w})}for(let n=this._length-1;n>=m;n--)this._array[this._getCyclicIndex(n+_.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<_.length;n++)this._array[this._getCyclicIndex(m+n)]=_[n];if(_.length&&this.onInsertEmitter.fire({index:m,amount:_.length}),this._length+_.length>this._maxLength){const n=this._length+_.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=_.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,w,_){if(!(w<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let l=w-1;l>=0;l--)this.set(m+l+_,this.get(m+l));const n=m+w+_-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<w;n++)this.set(m+n+_,this.get(m+n))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}s.CircularList=o},1439:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function u(h,g=5){if(typeof h!="object")return h;const o=Array.isArray(h)?[]:{};for(const p in h)o[p]=g<=1?h[p]:h[p]&&u(h[p],g-1);return o}},8055:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let u=0,h=0,g=0,o=0;var p,m,w,_,n;function l(c){const S=c.toString(16);return S.length<2?"0"+S:S}function a(c,S){return c<S?(S+.05)/(c+.05):(c+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(S,x,b,E){return E!==void 0?`#${l(S)}${l(x)}${l(b)}${l(E)}`:`#${l(S)}${l(x)}${l(b)}`},c.toRgba=function(S,x,b,E=255){return(S<<24|x<<16|b<<8|E)>>>0},c.toColor=function(S,x,b,E){return{css:c.toCss(S,x,b,E),rgba:c.toRgba(S,x,b,E)}}})(p||(s.channels=p={})),(function(c){function S(x,b){return o=Math.round(255*b),[u,h,g]=n.toChannels(x.rgba),{css:p.toCss(u,h,g,o),rgba:p.toRgba(u,h,g,o)}}c.blend=function(x,b){if(o=(255&b.rgba)/255,o===1)return{css:b.css,rgba:b.rgba};const E=b.rgba>>24&255,y=b.rgba>>16&255,R=b.rgba>>8&255,T=x.rgba>>24&255,I=x.rgba>>16&255,M=x.rgba>>8&255;return u=T+Math.round((E-T)*o),h=I+Math.round((y-I)*o),g=M+Math.round((R-M)*o),{css:p.toCss(u,h,g),rgba:p.toRgba(u,h,g)}},c.isOpaque=function(x){return(255&x.rgba)==255},c.ensureContrastRatio=function(x,b,E){const y=n.ensureContrastRatio(x.rgba,b.rgba,E);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},c.opaque=function(x){const b=(255|x.rgba)>>>0;return[u,h,g]=n.toChannels(b),{css:p.toCss(u,h,g),rgba:b}},c.opacity=S,c.multiplyOpacity=function(x,b){return o=255&x.rgba,S(x,o*b/255)},c.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(m||(s.color=m={})),(function(c){let S,x;try{const b=document.createElement("canvas");b.width=1,b.height=1;const E=b.getContext("2d",{willReadFrequently:!0});E&&(S=E,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return u=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),p.toColor(u,h,g);case 5:return u=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),o=parseInt(b.slice(4,5).repeat(2),16),p.toColor(u,h,g,o);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const E=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return u=parseInt(E[1]),h=parseInt(E[2]),g=parseInt(E[3]),o=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),p.toColor(u,h,g,o);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=b,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,h,g,o]=S.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,h,g,o),css:b}}})(w||(s.css=w={})),(function(c){function S(x,b,E){const y=x/255,R=b/255,T=E/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}c.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},c.relativeLuminance2=S})(_||(s.rgb=_={})),(function(c){function S(b,E,y){const R=b>>24&255,T=b>>16&255,I=b>>8&255;let M=E>>24&255,H=E>>16&255,q=E>>8&255,Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));for(;Q<y&&(M>0||H>0||q>0);)M-=Math.max(0,Math.ceil(.1*M)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));return(M<<24|H<<16|q<<8|255)>>>0}function x(b,E,y){const R=b>>24&255,T=b>>16&255,I=b>>8&255;let M=E>>24&255,H=E>>16&255,q=E>>8&255,Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));for(;Q<y&&(M<255||H<255||q<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),H=Math.min(255,H+Math.ceil(.1*(255-H))),q=Math.min(255,q+Math.ceil(.1*(255-q))),Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));return(M<<24|H<<16|q<<8|255)>>>0}c.blend=function(b,E){if(o=(255&E)/255,o===1)return E;const y=E>>24&255,R=E>>16&255,T=E>>8&255,I=b>>24&255,M=b>>16&255,H=b>>8&255;return u=I+Math.round((y-I)*o),h=M+Math.round((R-M)*o),g=H+Math.round((T-H)*o),p.toRgba(u,h,g)},c.ensureContrastRatio=function(b,E,y){const R=_.relativeLuminance(b>>8),T=_.relativeLuminance(E>>8);if(a(R,T)<y){if(T<R){const H=S(b,E,y),q=a(R,_.relativeLuminance(H>>8));if(q<y){const Q=x(b,E,y);return q>a(R,_.relativeLuminance(Q>>8))?H:Q}return H}const I=x(b,E,y),M=a(R,_.relativeLuminance(I>>8));if(M<y){const H=S(b,E,y);return M>a(R,_.relativeLuminance(H>>8))?I:H}return I}},c.reduceLuminance=S,c.increaseLuminance=x,c.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(n||(s.rgba=n={})),s.toPaddedHex=l,s.contrastRatio=a},8969:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=u(844),g=u(2585),o=u(4348),p=u(7866),m=u(744),w=u(7302),_=u(6975),n=u(8460),l=u(1753),a=u(1480),c=u(7994),S=u(9282),x=u(5435),b=u(5981),E=u(2660);let y=!1;class R extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((I=>{var M;(M=this._onScrollApi)==null||M.fire(I.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(I){for(const M in I)this.optionsService.options[M]=I[M]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new o.InstantiationService,this.optionsService=this.register(new w.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(a.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new b.WriteBuffer(((M,H)=>this._inputHandler.parse(M,H)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,M){this._writeBuffer.write(I,M)}writeSync(I,M){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(I,M)}input(I,M=!0){this.coreService.triggerDataEvent(I,M)}resize(I,M){isNaN(I)||isNaN(M)||(I=Math.max(I,m.MINIMUM_COLS),M=Math.max(M,m.MINIMUM_ROWS),this._bufferService.resize(I,M))}scroll(I,M=!1){this._bufferService.scroll(I,M)}scrollLines(I,M,H){this._bufferService.scrollLines(I,M,H)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const M=I-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(I,M){return this._inputHandler.registerEscHandler(I,M)}registerDcsHandler(I,M){return this._inputHandler.registerDcsHandler(I,M)}registerCsiHandler(I,M){return this._inputHandler.registerCsiHandler(I,M)}registerOscHandler(I,M){return this._inputHandler.registerOscHandler(I,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?I=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const M of I)M.dispose()}))}}}s.CoreTerminal=R},8460:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const g=[];for(let o=0;o<this._listeners.length;o++)g.push(this._listeners[o]);for(let o=0;o<g.length;o++)g[o].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(u,h){return u((g=>h.fire(g)))},s.runAndSubscribe=function(u,h){return h(void 0),u((g=>h(g)))}},5435:function(B,s,u){var h=this&&this.__decorate||function(Y,k,F,O){var N,Z=arguments.length,ee=Z<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,F):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(Y,k,F,O);else for(var he=Y.length-1;he>=0;he--)(N=Y[he])&&(ee=(Z<3?N(ee):Z>3?N(k,F,ee):N(k,F))||ee);return Z>3&&ee&&Object.defineProperty(k,F,ee),ee},g=this&&this.__param||function(Y,k){return function(F,O){k(F,O,Y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const o=u(2584),p=u(7116),m=u(2015),w=u(844),_=u(482),n=u(8437),l=u(8460),a=u(643),c=u(511),S=u(3734),x=u(2585),b=u(1480),E=u(6242),y=u(6351),R=u(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function M(Y,k){if(Y>24)return k.setWinLines||!1;switch(Y){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}var H;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(H||(s.WindowsOptionsReportType=H={}));let q=0;class Q extends w.Disposable{getAttrData(){return this._curAttrData}constructor(k,F,O,N,Z,ee,he,ce,X=new m.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=F,this._coreService=O,this._logService=N,this._optionsService=Z,this._oscLinkService=ee,this._coreMouseService=he,this._unicodeService=ce,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._parser.setCsiHandlerFallback(((P,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(P),params:ne.toArray()})})),this._parser.setEscHandlerFallback((P=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(P)})})),this._parser.setExecuteHandlerFallback((P=>{this._logService.debug("Unknown EXECUTE code: ",{code:P})})),this._parser.setOscHandlerFallback(((P,ne,ie)=>{this._logService.debug("Unknown OSC code: ",{identifier:P,action:ne,data:ie})})),this._parser.setDcsHandlerFallback(((P,ne,ie)=>{ne==="HOOK"&&(ie=ie.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(P),action:ne,payload:ie})})),this._parser.setPrintHandler(((P,ne,ie)=>this.print(P,ne,ie))),this._parser.registerCsiHandler({final:"@"},(P=>this.insertChars(P))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(P=>this.scrollLeft(P))),this._parser.registerCsiHandler({final:"A"},(P=>this.cursorUp(P))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(P=>this.scrollRight(P))),this._parser.registerCsiHandler({final:"B"},(P=>this.cursorDown(P))),this._parser.registerCsiHandler({final:"C"},(P=>this.cursorForward(P))),this._parser.registerCsiHandler({final:"D"},(P=>this.cursorBackward(P))),this._parser.registerCsiHandler({final:"E"},(P=>this.cursorNextLine(P))),this._parser.registerCsiHandler({final:"F"},(P=>this.cursorPrecedingLine(P))),this._parser.registerCsiHandler({final:"G"},(P=>this.cursorCharAbsolute(P))),this._parser.registerCsiHandler({final:"H"},(P=>this.cursorPosition(P))),this._parser.registerCsiHandler({final:"I"},(P=>this.cursorForwardTab(P))),this._parser.registerCsiHandler({final:"J"},(P=>this.eraseInDisplay(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(P=>this.eraseInDisplay(P,!0))),this._parser.registerCsiHandler({final:"K"},(P=>this.eraseInLine(P,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(P=>this.eraseInLine(P,!0))),this._parser.registerCsiHandler({final:"L"},(P=>this.insertLines(P))),this._parser.registerCsiHandler({final:"M"},(P=>this.deleteLines(P))),this._parser.registerCsiHandler({final:"P"},(P=>this.deleteChars(P))),this._parser.registerCsiHandler({final:"S"},(P=>this.scrollUp(P))),this._parser.registerCsiHandler({final:"T"},(P=>this.scrollDown(P))),this._parser.registerCsiHandler({final:"X"},(P=>this.eraseChars(P))),this._parser.registerCsiHandler({final:"Z"},(P=>this.cursorBackwardTab(P))),this._parser.registerCsiHandler({final:"`"},(P=>this.charPosAbsolute(P))),this._parser.registerCsiHandler({final:"a"},(P=>this.hPositionRelative(P))),this._parser.registerCsiHandler({final:"b"},(P=>this.repeatPrecedingCharacter(P))),this._parser.registerCsiHandler({final:"c"},(P=>this.sendDeviceAttributesPrimary(P))),this._parser.registerCsiHandler({prefix:">",final:"c"},(P=>this.sendDeviceAttributesSecondary(P))),this._parser.registerCsiHandler({final:"d"},(P=>this.linePosAbsolute(P))),this._parser.registerCsiHandler({final:"e"},(P=>this.vPositionRelative(P))),this._parser.registerCsiHandler({final:"f"},(P=>this.hVPosition(P))),this._parser.registerCsiHandler({final:"g"},(P=>this.tabClear(P))),this._parser.registerCsiHandler({final:"h"},(P=>this.setMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(P=>this.setModePrivate(P))),this._parser.registerCsiHandler({final:"l"},(P=>this.resetMode(P))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(P=>this.resetModePrivate(P))),this._parser.registerCsiHandler({final:"m"},(P=>this.charAttributes(P))),this._parser.registerCsiHandler({final:"n"},(P=>this.deviceStatus(P))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(P=>this.deviceStatusPrivate(P))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(P=>this.softReset(P))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(P=>this.setCursorStyle(P))),this._parser.registerCsiHandler({final:"r"},(P=>this.setScrollRegion(P))),this._parser.registerCsiHandler({final:"s"},(P=>this.saveCursor(P))),this._parser.registerCsiHandler({final:"t"},(P=>this.windowOptions(P))),this._parser.registerCsiHandler({final:"u"},(P=>this.restoreCursor(P))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(P=>this.insertColumns(P))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(P=>this.deleteColumns(P))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(P=>this.selectProtected(P))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(P=>this.requestMode(P,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(P=>this.requestMode(P,!1))),this._parser.setExecuteHandler(o.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(o.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(o.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(o.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(o.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(o.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(o.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(o.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(o.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(o.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new E.OscHandler((P=>(this.setTitle(P),this.setIconName(P),!0)))),this._parser.registerOscHandler(1,new E.OscHandler((P=>this.setIconName(P)))),this._parser.registerOscHandler(2,new E.OscHandler((P=>this.setTitle(P)))),this._parser.registerOscHandler(4,new E.OscHandler((P=>this.setOrReportIndexedColor(P)))),this._parser.registerOscHandler(8,new E.OscHandler((P=>this.setHyperlink(P)))),this._parser.registerOscHandler(10,new E.OscHandler((P=>this.setOrReportFgColor(P)))),this._parser.registerOscHandler(11,new E.OscHandler((P=>this.setOrReportBgColor(P)))),this._parser.registerOscHandler(12,new E.OscHandler((P=>this.setOrReportCursorColor(P)))),this._parser.registerOscHandler(104,new E.OscHandler((P=>this.restoreIndexedColor(P)))),this._parser.registerOscHandler(110,new E.OscHandler((P=>this.restoreFgColor(P)))),this._parser.registerOscHandler(111,new E.OscHandler((P=>this.restoreBgColor(P)))),this._parser.registerOscHandler(112,new E.OscHandler((P=>this.restoreCursorColor(P)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const P in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:P},(()=>this.selectCharset("("+P))),this._parser.registerEscHandler({intermediates:")",final:P},(()=>this.selectCharset(")"+P))),this._parser.registerEscHandler({intermediates:"*",final:P},(()=>this.selectCharset("*"+P))),this._parser.registerEscHandler({intermediates:"+",final:P},(()=>this.selectCharset("+"+P))),this._parser.registerEscHandler({intermediates:"-",final:P},(()=>this.selectCharset("-"+P))),this._parser.registerEscHandler({intermediates:".",final:P},(()=>this.selectCharset("."+P))),this._parser.registerEscHandler({intermediates:"/",final:P},(()=>this.selectCharset("/"+P)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((P=>(this._logService.error("Parsing error: ",P),P))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((P,ne)=>this.requestStatusString(P,ne))))}_preserveStack(k,F,O,N){this._parseStack.paused=!0,this._parseStack.cursorStartX=k,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=O,this._parseStack.position=N}_logSlowResolvingAsync(k){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([k,new Promise(((F,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((F=>{if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(k,F){let O,N=this._activeBuffer.x,Z=this._activeBuffer.y,ee=0;const he=this._parseStack.paused;if(he){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(O),O;N=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>I&&(ee=this._parseStack.position+I)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,(P=>String.fromCharCode(P))).join("")}"`),typeof k=="string"?k.split("").map((P=>P.charCodeAt(0))):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(k.length,I))),he||this._dirtyRowTracker.clearRange(),k.length>I)for(let P=ee;P<k.length;P+=I){const ne=P+I<k.length?P+I:k.length,ie=typeof k=="string"?this._stringDecoder.decode(k.substring(P,ne),this._parseBuffer):this._utf8Decoder.decode(k.subarray(P,ne),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ie))return this._preserveStack(N,Z,ie,P),this._logSlowResolvingAsync(O),O}else if(!he){const P=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,P))return this._preserveStack(N,Z,P,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===N&&this._activeBuffer.y===Z||this._onCursorMove.fire();const ce=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ce,this._bufferService.rows-1))}print(k,F,O){let N,Z;const ee=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,ce=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,P=this._coreService.modes.insertMode,ne=this._curAttrData;let ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-F>0&&ie.getWidth(this._activeBuffer.x-1)===2&&ie.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let _e=this._parser.precedingJoinState;for(let fe=F;fe<O;++fe){if(N=k[fe],N<127&&ee){const Pe=ee[String.fromCharCode(N)];Pe&&(N=Pe.charCodeAt(0))}const ye=this._unicodeService.charProperties(N,_e);Z=b.UnicodeService.extractWidth(ye);const ve=b.UnicodeService.extractShouldJoin(ye),Te=ve?b.UnicodeService.extractWidth(_e):0;if(_e=ye,he&&this._onA11yChar.fire((0,_.stringFromCodePoint)(N)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Te>ce){if(X){const Pe=ie;let Se=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,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),ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&ie instanceof n.BufferLine&&ie.copyCellsFrom(Pe,Se,0,Te,!1);Se<ce;)Pe.setCellFromCodepoint(Se++,0,1,ne)}else if(this._activeBuffer.x=ce-1,Z===2)continue}if(ve&&this._activeBuffer.x){const Pe=ie.getWidth(this._activeBuffer.x-1)?1:2;ie.addCodepointToCell(this._activeBuffer.x-Pe,N,Z);for(let Se=Z-Te;--Se>=0;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(P&&(ie.insertCells(this._activeBuffer.x,Z-Te,this._activeBuffer.getNullCell(ne)),ie.getWidth(ce-1)===2&&ie.setCellFromCodepoint(ce-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,ne)),ie.setCellFromCodepoint(this._activeBuffer.x++,N,Z,ne),Z>0)for(;--Z;)ie.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=_e,this._activeBuffer.x<ce&&O-F>0&&ie.getWidth(this._activeBuffer.x)===0&&!ie.hasContent(this._activeBuffer.x)&&ie.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(k,F){return k.final!=="t"||k.prefix||k.intermediates?this._parser.registerCsiHandler(k,F):this._parser.registerCsiHandler(k,(O=>!M(O.params[0],this._optionsService.rawOptions.windowOptions)||F(O)))}registerDcsHandler(k,F){return this._parser.registerDcsHandler(k,new y.DcsHandler(F))}registerEscHandler(k,F){return this._parser.registerEscHandler(k,F)}registerOscHandler(k,F){return this._parser.registerOscHandler(k,new E.OscHandler(F))}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 k;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&&((k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&k.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const k=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-k),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(k=this._bufferService.cols-1){this._activeBuffer.x=Math.min(k,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(k,F){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=k,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=k,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(k,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+k,this._activeBuffer.y+F)}cursorUp(k){const F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,k.params[0]||1)):this._moveCursor(0,-(k.params[0]||1)),!0}cursorDown(k){const F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,k.params[0]||1)):this._moveCursor(0,k.params[0]||1),!0}cursorForward(k){return this._moveCursor(k.params[0]||1,0),!0}cursorBackward(k){return this._moveCursor(-(k.params[0]||1),0),!0}cursorNextLine(k){return this.cursorDown(k),this._activeBuffer.x=0,!0}cursorPrecedingLine(k){return this.cursorUp(k),this._activeBuffer.x=0,!0}cursorCharAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(k){return this._setCursor(k.length>=2?(k.params[1]||1)-1:0,(k.params[0]||1)-1),!0}charPosAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(k){return this._moveCursor(k.params[0]||1,0),!0}linePosAbsolute(k){return this._setCursor(this._activeBuffer.x,(k.params[0]||1)-1),!0}vPositionRelative(k){return this._moveCursor(0,k.params[0]||1),!0}hVPosition(k){return this.cursorPosition(k),!0}tabClear(k){const F=k.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=k.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=k.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(k){const F=k.params[0];return F===1&&(this._curAttrData.bg|=536870912),F!==2&&F!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(k,F,O,N=!1,Z=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);ee.replaceCells(F,O,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),N&&(ee.isWrapped=!1)}_resetBufferLine(k,F=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),F),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+k),O.isWrapped=!1)}eraseInDisplay(k,F=!1){let O;switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);O<this._bufferService.rows;O++)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,F),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,F);this._dirtyRowTracker.markDirty(0);break;case 3:const N=this._activeBuffer.lines.length-this._bufferService.rows;N>0&&(this._activeBuffer.lines.trimStart(N),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-N,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-N,0),this._onScroll.fire(0))}return!0}eraseInLine(k,F=!1){switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,F);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,F)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(k){this._restrictCursor();let F=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,N=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-N+1;for(;F--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(k){this._restrictCursor();let F=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let N;for(N=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-N;F--;)this._activeBuffer.lines.splice(O,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}insertChars(k){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.insertCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(k){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.deleteCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(k){let F=k.params[0]||1;for(;F--;)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(k){let F=k.params[0]||1;for(;F--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);N.deleteCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);N.insertCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);N.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=k.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);N.deleteCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),N.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(k){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(k.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(k){const F=this._parser.precedingJoinState;if(!F)return!0;const O=k.params[0]||1,N=b.UnicodeService.extractWidth(F),Z=this._activeBuffer.x-N,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),he=new Uint32Array(ee.length*O);let ce=0;for(let P=0;P<ee.length;){const ne=ee.codePointAt(P)||0;he[ce++]=ne,P+=ne>65535?2:1}let X=ce;for(let P=1;P<O;++P)he.copyWithin(X,0,ce),X+=ce;return this.print(he,0,X),!0}sendDeviceAttributesPrimary(k){return k.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(k){return k.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(k.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c")),!0}_is(k){return(this._optionsService.rawOptions.termName+"").indexOf(k)===0}setMode(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(k){for(let F=0;F<k.length;F++)switch(k.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),k.params[F]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(k,F){const O=this._coreService.decPrivateModes,{activeProtocol:N,activeEncoding:Z}=this._coreMouseService,ee=this._coreService,{buffers:he,cols:ce}=this._bufferService,{active:X,alt:P}=he,ne=this._optionsService.rawOptions,ie=ve=>ve?1:2,_e=k.params[0];return fe=_e,ye=F?_e===2?4:_e===4?ie(ee.modes.insertMode):_e===12?3:_e===20?ie(ne.convertEol):0:_e===1?ie(O.applicationCursorKeys):_e===3?ne.windowOptions.setWinLines?ce===80?2:ce===132?1:0:0:_e===6?ie(O.origin):_e===7?ie(O.wraparound):_e===8?3:_e===9?ie(N==="X10"):_e===12?ie(ne.cursorBlink):_e===25?ie(!ee.isCursorHidden):_e===45?ie(O.reverseWraparound):_e===66?ie(O.applicationKeypad):_e===67?4:_e===1e3?ie(N==="VT200"):_e===1002?ie(N==="DRAG"):_e===1003?ie(N==="ANY"):_e===1004?ie(O.sendFocus):_e===1005?4:_e===1006?ie(Z==="SGR"):_e===1015?4:_e===1016?ie(Z==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?ie(X===P):_e===2004?ie(O.bracketedPasteMode):0,ee.triggerDataEvent(`${o.C0.ESC}[${F?"":"?"}${fe};${ye}$y`),!0;var fe,ye}_updateAttrColor(k,F,O,N,Z){return F===2?(k|=50331648,k&=-16777216,k|=S.AttributeData.fromColorRGB([O,N,Z])):F===5&&(k&=-50331904,k|=33554432|255&O),k}_extractColor(k,F,O){const N=[0,0,-1,0,0,0];let Z=0,ee=0;do{if(N[ee+Z]=k.params[F+ee],k.hasSubParams(F+ee)){const he=k.getSubParams(F+ee);let ce=0;do N[1]===5&&(Z=1),N[ee+ce+1+Z]=he[ce];while(++ce<he.length&&ce+ee+1+Z<N.length);break}if(N[1]===5&&ee+Z>=2||N[1]===2&&ee+Z>=5)break;N[1]&&(Z=1)}while(++ee+F<k.length&&ee+Z<N.length);for(let he=2;he<N.length;++he)N[he]===-1&&(N[he]=0);switch(N[0]){case 38:O.fg=this._updateAttrColor(O.fg,N[1],N[3],N[4],N[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,N[1],N[3],N[4],N[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,N[1],N[3],N[4],N[5])}return ee}_processUnderline(k,F){F.extended=F.extended.clone(),(!~k||k>5)&&(k=1),F.extended.underlineStyle=k,F.fg|=268435456,k===0&&(F.fg&=-268435457),F.updateExtended()}_processSGR0(k){k.fg=n.DEFAULT_ATTR_DATA.fg,k.bg=n.DEFAULT_ATTR_DATA.bg,k.extended=k.extended.clone(),k.extended.underlineStyle=0,k.extended.underlineColor&=-67108864,k.updateExtended()}charAttributes(k){if(k.length===1&&k.params[0]===0)return this._processSGR0(this._curAttrData),!0;const F=k.length;let O;const N=this._curAttrData;for(let Z=0;Z<F;Z++)O=k.params[Z],O>=30&&O<=37?(N.fg&=-50331904,N.fg|=16777216|O-30):O>=40&&O<=47?(N.bg&=-50331904,N.bg|=16777216|O-40):O>=90&&O<=97?(N.fg&=-50331904,N.fg|=16777224|O-90):O>=100&&O<=107?(N.bg&=-50331904,N.bg|=16777224|O-100):O===0?this._processSGR0(N):O===1?N.fg|=134217728:O===3?N.bg|=67108864:O===4?(N.fg|=268435456,this._processUnderline(k.hasSubParams(Z)?k.getSubParams(Z)[0]:1,N)):O===5?N.fg|=536870912:O===7?N.fg|=67108864:O===8?N.fg|=1073741824:O===9?N.fg|=2147483648:O===2?N.bg|=134217728:O===21?this._processUnderline(2,N):O===22?(N.fg&=-134217729,N.bg&=-134217729):O===23?N.bg&=-67108865:O===24?(N.fg&=-268435457,this._processUnderline(0,N)):O===25?N.fg&=-536870913:O===27?N.fg&=-67108865:O===28?N.fg&=-1073741825:O===29?N.fg&=2147483647:O===39?(N.fg&=-67108864,N.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):O===49?(N.bg&=-67108864,N.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?Z+=this._extractColor(k,Z,N):O===53?N.bg|=1073741824:O===55?N.bg&=-1073741825:O===59?(N.extended=N.extended.clone(),N.extended.underlineColor=-1,N.updateExtended()):O===100?(N.fg&=-67108864,N.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,N.bg&=-67108864,N.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(k){switch(k.params[0]){case 5:this._coreService.triggerDataEvent(`${o.C0.ESC}[0n`);break;case 6:const F=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[${F};${O}R`)}return!0}deviceStatusPrivate(k){if(k.params[0]===6){const F=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${o.C0.ESC}[?${F};${O}R`)}return!0}softReset(k){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(k){const F=k.params[0]||1;switch(F){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=F%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(k){const F=k.params[0]||1;let O;return(k.length<2||(O=k.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>F&&(this._activeBuffer.scrollTop=F-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(k){if(!M(k.params[0],this._optionsService.rawOptions.windowOptions))return!0;const F=k.length>1?k.params[1]:0;switch(k.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(H.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(H.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${o.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(k){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(k){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(k){return this._windowTitle=k,this._onTitleChange.fire(k),!0}setIconName(k){return this._iconName=k,!0}setOrReportIndexedColor(k){const F=[],O=k.split(";");for(;O.length>1;){const N=O.shift(),Z=O.shift();if(/^\d+$/.exec(N)){const ee=parseInt(N);if($(ee))if(Z==="?")F.push({type:0,index:ee});else{const he=(0,R.parseColor)(Z);he&&F.push({type:1,index:ee,color:he})}}}return F.length&&this._onColor.fire(F),!0}setHyperlink(k){const F=k.split(";");return!(F.length<2)&&(F[1]?this._createHyperlink(F[0],F[1]):!F[0]&&this._finishHyperlink())}_createHyperlink(k,F){this._getCurrentLinkId()&&this._finishHyperlink();const O=k.split(":");let N;const Z=O.findIndex((ee=>ee.startsWith("id=")));return Z!==-1&&(N=O[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:N,uri:F}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(k,F){const O=k.split(";");for(let N=0;N<O.length&&!(F>=this._specialColors.length);++N,++F)if(O[N]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{const Z=(0,R.parseColor)(O[N]);Z&&this._onColor.fire([{type:1,index:this._specialColors[F],color:Z}])}return!0}setOrReportFgColor(k){return this._setOrReportSpecialColor(k,0)}setOrReportBgColor(k){return this._setOrReportSpecialColor(k,1)}setOrReportCursorColor(k){return this._setOrReportSpecialColor(k,2)}restoreIndexedColor(k){if(!k)return this._onColor.fire([{type:2}]),!0;const F=[],O=k.split(";");for(let N=0;N<O.length;++N)if(/^\d+$/.exec(O[N])){const Z=parseInt(O[N]);$(Z)&&F.push({type:2,index:Z})}return F.length&&this._onColor.fire(F),!0}restoreFgColor(k){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(k){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(k){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,p.DEFAULT_CHARSET),!0}selectCharset(k){return k.length!==2?(this.selectDefaultCharset(),!0):(k[0]==="/"||this._charsetService.setgCharset(T[k[0]],p.CHARSETS[k[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const k=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,k,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(k){return this._charsetService.setgLevel(k),!0}screenAlignmentPattern(){const k=new c.CellData;k.content=4194373,k.fg=this._curAttrData.fg,k.bg=this._curAttrData.bg,this._setCursor(0,0);for(let F=0;F<this._bufferService.rows;++F){const O=this._activeBuffer.ybase+this._activeBuffer.y+F,N=this._activeBuffer.lines.get(O);N&&(N.fill(k),N.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(k,F){const O=this._bufferService.buffer,N=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${o.C0.ESC}${Z}${o.C0.ESC}\\`),!0))(k==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:k==='"p'?'P1$r61;1"p':k==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:k==="m"?"P1$r0m":k===" q"?`P1$r${{block:2,underline:4,bar:6}[N.cursorStyle]-(N.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(k,F){this._dirtyRowTracker.markRangeDirty(k,F)}}s.InputHandler=Q;let G=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,k){Y>k&&(q=Y,Y=k,k=q),Y<this.start&&(this.start=Y),k>this.end&&(this.end=k)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(Y){return 0<=Y&&Y<256}G=h([g(0,x.IBufferService)],G)},844:(B,s)=>{function u(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=u,s.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,o,p){this._data[g]||(this._data[g]={}),this._data[g][o]=p}get(g,o){return this._data[g]?this._data[g][o]:void 0}clear(){this._data={}}}s.TwoKeyMap=u,s.FourKeyMap=class{constructor(){this._data=new u}set(h,g,o,p,m){this._data.get(h,g)||this._data.set(h,g,new u),this._data.get(h,g).set(o,p,m)}get(h,g,o,p){var m;return(m=this._data.get(h,g))==null?void 0:m.get(o,p)}clear(){this._data.clear()}}},6114:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const u=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=u.includes("Firefox"),s.isLegacyEdge=u.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(u),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(u)},6106:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let u=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,g){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let g=0,o=this._array.length-1;for(;o>=g;){let p=g+o>>1;const m=this._getKey(this._array[p]);if(m>h)o=p-1;else{if(!(m<h)){for(;p>0&&this._getKey(this._array[p-1])===h;)p--;return p}g=p+1}}return g}}},7226:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let w=0,_=0,n=m.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),l=m.timeRemaining(),1.5*_>l)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=l}this.clear()}}class o extends g{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const w=Date.now()+m;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=o,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:o,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=u(643);s.updateWindowsModeWrappedState=function(g){const o=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=o==null?void 0:o.get(g.cols-1),m=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);m&&p&&(m.isWrapped=p[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&p[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new u;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,p=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=p}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=u(6349),g=u(7226),o=u(3734),p=u(8437),m=u(4634),w=u(511),_=u(643),n=u(4863),l=u(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(a,c,S){this._hasScrollback=a,this._optionsService=c,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(a){return a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg,this._nullCell.extended=a.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell}getWhitespaceCell(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg,this._whitespaceCell.extended=a.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell}getBlankLine(a,c){return new p.BufferLine(this._bufferService.cols,this.getNullCell(a),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const a=this.ybase+this.y-this.ydisp;return a>=0&&a<this._rows}_getCorrectBufferLength(a){if(!this._hasScrollback)return a;const c=a+this._optionsService.rawOptions.scrollback;return c>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:c}fillViewportRows(a){if(this.lines.length===0){a===void 0&&(a=p.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(a))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(a,c){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=0;const b=this._getCorrectBufferLength(c);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<a)for(let y=0;y<this.lines.length;y++)x+=+this.lines.get(y).resize(a,S);let E=0;if(this._rows<c)for(let y=this._rows;y<c;y++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(a,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(a,S)));else for(let y=this._rows;y>c;y--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const y=this.lines.length-b;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=b}this.x=Math.min(this.x,a-1),this.y=Math.min(this.y,c-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,a-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(a,c),this._cols>a))for(let E=0;E<this.lines.length;E++)x+=+this.lines.get(E).resize(a,S);this._cols=a,this._rows=c,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let a=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,a=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return a}get _isReflowEnabled(){const a=this._optionsService.rawOptions.windowsPty;return a&&a.buildNumber?this._hasScrollback&&a.backend==="conpty"&&a.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(a,c){this._cols!==a&&(a>this._cols?this._reflowLarger(a,c):this._reflowSmaller(a,c))}_reflowLarger(a,c){const S=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(S.length>0){const x=(0,m.reflowLargerCreateNewLayout)(this.lines,S);(0,m.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(a,c,x.countRemoved)}}_reflowLargerAdjustViewport(a,c,S){const x=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=S;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new p.BufferLine(a,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(a,c){const S=this.getNullCell(p.DEFAULT_ATTR_DATA),x=[];let b=0;for(let E=this.lines.length-1;E>=0;E--){let y=this.lines.get(E);if(!y||!y.isWrapped&&y.getTrimmedLength()<=a)continue;const R=[y];for(;y.isWrapped&&E>0;)y=this.lines.get(--E),R.unshift(y);const T=this.ybase+this.y;if(T>=E&&T<E+R.length)continue;const I=R[R.length-1].getTrimmedLength(),M=(0,m.reflowSmallerGetNewLineLengths)(R,this._cols,a),H=M.length-R.length;let q;q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+H):Math.max(0,this.lines.length-this.lines.maxLength+H);const Q=[];for(let O=0;O<H;O++){const N=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);Q.push(N)}Q.length>0&&(x.push({start:E+R.length+b,newLines:Q}),b+=Q.length),R.push(...Q);let G=M.length-1,$=M[G];$===0&&(G--,$=M[G]);let Y=R.length-H-1,k=I;for(;Y>=0;){const O=Math.min(k,$);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[Y],k-O,$-O,O,!0),$-=O,$===0&&(G--,$=M[G]),k-=O,k===0){Y--;const N=Math.max(Y,0);k=(0,m.getWrappedLineTrimmedLength)(R,N,this._cols)}}for(let O=0;O<R.length;O++)M[O]<a&&R[O].setCell(M[O],S);let F=H-q;for(;F-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+H,this.ybase+c-1)}if(x.length>0){const E=[],y=[];for(let G=0;G<this.lines.length;G++)y.push(this.lines.get(G));const R=this.lines.length;let T=R-1,I=0,M=x[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let H=0;for(let G=Math.min(this.lines.maxLength-1,R+b-1);G>=0;G--)if(M&&M.start>T+H){for(let $=M.newLines.length-1;$>=0;$--)this.lines.set(G--,M.newLines[$]);G++,E.push({index:T+1,amount:M.newLines.length}),H+=M.newLines.length,M=x[++I]}else this.lines.set(G,y[T--]);let q=0;for(let G=E.length-1;G>=0;G--)E[G].index+=q,this.lines.onInsertEmitter.fire(E[G]),q+=E[G].amount;const Q=Math.max(0,R+b-this.lines.maxLength);Q>0&&this.lines.onTrimEmitter.fire(Q)}}translateBufferLineToString(a,c,S=0,x){const b=this.lines.get(a);return b?b.translateToString(c,S,x):""}getWrappedRangeForLine(a){let c=a,S=a;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:c,last:S}}setupTabStops(a){for(a!=null?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.rawOptions.tabStopWidth)this.tabs[a]=!0}prevStop(a){for(a==null&&(a=this.x);!this.tabs[--a]&&a>0;);return a>=this._cols?this._cols-1:a<0?0:a}nextStop(a){for(a==null&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:a<0?0:a}clearMarkers(a){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===a&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].dispose(),this.markers.splice(a--,1);this._isClearing=!1}addMarker(a){const c=new n.Marker(a);return this.markers.push(c),c.register(this.lines.onTrim((S=>{c.line-=S,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((S=>{c.line>=S.index&&(c.line+=S.amount)}))),c.register(this.lines.onDelete((S=>{c.line>=S.index&&c.line<S.index+S.amount&&c.dispose(),c.line>S.index&&(c.line-=S.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(a){this._isClearing||this.markers.splice(this.markers.indexOf(a),1)}}},8437:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=u(3734),g=u(511),o=u(643),p=u(482);s.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let m=0;class w{constructor(n,l,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=l||g.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]);for(let S=0;S<n;++S)this.setCell(S,c);this.length=n}get(n){const l=this._data[3*n+0],a=2097151&l;return[this._data[3*n+1],2097152&l?this._combined[n]:a?(0,p.stringFromCodePoint)(a):"",l>>22,2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):a]}set(n,l){this._data[3*n+1]=l[o.CHAR_DATA_ATTR_INDEX],l[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=l[1],this._data[3*n+0]=2097152|n|l[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=l[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[o.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&l}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n]:2097151&l?(0,p.stringFromCodePoint)(2097151&l):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,l){return m=3*n,l.content=this._data[m+0],l.fg=this._data[m+1],l.bg=this._data[m+2],2097152&l.content&&(l.combinedData=this._combined[n]),268435456&l.bg&&(l.extended=this._extendedAttrs[n]),l}setCell(n,l){2097152&l.content&&(this._combined[n]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[n]=l.extended),this._data[3*n+0]=l.content,this._data[3*n+1]=l.fg,this._data[3*n+2]=l.bg}setCellFromCodepoint(n,l,a,c){268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=l|a<<22,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}addCodepointToCell(n,l,a){let c=this._data[3*n+0];2097152&c?this._combined[n]+=(0,p.stringFromCodePoint)(l):2097151&c?(this._combined[n]=(0,p.stringFromCodePoint)(2097151&c)+(0,p.stringFromCodePoint)(l),c&=-2097152,c|=2097152):c=l|4194304,a&&(c&=-12582913,c|=a<<22),this._data[3*n+0]=c}insertCells(n,l,a){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,a),l<this.length-n){const c=new g.CellData;for(let S=this.length-n-l-1;S>=0;--S)this.setCell(n+l+S,this.loadCell(n+S,c));for(let S=0;S<l;++S)this.setCell(n+S,a)}else for(let c=n;c<this.length;++c)this.setCell(c,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(n,l,a){if(n%=this.length,l<this.length-n){const c=new g.CellData;for(let S=0;S<this.length-n-l;++S)this.setCell(n+S,this.loadCell(n+l+S,c));for(let S=this.length-l;S<this.length;++S)this.setCell(S,a)}else for(let c=n;c<this.length;++c)this.setCell(c,a);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,a),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,a)}replaceCells(n,l,a,c=!1){if(c)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,a),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,a);n<l&&n<this.length;)this.isProtected(n)||this.setCell(n,a),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,a),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,a);n<l&&n<this.length;)this.setCell(n++,a)}resize(n,l){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const a=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*a)this._data=new Uint32Array(this._data.buffer,0,a);else{const c=new Uint32Array(a);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,l)}else{this._data=this._data.subarray(0,a);const c=Object.keys(this._combined);for(let x=0;x<c.length;x++){const b=parseInt(c[x],10);b>=n&&delete this._combined[b]}const S=Object.keys(this._extendedAttrs);for(let x=0;x<S.length;x++){const b=parseInt(S[x],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*a*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,l=!1){if(l)for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,n);else{this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const l in n._combined)this._combined[l]=n._combined[l];this._extendedAttrs={};for(const l in n._extendedAttrs)this._extendedAttrs[l]=n._extendedAttrs[l];this.isWrapped=n.isWrapped}clone(){const n=new w(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const l in this._combined)n._combined[l]=this._combined[l];for(const l in this._extendedAttrs)n._extendedAttrs[l]=this._extendedAttrs[l];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,l,a,c,S){const x=n._data;if(S)for(let E=c-1;E>=0;E--){for(let y=0;y<3;y++)this._data[3*(a+E)+y]=x[3*(l+E)+y];268435456&x[3*(l+E)+2]&&(this._extendedAttrs[a+E]=n._extendedAttrs[l+E])}else for(let E=0;E<c;E++){for(let y=0;y<3;y++)this._data[3*(a+E)+y]=x[3*(l+E)+y];268435456&x[3*(l+E)+2]&&(this._extendedAttrs[a+E]=n._extendedAttrs[l+E])}const b=Object.keys(n._combined);for(let E=0;E<b.length;E++){const y=parseInt(b[E],10);y>=l&&(this._combined[y-l+a]=n._combined[y])}}translateToString(n,l,a,c){l=l??0,a=a??this.length,n&&(a=Math.min(a,this.getTrimmedLength())),c&&(c.length=0);let S="";for(;l<a;){const x=this._data[3*l+0],b=2097151&x,E=2097152&x?this._combined[l]:b?(0,p.stringFromCodePoint)(b):o.WHITESPACE_CELL_CHAR;if(S+=E,c)for(let y=0;y<E.length;++y)c.push(l);l+=x>>22||1}return c&&c.push(l),S}}s.BufferLine=w},4841:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(B,s)=>{function u(h,g,o){if(g===h.length-1)return h[g].getTrimmedLength();const p=!h[g].hasContent(o-1)&&h[g].getWidth(o-1)===1,m=h[g+1].getWidth(0)===2;return p&&m?o-1:o}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,g,o,p,m){const w=[];for(let _=0;_<h.length-1;_++){let n=_,l=h.get(++n);if(!l.isWrapped)continue;const a=[h.get(_)];for(;n<h.length&&l.isWrapped;)a.push(l),l=h.get(++n);if(p>=_&&p<n){_+=a.length-1;continue}let c=0,S=u(a,c,g),x=1,b=0;for(;x<a.length;){const y=u(a,x,g),R=y-b,T=o-S,I=Math.min(R,T);a[c].copyCellsFrom(a[x],b,S,I,!1),S+=I,S===o&&(c++,S=0),b+=I,b===y&&(x++,b=0),S===0&&c!==0&&a[c-1].getWidth(o-1)===2&&(a[c].copyCellsFrom(a[c-1],o-1,S++,1,!1),a[c-1].setCell(o-1,m))}a[c].replaceCells(S,o,m);let E=0;for(let y=a.length-1;y>0&&(y>c||a[y].getTrimmedLength()===0);y--)E++;E>0&&(w.push(_+a.length-E),w.push(E)),_+=a.length-1}return w},s.reflowLargerCreateNewLayout=function(h,g){const o=[];let p=0,m=g[p],w=0;for(let _=0;_<h.length;_++)if(m===_){const n=g[++p];h.onDeleteEmitter.fire({index:_-w,amount:n}),_+=n-1,w+=n,m=g[++p]}else o.push(_);return{layout:o,countRemoved:w}},s.reflowLargerApplyNewLayout=function(h,g){const o=[];for(let p=0;p<g.length;p++)o.push(h.get(g[p]));for(let p=0;p<o.length;p++)h.set(p,o[p]);h.length=g.length},s.reflowSmallerGetNewLineLengths=function(h,g,o){const p=[],m=h.map(((l,a)=>u(h,a,g))).reduce(((l,a)=>l+a));let w=0,_=0,n=0;for(;n<m;){if(m-n<o){p.push(m-n);break}w+=o;const l=u(h,_,g);w>l&&(w-=l,_++);const a=h[_].getWidth(w-1)===2;a&&w--;const c=a?o-1:o;p.push(c),n+=c}return p},s.getWrappedLineTrimmedLength=u},5295:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=u(8460),g=u(844),o=u(9092);class p extends g.Disposable{constructor(w,_){super(),this._optionsService=w,this._bufferService=_,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new o.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,_){this._normal.resize(w,_),this._alt.resize(w,_),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=p},511:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=u(482),g=u(643),o=u(3734);class p extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const _=new p;return _.setFromCharData(w),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const n=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=u(8460),g=u(844);class o{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=o._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}s.Marker=o,o._nextId=1},7116:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(B,s)=>{var u,h,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(o){o.NUL="\0",o.SOH="",o.STX="",o.ETX="",o.EOT="",o.ENQ="",o.ACK="",o.BEL="\x07",o.BS="\b",o.HT=" ",o.LF=`
81
+ `,o.VT="\v",o.FF="\f",o.CR="\r",o.SO="",o.SI="",o.DLE="",o.DC1="",o.DC2="",o.DC3="",o.DC4="",o.NAK="",o.SYN="",o.ETB="",o.CAN="",o.EM="",o.SUB="",o.ESC="\x1B",o.FS="",o.GS="",o.RS="",o.US="",o.SP=" ",o.DEL=""})(u||(s.C0=u={})),(function(o){o.PAD="€",o.HOP="",o.BPH="‚",o.NBH="ƒ",o.IND="„",o.NEL="…",o.SSA="†",o.ESA="‡",o.HTS="ˆ",o.HTJ="‰",o.VTS="Š",o.PLD="‹",o.PLU="Œ",o.RI="",o.SS2="Ž",o.SS3="",o.DCS="",o.PU1="‘",o.PU2="’",o.STS="“",o.CCH="”",o.MW="•",o.SPA="–",o.EPA="—",o.SOS="˜",o.SGCI="™",o.SCI="š",o.CSI="›",o.ST="œ",o.OSC="",o.PM="ž",o.APC="Ÿ"})(h||(s.C1=h={})),(function(o){o.ST=`${u.ESC}\\`})(g||(s.C1_ESCAPED=g={}))},7399:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=u(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(o,p,m,w){const _={type:0,cancel:!1,key:void 0},n=(o.shiftKey?1:0)|(o.altKey?2:0)|(o.ctrlKey?4:0)|(o.metaKey?8:0);switch(o.keyCode){case 0:o.key==="UIKeyInputUpArrow"?_.key=p?h.C0.ESC+"OA":h.C0.ESC+"[A":o.key==="UIKeyInputLeftArrow"?_.key=p?h.C0.ESC+"OD":h.C0.ESC+"[D":o.key==="UIKeyInputRightArrow"?_.key=p?h.C0.ESC+"OC":h.C0.ESC+"[C":o.key==="UIKeyInputDownArrow"&&(_.key=p?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:_.key=o.ctrlKey?"\b":h.C0.DEL,o.altKey&&(_.key=h.C0.ESC+_.key);break;case 9:if(o.shiftKey){_.key=h.C0.ESC+"[Z";break}_.key=h.C0.HT,_.cancel=!0;break;case 13:_.key=o.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,_.cancel=!0;break;case 27:_.key=h.C0.ESC,o.altKey&&(_.key=h.C0.ESC+h.C0.ESC),_.cancel=!0;break;case 37:if(o.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"D",_.key===h.C0.ESC+"[1;3D"&&(_.key=h.C0.ESC+(m?"b":"[1;5D"))):_.key=p?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(o.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"C",_.key===h.C0.ESC+"[1;3C"&&(_.key=h.C0.ESC+(m?"f":"[1;5C"))):_.key=p?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(o.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"A",m||_.key!==h.C0.ESC+"[1;3A"||(_.key=h.C0.ESC+"[1;5A")):_.key=p?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(o.metaKey)break;n?(_.key=h.C0.ESC+"[1;"+(n+1)+"B",m||_.key!==h.C0.ESC+"[1;3B"||(_.key=h.C0.ESC+"[1;5B")):_.key=p?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:o.shiftKey||o.ctrlKey||(_.key=h.C0.ESC+"[2~");break;case 46:_.key=n?h.C0.ESC+"[3;"+(n+1)+"~":h.C0.ESC+"[3~";break;case 36:_.key=n?h.C0.ESC+"[1;"+(n+1)+"H":p?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:_.key=n?h.C0.ESC+"[1;"+(n+1)+"F":p?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:o.shiftKey?_.type=2:o.ctrlKey?_.key=h.C0.ESC+"[5;"+(n+1)+"~":_.key=h.C0.ESC+"[5~";break;case 34:o.shiftKey?_.type=3:o.ctrlKey?_.key=h.C0.ESC+"[6;"+(n+1)+"~":_.key=h.C0.ESC+"[6~";break;case 112:_.key=n?h.C0.ESC+"[1;"+(n+1)+"P":h.C0.ESC+"OP";break;case 113:_.key=n?h.C0.ESC+"[1;"+(n+1)+"Q":h.C0.ESC+"OQ";break;case 114:_.key=n?h.C0.ESC+"[1;"+(n+1)+"R":h.C0.ESC+"OR";break;case 115:_.key=n?h.C0.ESC+"[1;"+(n+1)+"S":h.C0.ESC+"OS";break;case 116:_.key=n?h.C0.ESC+"[15;"+(n+1)+"~":h.C0.ESC+"[15~";break;case 117:_.key=n?h.C0.ESC+"[17;"+(n+1)+"~":h.C0.ESC+"[17~";break;case 118:_.key=n?h.C0.ESC+"[18;"+(n+1)+"~":h.C0.ESC+"[18~";break;case 119:_.key=n?h.C0.ESC+"[19;"+(n+1)+"~":h.C0.ESC+"[19~";break;case 120:_.key=n?h.C0.ESC+"[20;"+(n+1)+"~":h.C0.ESC+"[20~";break;case 121:_.key=n?h.C0.ESC+"[21;"+(n+1)+"~":h.C0.ESC+"[21~";break;case 122:_.key=n?h.C0.ESC+"[23;"+(n+1)+"~":h.C0.ESC+"[23~";break;case 123:_.key=n?h.C0.ESC+"[24;"+(n+1)+"~":h.C0.ESC+"[24~";break;default:if(!o.ctrlKey||o.shiftKey||o.altKey||o.metaKey)if(m&&!w||!o.altKey||o.metaKey)!m||o.altKey||o.ctrlKey||o.shiftKey||!o.metaKey?o.key&&!o.ctrlKey&&!o.altKey&&!o.metaKey&&o.keyCode>=48&&o.key.length===1?_.key=o.key:o.key&&o.ctrlKey&&(o.key==="_"&&(_.key=h.C0.US),o.key==="@"&&(_.key=h.C0.NUL)):o.keyCode===65&&(_.type=1);else{const l=g[o.keyCode],a=l==null?void 0:l[o.shiftKey?1:0];if(a)_.key=h.C0.ESC+a;else if(o.keyCode>=65&&o.keyCode<=90){const c=o.ctrlKey?o.keyCode-64:o.keyCode+32;let S=String.fromCharCode(c);o.shiftKey&&(S=S.toUpperCase()),_.key=h.C0.ESC+S}else if(o.keyCode===32)_.key=h.C0.ESC+(o.ctrlKey?h.C0.NUL:" ");else if(o.key==="Dead"&&o.code.startsWith("Key")){let c=o.code.slice(3,4);o.shiftKey||(c=c.toLowerCase()),_.key=h.C0.ESC+c,_.cancel=!0}}else o.keyCode>=65&&o.keyCode<=90?_.key=String.fromCharCode(o.keyCode-64):o.keyCode===32?_.key=h.C0.NUL:o.keyCode>=51&&o.keyCode<=55?_.key=String.fromCharCode(o.keyCode-51+27):o.keyCode===56?_.key=h.C0.DEL:o.keyCode===219?_.key=h.C0.ESC:o.keyCode===220?_.key=h.C0.FS:o.keyCode===221&&(_.key=h.C0.GS)}return _}},482:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},s.utf32ToString=function(u,h=0,g=u.length){let o="";for(let p=h;p<g;++p){let m=u[p];m>65535?(m-=65536,o+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):o+=String.fromCharCode(m)}return o},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const g=u.length;if(!g)return 0;let o=0,p=0;if(this._interim){const m=u.charCodeAt(p++);56320<=m&&m<=57343?h[o++]=1024*(this._interim-55296)+m-56320+65536:(h[o++]=this._interim,h[o++]=m),this._interim=0}for(let m=p;m<g;++m){const w=u.charCodeAt(m);if(55296<=w&&w<=56319){if(++m>=g)return this._interim=w,o;const _=u.charCodeAt(m);56320<=_&&_<=57343?h[o++]=1024*(w-55296)+_-56320+65536:(h[o++]=w,h[o++]=_)}else w!==65279&&(h[o++]=w)}return o}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const g=u.length;if(!g)return 0;let o,p,m,w,_=0,n=0,l=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)x<<=6,x|=b;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-E;for(;l<R;){if(l>=g)return 0;if(b=u[l++],(192&b)!=128){l--,S=!0;break}this.interim[E++]=b,x<<=6,x|=63&b}S||(y===2?x<128?l--:h[_++]=x:y===3?x<2048||x>=55296&&x<=57343||x===65279||(h[_++]=x):x<65536||x>1114111||(h[_++]=x)),this.interim.fill(0)}const a=g-4;let c=l;for(;c<g;){for(;!(!(c<a)||128&(o=u[c])||128&(p=u[c+1])||128&(m=u[c+2])||128&(w=u[c+3]));)h[_++]=o,h[_++]=p,h[_++]=m,h[_++]=w,c+=4;if(o=u[c++],o<128)h[_++]=o;else if((224&o)==192){if(c>=g)return this.interim[0]=o,_;if(p=u[c++],(192&p)!=128){c--;continue}if(n=(31&o)<<6|63&p,n<128){c--;continue}h[_++]=n}else if((240&o)==224){if(c>=g)return this.interim[0]=o,_;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=o,this.interim[1]=p,_;if(m=u[c++],(192&m)!=128){c--;continue}if(n=(15&o)<<12|(63&p)<<6|63&m,n<2048||n>=55296&&n<=57343||n===65279)continue;h[_++]=n}else if((248&o)==240){if(c>=g)return this.interim[0]=o,_;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=o,this.interim[1]=p,_;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=g)return this.interim[0]=o,this.interim[1]=p,this.interim[2]=m,_;if(w=u[c++],(192&w)!=128){c--;continue}if(n=(7&o)<<18|(63&p)<<12|(63&m)<<6|63&w,n<65536||n>1114111)continue;h[_++]=n}}return _}}},225:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=u(1480),g=[[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]],o=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<g.length;++m)p.fill(0,g[m][0],g[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(w,_){let n,l=0,a=_.length-1;if(w<_[0][0]||w>_[a][1])return!1;for(;a>=l;)if(n=l+a>>1,w>_[n][1])l=n+1;else{if(!(w<_[n][0]))return!0;a=n-1}return!1})(m,o)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,w){let _=this.wcwidth(m),n=_===0&&w!==0;if(n){const l=h.UnicodeService.extractWidth(w);l===0?n=!1:l>_&&(_=l)}return h.UnicodeService.createPropertyValue(0,_,n)}}},5981:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=u(8460),g=u(844);class o extends g.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(w)}_innerWrite(m=0,w=!0){const _=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],l=this._action(n,w);if(l){const c=S=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(_,S);return void l.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(c)}const a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=o},5941:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const u=/^([\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})$/,h=/^[\da-f]+$/;function g(o,p){const m=o.toString(16),w=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(o){if(!o)return;let p=o.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=u.exec(p);if(m){const w=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/w*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/w*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),h.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,w=[0,0,0];for(let _=0;_<3;++_){const n=parseInt(p.slice(m*_,m*_+m),16);w[_]=m===1?n<<4:m===2?n:m===3?n>>4:n>>8}return w}},s.toRgbString=function(o,p=16){const[m,w,_]=o;return`rgb:${g(m,p)}/${g(w,p)}/${g(_,p)}`}},5770:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=u(482),g=u(8742),o=u(5770),p=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,_){this._handlers[w]===void 0&&(this._handlers[w]=[]);const n=this._handlers[w];return n.push(_),{dispose:()=>{const l=n.indexOf(_);l!==-1&&n.splice(l,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,_){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(w,_,n){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(w,_,n);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(w,_,n))}unhook(w,_=!0){if(this._active.length){let n=!1,l=this._active.length-1,a=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=_,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;l>=0&&(n=this._active[l].unhook(w),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const m=new g.Params;m.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=m,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():m,this._data="",this._hitLimit=!1}put(w,_,n){this._hitLimit||(this._data+=(0,h.utf32ToString)(w,_,n),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let _=!1;if(this._hitLimit)_=!1;else if(w&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((n=>(this._params=m,this._data="",this._hitLimit=!1,n)));return this._params=m,this._data="",this._hitLimit=!1,_}}},2015:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=u(844),g=u(8742),o=u(6242),p=u(6351);class m{constructor(l){this.table=new Uint8Array(l)}setDefault(l,a){this.table.fill(l<<4|a)}add(l,a,c,S){this.table[a<<8|l]=c<<4|S}addMany(l,a,c,S){for(let x=0;x<l.length;x++)this.table[a<<8|l[x]]=c<<4|S}}s.TransitionTable=m;const w=160;s.VT500_TRANSITION_TABLE=(function(){const n=new m(4095),l=Array.apply(null,Array(256)).map(((E,y)=>y)),a=(E,y)=>l.slice(E,y),c=a(32,127),S=a(0,24);S.push(25),S.push.apply(S,a(28,32));const x=a(0,14);let b;for(b in n.setDefault(1,0),n.addMany(c,0,2,0),x)n.addMany([24,26,153,154],b,3,0),n.addMany(a(128,144),b,3,0),n.addMany(a(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(S,0,3,0),n.addMany(S,1,3,1),n.add(127,1,0,1),n.addMany(S,8,0,8),n.addMany(S,3,3,3),n.add(127,3,0,3),n.addMany(S,4,3,4),n.add(127,4,0,4),n.addMany(S,6,3,6),n.addMany(S,5,3,5),n.add(127,5,0,5),n.addMany(S,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(a(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(S,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(a(64,127),3,7,0),n.addMany(a(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(a(48,60),4,8,4),n.addMany(a(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(a(32,64),6,0,6),n.add(127,6,0,6),n.addMany(a(64,127),6,0,0),n.addMany(a(32,48),3,9,5),n.addMany(a(32,48),5,9,5),n.addMany(a(48,64),5,0,6),n.addMany(a(64,127),5,7,0),n.addMany(a(32,48),4,9,5),n.addMany(a(32,48),1,9,2),n.addMany(a(32,48),2,9,2),n.addMany(a(48,127),2,10,0),n.addMany(a(48,80),1,10,0),n.addMany(a(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(a(96,127),1,10,0),n.add(80,1,11,9),n.addMany(S,9,0,9),n.add(127,9,0,9),n.addMany(a(28,32),9,0,9),n.addMany(a(32,48),9,9,12),n.addMany(a(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(S,11,0,11),n.addMany(a(32,128),11,0,11),n.addMany(a(28,32),11,0,11),n.addMany(S,10,0,10),n.add(127,10,0,10),n.addMany(a(28,32),10,0,10),n.addMany(a(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(a(32,48),10,9,12),n.addMany(S,12,0,12),n.add(127,12,0,12),n.addMany(a(28,32),12,0,12),n.addMany(a(32,48),12,9,12),n.addMany(a(48,64),12,0,11),n.addMany(a(64,127),12,12,13),n.addMany(a(64,127),10,12,13),n.addMany(a(64,127),9,12,13),n.addMany(S,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(w,0,2,0),n.add(w,8,5,8),n.add(w,6,0,6),n.add(w,11,0,11),n.add(w,13,13,13),n})();class _ extends h.Disposable{constructor(l=s.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(a,c,S)=>{},this._executeHandlerFb=a=>{},this._csiHandlerFb=(a,c)=>{},this._escHandlerFb=a=>{},this._errorHandlerFb=a=>a,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(l,a=[64,126]){let c=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=l.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<l.intermediates.length;++x){const b=l.intermediates.charCodeAt(x);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=b}}if(l.final.length!==1)throw new Error("final must be a single byte");const S=l.final.charCodeAt(0);if(a[0]>S||S>a[1])throw new Error(`final must be in range ${a[0]} .. ${a[1]}`);return c<<=8,c|=S,c}identToString(l){const a=[];for(;l;)a.push(String.fromCharCode(255&l)),l>>=8;return a.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,a){const c=this._identifier(l,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const S=this._escHandlers[c];return S.push(a),{dispose:()=>{const x=S.indexOf(a);x!==-1&&S.splice(x,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,a){this._executeHandlers[l.charCodeAt(0)]=a}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,a){const c=this._identifier(l);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const S=this._csiHandlers[c];return S.push(a),{dispose:()=>{const x=S.indexOf(a);x!==-1&&S.splice(x,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,a){return this._dcsParser.registerHandler(this._identifier(l),a)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,a){return this._oscParser.registerHandler(l,a)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(l,a,c,S,x){this._parseStack.state=l,this._parseStack.handlers=a,this._parseStack.handlerPos=c,this._parseStack.transition=S,this._parseStack.chunkPos=x}parse(l,a,c){let S,x=0,b=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&R>-1){for(;R>=0&&(S=y[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(c===!1&&R>-1){for(;R>=0&&(S=y[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 6:if(x=l[this._parseStack.chunkPos],S=this._dcsParser.unhook(x!==24&&x!==26,c),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=l[this._parseStack.chunkPos],S=this._oscParser.end(x!==24&&x!==26,c),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=E;y<a;++y){switch(x=l[y],b=this._transitions.table[this.currentState<<8|(x<160?x:w)],b>>4){case 2:for(let H=y+1;;++H){if(H>=a||(x=l[H])<32||x>126&&x<w){this._printHandler(l,y,H),y=H-1;break}if(++H>=a||(x=l[H])<32||x>126&&x<w){this._printHandler(l,y,H),y=H-1;break}if(++H>=a||(x=l[H])<32||x>126&&x<w){this._printHandler(l,y,H),y=H-1;break}if(++H>=a||(x=l[H])<32||x>126&&x<w){this._printHandler(l,y,H),y=H-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|x];let T=R?R.length-1:-1;for(;T>=0&&(S=R[T](this._params),S!==!0);T--)if(S instanceof Promise)return this._preserveStack(3,R,T,b,y),S;T<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++y<a&&(x=l[y])>47&&x<60);y--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const I=this._escHandlers[this._collect<<8|x];let M=I?I.length-1:-1;for(;M>=0&&(S=I[M](),S!==!0);M--)if(S instanceof Promise)return this._preserveStack(4,I,M,b,y),S;M<0&&this._escHandlerFb(this._collect<<8|x),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|x,this._params);break;case 13:for(let H=y+1;;++H)if(H>=a||(x=l[H])===24||x===26||x===27||x>127&&x<w){this._dcsParser.put(l,y,H),y=H-1;break}break;case 14:if(S=this._dcsParser.unhook(x!==24&&x!==26),S)return this._preserveStack(6,[],0,b,y),S;x===27&&(b|=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 H=y+1;;H++)if(H>=a||(x=l[H])<32||x>127&&x<w){this._oscParser.put(l,y,H),y=H-1;break}break;case 6:if(S=this._oscParser.end(x!==24&&x!==26),S)return this._preserveStack(5,[],0,b,y),S;x===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}s.EscapeSequenceParser=_},6242:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=u(5770),g=u(482),o=[];s.OscParser=class{constructor(){this._state=0,this._active=o,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(m),{dispose:()=>{const _=w.indexOf(m);_!==-1&&w.splice(_,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=o,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||o,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,w){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(p,m,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,m,w))}start(){this.reset(),this._state=1}put(p,m,w){if(this._state!==3){if(this._state===1)for(;m<w;){const _=p[m++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&w-m>0&&this._put(p,m,w)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,_=this._active.length-1,n=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,w=m,n=this._stack.fallThrough,this._stack.paused=!1),!n&&w===!1){for(;_>=0&&(w=this._active[_].end(p),w!==!0);_--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,w;_--}for(;_>=0;_--)if(w=this._active[_].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=o,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,m,w),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,m}}},8742:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const u=2147483647;class h{static fromArray(o){const p=new h;if(!o.length)return p;for(let m=Array.isArray(o[0])?1:0;m<o.length;++m){const w=o[m];if(Array.isArray(w))for(let _=0;_<w.length;++_)p.addSubParam(w[_]);else p.addParam(w)}return p}constructor(o=32,p=32){if(this.maxLength=o,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(o),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(o),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const o=new h(this.maxLength,this.maxSubParamsLength);return o.params.set(this.params),o.length=this.length,o._subParams.set(this._subParams),o._subParamsLength=this._subParamsLength,o._subParamsIdx.set(this._subParamsIdx),o._rejectDigits=this._rejectDigits,o._rejectSubDigits=this._rejectSubDigits,o._digitIsSub=this._digitIsSub,o}toArray(){const o=[];for(let p=0;p<this.length;++p){o.push(this.params[p]);const m=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-m>0&&o.push(Array.prototype.slice.call(this._subParams,m,w))}return o}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(o){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=o>u?u:o}}addSubParam(o){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(o<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=o>u?u:o,this._subParamsIdx[this.length-1]++}}hasSubParams(o){return(255&this._subParamsIdx[o])-(this._subParamsIdx[o]>>8)>0}getSubParams(o){const p=this._subParamsIdx[o]>>8,m=255&this._subParamsIdx[o];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const o={};for(let p=0;p<this.length;++p){const m=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-m>0&&(o[p]=this._subParams.slice(m,w))}return o}addDigit(o){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,w=m[p-1];m[p-1]=~w?Math.min(10*w+o,u):o}}s.Params=h},5741:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){h=g;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=u(3785),g=u(511);s.BufferApiView=class{constructor(o,p){this._buffer=o,this.type=p}init(o){return this._buffer=o,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(o){const p=this._buffer.lines.get(o);if(p)return new h.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=u(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,o){if(!(g<0||g>=this._line.length))return o?(this._line.loadCell(g,o),o):this._line.loadCell(g,new h.CellData)}translateToString(g,o,p){return this._line.translateToString(g,o,p)}}},8285:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=u(8771),g=u(8460),o=u(844);class p extends o.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=p},7975:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(g=>h(g.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((g,o)=>h(g,o.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(B,s,u){var h=this&&this.__decorate||function(n,l,a,c){var S,x=arguments.length,b=x<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,a):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,a,c);else for(var E=n.length-1;E>=0;E--)(S=n[E])&&(b=(x<3?S(b):x>3?S(l,a,b):S(l,a))||b);return x>3&&b&&Object.defineProperty(l,a,b),b},g=this&&this.__param||function(n,l){return function(a,c){l(a,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const o=u(8460),p=u(844),m=u(5295),w=u(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let _=s.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(n,this))}resize(n,l){this.cols=n,this.rows=l,this.buffers.resize(n,l),this._onResize.fire({cols:n,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,l=!1){const a=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=a.getBlankLine(n,l),this._cachedBlankLine=c),c.isWrapped=l;const S=a.ybase+a.scrollTop,x=a.ybase+a.scrollBottom;if(a.scrollTop===0){const b=a.lines.isFull;x===a.lines.length-1?b?a.lines.recycle().copyFrom(c):a.lines.push(c.clone()):a.lines.splice(x+1,0,c.clone()),b?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{const b=x-S+1;a.lines.shiftElements(S+1,b-1,-1),a.lines.set(x,c.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(n,l,a){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const S=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),S!==c.ydisp&&(l||this._onScroll.fire(c.ydisp))}};s.BufferService=_=h([g(0,w.IOptionsService)],_)},7994:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(B,s,u){var h=this&&this.__decorate||function(c,S,x,b){var E,y=arguments.length,R=y<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(c,S,x,b);else for(var T=c.length-1;T>=0;T--)(E=c[T])&&(R=(y<3?E(R):y>3?E(S,x,R):E(S,x))||R);return y>3&&R&&Object.defineProperty(S,x,R),R},g=this&&this.__param||function(c,S){return function(x,b){S(x,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const o=u(2585),p=u(8460),m=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function _(c,S){let x=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(x|=64,x|=c.action):(x|=3&c.button,4&c.button&&(x|=64),8&c.button&&(x|=128),c.action===32?x|=32:c.action!==0||S||(x|=3)),x}const n=String.fromCharCode,l={DEFAULT:c=>{const S=[_(c,!1)+32,c.col+32,c.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${n(S[0])}${n(S[1])}${n(S[2])}`},SGR:c=>{const S=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.col};${c.row}${S}`},SGR_PIXELS:c=>{const S=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.x};${c.y}${S}`}};let a=s.CoreMouseService=class extends m.Disposable{constructor(c,S){super(),this._bufferService=c,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(w))this.addProtocol(x,w[x]);for(const x of Object.keys(l))this.addEncoding(x,l[x]);this.reset()}addProtocol(c,S){this._protocols[c]=S}addEncoding(c,S){this._encodings[c]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const S=this._encodings[this._activeEncoding](c);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,S,x){if(x){if(c.x!==S.x||c.y!==S.y)return!1}else if(c.col!==S.col||c.row!==S.row)return!1;return c.button===S.button&&c.action===S.action&&c.ctrl===S.ctrl&&c.alt===S.alt&&c.shift===S.shift}};s.CoreMouseService=a=h([g(0,o.IBufferService),g(1,o.ICoreService)],a)},6975:function(B,s,u){var h=this&&this.__decorate||function(a,c,S,x){var b,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,c,S,x);else for(var R=a.length-1;R>=0;R--)(b=a[R])&&(y=(E<3?b(y):E>3?b(c,S,y):b(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(a,c){return function(S,x){c(S,x,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const o=u(1439),p=u(8460),m=u(844),w=u(2585),_=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=s.CoreService=class extends m.Disposable{constructor(a,c,S){super(),this._bufferService=a,this._logService=c,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,o.clone)(_),this.decPrivateModes=(0,o.clone)(n)}reset(){this.modes=(0,o.clone)(_),this.decPrivateModes=(0,o.clone)(n)}triggerDataEvent(a,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${a}"`,(()=>a.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(a)}triggerBinaryEvent(a){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${a}"`,(()=>a.split("").map((c=>c.charCodeAt(0))))),this._onBinary.fire(a))}};s.CoreService=l=h([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],l)},9074:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=u(8055),g=u(8460),o=u(844),p=u(6106);let m=0,w=0;class _ extends o.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((a=>a==null?void 0:a.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,o.toDisposable)((()=>this.reset())))}registerDecoration(a){if(a.marker.isDisposed)return;const c=new n(a);if(c){const S=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),S.dispose())})),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const a of this._decorations.values())a.dispose();this._decorations.clear()}*getDecorationsAtCell(a,c,S){let x=0,b=0;for(const E of this._decorations.getKeyIterator(c))x=E.options.x??0,b=x+(E.options.width??1),a>=x&&a<b&&(!S||(E.options.layer??"bottom")===S)&&(yield E)}forEachDecorationAtCell(a,c,S,x){this._decorations.forEachByKey(c,(b=>{m=b.options.x??0,w=m+(b.options.width??1),a>=m&&a<w&&(!S||(b.options.layer??"bottom")===S)&&x(b)}))}}s.DecorationService=_;class n extends o.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(a){super(),this.options=a,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=a.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=u(2585),g=u(8343);class o{constructor(...m){this._entries=new Map;for(const[w,_]of m)this.set(w,_)}set(m,w){const _=this._entries.get(m);return this._entries.set(m,w),_}forEach(m){for(const[w,_]of this._entries.entries())m(w,_)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}s.ServiceCollection=o,s.InstantiationService=class{constructor(){this._services=new o,this._services.set(h.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const w=(0,g.getServiceDependencies)(p).sort(((l,a)=>l.index-a.index)),_=[];for(const l of w){const a=this._services.get(l.id);if(!a)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${l.id}.`);_.push(a)}const n=w.length>0?w[0].index:m.length;if(m.length!==n)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${n+1} conflicts with ${m.length} static arguments`);return new p(...m,..._)}}},7866:function(B,s,u){var h=this&&this.__decorate||function(n,l,a,c){var S,x=arguments.length,b=x<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,a):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,a,c);else for(var E=n.length-1;E>=0;E--)(S=n[E])&&(b=(x<3?S(b):x>3?S(l,a,b):S(l,a))||b);return x>3&&b&&Object.defineProperty(l,a,b),b},g=this&&this.__param||function(n,l){return function(a,c){l(a,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const o=u(844),p=u(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,_=s.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,a){this._evalLazyOptionalParams(a),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...a)}trace(n,...l){var a;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,n,l)}debug(n,...l){var a;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,n,l)}info(n,...l){var a;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,n,l)}warn(n,...l){var a;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,n,l)}error(n,...l){var a;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,n,l)}};s.LogService=_=h([g(0,p.IOptionsService)],_),s.setTraceLogger=function(n){w=n},s.traceCall=function(n,l,a){if(typeof a.value!="function")throw new Error("not supported");const c=a.value;a.value=function(...S){if(w.logLevel!==p.LogLevelEnum.TRACE)return c.apply(this,S);w.trace(`GlyphRenderer#${c.name}(${S.map((b=>JSON.stringify(b))).join(", ")})`);const x=c.apply(this,S);return w.trace(`GlyphRenderer#${c.name} return`,x),x}}},7302:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=u(8460),g=u(844),o=u(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:o.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends g.Disposable{constructor(_){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...s.DEFAULT_OPTIONS};for(const l in _)if(l in n)try{const a=_[l];n[l]=this._sanitizeAndValidateOption(l,a)}catch(a){console.error(a)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,n){return this.onOptionChange((l=>{l===_&&n(this.rawOptions[_])}))}onMultipleOptionChange(_,n){return this.onOptionChange((l=>{_.indexOf(l)!==-1&&n()}))}_setupOptions(){const _=l=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},n=(l,a)=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);a=this._sanitizeAndValidateOption(l,a),this.rawOptions[l]!==a&&(this.rawOptions[l]=a,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const a={get:_.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this.options,l,a)}}_sanitizeAndValidateOption(_,n){switch(_){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[_]),!(function(l){return l==="block"||l==="underline"||l==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${_}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=p.includes(n)?n:s.DEFAULT_OPTIONS[_];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${_} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${_} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=m},2660:function(B,s,u){var h=this&&this.__decorate||function(m,w,_,n){var l,a=arguments.length,c=a<3?w:n===null?n=Object.getOwnPropertyDescriptor(w,_):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(m,w,_,n);else for(var S=m.length-1;S>=0;S--)(l=m[S])&&(c=(a<3?l(c):a>3?l(w,_,c):l(w,_))||c);return a>3&&c&&Object.defineProperty(w,_,c),c},g=this&&this.__param||function(m,w){return function(_,n){w(_,n,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const o=u(2585);let p=s.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const w=this._bufferService.buffer;if(m.id===void 0){const S=w.addMarker(w.ybase+w.y),x={data:m,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(x,S))),this._dataByLinkId.set(x.id,x),x.id}const _=m,n=this._getEntryIdKey(_),l=this._entriesWithId.get(n);if(l)return this.addLineToLink(l.id,w.ybase+w.y),l.id;const a=w.addMarker(w.ybase+w.y),c={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(c,a))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(m,w){const _=this._dataByLinkId.get(m);if(_&&_.lines.every((n=>n.line!==w))){const n=this._bufferService.buffer.addMarker(w);_.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(_,n)))}}getLinkData(m){var w;return(w=this._dataByLinkId.get(m))==null?void 0:w.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,w){const _=m.lines.indexOf(w);_!==-1&&(m.lines.splice(_,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};s.OscLinkService=p=h([g(0,o.IBufferService)],p)},8343:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const u="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[h]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const o=function(p,m,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,l){n[u]===n?n[h].push({id:_,index:l}):(n[h]=[{id:_,index:l}],n[u]=n)})(o,p,w)};return o.toString=()=>g,s.serviceRegistry.set(g,o),o}},2585:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=u(8343);var g;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=u(8460),g=u(225);class o{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,w,_=!1){return(16777215&m)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const m=new g.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let w=0,_=0;const n=m.length;for(let l=0;l<n;++l){let a=m.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=n)return w+this.wcwidth(a);const x=m.charCodeAt(l);56320<=x&&x<=57343?a=1024*(a-55296)+x-56320+65536:w+=this.wcwidth(x)}const c=this.charProperties(a,_);let S=o.extractWidth(c);o.extractShouldJoin(c)&&(S-=o.extractWidth(_)),w+=S,_=c}return w}charProperties(m,w){return this._activeProvider.charProperties(m,w)}}s.UnicodeService=o}},A={};function z(B){var s=A[B];if(s!==void 0)return s.exports;var u=A[B]={exports:{}};return D[B].call(u.exports,u,u.exports,z),u.exports}var U={};return(()=>{var B=U;Object.defineProperty(B,"__esModule",{value:!0}),B.Terminal=void 0;const s=z(9042),u=z(3236),h=z(844),g=z(5741),o=z(8285),p=z(7975),m=z(7090),w=["cols","rows"];class _ extends h.Disposable{constructor(l){super(),this._core=this.register(new u.Terminal(l)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const a=S=>this._core.options[S],c=(S,x)=>{this._checkReadonlyOptions(S),this._core.options[S]=x};for(const S in this._core.options){const x={get:a.bind(this,S),set:c.bind(this,S)};Object.defineProperty(this._publicOptions,S,x)}}_checkReadonlyOptions(l){if(w.includes(l))throw new Error(`Option "${l}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new o.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let a="none";switch(this._core.coreMouseService.activeProtocol){case"X10":a="x10";break;case"VT200":a="vt200";break;case"DRAG":a="drag";break;case"ANY":a="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:a,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const a in l)this._publicOptions[a]=l[a]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,a=!0){this._core.input(l,a)}resize(l,a){this._verifyIntegers(l,a),this._core.resize(l,a)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,a,c){this._verifyIntegers(l,a,c),this._core.select(l,a,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,a){this._verifyIntegers(l,a),this._core.selectLines(l,a)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,a){this._core.write(l,a)}writeln(l,a){this._core.write(l),this._core.write(`\r
82
+ `,a)}paste(l){this._core.paste(l)}refresh(l,a){this._verifyIntegers(l,a),this._core.refresh(l,a)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return s}_verifyIntegers(...l){for(const a of l)if(a===1/0||isNaN(a)||a%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const a of l)if(a&&(a===1/0||isNaN(a)||a%1!=0||a<0))throw new Error("This API only accepts positive integers")}}B.Terminal=_})(),U})()))})(Hc)),Hc.exports}var Mm=Tm(),zc={exports:{}},T_;function km(){return T_||(T_=1,(function(f,C){(function(D,A){f.exports=A()})(self,(()=>(()=>{var D={};return(()=>{var A=D;Object.defineProperty(A,"__esModule",{value:!0}),A.FitAddon=void 0,A.FitAddon=class{activate(z){this._terminal=z}dispose(){}fit(){const z=this.proposeDimensions();if(!z||!this._terminal||isNaN(z.cols)||isNaN(z.rows))return;const U=this._terminal._core;this._terminal.rows===z.rows&&this._terminal.cols===z.cols||(U._renderService.clear(),this._terminal.resize(z.cols,z.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const z=this._terminal._core,U=z._renderService.dimensions;if(U.css.cell.width===0||U.css.cell.height===0)return;const B=this._terminal.options.scrollback===0?0:z.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(s.getPropertyValue("height")),h=Math.max(0,parseInt(s.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),o=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-B;return{cols:Math.max(2,Math.floor(p/U.css.cell.width)),rows:Math.max(1,Math.floor(o/U.css.cell.height))}}}})(),D})()))})(zc)),zc.exports}var Om=km(),Ic={exports:{}},M_;function Bm(){return M_||(M_=1,(function(f,C){(function(D,A){f.exports=A()})(self,(()=>(()=>{var D={965:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const h=u(374),g=u(509),o=u(855),p=u(859),m=u(381),w=11,_=w*Float32Array.BYTES_PER_ELEMENT;let n,l=0,a=0,c=0;class S extends p.Disposable{constructor(b,E,y,R){super(),this._terminal=b,this._gl=E,this._dimensions=y,this._optionsService=R,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const T=this._gl;g.TextureAtlas.maxAtlasPages===void 0&&(g.TextureAtlas.maxAtlasPages=Math.min(32,(0,h.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_IMAGE_UNITS))),g.TextureAtlas.maxTextureSize=(0,h.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_SIZE))),this._program=(0,h.throwIfFalsy)((0,m.createProgram)(T,`#version 300 es
83
+ layout (location = 0) in vec2 a_unitquad;
84
+ layout (location = 1) in vec2 a_cellpos;
85
+ layout (location = 2) in vec2 a_offset;
86
+ layout (location = 3) in vec2 a_size;
87
+ layout (location = 4) in float a_texpage;
88
+ layout (location = 5) in vec2 a_texcoord;
89
+ layout (location = 6) in vec2 a_texsize;
90
+
91
+ uniform mat4 u_projection;
92
+ uniform vec2 u_resolution;
93
+
94
+ out vec2 v_texcoord;
95
+ flat out int v_texpage;
96
+
97
+ void main() {
98
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
99
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
100
+ v_texpage = int(a_texpage);
101
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
102
+ }`,(function(G){let $="";for(let Y=1;Y<G;Y++)$+=` else if (v_texpage == ${Y}) { outColor = texture(u_texture[${Y}], v_texcoord); }`;return`#version 300 es
103
+ precision lowp float;
104
+
105
+ in vec2 v_texcoord;
106
+ flat in int v_texpage;
107
+
108
+ uniform sampler2D u_texture[${G}];
109
+
110
+ out vec4 outColor;
111
+
112
+ void main() {
113
+ if (v_texpage == 0) {
114
+ outColor = texture(u_texture[0], v_texcoord);
115
+ } ${$}
116
+ }`})(g.TextureAtlas.maxAtlasPages))),this.register((0,p.toDisposable)((()=>T.deleteProgram(this._program)))),this._projectionLocation=(0,h.throwIfFalsy)(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,h.throwIfFalsy)(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,h.throwIfFalsy)(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);const I=new Float32Array([0,0,1,0,0,1,1,1]),M=T.createBuffer();this.register((0,p.toDisposable)((()=>T.deleteBuffer(M)))),T.bindBuffer(T.ARRAY_BUFFER,M),T.bufferData(T.ARRAY_BUFFER,I,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const H=new Uint8Array([0,1,2,3]),q=T.createBuffer();this.register((0,p.toDisposable)((()=>T.deleteBuffer(q)))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,q),T.bufferData(T.ELEMENT_ARRAY_BUFFER,H,T.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(T.createBuffer()),this.register((0,p.toDisposable)((()=>T.deleteBuffer(this._attributesBuffer)))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,_,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,_,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,_,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,_,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,_,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,_,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);const Q=new Int32Array(g.TextureAtlas.maxAtlasPages);for(let G=0;G<g.TextureAtlas.maxAtlasPages;G++)Q[G]=G;T.uniform1iv(this._textureLocation,Q),T.uniformMatrix4fv(this._projectionLocation,!1,m.PROJECTION_MATRIX),this._atlasTextures=[];for(let G=0;G<g.TextureAtlas.maxAtlasPages;G++){const $=new m.GLTexture((0,h.throwIfFalsy)(T.createTexture()));this.register((0,p.toDisposable)((()=>T.deleteTexture($.texture)))),T.activeTexture(T.TEXTURE0+G),T.bindTexture(T.TEXTURE_2D,$.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[G]=$}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(b,E,y,R,T,I,M,H,q){this._updateCell(this._vertices.attributes,b,E,y,R,T,I,M,H,q)}_updateCell(b,E,y,R,T,I,M,H,q,Q){l=(y*this._terminal.cols+E)*w,R!==o.NULL_CELL_CODE&&R!==void 0?this._atlas&&(n=H&&H.length>1?this._atlas.getRasterizedGlyphCombinedChar(H,T,I,M,!1):this._atlas.getRasterizedGlyph(R,T,I,M,!1),a=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==Q&&n.offset.x>a?(c=n.offset.x-a,b[l]=-(n.offset.x-c)+this._dimensions.device.char.left,b[l+1]=-n.offset.y+this._dimensions.device.char.top,b[l+2]=(n.size.x-c)/this._dimensions.device.canvas.width,b[l+3]=n.size.y/this._dimensions.device.canvas.height,b[l+4]=n.texturePage,b[l+5]=n.texturePositionClipSpace.x+c/this._atlas.pages[n.texturePage].canvas.width,b[l+6]=n.texturePositionClipSpace.y,b[l+7]=n.sizeClipSpace.x-c/this._atlas.pages[n.texturePage].canvas.width,b[l+8]=n.sizeClipSpace.y):(b[l]=-n.offset.x+this._dimensions.device.char.left,b[l+1]=-n.offset.y+this._dimensions.device.char.top,b[l+2]=n.size.x/this._dimensions.device.canvas.width,b[l+3]=n.size.y/this._dimensions.device.canvas.height,b[l+4]=n.texturePage,b[l+5]=n.texturePositionClipSpace.x,b[l+6]=n.texturePositionClipSpace.y,b[l+7]=n.sizeClipSpace.x,b[l+8]=n.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,h.allowRescaling)(R,q,n.size.x,this._dimensions.device.cell.width)&&(b[l+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):b.fill(0,l,l+w-1-2)}clear(){const b=this._terminal,E=b.cols*b.rows*w;this._vertices.count!==E?this._vertices.attributes=new Float32Array(E):this._vertices.attributes.fill(0);let y=0;for(;y<this._vertices.attributesBuffers.length;y++)this._vertices.count!==E?this._vertices.attributesBuffers[y]=new Float32Array(E):this._vertices.attributesBuffers[y].fill(0);this._vertices.count=E,y=0;for(let R=0;R<b.rows;R++)for(let T=0;T<b.cols;T++)this._vertices.attributes[y+9]=T/b.cols,this._vertices.attributes[y+10]=R/b.rows,y+=w}handleResize(){const b=this._gl;b.useProgram(this._program),b.viewport(0,0,b.canvas.width,b.canvas.height),b.uniform2f(this._resolutionLocation,b.canvas.width,b.canvas.height),this.clear()}render(b){if(!this._atlas)return;const E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const y=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let T=0;T<b.lineLengths.length;T++){const I=T*this._terminal.cols*w,M=this._vertices.attributes.subarray(I,I+b.lineLengths[T]*w);y.set(M,R),R+=M.length}E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,y.subarray(0,R),E.STREAM_DRAW);for(let T=0;T<this._atlas.pages.length;T++)this._atlas.pages[T].version!==this._atlasTextures[T].version&&this._bindAtlasPageTexture(E,this._atlas,T);E.drawElementsInstanced(E.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,R/w)}setAtlas(b){this._atlas=b;for(const E of this._atlasTextures)E.version=-1}_bindAtlasPageTexture(b,E,y){b.activeTexture(b.TEXTURE0+y),b.bindTexture(b.TEXTURE_2D,this._atlasTextures[y].texture),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,E.pages[y].canvas),b.generateMipmap(b.TEXTURE_2D),this._atlasTextures[y].version=E.pages[y].version}setDimensions(b){this._dimensions=b}}s.GlyphRenderer=S},742:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const h=u(374),g=u(859),o=u(310),p=u(381),m=8*Float32Array.BYTES_PER_ELEMENT;class w{constructor(){this.attributes=new Float32Array(160),this.count=0}}let _=0,n=0,l=0,a=0,c=0,S=0,x=0;class b extends g.Disposable{constructor(y,R,T,I){super(),this._terminal=y,this._gl=R,this._dimensions=T,this._themeService=I,this._vertices=new w,this._verticesCursor=new w;const M=this._gl;this._program=(0,h.throwIfFalsy)((0,p.createProgram)(M,`#version 300 es
117
+ layout (location = 0) in vec2 a_position;
118
+ layout (location = 1) in vec2 a_size;
119
+ layout (location = 2) in vec4 a_color;
120
+ layout (location = 3) in vec2 a_unitquad;
121
+
122
+ uniform mat4 u_projection;
123
+
124
+ out vec4 v_color;
125
+
126
+ void main() {
127
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
128
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
129
+ v_color = a_color;
130
+ }`,`#version 300 es
131
+ precision lowp float;
132
+
133
+ in vec4 v_color;
134
+
135
+ out vec4 outColor;
136
+
137
+ void main() {
138
+ outColor = v_color;
139
+ }`)),this.register((0,g.toDisposable)((()=>M.deleteProgram(this._program)))),this._projectionLocation=(0,h.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const H=new Float32Array([0,0,1,0,0,1,1,1]),q=M.createBuffer();this.register((0,g.toDisposable)((()=>M.deleteBuffer(q)))),M.bindBuffer(M.ARRAY_BUFFER,q),M.bufferData(M.ARRAY_BUFFER,H,M.STATIC_DRAW),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const Q=new Uint8Array([0,1,2,3]),G=M.createBuffer();this.register((0,g.toDisposable)((()=>M.deleteBuffer(G)))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,G),M.bufferData(M.ELEMENT_ARRAY_BUFFER,Q,M.STATIC_DRAW),this._attributesBuffer=(0,h.throwIfFalsy)(M.createBuffer()),this.register((0,g.toDisposable)((()=>M.deleteBuffer(this._attributesBuffer)))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,M.FLOAT,!1,m,0),M.vertexAttribDivisor(0,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,4,M.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors(($=>{this._updateCachedColors($),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(y){const R=this._gl;R.useProgram(this._program),R.bindVertexArray(this._vertexArrayObject),R.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.bufferData(R.ARRAY_BUFFER,y.attributes,R.DYNAMIC_DRAW),R.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,R.UNSIGNED_BYTE,0,y.count)}handleResize(){this._updateViewportRectangle()}setDimensions(y){this._dimensions=y}_updateCachedColors(y){this._bgFloat=this._colorToFloat32Array(y.background),this._cursorFloat=this._colorToFloat32Array(y.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(y){const R=this._terminal,T=this._vertices;let I,M,H,q,Q,G,$,Y,k,F,O,N=1;for(I=0;I<R.rows;I++){for(H=-1,q=0,Q=0,G=!1,M=0;M<R.cols;M++)$=(I*R.cols+M)*o.RENDER_MODEL_INDICIES_PER_CELL,Y=y.cells[$+o.RENDER_MODEL_BG_OFFSET],k=y.cells[$+o.RENDER_MODEL_FG_OFFSET],F=!!(67108864&k),(Y!==q||k!==Q&&(G||F))&&((q!==0||G&&Q!==0)&&(O=8*N++,this._updateRectangle(T,O,Q,q,H,M,I)),H=M,q=Y,Q=k,G=F);(q!==0||G&&Q!==0)&&(O=8*N++,this._updateRectangle(T,O,Q,q,H,R.cols,I))}T.count=N}updateCursor(y){const R=this._verticesCursor,T=y.cursor;if(!T||T.style==="block")return void(R.count=0);let I,M=0;T.style!=="bar"&&T.style!=="outline"||(I=8*M++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.style==="bar"?T.dpr*T.cursorWidth:T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.style!=="underline"&&T.style!=="outline"||(I=8*M++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,(T.y+1)*this._dimensions.device.cell.height-T.dpr,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat)),T.style==="outline"&&(I=8*M++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat),I=8*M++,this._addRectangleFloat(R.attributes,I,(T.x+T.width)*this._dimensions.device.cell.width-T.dpr,T.y*this._dimensions.device.cell.height,T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.count=M}_updateRectangle(y,R,T,I,M,H,q){if(67108864&T)switch(50331648&T){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&T].rgba;break;case 50331648:_=(16777215&T)<<8;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:_=(16777215&I)<<8;break;default:_=this._themeService.colors.background.rgba}y.attributes.length<R+4&&(y.attributes=(0,p.expandFloat32Array)(y.attributes,this._terminal.rows*this._terminal.cols*8)),n=M*this._dimensions.device.cell.width,l=q*this._dimensions.device.cell.height,a=(_>>24&255)/255,c=(_>>16&255)/255,S=(_>>8&255)/255,x=1,this._addRectangle(y.attributes,R,n,l,(H-M)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,a,c,S,x)}_addRectangle(y,R,T,I,M,H,q,Q,G,$){y[R]=T/this._dimensions.device.canvas.width,y[R+1]=I/this._dimensions.device.canvas.height,y[R+2]=M/this._dimensions.device.canvas.width,y[R+3]=H/this._dimensions.device.canvas.height,y[R+4]=q,y[R+5]=Q,y[R+6]=G,y[R+7]=$}_addRectangleFloat(y,R,T,I,M,H,q){y[R]=T/this._dimensions.device.canvas.width,y[R+1]=I/this._dimensions.device.canvas.height,y[R+2]=M/this._dimensions.device.canvas.width,y[R+3]=H/this._dimensions.device.canvas.height,y[R+4]=q[0],y[R+5]=q[1],y[R+6]=q[2],y[R+7]=q[3]}_colorToFloat32Array(y){return new Float32Array([(y.rgba>>24&255)/255,(y.rgba>>16&255)/255,(y.rgba>>8&255)/255,(255&y.rgba)/255])}}s.RectangleRenderer=b},310:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const h=u(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,h.createSelectionRenderModel)()}resize(g,o){const p=g*o*s.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(o))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const h=u(820),g=u(274),o=u(627),p=u(457),m=u(56),w=u(374),_=u(345),n=u(859),l=u(147),a=u(782),c=u(855),S=u(965),x=u(742),b=u(310),E=u(733);class y extends n.Disposable{constructor(M,H,q,Q,G,$,Y,k,F){super(),this._terminal=M,this._characterJoinerService=H,this._charSizeService=q,this._coreBrowserService=Q,this._coreService=G,this._decorationService=$,this._optionsService=Y,this._themeService=k,this._cursorBlinkStateManager=new n.MutableDisposable,this._charAtlasDisposable=this.register(new n.MutableDisposable),this._observerDisposable=this.register(new n.MutableDisposable),this._model=new b.RenderModel,this._workCell=new a.CellData,this._workCell2=new a.CellData,this._rectangleRenderer=this.register(new n.MutableDisposable),this._glyphRenderer=this.register(new n.MutableDisposable),this._onChangeTextureAtlas=this.register(new _.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new _.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new _.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new _.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new g.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new E.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,Y,this._themeService)],this.dimensions=(0,w.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(Y.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const O={antialias:!1,depth:!1,preserveDrawingBuffer:F};if(this._gl=this._canvas.getContext("webgl2",O),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextlost",(N=>{console.log("webglcontextlost event received"),N.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(N)}),3e3)}))),this.register((0,h.addDisposableDomListener)(this._canvas,"webglcontextrestored",(N=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,o.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,m.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((N,Z)=>this._setCanvasDevicePixelDimensions(N,Z))),this.register(this._coreBrowserService.onWindowChange((N=>{this._observerDisposable.value=(0,m.observeDevicePixelDimensions)(this._canvas,N,((Z,ee)=>this._setCanvasDevicePixelDimensions(Z,ee)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,n.toDisposable)((()=>{var N;for(const Z of this._renderLayers)Z.dispose();(N=this._canvas.parentElement)==null||N.removeChild(this._canvas),(0,o.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var M;return(M=this._charAtlas)==null?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,H){var q,Q,G,$;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const Y of this._renderLayers)Y.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(q=this._rectangleRenderer.value)==null||q.setDimensions(this.dimensions),(Q=this._rectangleRenderer.value)==null||Q.handleResize(),(G=this._glyphRenderer.value)==null||G.setDimensions(this.dimensions),($=this._glyphRenderer.value)==null||$.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const H of this._renderLayers)H.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const H of this._renderLayers)H.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,H,q){for(const Q of this._renderLayers)Q.handleSelectionChanged(this._terminal,M,H,q);this._model.selection.update(this._core,M,H,q),this._requestRedrawViewport()}handleCursorMove(){var M;for(const H of this._renderLayers)H.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var H;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const M=(0,o.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==M&&(this._onChangeTextureAtlas.fire(M.pages[0].canvas),this._charAtlasDisposable.value=(0,n.getDisposeArrayDisposable)([(0,_.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,_.forwardEvent)(M.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=M,this._charAtlas.warmUp(),(H=this._glyphRenderer.value)==null||H.setAtlas(this._charAtlas)}_clearModel(M){var H;this._model.clear(),M&&((H=this._glyphRenderer.value)==null||H.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)==null||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const H of this._renderLayers)H.reset(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,H){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const q of this._renderLayers)q.handleGridChanged(this._terminal,M,H);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,H),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,H){const q=this._core;let Q,G,$,Y,k,F,O,N,Z,ee,he,ce,X,P,ne=this._workCell;M=T(M,q.rows-1,0),H=T(H,q.rows-1,0);const ie=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=ie-q.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,q.cols-1);let ye=-1;const ve=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Te=!1;for(G=M;G<=H;G++)for($=G+q.buffer.ydisp,Y=q.buffer.lines.get($),this._model.lineLengths[G]=0,k=this._characterJoinerService.getJoinedCharacters($),X=0;X<q.cols;X++)if(Q=this._cellColorResolver.result.bg,Y.loadCell(X,ne),X===0&&(Q=this._cellColorResolver.result.bg),F=!1,O=X,k.length>0&&X===k[0][0]&&(F=!0,N=k.shift(),ne=new R(ne,Y.translateToString(!0,N[0],N[1]),N[1]-N[0]),O=N[1]-1),Z=ne.getChars(),ee=ne.getCode(),ce=(G*q.cols+X)*b.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ne,X,$,this.dimensions.device.cell.width),ve&&$===ie&&(X===fe&&(this._model.cursor={x:fe,y:_e,width:ne.getWidth(),style:this._coreBrowserService.isFocused?q.options.cursorStyle||"block":q.options.cursorInactiveStyle,cursorWidth:q.options.cursorWidth,dpr:this._devicePixelRatio},ye=fe+ne.getWidth()-1),X>=fe&&X<=ye&&(this._coreBrowserService.isFocused&&(q.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&q.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ee!==c.NULL_CELL_CODE&&(this._model.lineLengths[G]=X+1),(this._model.cells[ce]!==ee||this._model.cells[ce+b.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ce+b.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ce+b.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Te=!0,Z.length>1&&(ee|=b.COMBINED_CHAR_BIT_MASK),this._model.cells[ce]=ee,this._model.cells[ce+b.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ce+b.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ce+b.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,he=ne.getWidth(),this._glyphRenderer.value.updateCell(X,G,ee,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Z,he,Q),F))for(ne=this._workCell,X++;X<O;X++)P=(G*q.cols+X)*b.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(X,G,c.NULL_CELL_CODE,0,0,0,c.NULL_CELL_CHAR,0,0),this._model.cells[P]=c.NULL_CELL_CODE,this._model.cells[P+b.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[P+b.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[P+b.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Te&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(M,H){this._canvas.width===M&&this._canvas.height===H||(this._canvas.width=M,this._canvas.height=H,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const M=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:M,end:M})}}s.WebglRenderer=y;class R extends l.AttributeData{constructor(M,H,q){super(),this.content=0,this.combinedData="",this.fg=M.fg,this.bg=M.bg,this.combinedData=H,this._width=q}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(M){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function T(I,M,H=0){return Math.max(Math.min(I,M),H)}s.JoinedCellData=R},381:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const h=u(374);function g(o,p,m){const w=(0,h.throwIfFalsy)(o.createShader(p));if(o.shaderSource(w,m),o.compileShader(w),o.getShaderParameter(w,o.COMPILE_STATUS))return w;console.error(o.getShaderInfoLog(w)),o.deleteShader(w)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(o,p,m){const w=(0,h.throwIfFalsy)(o.createProgram());if(o.attachShader(w,(0,h.throwIfFalsy)(g(o,o.VERTEX_SHADER,p))),o.attachShader(w,(0,h.throwIfFalsy)(g(o,o.FRAGMENT_SHADER,m))),o.linkProgram(w),o.getProgramParameter(w,o.LINK_STATUS))return w;console.error(o.getProgramInfoLog(w)),o.deleteProgram(w)},s.createShader=g,s.expandFloat32Array=function(o,p){const m=Math.min(2*o.length,p),w=new Float32Array(m);for(let _=0;_<o.length;_++)w[_]=o[_];return w},s.GLTexture=class{constructor(o){this.texture=o,this.version=-1}}},592:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const h=u(627),g=u(237),o=u(374),p=u(859);class m extends p.Disposable{constructor(_,n,l,a,c,S,x,b){super(),this._container=n,this._alpha=c,this._coreBrowserService=S,this._optionsService=x,this._themeService=b,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${l}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((E=>{this._refreshCharAtlas(_,E),this.reset(_)}))),this.register((0,p.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(_){}handleFocus(_){}handleCursorMove(_){}handleGridChanged(_,n,l){}handleSelectionChanged(_,n,l,a=!1){}_setTransparency(_,n){if(n===this._alpha)return;const l=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(_,this._themeService.colors),this.handleGridChanged(_,0,_.rows-1)}_refreshCharAtlas(_,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,h.acquireTextureAtlas)(_,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(_,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(_,this._themeService.colors)}_fillBottomLineAtCells(_,n,l=1){this._ctx.fillRect(_*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,l*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(_,n,l,a){this._alpha?this._ctx.clearRect(_*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(_*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(_,n,l,a){this._ctx.font=this._getFont(_,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(l,a,n.getWidth()),this._ctx.fillText(n.getChars(),l*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(_,n,l){this._ctx.beginPath(),this._ctx.rect(_*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(_,n,l){return`${l?"italic":""} ${n?_.options.fontWeightBold:_.options.fontWeight} ${_.options.fontSize*this._coreBrowserService.dpr}px ${_.options.fontFamily}`}}s.BaseRenderLayer=m},733:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const h=u(197),g=u(237),o=u(592);class p extends o.BaseRenderLayer{constructor(w,_,n,l,a,c,S){super(n,w,"link",_,!0,a,c,S),this.register(l.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(l.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(w,_){super.resize(w,_),this._state=void 0}reset(w){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(w){if(w.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:w.fg!==void 0&&(0,h.is256Color)(w.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[w.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(let _=w.y1+1;_<w.y2;_++)this._fillBottomLineAtCells(0,_,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w}_handleHideLinkUnderline(w){this._clearCurrentLink()}}s.LinkRenderLayer=p},820:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(u,h,g,o){u.addEventListener(h,g,o);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(h,g,o))}}}},274:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const h=u(855),g=u(160),o=u(374);let p,m=0,w=0,_=!1,n=!1,l=!1,a=0;s.CellColorResolver=class{constructor(c,S,x,b,E,y){this._terminal=c,this._optionService=S,this._selectionRenderModel=x,this._decorationService=b,this._coreBrowserService=E,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(c,S,x,b){if(this.result.bg=c.bg,this.result.fg=c.fg,this.result.ext=268435456&c.bg?c.extended.ext:0,w=0,m=0,n=!1,_=!1,l=!1,p=this._themeService.colors,a=0,c.getCode()!==h.NULL_CELL_CODE&&c.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));a=S*b%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(E=>{E.backgroundColorRGB&&(w=E.backgroundColorRGB.rgba>>8&16777215,n=!0),E.foregroundColorRGB&&(m=E.foregroundColorRGB.rgba>>8&16777215,_=!0)})),l=this._selectionRenderModel.isCellSelected(this._terminal,S,x),l){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}w=g.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(n=!0,p.selectionForeground&&(m=p.selectionForeground.rgba>>8&16777215,_=!0),(0,o.treatGlyphAsBackgroundColor)(c.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)m=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:m=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:m=(16777215&this.result.fg)<<8|255;break;default:m=this._themeService.colors.foreground.rgba}m=g.rgba.blend(m,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}_=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(E=>{E.backgroundColorRGB&&(w=E.backgroundColorRGB.rgba>>8&16777215,n=!0),E.foregroundColorRGB&&(m=E.foregroundColorRGB.rgba>>8&16777215,_=!0)})),n&&(w=l?-16777216&c.bg&-134217729|w|50331648:-16777216&c.bg|w|50331648),_&&(m=-16777216&c.fg&-67108865|m|50331648),67108864&this.result.fg&&(n&&!_&&(m=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,_=!0),!n&&_&&(w=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),p=void 0,this.result.bg=n?w:this.result.bg,this.result.fg=_?m:this.result.fg,this.result.ext&=536870911,this.result.ext|=a<<29&3758096384}}},627:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const h=u(509),g=u(197),o=[];s.acquireTextureAtlas=function(p,m,w,_,n,l,a,c){const S=(0,g.generateConfig)(_,n,l,a,m,w,c);for(let E=0;E<o.length;E++){const y=o[E],R=y.ownedBy.indexOf(p);if(R>=0){if((0,g.configEquals)(y.config,S))return y.atlas;y.ownedBy.length===1?(y.atlas.dispose(),o.splice(E,1)):y.ownedBy.splice(R,1);break}}for(let E=0;E<o.length;E++){const y=o[E];if((0,g.configEquals)(y.config,S))return y.ownedBy.push(p),y.atlas}const x=p._core,b={atlas:new h.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[p]};return o.push(b),b.atlas},s.removeTerminalFromCache=function(p){for(let m=0;m<o.length;m++){const w=o[m].ownedBy.indexOf(p);if(w!==-1){o[m].ownedBy.length===1?(o[m].atlas.dispose(),o.splice(m,1)):o[m].ownedBy.splice(w,1);break}}}},197:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const h=u(160);s.generateConfig=function(g,o,p,m,w,_,n){const l={foreground:_.foreground,background:_.background,cursor:h.NULL_COLOR,cursorAccent:h.NULL_COLOR,selectionForeground:h.NULL_COLOR,selectionBackgroundTransparent:h.NULL_COLOR,selectionBackgroundOpaque:h.NULL_COLOR,selectionInactiveBackgroundTransparent:h.NULL_COLOR,selectionInactiveBackgroundOpaque:h.NULL_COLOR,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:w.customGlyphs,devicePixelRatio:n,letterSpacing:w.letterSpacing,lineHeight:w.lineHeight,deviceCellWidth:g,deviceCellHeight:o,deviceCharWidth:p,deviceCharHeight:m,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,drawBoldTextInBrightColors:w.drawBoldTextInBrightColors,minimumContrastRatio:w.minimumContrastRatio,colors:l}},s.configEquals=function(g,o){for(let p=0;p<g.colors.ansi.length;p++)if(g.colors.ansi[p].rgba!==o.colors.ansi[p].rgba)return!1;return g.devicePixelRatio===o.devicePixelRatio&&g.customGlyphs===o.customGlyphs&&g.lineHeight===o.lineHeight&&g.letterSpacing===o.letterSpacing&&g.fontFamily===o.fontFamily&&g.fontSize===o.fontSize&&g.fontWeight===o.fontWeight&&g.fontWeightBold===o.fontWeightBold&&g.allowTransparency===o.allowTransparency&&g.deviceCharWidth===o.deviceCharWidth&&g.deviceCharHeight===o.deviceCharHeight&&g.drawBoldTextInBrightColors===o.drawBoldTextInBrightColors&&g.minimumContrastRatio===o.minimumContrastRatio&&g.colors.foreground.rgba===o.colors.foreground.rgba&&g.colors.background.rgba===o.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=u(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},457:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const h=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,h>0)return void this._restartInterval(h)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const h=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(h)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const h=u(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(_,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(_,n)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╒":{1:(_,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(_,n)=>`M${.5-_},1 L${.5-_},.5 L1,.5 M${.5+_},.5 L${.5+_},1`},"╔":{1:(_,n)=>`M1,${.5-n} L${.5-_},${.5-n} L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1`},"╕":{1:(_,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(_,n)=>`M${.5+_},1 L${.5+_},.5 L0,.5 M${.5-_},.5 L${.5-_},1`},"╗":{1:(_,n)=>`M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M0,${.5-n} L${.5+_},${.5-n} L${.5+_},1`},"╘":{1:(_,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(_,n)=>`M1,.5 L${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╚":{1:(_,n)=>`M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0 M1,${.5+n} L${.5-_},${.5+n} L${.5-_},0`},"╛":{1:(_,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(_,n)=>`M0,.5 L${.5+_},.5 L${.5+_},0 M${.5-_},.5 L${.5-_},0`},"╝":{1:(_,n)=>`M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0 M0,${.5+n} L${.5+_},${.5+n} L${.5+_},0`},"╞":{1:(_,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(_,n)=>`M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1 M${.5+_},.5 L1,.5`},"╠":{1:(_,n)=>`M${.5-_},0 L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1 M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0`},"╡":{1:(_,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(_,n)=>`M0,.5 L${.5-_},.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╣":{1:(_,n)=>`M${.5+_},0 L${.5+_},1 M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0`},"╤":{1:(_,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(_,n)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},1 M${.5+_},.5 L${.5+_},1`},"╦":{1:(_,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1`},"╧":{1:(_,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(_,n)=>`M0,.5 L1,.5 M${.5-_},.5 L${.5-_},0 M${.5+_},.5 L${.5+_},0`},"╩":{1:(_,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0 M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0`},"╪":{1:(_,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(_,n)=>`M0,.5 L1,.5 M${.5-_},0 L${.5-_},1 M${.5+_},0 L${.5+_},1`},"╬":{1:(_,n)=>`M0,${.5+n} L${.5-_},${.5+n} L${.5-_},1 M1,${.5+n} L${.5+_},${.5+n} L${.5+_},1 M0,${.5-n} L${.5-_},${.5-n} L${.5-_},0 M1,${.5-n} L${.5+_},${.5-n} L${.5+_},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(_,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(_,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(_,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(_,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(_,n,l,a,c,S,x,b){const E=s.blockElementDefinitions[n];if(E)return(function(I,M,H,q,Q,G){for(let $=0;$<M.length;$++){const Y=M[$],k=Q/8,F=G/8;I.fillRect(H+Y.x*k,q+Y.y*F,Y.w*k,Y.h*F)}})(_,E,l,a,c,S),!0;const y=g[n];if(y)return(function(I,M,H,q,Q,G){let $=o.get(M);$||($=new Map,o.set(M,$));const Y=I.fillStyle;if(typeof Y!="string")throw new Error(`Unexpected fillStyle type "${Y}"`);let k=$.get(Y);if(!k){const F=M[0].length,O=M.length,N=I.canvas.ownerDocument.createElement("canvas");N.width=F,N.height=O;const Z=(0,h.throwIfFalsy)(N.getContext("2d")),ee=new ImageData(F,O);let he,ce,X,P;if(Y.startsWith("#"))he=parseInt(Y.slice(1,3),16),ce=parseInt(Y.slice(3,5),16),X=parseInt(Y.slice(5,7),16),P=Y.length>7&&parseInt(Y.slice(7,9),16)||1;else{if(!Y.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${Y}" when drawing pattern glyph`);[he,ce,X,P]=Y.substring(5,Y.length-1).split(",").map((ne=>parseFloat(ne)))}for(let ne=0;ne<O;ne++)for(let ie=0;ie<F;ie++)ee.data[4*(ne*F+ie)]=he,ee.data[4*(ne*F+ie)+1]=ce,ee.data[4*(ne*F+ie)+2]=X,ee.data[4*(ne*F+ie)+3]=M[ne][ie]*(255*P);Z.putImageData(ee,0,0),k=(0,h.throwIfFalsy)(I.createPattern(N,null)),$.set(Y,k)}I.fillStyle=k,I.fillRect(H,q,Q,G)})(_,y,l,a,c,S),!0;const R=s.boxDrawingDefinitions[n];if(R)return(function(I,M,H,q,Q,G,$){I.strokeStyle=I.fillStyle;for(const[Y,k]of Object.entries(M)){let F;I.beginPath(),I.lineWidth=$*Number.parseInt(Y),F=typeof k=="function"?k(.15,.15/G*Q):k;for(const O of F.split(" ")){const N=O[0],Z=m[N];if(!Z){console.error(`Could not find drawing instructions for "${N}"`);continue}const ee=O.substring(1).split(",");ee[0]&&ee[1]&&Z(I,w(ee,Q,G,H,q,!0,$))}I.stroke(),I.closePath()}})(_,R,l,a,c,S,b),!0;const T=s.powerlineDefinitions[n];return!!T&&((function(I,M,H,q,Q,G,$,Y){const k=new Path2D;k.rect(H,q,Q,G),I.clip(k),I.beginPath();const F=$/12;I.lineWidth=Y*F;for(const O of M.d.split(" ")){const N=O[0],Z=m[N];if(!Z){console.error(`Could not find drawing instructions for "${N}"`);continue}const ee=O.substring(1).split(",");ee[0]&&ee[1]&&Z(I,w(ee,Q,G,H,q,!1,Y,(M.leftPadding??0)*(F/2),(M.rightPadding??0)*(F/2)))}M.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(_,T,l,a,c,S,x,b),!0)};const o=new Map;function p(_,n,l=0){return Math.max(Math.min(_,n),l)}const m={C:(_,n)=>_.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(_,n)=>_.lineTo(n[0],n[1]),M:(_,n)=>_.moveTo(n[0],n[1])};function w(_,n,l,a,c,S,x,b=0,E=0){const y=_.map((R=>parseFloat(R)||parseInt(R)));if(y.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<y.length;R+=2)y[R]*=n-b*x-E*x,S&&y[R]!==0&&(y[R]=p(Math.round(y[R]+.5)-.5,n,0)),y[R]+=a+b*x;for(let R=1;R<y.length;R+=2)y[R]*=l,S&&y[R]!==0&&(y[R]=p(Math.round(y[R]+.5)-.5,l,0)),y[R]+=c;return y}},56:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const h=u(859);s.observeDevicePixelDimensions=function(g,o,p){let m=new o.ResizeObserver((w=>{const _=w.find((a=>a.target===g));if(!_)return;if(!("devicePixelContentBoxSize"in _))return m==null||m.disconnect(),void(m=void 0);const n=_.devicePixelContentBoxSize[0].inlineSize,l=_.devicePixelContentBoxSize[0].blockSize;n>0&&l>0&&p(n,l)}));try{m.observe(g,{box:["device-pixel-content-box"]})}catch{m.disconnect(),m=void 0}return(0,h.toDisposable)((()=>m==null?void 0:m.disconnect()))}},374:(B,s)=>{function u(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=u,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=h,s.allowRescaling=function(g,o,p,m){return o===1&&p>Math.ceil(1.5*m)&&g!==void 0&&g>255&&!h(g)&&!u(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(o){return 9472<=o&&o<=9631})(g)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(g,o,p=0){return(g-(2*Math.round(o)-p))%(2*Math.round(o))}},296:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class u{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(g,o,p,m=!1){if(this.selectionStart=o,this.selectionEnd=p,!o||!p||o[0]===p[0]&&o[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,_=o[1]-w,n=p[1]-w,l=Math.max(_,0),a=Math.min(n,g.rows-1);l>=g.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=_,this.viewportEndRow=n,this.viewportCappedStartRow=l,this.viewportCappedEndRow=a,this.startCol=o[0],this.endCol=p[0])}isCellSelected(g,o,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?o>=this.startCol&&p>=this.viewportCappedStartRow&&o<this.endCol&&p<=this.viewportCappedEndRow:o<this.startCol&&p>=this.viewportCappedStartRow&&o>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&o>=this.startCol&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&o<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&o>=this.startCol)}}s.createSelectionRenderModel=function(){return new u}},509:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const h=u(237),g=u(860),o=u(374),p=u(160),m=u(345),w=u(485),_=u(385),n=u(147),l=u(855),a={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let c;class S{get pages(){return this._pages}constructor(R,T,I){this._document=R,this._config=T,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new w.FourKeyMap,this._cacheMapCombined=new w.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new m.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new m.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=E(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,o.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new _.IdleTaskQueue;for(let T=33;T<126;T++)R.enqueue((()=>{if(!this._cacheMap.get(T,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT)){const I=this._drawToCache(T,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT);this._cacheMap.set(T,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const T=this._pages.filter(($=>2*$.canvas.width<=(S.maxTextureSize||4096))).sort((($,Y)=>Y.canvas.width!==$.canvas.width?Y.canvas.width-$.canvas.width:Y.percentageUsed-$.percentageUsed));let I=-1,M=0;for(let $=0;$<T.length;$++)if(T[$].canvas.width!==M)I=$,M=T[$].canvas.width;else if($-I==3)break;const H=T.slice(I,I+4),q=H.map(($=>$.glyphs[0].texturePage)).sort((($,Y)=>$>Y?1:-1)),Q=this.pages.length-H.length,G=this._mergePages(H,Q);G.version++;for(let $=q.length-1;$>=0;$--)this._deletePage(q[$]);this.pages.push(G),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(G.canvas)}const R=new x(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,T){const I=2*R[0].canvas.width,M=new x(this._document,I,R);for(const[H,q]of R.entries()){const Q=H*q.canvas.width%I,G=Math.floor(H/2)*q.canvas.height;M.ctx.drawImage(q.canvas,Q,G);for(const Y of q.glyphs)Y.texturePage=T,Y.sizeClipSpace.x=Y.size.x/I,Y.sizeClipSpace.y=Y.size.y/I,Y.texturePosition.x+=Q,Y.texturePosition.y+=G,Y.texturePositionClipSpace.x=Y.texturePosition.x/I,Y.texturePositionClipSpace.y=Y.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire(q.canvas);const $=this._activePages.indexOf(q);$!==-1&&this._activePages.splice($,1)}return M}_deletePage(R){this._pages.splice(R,1);for(let T=R;T<this._pages.length;T++){const I=this._pages[T];for(const M of I.glyphs)M.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(R,T,I,M,H){return this._getFromCacheMap(this._cacheMapCombined,R,T,I,M,H)}getRasterizedGlyph(R,T,I,M,H){return this._getFromCacheMap(this._cacheMap,R,T,I,M,H)}_getFromCacheMap(R,T,I,M,H,q=!1){return c=R.get(T,I,M,H),c||(c=this._drawToCache(T,I,M,H,q),R.set(T,I,M,H,c)),c}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,T,I,M){if(this._config.allowTransparency)return p.NULL_COLOR;let H;switch(R){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(T);break;case 50331648:const q=n.AttributeData.toColorRGB(T);H=p.channels.toColor(q[0],q[1],q[2]);break;default:H=I?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return H}_getForegroundColor(R,T,I,M,H,q,Q,G,$,Y){const k=this._getMinimumContrastColor(R,T,I,M,H,q,Q,$,G,Y);if(k)return k;let F;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&$&&q<8&&(q+=8),F=this._getColorFromAnsiIndex(q);break;case 50331648:const O=n.AttributeData.toColorRGB(q);F=p.channels.toColor(O[0],O[1],O[2]);break;default:F=Q?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(F=p.color.opaque(F)),G&&(F=p.color.multiplyOpacity(F,h.DIM_OPACITY)),F}_resolveBackgroundRgba(R,T,I){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,T,I,M){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&T<8&&(T+=8),this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,T,I,M,H,q,Q,G,$,Y){if(this._config.minimumContrastRatio===1||Y)return;const k=this._getContrastCache($),F=k.getColor(R,M);if(F!==void 0)return F||void 0;const O=this._resolveBackgroundRgba(T,I,Q),N=this._resolveForegroundRgba(H,q,Q,G),Z=p.rgba.ensureContrastRatio(O,N,this._config.minimumContrastRatio/($?2:1));if(!Z)return void k.setColor(R,M,null);const ee=p.channels.toColor(Z>>24&255,Z>>16&255,Z>>8&255);return k.setColor(R,M,ee),ee}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,T,I,M,H=!1){const q=typeof R=="number"?String.fromCharCode(R):R,Q=Math.min(this._config.deviceCellWidth*Math.max(q.length,2)+4,this._textureSize);this._tmpCanvas.width<Q&&(this._tmpCanvas.width=Q);const G=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<G&&(this._tmpCanvas.height=G),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=T,this._workAttributeData.extended.ext=M,this._workAttributeData.isInvisible())return a;const $=!!this._workAttributeData.isBold(),Y=!!this._workAttributeData.isInverse(),k=!!this._workAttributeData.isDim(),F=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),N=!!this._workAttributeData.isStrikethrough(),Z=!!this._workAttributeData.isOverline();let ee=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),ce=this._workAttributeData.getBgColor(),X=this._workAttributeData.getBgColorMode();if(Y){const ge=ee;ee=ce,ce=ge;const we=he;he=X,X=we}const P=this._getBackgroundColor(X,ce,Y,k);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=P.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ne=$?this._config.fontWeightBold:this._config.fontWeight,ie=F?"italic":"";this._tmpCtx.font=`${ie} ${ne} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=h.TEXT_BASELINE;const _e=q.length===1&&(0,o.isPowerlineGlyph)(q.charCodeAt(0)),fe=q.length===1&&(0,o.isRestrictedPowerlineGlyph)(q.charCodeAt(0)),ye=this._getForegroundColor(T,X,ce,I,he,ee,Y,k,$,(0,o.treatGlyphAsBackgroundColor)(q.charCodeAt(0)));this._tmpCtx.fillStyle=ye.css;const ve=fe?0:4;let Te=!1;this._config.customGlyphs!==!1&&(Te=(0,g.tryDrawCustomChar)(this._tmpCtx,q,ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Pe,Se=!_e;if(Pe=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),O){this._tmpCtx.save();const ge=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ge%2==1?.5:0;if(this._tmpCtx.lineWidth=ge,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Se=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Se=!1;let Qe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Qe<8&&(Qe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Qe).css}this._tmpCtx.beginPath();const Ke=ve,qe=Math.ceil(ve+this._config.deviceCharHeight)-we-(H?2*ge:0),gt=qe+ge,Ze=qe+2*ge;let ct=this._workAttributeData.getUnderlineVariantOffset();for(let Qe=0;Qe<Pe;Qe++){this._tmpCtx.save();const ke=Ke+Qe*this._config.deviceCellWidth,De=Ke+(Qe+1)*this._config.deviceCellWidth,Xt=ke+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe),this._tmpCtx.moveTo(ke,Ze),this._tmpCtx.lineTo(De,Ze);break;case 3:const ut=ge<=1?Ze:Math.ceil(ve+this._config.deviceCharHeight-ge/2)-we,Et=ge<=1?qe:Math.ceil(ve+this._config.deviceCharHeight+ge/2)-we,vt=new Path2D;vt.rect(ke,qe,this._config.deviceCellWidth,Ze-qe),this._tmpCtx.clip(vt),this._tmpCtx.moveTo(ke-this._config.deviceCellWidth/2,gt),this._tmpCtx.bezierCurveTo(ke-this._config.deviceCellWidth/2,Et,ke,Et,ke,gt),this._tmpCtx.bezierCurveTo(ke,ut,Xt,ut,Xt,gt),this._tmpCtx.bezierCurveTo(Xt,Et,De,Et,De,gt),this._tmpCtx.bezierCurveTo(De,ut,De+this._config.deviceCellWidth/2,ut,De+this._config.deviceCellWidth/2,gt);break;case 4:const Qi=ct===0?0:ct>=ge?2*ge-ct:ge-ct;ct>=ge||Qi===0?(this._tmpCtx.setLineDash([Math.round(ge),Math.round(ge)]),this._tmpCtx.moveTo(ke+Qi,qe),this._tmpCtx.lineTo(De,qe)):(this._tmpCtx.setLineDash([Math.round(ge),Math.round(ge)]),this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(ke+Qi,qe),this._tmpCtx.moveTo(ke+Qi+ge,qe),this._tmpCtx.lineTo(De,qe)),ct=(0,o.computeNextVariantOffset)(De-ke,ge,ct);break;case 5:const Fr=.6,ks=.3,Ei=De-ke,Mi=Math.floor(Fr*Ei),tt=Math.floor(ks*Ei),st=Ei-Mi-tt;this._tmpCtx.setLineDash([Mi,tt,st]),this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe);break;default:this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Te&&this._config.fontSize>=12&&!this._config.allowTransparency&&q!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Qe=this._tmpCtx.measureText(q);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Qe&&Qe.actualBoundingBoxDescent>0){this._tmpCtx.save();const ke=new Path2D;ke.rect(Ke,qe-Math.ceil(ge/2),this._config.deviceCellWidth*Pe,Ze-qe+Math.ceil(ge/2)),this._tmpCtx.clip(ke),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=P.css,this._tmpCtx.strokeText(q,ve,ve+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Z){const ge=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ge%2==1?.5:0;this._tmpCtx.lineWidth=ge,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ve,ve+we),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*Pe,ve+we),this._tmpCtx.stroke()}if(Te||this._tmpCtx.fillText(q,ve,ve+this._config.deviceCharHeight),q==="_"&&!this._config.allowTransparency){let ge=b(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),P,ye,Se);if(ge)for(let we=1;we<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=P.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(q,ve,ve+this._config.deviceCharHeight-we),ge=b(this._tmpCtx.getImageData(ve,ve,this._config.deviceCellWidth,this._config.deviceCellHeight),P,ye,Se),ge);we++);}if(N){const ge=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),we=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ge,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ve,ve+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.lineTo(ve+this._config.deviceCharWidth*Pe,ve+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.stroke()}this._tmpCtx.restore();const Mt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let zt;if(zt=this._config.allowTransparency?(function(ge){for(let we=0;we<ge.data.length;we+=4)if(ge.data[we+3]>0)return!1;return!0})(Mt):b(Mt,P,ye,Se),zt)return a;const xe=this._findGlyphBoundingBox(Mt,this._workBoundingBox,Q,fe,Te,ve);let Ee,Ae;for(;;){if(this._activePages.length===0){const ge=this._createNewPage();Ee=ge,Ae=ge.currentRow,Ae.height=xe.size.y;break}Ee=this._activePages[this._activePages.length-1],Ae=Ee.currentRow;for(const ge of this._activePages)xe.size.y<=ge.currentRow.height&&(Ee=ge,Ae=ge.currentRow);for(let ge=this._activePages.length-1;ge>=0;ge--)for(const we of this._activePages[ge].fixedRows)we.height<=Ae.height&&xe.size.y<=we.height&&(Ee=this._activePages[ge],Ae=we);if(Ae.y+xe.size.y>=Ee.canvas.height||Ae.height>xe.size.y+2){let ge=!1;if(Ee.currentRow.y+Ee.currentRow.height+xe.size.y>=Ee.canvas.height){let we;for(const Ke of this._activePages)if(Ke.currentRow.y+Ke.currentRow.height+xe.size.y<Ke.canvas.height){we=Ke;break}if(we)Ee=we;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&Ae.y+xe.size.y<=Ee.canvas.height&&Ae.height>=xe.size.y&&Ae.x+xe.size.x<=Ee.canvas.width)ge=!0;else{const Ke=this._createNewPage();Ee=Ke,Ae=Ke.currentRow,Ae.height=xe.size.y,ge=!0}}ge||(Ee.currentRow.height>0&&Ee.fixedRows.push(Ee.currentRow),Ae={x:0,y:Ee.currentRow.y+Ee.currentRow.height,height:xe.size.y},Ee.fixedRows.push(Ae),Ee.currentRow={x:0,y:Ae.y+Ae.height,height:0})}if(Ae.x+xe.size.x<=Ee.canvas.width)break;Ae===Ee.currentRow?(Ae.x=0,Ae.y+=Ae.height,Ae.height=0):Ee.fixedRows.splice(Ee.fixedRows.indexOf(Ae),1)}return xe.texturePage=this._pages.indexOf(Ee),xe.texturePosition.x=Ae.x,xe.texturePosition.y=Ae.y,xe.texturePositionClipSpace.x=Ae.x/Ee.canvas.width,xe.texturePositionClipSpace.y=Ae.y/Ee.canvas.height,xe.sizeClipSpace.x/=Ee.canvas.width,xe.sizeClipSpace.y/=Ee.canvas.height,Ae.height=Math.max(Ae.height,xe.size.y),Ae.x+=xe.size.x,Ee.ctx.putImageData(Mt,xe.texturePosition.x-this._workBoundingBox.left,xe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,xe.size.x,xe.size.y),Ee.addGlyph(xe),Ee.version++,xe}_findGlyphBoundingBox(R,T,I,M,H,q){T.top=0;const Q=M?this._config.deviceCellHeight:this._tmpCanvas.height,G=M?this._config.deviceCellWidth:I;let $=!1;for(let Y=0;Y<Q;Y++){for(let k=0;k<G;k++){const F=Y*this._tmpCanvas.width*4+4*k+3;if(R.data[F]!==0){T.top=Y,$=!0;break}}if($)break}T.left=0,$=!1;for(let Y=0;Y<q+G;Y++){for(let k=0;k<Q;k++){const F=k*this._tmpCanvas.width*4+4*Y+3;if(R.data[F]!==0){T.left=Y,$=!0;break}}if($)break}T.right=G,$=!1;for(let Y=q+G-1;Y>=q;Y--){for(let k=0;k<Q;k++){const F=k*this._tmpCanvas.width*4+4*Y+3;if(R.data[F]!==0){T.right=Y,$=!0;break}}if($)break}T.bottom=Q,$=!1;for(let Y=Q-1;Y>=0;Y--){for(let k=0;k<G;k++){const F=Y*this._tmpCanvas.width*4+4*k+3;if(R.data[F]!==0){T.bottom=Y,$=!0;break}}if($)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:T.right-T.left+1,y:T.bottom-T.top+1},sizeClipSpace:{x:T.right-T.left+1,y:T.bottom-T.top+1},offset:{x:-T.left+q+(M||H?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-T.top+q+(M||H?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,T,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const M of I)this._glyphs.push(...M.glyphs),this._usedPixels+=M._usedPixels;this.canvas=E(R,T,T),this.ctx=(0,o.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function b(y,R,T,I){const M=R.rgba>>>24,H=R.rgba>>>16&255,q=R.rgba>>>8&255,Q=T.rgba>>>24,G=T.rgba>>>16&255,$=T.rgba>>>8&255,Y=Math.floor((Math.abs(M-Q)+Math.abs(H-G)+Math.abs(q-$))/12);let k=!0;for(let F=0;F<y.data.length;F+=4)y.data[F]===M&&y.data[F+1]===H&&y.data[F+2]===q||I&&Math.abs(y.data[F]-M)+Math.abs(y.data[F+1]-H)+Math.abs(y.data[F+2]-q)<Y?y.data[F+3]=0:k=!1;return k}function E(y,R,T){const I=y.createElement("canvas");return I.width=R,I.height=T,I}},160:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let u=0,h=0,g=0,o=0;var p,m,w,_,n;function l(c){const S=c.toString(16);return S.length<2?"0"+S:S}function a(c,S){return c<S?(S+.05)/(c+.05):(c+.05)/(S+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(S,x,b,E){return E!==void 0?`#${l(S)}${l(x)}${l(b)}${l(E)}`:`#${l(S)}${l(x)}${l(b)}`},c.toRgba=function(S,x,b,E=255){return(S<<24|x<<16|b<<8|E)>>>0},c.toColor=function(S,x,b,E){return{css:c.toCss(S,x,b,E),rgba:c.toRgba(S,x,b,E)}}})(p||(s.channels=p={})),(function(c){function S(x,b){return o=Math.round(255*b),[u,h,g]=n.toChannels(x.rgba),{css:p.toCss(u,h,g,o),rgba:p.toRgba(u,h,g,o)}}c.blend=function(x,b){if(o=(255&b.rgba)/255,o===1)return{css:b.css,rgba:b.rgba};const E=b.rgba>>24&255,y=b.rgba>>16&255,R=b.rgba>>8&255,T=x.rgba>>24&255,I=x.rgba>>16&255,M=x.rgba>>8&255;return u=T+Math.round((E-T)*o),h=I+Math.round((y-I)*o),g=M+Math.round((R-M)*o),{css:p.toCss(u,h,g),rgba:p.toRgba(u,h,g)}},c.isOpaque=function(x){return(255&x.rgba)==255},c.ensureContrastRatio=function(x,b,E){const y=n.ensureContrastRatio(x.rgba,b.rgba,E);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},c.opaque=function(x){const b=(255|x.rgba)>>>0;return[u,h,g]=n.toChannels(b),{css:p.toCss(u,h,g),rgba:b}},c.opacity=S,c.multiplyOpacity=function(x,b){return o=255&x.rgba,S(x,o*b/255)},c.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(m||(s.color=m={})),(function(c){let S,x;try{const b=document.createElement("canvas");b.width=1,b.height=1;const E=b.getContext("2d",{willReadFrequently:!0});E&&(S=E,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return u=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),p.toColor(u,h,g);case 5:return u=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),g=parseInt(b.slice(3,4).repeat(2),16),o=parseInt(b.slice(4,5).repeat(2),16),p.toColor(u,h,g,o);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const E=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return u=parseInt(E[1]),h=parseInt(E[2]),g=parseInt(E[3]),o=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),p.toColor(u,h,g,o);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=b,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,h,g,o]=S.getImageData(0,0,1,1).data,o!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,h,g,o),css:b}}})(w||(s.css=w={})),(function(c){function S(x,b,E){const y=x/255,R=b/255,T=E/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}c.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},c.relativeLuminance2=S})(_||(s.rgb=_={})),(function(c){function S(b,E,y){const R=b>>24&255,T=b>>16&255,I=b>>8&255;let M=E>>24&255,H=E>>16&255,q=E>>8&255,Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));for(;Q<y&&(M>0||H>0||q>0);)M-=Math.max(0,Math.ceil(.1*M)),H-=Math.max(0,Math.ceil(.1*H)),q-=Math.max(0,Math.ceil(.1*q)),Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));return(M<<24|H<<16|q<<8|255)>>>0}function x(b,E,y){const R=b>>24&255,T=b>>16&255,I=b>>8&255;let M=E>>24&255,H=E>>16&255,q=E>>8&255,Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));for(;Q<y&&(M<255||H<255||q<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),H=Math.min(255,H+Math.ceil(.1*(255-H))),q=Math.min(255,q+Math.ceil(.1*(255-q))),Q=a(_.relativeLuminance2(M,H,q),_.relativeLuminance2(R,T,I));return(M<<24|H<<16|q<<8|255)>>>0}c.blend=function(b,E){if(o=(255&E)/255,o===1)return E;const y=E>>24&255,R=E>>16&255,T=E>>8&255,I=b>>24&255,M=b>>16&255,H=b>>8&255;return u=I+Math.round((y-I)*o),h=M+Math.round((R-M)*o),g=H+Math.round((T-H)*o),p.toRgba(u,h,g)},c.ensureContrastRatio=function(b,E,y){const R=_.relativeLuminance(b>>8),T=_.relativeLuminance(E>>8);if(a(R,T)<y){if(T<R){const H=S(b,E,y),q=a(R,_.relativeLuminance(H>>8));if(q<y){const Q=x(b,E,y);return q>a(R,_.relativeLuminance(Q>>8))?H:Q}return H}const I=x(b,E,y),M=a(R,_.relativeLuminance(I>>8));if(M<y){const H=S(b,E,y);return M>a(R,_.relativeLuminance(H>>8))?I:H}return I}},c.reduceLuminance=S,c.increaseLuminance=x,c.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(n||(s.rgba=n={})),s.toPaddedHex=l,s.contrastRatio=a},345:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const g=[];for(let o=0;o<this._listeners.length;o++)g.push(this._listeners[o]);for(let o=0;o<g.length;o++)g[o].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(u,h){return u((g=>h.fire(g)))},s.runAndSubscribe=function(u,h){return h(void 0),u((g=>h(g)))}},859:(B,s)=>{function u(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=u,s.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},485:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,o,p){this._data[g]||(this._data[g]={}),this._data[g][o]=p}get(g,o){return this._data[g]?this._data[g][o]:void 0}clear(){this._data={}}}s.TwoKeyMap=u,s.FourKeyMap=class{constructor(){this._data=new u}set(h,g,o,p,m){this._data.get(h,g)||this._data.set(h,g,new u),this._data.get(h,g).set(o,p,m)}get(h,g,o,p){var m;return(m=this._data.get(h,g))==null?void 0:m.get(o,p)}clear(){this._data.clear()}}},399:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const u=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=u.includes("Firefox"),s.isLegacyEdge=u.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(u),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(u)},385:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=u(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let w=0,_=0,n=m.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),l=m.timeRemaining(),1.5*_>l)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=l}this.clear()}}class o extends g{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const w=Date.now()+m;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=o,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:o,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(o){return[o>>>16&255,o>>>8&255,255&o]}static fromColorRGB(o){return(255&o[0])<<16|(255&o[1])<<8|255&o[2]}clone(){const o=new u;return o.fg=this.fg,o.bg=this.bg,o.extended=this.extended.clone(),o}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(o){this._ext=o}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(o){this._ext&=-469762049,this._ext|=o<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(o){this._ext&=-67108864,this._ext|=67108863&o}get urlId(){return this._urlId}set urlId(o){this._urlId=o}get underlineVariantOffset(){const o=(3758096384&this._ext)>>29;return o<0?4294967288^o:o}set underlineVariantOffset(o){this._ext&=536870911,this._ext|=o<<29&3758096384}constructor(o=0,p=0){this._ext=0,this._urlId=0,this._ext=o,this._urlId=p}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},782:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=u(133),g=u(855),o=u(147);class p extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const _=new p;return _.setFromCharData(w),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const n=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},855:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},s.utf32ToString=function(u,h=0,g=u.length){let o="";for(let p=h;p<g;++p){let m=u[p];m>65535?(m-=65536,o+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):o+=String.fromCharCode(m)}return o},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const g=u.length;if(!g)return 0;let o=0,p=0;if(this._interim){const m=u.charCodeAt(p++);56320<=m&&m<=57343?h[o++]=1024*(this._interim-55296)+m-56320+65536:(h[o++]=this._interim,h[o++]=m),this._interim=0}for(let m=p;m<g;++m){const w=u.charCodeAt(m);if(55296<=w&&w<=56319){if(++m>=g)return this._interim=w,o;const _=u.charCodeAt(m);56320<=_&&_<=57343?h[o++]=1024*(w-55296)+_-56320+65536:(h[o++]=w,h[o++]=_)}else w!==65279&&(h[o++]=w)}return o}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const g=u.length;if(!g)return 0;let o,p,m,w,_=0,n=0,l=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)x<<=6,x|=b;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-E;for(;l<R;){if(l>=g)return 0;if(b=u[l++],(192&b)!=128){l--,S=!0;break}this.interim[E++]=b,x<<=6,x|=63&b}S||(y===2?x<128?l--:h[_++]=x:y===3?x<2048||x>=55296&&x<=57343||x===65279||(h[_++]=x):x<65536||x>1114111||(h[_++]=x)),this.interim.fill(0)}const a=g-4;let c=l;for(;c<g;){for(;!(!(c<a)||128&(o=u[c])||128&(p=u[c+1])||128&(m=u[c+2])||128&(w=u[c+3]));)h[_++]=o,h[_++]=p,h[_++]=m,h[_++]=w,c+=4;if(o=u[c++],o<128)h[_++]=o;else if((224&o)==192){if(c>=g)return this.interim[0]=o,_;if(p=u[c++],(192&p)!=128){c--;continue}if(n=(31&o)<<6|63&p,n<128){c--;continue}h[_++]=n}else if((240&o)==224){if(c>=g)return this.interim[0]=o,_;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=o,this.interim[1]=p,_;if(m=u[c++],(192&m)!=128){c--;continue}if(n=(15&o)<<12|(63&p)<<6|63&m,n<2048||n>=55296&&n<=57343||n===65279)continue;h[_++]=n}else if((248&o)==240){if(c>=g)return this.interim[0]=o,_;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=o,this.interim[1]=p,_;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=g)return this.interim[0]=o,this.interim[1]=p,this.interim[2]=m,_;if(w=u[c++],(192&w)!=128){c--;continue}if(n=(7&o)<<18|(63&p)<<12|(63&m)<<6|63&w,n<65536||n>1114111)continue;h[_++]=n}}return _}}},776:function(B,s,u){var h=this&&this.__decorate||function(n,l,a,c){var S,x=arguments.length,b=x<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,a):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,a,c);else for(var E=n.length-1;E>=0;E--)(S=n[E])&&(b=(x<3?S(b):x>3?S(l,a,b):S(l,a))||b);return x>3&&b&&Object.defineProperty(l,a,b),b},g=this&&this.__param||function(n,l){return function(a,c){l(a,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const o=u(859),p=u(97),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,_=s.LogService=class extends o.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,a){this._evalLazyOptionalParams(a),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...a)}trace(n,...l){var a;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,n,l)}debug(n,...l){var a;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,n,l)}info(n,...l){var a;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,n,l)}warn(n,...l){var a;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,n,l)}error(n,...l){var a;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,n,l)}};s.LogService=_=h([g(0,p.IOptionsService)],_),s.setTraceLogger=function(n){w=n},s.traceCall=function(n,l,a){if(typeof a.value!="function")throw new Error("not supported");const c=a.value;a.value=function(...S){if(w.logLevel!==p.LogLevelEnum.TRACE)return c.apply(this,S);w.trace(`GlyphRenderer#${c.name}(${S.map((b=>JSON.stringify(b))).join(", ")})`);const x=c.apply(this,S);return w.trace(`GlyphRenderer#${c.name} return`,x),x}}},726:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const u="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[h]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const o=function(p,m,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,n,l){n[u]===n?n[h].push({id:_,index:l}):(n[h]=[{id:_,index:l}],n[u]=n)})(o,p,w)};return o.toString=()=>g,s.serviceRegistry.set(g,o),o}},97:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=u(726);var g;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(o){o[o.TRACE=0]="TRACE",o[o.DEBUG=1]="DEBUG",o[o.INFO=2]="INFO",o[o.WARN=3]="WARN",o[o.ERROR=4]="ERROR",o[o.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")}},A={};function z(B){var s=A[B];if(s!==void 0)return s.exports;var u=A[B]={exports:{}};return D[B].call(u.exports,u,u.exports,z),u.exports}var U={};return(()=>{var B=U;Object.defineProperty(B,"__esModule",{value:!0}),B.WebglAddon=void 0;const s=z(345),u=z(859),h=z(399),g=z(666),o=z(776);class p extends u.Disposable{constructor(w){if(h.isSafari&&(0,h.getSafariVersion)()<16){const _={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",_))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=w,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(w){const _=w._core;if(!w.element)return void this.register(_.onWillOpen((()=>this.activate(w))));this._terminal=w;const n=_.coreService,l=_.optionsService,a=_,c=a._renderService,S=a._characterJoinerService,x=a._charSizeService,b=a._coreBrowserService,E=a._decorationService,y=a._logService,R=a._themeService;(0,o.setTraceLogger)(y),this._renderer=this.register(new g.WebglRenderer(w,S,x,b,n,E,l,R,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const T=this._terminal._core._renderService;T.setRenderer(this._terminal._core._createRenderer()),T.handleResize(w.cols,w.rows)})))}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}B.WebglAddon=p})(),U})()))})(Ic)),Ic.exports}var Hm=Bm(),ro={exports:{}},zm=ro.exports,k_;function Im(){return k_||(k_=1,(function(f,C){(function(D,A){f.exports=A()})(zm,(()=>(()=>{var D={433:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const h=u(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],o=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],p=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],m=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function _(n,l){let a,c=0,S=l.length-1;if(n<l[0][0]||n>l[S][1])return!1;for(;S>=c;)if(a=c+S>>1,n>l[a][1])c=a+1;else{if(!(n<l[a][0]))return!0;S=a-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let n=0;n<g.length;++n)w.fill(0,g[n][0],g[n][1]+1);for(let n=0;n<p.length;++n)w.fill(2,p[n][0],p[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?w[n]:_(n,o)?0:_(n,m)?2:1}charProperties(n,l){let a=this.wcwidth(n),c=a===0&&l!==0;if(c){const S=h.UnicodeService.extractWidth(l);S===0?c=!1:S>a&&(a=S)}return h.UnicodeService.createPropertyValue(0,a,c)}}},345:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const g=[];for(let o=0;o<this._listeners.length;o++)g.push(this._listeners[o]);for(let o=0;o<g.length;o++)g[o].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(u,h){return u((g=>h.fire(g)))},s.runAndSubscribe=function(u,h){return h(void 0),u((g=>h(g)))}},490:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=u(938),g=[[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]],o=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<g.length;++m)p.fill(0,g[m][0],g[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(w,_){let n,l=0,a=_.length-1;if(w<_[0][0]||w>_[a][1])return!1;for(;a>=l;)if(n=l+a>>1,w>_[n][1])l=n+1;else{if(!(w<_[n][0]))return!0;a=n-1}return!1})(m,o)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,w){let _=this.wcwidth(m),n=_===0&&w!==0;if(n){const l=h.UnicodeService.extractWidth(w);l===0?n=!1:l>_&&(_=l)}return h.UnicodeService.createPropertyValue(0,_,n)}}},938:(B,s,u)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=u(345),g=u(490);class o{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,w,_=!1){return(16777215&m)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const m=new g.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let w=0,_=0;const n=m.length;for(let l=0;l<n;++l){let a=m.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=n)return w+this.wcwidth(a);const x=m.charCodeAt(l);56320<=x&&x<=57343?a=1024*(a-55296)+x-56320+65536:w+=this.wcwidth(x)}const c=this.charProperties(a,_);let S=o.extractWidth(c);o.extractShouldJoin(c)&&(S-=o.extractWidth(_)),w+=S,_=c}return w}charProperties(m,w){return this._activeProvider.charProperties(m,w)}}s.UnicodeService=o}},A={};function z(B){var s=A[B];if(s!==void 0)return s.exports;var u=A[B]={exports:{}};return D[B](u,u.exports,z),u.exports}var U={};return(()=>{var B=U;Object.defineProperty(B,"__esModule",{value:!0}),B.Unicode11Addon=void 0;const s=z(433);B.Unicode11Addon=class{activate(u){u.unicode.register(new s.UnicodeV11)}dispose(){}}})(),U})()))})(ro)),ro.exports}var Nm=Im();const Um=16,jm=256*1024,O_=50;function Pm(f,C){const D=W.useRef(null),A=W.useRef(null),z=W.useRef(null),U=W.useRef(C);U.current=C;const B=W.useRef([]),s=W.useRef(0),u=W.useRef(null),h=W.useRef(null),g=W.useRef(null),o=W.useRef(0),p=W.useRef(null),m=W.useRef(null),w=W.useRef(null),_=W.useRef(!0),n=W.useRef(!0),[l,a]=W.useState(!1),c=W.useRef(null),S=W.useRef(0),x=W.useRef(0),b=W.useRef(0),E=2e3,y=50;W.useEffect(()=>{if(!f.current)return;const G=()=>{if(!D.current||B.current.length===0)return;const N=B.current.join("");B.current=[],s.current=0,D.current.write(N)};g.current=G;const $=(N,Z)=>{const ee=w.current;if(ee&&ee.cols===N&&ee.rows===Z)return;const ce=Date.now()-o.current,X=()=>{var ne;o.current=Date.now(),((ne=U.current)==null?void 0:ne.call(U,N,Z))!==!1&&(w.current={cols:N,rows:Z})};if(ce>=O_){X();return}m.current={cols:N,rows:Z},p.current||(p.current=setTimeout(()=>{var ne;p.current=null;const P=m.current;m.current=null,P&&(o.current=Date.now(),((ne=U.current)==null?void 0:ne.call(U,P.cols,P.rows))!==!1&&(w.current={cols:P.cols,rows:P.rows}))},O_-ce))},Y=new Mm.Terminal({disableStdin:!0,fontSize:14,fontFamily:"'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},scrollback:1e4}),k=new Om.FitAddon;Y.loadAddon(k);try{const N=new Nm.Unicode11Addon;Y.loadAddon(N),Y.unicode.activeVersion="11"}catch{}Y.open(f.current);try{const N=new Hm.WebglAddon;Y.loadAddon(N),N.onContextLoss(()=>{N.dispose()})}catch{}k.fit(),requestAnimationFrame(()=>{D.current&&$(D.current.cols,D.current.rows)}),D.current=Y,A.current=k,b.current=Y.buffer.active.viewportY;const F=(N,Z)=>{k.fit(),$(Y.cols,Y.rows)};z.current=F;const O=new ResizeObserver(()=>{k.fit(),$(Y.cols,Y.rows)});return O.observe(f.current),Y.onScroll(()=>{const N=Date.now();if(N-x.current<y)return;const Z=Y.buffer.active,ee=Z.viewportY,he=ee===Z.length-Y.rows;b.current-ee>0&&!he&&(c.current="up",S.current=N,_.current=!1),b.current=ee,n.current=he,he&&(c.current=null,_.current=!0),a(!_.current&&!he)}),()=>{O.disconnect(),p.current&&(clearTimeout(p.current),p.current=null),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),h.current&&(clearTimeout(h.current),h.current=null),G(),Y.dispose(),D.current=null,A.current=null,z.current=null,g.current=null}},[f]);const R=W.useCallback(()=>{const G=D.current;if(!G)return;const $=Date.now(),Y=c.current==="up"&&$-S.current<E;if(_.current&&!Y){x.current=Date.now(),G.scrollToBottom(),b.current=G.buffer.active.viewportY;return}const k=G.buffer.active,F=k.viewportY===k.length-G.rows;F!==n.current&&(n.current=F,a(!F))},[]),T=W.useCallback((G,$)=>{var Y;if(!G){$==null||$();return}if(B.current.push(G),s.current+=G.length,s.current>=jm){(Y=g.current)==null||Y.call(g),R(),$==null||$();return}u.current===null&&(u.current=requestAnimationFrame(()=>{var k;u.current=null,h.current&&(clearTimeout(h.current),h.current=null),(k=g.current)==null||k.call(g),R()})),h.current||(h.current=setTimeout(()=>{var k;h.current=null,(k=g.current)==null||k.call(g),R()},Um)),$==null||$()},[]),I=W.useCallback(()=>{var G;(G=D.current)==null||G.clear()},[]),M=W.useCallback(()=>{var G;(G=D.current)==null||G.reset()},[]),H=W.useCallback(()=>{const G=D.current;G&&(x.current=Date.now(),G.scrollToBottom(),b.current=G.buffer.active.viewportY)},[]),q=W.useCallback(G=>{_.current=G,G&&(c.current=null,a(!1))},[]),Q=W.useCallback((G,$)=>{var Y;(Y=z.current)==null||Y.call(z,G,$)},[]);return{write:T,clear:I,reset:M,scrollToBottom:H,setAutoFollow:q,showScrollHint:l,adaptToPtyCols:Q,terminal:D}}function Fm(){const[f,C]=W.useState(0),[D,A]=W.useState(!1),z=W.useRef(null),U=W.useCallback(()=>{const h=document.activeElement;if((h==null?void 0:h.tagName)!=="INPUT"&&(h==null?void 0:h.tagName)!=="TEXTAREA")return!1;const g=window.visualViewport;return g?h.getBoundingClientRect().bottom>g.height+g.offsetTop-10:!1},[]),B=W.useCallback(()=>{const h=window.visualViewport;if(!h){C(0),A(!1);return}const g=U();A(g),C(g?h.offsetTop:0)},[U]),s=W.useCallback(()=>{if(!window.visualViewport)return;const g=U();A(g),g||C(0)},[U]),u=W.useCallback(()=>{z.current&&clearTimeout(z.current),z.current=setTimeout(B,0)},[B]);return W.useEffect(()=>{const h=window.visualViewport;if(h)return C(0),h.addEventListener("resize",u),h.addEventListener("scroll",u),document.addEventListener("focusin",s,!0),document.addEventListener("focusout",s,!0),()=>{h.removeEventListener("resize",u),h.removeEventListener("scroll",u),document.removeEventListener("focusin",s,!0),document.removeEventListener("focusout",s,!0),z.current&&clearTimeout(z.current)}},[u,s]),{offsetTop:f,needsCompensation:D}}function qm(f){const C="=".repeat((4-f.length%4)%4),D=(f+C).replace(/-/g,"+").replace(/_/g,"/"),A=atob(D),z=new Uint8Array(A.length);for(let U=0;U<A.length;U++)z[U]=A.charCodeAt(U);return z}function Wm(){const f=W.useRef(!1);W.useEffect(()=>{if(!f.current){if(f.current=!0,!("serviceWorker"in navigator)||!("PushManager"in window)){console.log("[Push] Service Worker or PushManager not supported");return}(async()=>{try{console.log("[Push] Registering service worker...");const C=await navigator.serviceWorker.register("/sw.js");console.log("[Push] Service worker registered:",C.scope);const D=await C.pushManager.getSubscription();if(D){console.log("[Push] Already subscribed, endpoint:",D.endpoint);return}console.log("[Push] Fetching VAPID key from server...");let A="";for(let u=0;u<8;u++){const h=await fetch("/api/push/vapid-key",{credentials:"include"});if(h.ok){const g=await h.json();if(g!=null&&g.vapidPublicKey){A=g.vapidPublicKey,console.log("[Push] Got VAPID key:",A.substring(0,20)+"...");break}}else console.log("[Push] VAPID key fetch failed, attempt",u+1,"status:",h.status);await new Promise(g=>setTimeout(g,Math.min(300*(u+1),1500)))}if(!A){console.warn("[Push] Failed to get VAPID key after retries");return}console.log("[Push] Requesting notification permission...");const z=await Notification.requestPermission();if(console.log("[Push] Permission result:",z),z!=="granted"){console.warn("[Push] Notification permission not granted");return}console.log("[Push] Creating push subscription...");const U=await C.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:qm(A)});console.log("[Push] Subscription created:",U.endpoint);const B=U.toJSON();console.log("[Push] Sending subscription to server...");const s=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({endpoint:B.endpoint,keys:B.keys})});s.ok?console.log("[Push] Subscription sent to server successfully"):console.error("[Push] Failed to send subscription, status:",s.status)}catch(C){console.error("[Push] Setup failed:",C)}})()}},[])}function Gm(){const f=W.useRef("default"),C=W.useRef(null);W.useEffect(()=>{"Notification"in window&&(f.current=Notification.permission)},[]);const D=W.useCallback(async()=>{if(!("Notification"in window))return console.log("[useLocalNotification] Notification API not supported"),!1;if(Notification.permission==="granted")return f.current="granted",!0;if(Notification.permission==="denied")return console.log("[useLocalNotification] Notification permission denied"),!1;const z=await Notification.requestPermission();return f.current=z,z==="granted"},[]);return{showNotification:W.useCallback(async z=>{if(z.tag&&z.tag===C.current)return console.log("[useLocalNotification] Skipping duplicate notification with tag:",z.tag),!1;if(f.current!=="granted"&&!await D())return console.log("[useLocalNotification] Permission not granted, cannot show notification"),!1;try{const U=new Notification(z.title,{body:z.body,tag:z.tag,icon:"/favicon.ico"});return U.onclick=()=>{window.focus(),U.close()},z.tag&&(C.current=z.tag),console.log("[useLocalNotification] Notification shown:",z.title),!0}catch(U){return console.error("[useLocalNotification] Failed to show notification:",U),!1}},[D]),requestPermission:D}}const $m=5e3;function Ym(){const f=Yt(A=>A.setInstances),C=Yt(A=>A.setActiveInstanceId),D=rt(A=>A.setServerAvailable);return W.useRef(!1),W.useEffect(()=>{let A,z=!1;const U=async()=>{try{const B=await Wc();if(z)return;if(D(!0),f(B),!Yt.getState().activeInstanceId&&B.length>0){const u=B.find(h=>h.isCurrent)??B[0];u&&C(u.instanceId)}}catch{if(z)return;D(!1)}};return U(),A=setInterval(U,$m),()=>{z=!0,A&&clearInterval(A)}},[f,C,D]),{activeInstanceId:Yt(A=>A.activeInstanceId)}}function Vm({wsUrl:f,instanceId:C,showCommandPicker:D,isKeyboardOpen:A}){const z=W.useRef(null),U=W.useRef(null),B=rt(q=>q.setSessionStatus),s=rt(q=>q.setIpChangeInfo),u=rt(q=>q.setInstanceConnectionStatus),{showNotification:h}=Gm(),g=W.useRef(null),o=W.useRef((q,Q)=>{}),p=W.useRef(()=>{}),m=W.useRef(()=>{}),w=W.useRef((q,Q)=>{}),_=W.useCallback(q=>{switch(q.type){case"terminal_output":o.current(q.data);break;case"history_sync":p.current(),w.current(0,0),o.current(q.data),B(q.status),m.current();break;case"terminal_resize":q.cols&&q.cols>0&&w.current(q.cols,q.rows);break;case"status_update":B(q.status),q.status==="waiting_input"&&h({title:"Claude Code 需要输入",body:q.detail??"Claude 正在等待你的输入",tag:"claude-waiting-input",renotify:!1});break;case"session_ended":B("idle"),C&&u(C,"disconnected");break;case"error":o.current(`\r
140
+ \x1B[31m[Error] ${q.message}\x1B[0m\r
141
+ `);break;case"heartbeat":break;case"ip_changed":s({oldIp:q.oldIp,newIp:q.newIp,newUrl:q.newUrl});break}},[B,s,h]),{connect:n,send:l}=Lm(_,f,C);g.current=l;const{write:a,reset:c,scrollToBottom:S,setAutoFollow:x,showScrollHint:b,adaptToPtyCols:E}=Pm(z,W.useCallback((q,Q)=>{var G;return((G=g.current)==null?void 0:G.call(g,{type:"resize",cols:q,rows:Q}))??!1},[]));o.current=a,p.current=c,m.current=S,w.current=E;const y=W.useRef(!1);W.useEffect(()=>{y.current||(y.current=!0,n())},[n]);const R=W.useCallback(q=>{q?(l({type:"user_input",data:q}),setTimeout(()=>{l({type:"user_input",data:"\r"})},0)):l({type:"user_input",data:"\r"})},[l]),T=W.useCallback(q=>{l({type:"user_input",data:q})},[l]),I=W.useCallback(q=>{var Q;(Q=U.current)==null||Q.setText(q)},[]),M=W.useCallback(q=>{l({type:"user_input",data:q}),l({type:"user_input",data:"\r"})},[l]),H=W.useCallback(()=>{S(),x(!0)},[S,x]);return V.jsxs(V.Fragment,{children:[V.jsx(gm,{}),V.jsx(vm,{}),V.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[V.jsx(um,{containerRef:z}),V.jsx(Dm,{visible:b,onClick:H})]}),V.jsx(_m,{onShortcut:T,onCommandSelect:I,onCommandSend:M,visible:D}),V.jsx(hm,{ref:U,onSend:R,isKeyboardOpen:A})]})}function Xm(f,C){return f.filter(D=>D.instanceId!==C).sort((D,A)=>D.startedAt.localeCompare(A.startedAt))}function Km(){const{offsetTop:f,needsCompensation:C}=Fm(),D=C&&f>0,A=!D;Wm(),Ym();const z=Yt(a=>a.instances),U=Yt(a=>a.activeInstanceId),B=Yt(a=>a.setActiveInstanceId),s=rt(a=>a.cachedToken),u=rt(a=>a.instanceConnectionStatus),h=rt(a=>a.toastMessage),g=rt(a=>a.showToast),o=rt(a=>a.hideToast),p=W.useRef(!1),m=W.useRef(null),w=z.find(a=>a.instanceId===U),_=U?pm(U):void 0;W.useEffect(()=>{if(!U)return;const a=!w,c=u[U]==="disconnected";if(!(a||c)||p.current||m.current===U)return;const x=Xm(z,U);if(x.length===0)return;p.current=!0,m.current=U,(async()=>{if(s)try{await xr(s)}catch{}const E=x[0];B(E.instanceId),g(`Switched to ${E.name}`),p.current=!1})()},[w,U,s,u,z,B,g]),W.useEffect(()=>{if(!h)return;const a=setTimeout(()=>o(),3e3);return()=>clearTimeout(a)},[h,o]);const n=W.useCallback(async a=>{if(s)try{await xr(s)}catch{}B(a)},[s,B]),l=W.useCallback(async a=>{const S=[...Yt.getState().instances].filter(x=>x.name===a).sort((x,b)=>b.startedAt.localeCompare(x.startedAt))[0];if(!S){g("Instance created, but switch failed");return}B(S.instanceId),g(`Created and switched to ${a}`)},[B,g]);return V.jsxs("div",{"data-testid":"console-page",style:{position:"fixed",top:0,left:0,right:0,height:"100dvh",transform:C?`translateY(-${f}px)`:"none",transition:"transform 0.25s ease-out",willChange:C?"transform":"auto",display:"flex",flexDirection:"column"},children:[V.jsx(cm,{}),V.jsx(Am,{onSwitch:n,onCopySuccess:l}),V.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:V.jsx(Vm,{wsUrl:_,instanceId:U??void 0,showCommandPicker:A,isKeyboardOpen:D},U??"default")}),h&&V.jsx("div",{className:"app-toast",role:"status","aria-live":"polite",children:h})]})}const B_=[{id:"add-instance",target:'button[aria-label="Create new instance"]',title:"Start Here",description:"Tap + to create a new Claude Code session. Each instance runs independently.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16},{id:"instance-tabs",target:'[data-testid="instance-tabs"]',title:"Switch Sessions",description:"Tap any tab to switch between different Claude sessions.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"clone-instance",target:'[data-testid="instance-tab"]',title:"Clone Sessions",description:"Long press a tab to clone it with all settings. Perfect for backup or testing.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"shortcut-bar",target:'[data-testid="shortcut-bar"]',title:"Quick Keys",description:"Send Ctrl+C, Tab, Enter etc. instantly without typing.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"command-buttons",target:'[data-testid="command-buttons"]',title:"One-Tap Commands",description:"Run preset commands with a single tap.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"input-bar",target:'[data-testid="command-input"]',title:"Chat with Claude",description:"Type your message or command here. Claude Code will respond in real-time.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"settings-button",target:'button[aria-label="Settings"]',title:"Customize",description:"Adjust shortcuts, commands, and preferences.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16}],H_="claude_remote_spotlight_done";function Zm(){const[f,C]=W.useState(!1),[D,A]=W.useState(0),[z,U]=W.useState(null),[B,s]=W.useState(!0),u=W.useRef(null),h=B_[D]??null,g=B_.length,o=W.useCallback(l=>{const a=document.querySelector(l.target);if(!a)return null;const c=a.getBoundingClientRect(),S=document.querySelector('[data-testid="console-page"]'),x=S?window.getComputedStyle(S):null,b=x==null?void 0:x.transform;let E=0;if(b&&b!=="none"){const y=b.match(/matrix\([^,]+,[^,]+,[^,]+,[^,]+,[^,]+,([^)]+)\)/);y&&(E=parseFloat(y[1]))}return{left:c.left,top:c.top-E,width:c.width,height:c.height}},[]),p=W.useCallback(()=>{if(!h)return;const l=o(h);U(l)},[h,o]);W.useEffect(()=>{localStorage.getItem(H_)||C(!0)},[]),W.useEffect(()=>{if(!f||!h)return;const l=document.querySelector(h.target);l&&l.scrollIntoView({behavior:"smooth",block:"center"});const a=setTimeout(()=>{const c=o(h);c?(U(c),s(!1)):D<g-1?A(D+1):m()},100);return()=>clearTimeout(a)},[f,D,h,o,g]),W.useEffect(()=>{if(!f||!h)return;const l=document.querySelector(h.target);if(!l)return;const a=l.style.outline,c=l.style.outlineOffset,S=l.style.position,x=l.style.zIndex;return l.style.outline="2px solid var(--status-running)",l.style.outlineOffset="2px",window.getComputedStyle(l).position==="static"&&(l.style.position="relative"),l.style.zIndex="2001",()=>{l.style.outline=a,l.style.outlineOffset=c,l.style.position=S,l.style.zIndex=x}},[f,h]),W.useEffect(()=>{if(!f)return;const l=()=>{u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{p()},100)};return window.addEventListener("resize",l),window.visualViewport&&window.visualViewport.addEventListener("resize",l),()=>{window.removeEventListener("resize",l),window.visualViewport&&window.visualViewport.removeEventListener("resize",l),u.current&&clearTimeout(u.current)}},[f,p]);const m=W.useCallback(()=>{localStorage.setItem(H_,"true"),C(!1),s(!0),U(null)},[]),w=W.useCallback(()=>{D<g-1?A(D+1):m()},[D,g,m]),_=W.useCallback(()=>{D>0&&A(D-1)},[D]),n=W.useCallback(()=>{m()},[m]);return{visible:f,currentStep:D,totalSteps:g,step:h,targetRect:z,isLoading:B,handleNext:w,handlePrev:_,handleSkip:n,recalculate:p}}const Mg=W.createContext(null);function Qm({children:f}){const C=Zm();return V.jsx(Mg.Provider,{value:C,children:f})}function Jm(){const f=W.useContext(Mg);if(!f)throw new Error("useSpotlightContext must be used within a SpotlightProvider");return f}function eS(){const{visible:f,currentStep:C,totalSteps:D,step:A,targetRect:z,isLoading:U,handleNext:B,handlePrev:s,handleSkip:u}=Jm(),h=W.useRef(null),g=W.useRef(null),o=W.useCallback(M=>{switch(M.key){case"ArrowRight":case"ArrowDown":M.preventDefault(),B();break;case"ArrowLeft":case"ArrowUp":M.preventDefault(),s();break;case"Escape":M.preventDefault(),u();break;case"Enter":case" ":M.preventDefault(),B();break}},[B,s,u]);if(W.useEffect(()=>{if(f){g.current=document.activeElement;const M=setTimeout(()=>{var H;(H=h.current)==null||H.focus()},100);return()=>clearTimeout(M)}else g.current&&g.current.focus()},[f]),!f||!A||!z)return null;const p=A.spotlightPadding??4;A.spotlightRadius;const m=C===D-1,w=C===0,_=z.left-p,n=z.top-p,l=z.width+p*2,a=z.height+p*2,c=140,S=n,x=window.innerHeight-(n+a);let b=A.tooltipPosition;A.tooltipPosition==="bottom"&&x<c&&S>=c?b="top":A.tooltipPosition==="top"&&S<c&&x>=c&&(b="bottom");const E=b==="bottom"?n+a+12:n-12,y=Math.min(E,window.innerHeight-c-16),R=280,T=Math.max(16,Math.min(window.innerWidth-R-16,_)),I=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;return V.jsxs("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":`Guide step ${C+1} of ${D}: ${A.title}`,tabIndex:-1,onKeyDown:o,style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2e3,cursor:"pointer",WebkitTapHighlightColor:"transparent"},onClick:M=>{M.target.closest("[data-spotlight-tooltip]")||B()},children:[V.jsx("div",{style:{position:"absolute",inset:0,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.75)",pointerEvents:"none"}}),V.jsxs("div",{"data-spotlight-tooltip":!0,style:{position:"absolute",left:T,top:Math.max(16,y),transform:b==="top"?"translateY(-100%)":"none",maxWidth:R,padding:"12px 16px",borderRadius:12,background:"var(--bg-secondary)",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.3)",pointerEvents:"auto",animation:I?"none":"spotlight-tooltip-enter 0.3s ease-out"},children:[V.jsx("div",{style:{position:"absolute",left:Math.max(16,Math.min(R-28,_+l/2-T-6)),[b==="top"?"bottom":"top"]:-6,width:12,height:12,background:"var(--bg-secondary)",transform:b==="top"?"translateY(50%) rotate(45deg)":"translateY(-50%) rotate(45deg)"}}),V.jsxs("div",{style:{position:"relative",zIndex:1},children:[V.jsx("div",{style:{fontSize:16,fontWeight:600,marginBottom:4,color:"var(--text-primary)"},children:A.title}),V.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"var(--text-secondary)"},children:A.description}),V.jsxs("div",{style:{marginTop:12,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[V.jsx("div",{style:{display:"flex",gap:6},children:Array.from({length:D}).map((M,H)=>V.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:H===C?"var(--status-running)":H<C?"var(--status-idle)":"var(--border-color)"}},H))}),V.jsxs("div",{style:{display:"flex",gap:8},children:[V.jsx("button",{onClick:M=>{M.stopPropagation(),u()},style:{padding:"6px 12px",borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",fontSize:13,cursor:"pointer"},children:"Skip"}),!w&&V.jsx("button",{onClick:M=>{M.stopPropagation(),s()},style:{padding:"6px 14px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:13,cursor:"pointer"},children:"Prev"}),V.jsx("button",{onClick:M=>{M.stopPropagation(),B()},style:{padding:"6px 16px",borderRadius:6,border:"none",background:"var(--status-running)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:m?"Done":"Next"})]})]})]})]}),V.jsx("style",{children:`
142
+ @keyframes spotlight-tooltip-enter {
143
+ from {
144
+ opacity: 0;
145
+ transform: translateY(8px);
146
+ }
147
+ to {
148
+ opacity: 1;
149
+ transform: translateY(0);
150
+ }
151
+ }
152
+ `})]})}function tS(){const C=new URLSearchParams(window.location.search).get("token");if(C){const D=window.location.pathname+window.location.hash;window.history.replaceState({},"",D)}return C}function iS(){const f=rt(U=>U.isAuthenticated),C=rt(U=>U.isCheckingAuth),D=rt(U=>U.setAuthenticated),A=rt(U=>U.setCheckingAuth),z=rt(U=>U.setCachedToken);return W.useEffect(()=>{const U=tS();if(U){xr(U).then(B=>{B?(D(!0),z(U),F_(U)):(sessionStorage.setItem("prefill_token",U),A(!1))}).catch(()=>{sessionStorage.setItem("prefill_token",U),A(!1)});return}i0().then(()=>{D(!0);const B=Tn();B&&z(B)}).catch(async()=>{const B=Tn();if(B)try{if(await xr(B)){D(!0),z(B);return}}catch{}A(!1),q_(),z(null)})},[D,A,z]),C?V.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-primary)",color:"var(--text-secondary)"},children:"Checking session…"}):f?V.jsxs(Qm,{children:[V.jsx(Km,{}),V.jsx(eS,{})]}):V.jsx(a0,{})}Qp.createRoot(document.getElementById("root")).render(V.jsx(W.StrictMode,{children:V.jsx(iS,{})}));