@sapiom/harness 0.1.4 → 0.1.5

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 (62) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/core/canvas-run-state.d.ts +95 -0
  3. package/dist/core/canvas-run-state.d.ts.map +1 -0
  4. package/dist/core/canvas-run-state.js +162 -0
  5. package/dist/core/canvas-run-state.js.map +1 -0
  6. package/dist/core/canvas-svg.d.ts.map +1 -1
  7. package/dist/core/canvas-svg.js +28 -8
  8. package/dist/core/canvas-svg.js.map +1 -1
  9. package/dist/core/canvas-template.d.ts +4 -3
  10. package/dist/core/canvas-template.d.ts.map +1 -1
  11. package/dist/core/canvas-template.js +75 -3
  12. package/dist/core/canvas-template.js.map +1 -1
  13. package/dist/core/definition-slug-resolver.d.ts +33 -0
  14. package/dist/core/definition-slug-resolver.d.ts.map +1 -0
  15. package/dist/core/definition-slug-resolver.js +81 -0
  16. package/dist/core/definition-slug-resolver.js.map +1 -0
  17. package/dist/core/execution-detector.d.ts +59 -0
  18. package/dist/core/execution-detector.d.ts.map +1 -0
  19. package/dist/core/execution-detector.js +110 -0
  20. package/dist/core/execution-detector.js.map +1 -0
  21. package/dist/core/inject/mcp-config.d.ts.map +1 -1
  22. package/dist/core/inject/mcp-config.js +9 -1
  23. package/dist/core/inject/mcp-config.js.map +1 -1
  24. package/dist/core/render-run-state.d.ts +9 -0
  25. package/dist/core/render-run-state.d.ts.map +1 -0
  26. package/dist/core/render-run-state.js +139 -0
  27. package/dist/core/render-run-state.js.map +1 -0
  28. package/dist/core/run-spend.d.ts +55 -0
  29. package/dist/core/run-spend.d.ts.map +1 -0
  30. package/dist/core/run-spend.js +109 -0
  31. package/dist/core/run-spend.js.map +1 -0
  32. package/dist/core/run-state.d.ts +45 -0
  33. package/dist/core/run-state.d.ts.map +1 -0
  34. package/dist/core/run-state.js +72 -0
  35. package/dist/core/run-state.js.map +1 -0
  36. package/dist/core/run-transactions.d.ts +60 -0
  37. package/dist/core/run-transactions.d.ts.map +1 -0
  38. package/dist/core/run-transactions.js +129 -0
  39. package/dist/core/run-transactions.js.map +1 -0
  40. package/dist/core/workflow-registry.d.ts +12 -1
  41. package/dist/core/workflow-registry.d.ts.map +1 -1
  42. package/dist/core/workflow-registry.js +2 -0
  43. package/dist/core/workflow-registry.js.map +1 -1
  44. package/dist/server/index.d.ts.map +1 -1
  45. package/dist/server/index.js +0 -0
  46. package/dist/server/index.js.map +1 -1
  47. package/dist/server/rest.d.ts +5 -0
  48. package/dist/server/rest.d.ts.map +1 -1
  49. package/dist/server/rest.js +36 -10
  50. package/dist/server/rest.js.map +1 -1
  51. package/dist/server/runs.d.ts +33 -0
  52. package/dist/server/runs.d.ts.map +1 -0
  53. package/dist/server/runs.js +124 -0
  54. package/dist/server/runs.js.map +1 -0
  55. package/dist/shared/types.d.ts +90 -0
  56. package/dist/shared/types.d.ts.map +1 -1
  57. package/dist/shared/types.js.map +1 -1
  58. package/dist/web/assets/index-DM84J83Y.js +234 -0
  59. package/dist/web/assets/{index-DRTrwTku.css → index-DemtWW4L.css} +1 -1
  60. package/dist/web/index.html +2 -2
  61. package/package.json +1 -1
  62. package/dist/web/assets/index-BhKGSTTT.js +0 -214
@@ -1,214 +0,0 @@
1
- var Hv=Object.defineProperty;var Nv=(T,q,G)=>q in T?Hv(T,q,{enumerable:!0,configurable:!0,writable:!0,value:G}):T[q]=G;var Ao=(T,q,G)=>Nv(T,typeof q!="symbol"?q+"":q,G);(function(){const q=document.createElement("link").relList;if(q&&q.supports&&q.supports("modulepreload"))return;for(const te of document.querySelectorAll('link[rel="modulepreload"]'))L(te);new MutationObserver(te=>{for(const le of te)if(le.type==="childList")for(const P of le.addedNodes)P.tagName==="LINK"&&P.rel==="modulepreload"&&L(P)}).observe(document,{childList:!0,subtree:!0});function G(te){const le={};return te.integrity&&(le.integrity=te.integrity),te.referrerPolicy&&(le.referrerPolicy=te.referrerPolicy),te.crossOrigin==="use-credentials"?le.credentials="include":te.crossOrigin==="anonymous"?le.credentials="omit":le.credentials="same-origin",le}function L(te){if(te.ep)return;te.ep=!0;const le=G(te);fetch(te.href,le)}})();var Do={exports:{}},Yr={};/**
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 Gf;function zv(){if(Gf)return Yr;Gf=1;var T=Symbol.for("react.transitional.element"),q=Symbol.for("react.fragment");function G(L,te,le){var P=null;if(le!==void 0&&(P=""+le),te.key!==void 0&&(P=""+te.key),"key"in te){le={};for(var u in te)u!=="key"&&(le[u]=te[u])}else le=te;return te=le.ref,{$$typeof:T,type:L,key:P,ref:te!==void 0?te:null,props:le}}return Yr.Fragment=q,Yr.jsx=G,Yr.jsxs=G,Yr}var Ff;function jv(){return Ff||(Ff=1,Do.exports=zv()),Do.exports}var M=jv(),To={exports:{}},ye={};/**
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 Xf;function Uv(){if(Xf)return ye;Xf=1;var T=Symbol.for("react.transitional.element"),q=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),P=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),p=Symbol.iterator;function b(A){return A===null||typeof A!="object"?null:(A=p&&A[p]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,o={};function c(A,O,$){this.props=A,this.context=O,this.refs=o,this.updater=$||E}c.prototype.isReactComponent={},c.prototype.setState=function(A,O){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,O,"setState")},c.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function n(){}n.prototype=c.prototype;function l(A,O,$){this.props=A,this.context=O,this.refs=o,this.updater=$||E}var _=l.prototype=new n;_.constructor=l,m(_,c.prototype),_.isPureReactComponent=!0;var C=Array.isArray;function w(){}var S={H:null,A:null,T:null,S:null},v=Object.prototype.hasOwnProperty;function x(A,O,$){var se=$.ref;return{$$typeof:T,type:A,key:O,ref:se!==void 0?se:null,props:$}}function B(A,O){return x(A.type,O,A.props)}function U(A){return typeof A=="object"&&A!==null&&A.$$typeof===T}function j(A){var O={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function($){return O[$]})}var N=/\/+/g;function J(A,O){return typeof A=="object"&&A!==null&&A.key!=null?j(""+A.key):O.toString(36)}function ce(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(w,w):(A.status="pending",A.then(function(O){A.status==="pending"&&(A.status="fulfilled",A.value=O)},function(O){A.status==="pending"&&(A.status="rejected",A.reason=O)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function W(A,O,$,se,Y){var F=typeof A;(F==="undefined"||F==="boolean")&&(A=null);var z=!1;if(A===null)z=!0;else switch(F){case"bigint":case"string":case"number":z=!0;break;case"object":switch(A.$$typeof){case T:case q:z=!0;break;case g:return z=A._init,W(z(A._payload),O,$,se,Y)}}if(z)return Y=Y(A),z=se===""?"."+J(A,0):se,C(Y)?($="",z!=null&&($=z.replace(N,"$&/")+"/"),W(Y,O,$,"",function(oe){return oe})):Y!=null&&(U(Y)&&(Y=B(Y,$+(Y.key==null||A&&A.key===Y.key?"":(""+Y.key).replace(N,"$&/")+"/")+z)),O.push(Y)),1;z=0;var R=se===""?".":se+":";if(C(A))for(var ie=0;ie<A.length;ie++)se=A[ie],F=R+J(se,ie),z+=W(se,O,$,F,Y);else if(ie=b(A),typeof ie=="function")for(A=ie.call(A),ie=0;!(se=A.next()).done;)se=se.value,F=R+J(se,ie++),z+=W(se,O,$,F,Y);else if(F==="object"){if(typeof A.then=="function")return W(ce(A),O,$,se,Y);throw O=String(A),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return z}function X(A,O,$){if(A==null)return A;var se=[],Y=0;return W(A,se,"","",function(F){return O.call($,F,Y++)}),se}function re(A){if(A._status===-1){var O=A._result;O=O(),O.then(function($){(A._status===0||A._status===-1)&&(A._status=1,A._result=$)},function($){(A._status===0||A._status===-1)&&(A._status=2,A._result=$)}),A._status===-1&&(A._status=0,A._result=O)}if(A._status===1)return A._result.default;throw A._result}var D=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},H={map:X,forEach:function(A,O,$){X(A,function(){O.apply(this,arguments)},$)},count:function(A){var O=0;return X(A,function(){O++}),O},toArray:function(A){return X(A,function(O){return O})||[]},only:function(A){if(!U(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return ye.Activity=h,ye.Children=H,ye.Component=c,ye.Fragment=G,ye.Profiler=te,ye.PureComponent=l,ye.StrictMode=L,ye.Suspense=f,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,ye.__COMPILER_RUNTIME={__proto__:null,c:function(A){return S.H.useMemoCache(A)}},ye.cache=function(A){return function(){return A.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(A,O,$){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var se=m({},A.props),Y=A.key;if(O!=null)for(F in O.key!==void 0&&(Y=""+O.key),O)!v.call(O,F)||F==="key"||F==="__self"||F==="__source"||F==="ref"&&O.ref===void 0||(se[F]=O[F]);var F=arguments.length-2;if(F===1)se.children=$;else if(1<F){for(var z=Array(F),R=0;R<F;R++)z[R]=arguments[R+2];se.children=z}return x(A.type,Y,se)},ye.createContext=function(A){return A={$$typeof:P,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:le,_context:A},A},ye.createElement=function(A,O,$){var se,Y={},F=null;if(O!=null)for(se in O.key!==void 0&&(F=""+O.key),O)v.call(O,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(Y[se]=O[se]);var z=arguments.length-2;if(z===1)Y.children=$;else if(1<z){for(var R=Array(z),ie=0;ie<z;ie++)R[ie]=arguments[ie+2];Y.children=R}if(A&&A.defaultProps)for(se in z=A.defaultProps,z)Y[se]===void 0&&(Y[se]=z[se]);return x(A,F,Y)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(A){return{$$typeof:u,render:A}},ye.isValidElement=U,ye.lazy=function(A){return{$$typeof:g,_payload:{_status:-1,_result:A},_init:re}},ye.memo=function(A,O){return{$$typeof:d,type:A,compare:O===void 0?null:O}},ye.startTransition=function(A){var O=S.T,$={};S.T=$;try{var se=A(),Y=S.S;Y!==null&&Y($,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(w,D)}catch(F){D(F)}finally{O!==null&&$.types!==null&&(O.types=$.types),S.T=O}},ye.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},ye.use=function(A){return S.H.use(A)},ye.useActionState=function(A,O,$){return S.H.useActionState(A,O,$)},ye.useCallback=function(A,O){return S.H.useCallback(A,O)},ye.useContext=function(A){return S.H.useContext(A)},ye.useDebugValue=function(){},ye.useDeferredValue=function(A,O){return S.H.useDeferredValue(A,O)},ye.useEffect=function(A,O){return S.H.useEffect(A,O)},ye.useEffectEvent=function(A){return S.H.useEffectEvent(A)},ye.useId=function(){return S.H.useId()},ye.useImperativeHandle=function(A,O,$){return S.H.useImperativeHandle(A,O,$)},ye.useInsertionEffect=function(A,O){return S.H.useInsertionEffect(A,O)},ye.useLayoutEffect=function(A,O){return S.H.useLayoutEffect(A,O)},ye.useMemo=function(A,O){return S.H.useMemo(A,O)},ye.useOptimistic=function(A,O){return S.H.useOptimistic(A,O)},ye.useReducer=function(A,O,$){return S.H.useReducer(A,O,$)},ye.useRef=function(A){return S.H.useRef(A)},ye.useState=function(A){return S.H.useState(A)},ye.useSyncExternalStore=function(A,O,$){return S.H.useSyncExternalStore(A,O,$)},ye.useTransition=function(){return S.H.useTransition()},ye.version="19.2.7",ye}var Vf;function Ko(){return Vf||(Vf=1,To.exports=Uv()),To.exports}var ae=Ko(),Ro={exports:{}},Gr={},ko={exports:{}},Mo={};/**
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 $f;function qv(){return $f||($f=1,(function(T){function q(W,X){var re=W.length;W.push(X);e:for(;0<re;){var D=re-1>>>1,H=W[D];if(0<te(H,X))W[D]=X,W[re]=H,re=D;else break e}}function G(W){return W.length===0?null:W[0]}function L(W){if(W.length===0)return null;var X=W[0],re=W.pop();if(re!==X){W[0]=re;e:for(var D=0,H=W.length,A=H>>>1;D<A;){var O=2*(D+1)-1,$=W[O],se=O+1,Y=W[se];if(0>te($,re))se<H&&0>te(Y,$)?(W[D]=Y,W[se]=re,D=se):(W[D]=$,W[O]=re,D=O);else if(se<H&&0>te(Y,re))W[D]=Y,W[se]=re,D=se;else break e}}return X}function te(W,X){var re=W.sortIndex-X.sortIndex;return re!==0?re:W.id-X.id}if(T.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var le=performance;T.unstable_now=function(){return le.now()}}else{var P=Date,u=P.now();T.unstable_now=function(){return P.now()-u}}var f=[],d=[],g=1,h=null,p=3,b=!1,E=!1,m=!1,o=!1,c=typeof setTimeout=="function"?setTimeout:null,n=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;function _(W){for(var X=G(d);X!==null;){if(X.callback===null)L(d);else if(X.startTime<=W)L(d),X.sortIndex=X.expirationTime,q(f,X);else break;X=G(d)}}function C(W){if(m=!1,_(W),!E)if(G(f)!==null)E=!0,w||(w=!0,j());else{var X=G(d);X!==null&&ce(C,X.startTime-W)}}var w=!1,S=-1,v=5,x=-1;function B(){return o?!0:!(T.unstable_now()-x<v)}function U(){if(o=!1,w){var W=T.unstable_now();x=W;var X=!0;try{e:{E=!1,m&&(m=!1,n(S),S=-1),b=!0;var re=p;try{t:{for(_(W),h=G(f);h!==null&&!(h.expirationTime>W&&B());){var D=h.callback;if(typeof D=="function"){h.callback=null,p=h.priorityLevel;var H=D(h.expirationTime<=W);if(W=T.unstable_now(),typeof H=="function"){h.callback=H,_(W),X=!0;break t}h===G(f)&&L(f),_(W)}else L(f);h=G(f)}if(h!==null)X=!0;else{var A=G(d);A!==null&&ce(C,A.startTime-W),X=!1}}break e}finally{h=null,p=re,b=!1}X=void 0}}finally{X?j():w=!1}}}var j;if(typeof l=="function")j=function(){l(U)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,J=N.port2;N.port1.onmessage=U,j=function(){J.postMessage(null)}}else j=function(){c(U,0)};function ce(W,X){S=c(function(){W(T.unstable_now())},X)}T.unstable_IdlePriority=5,T.unstable_ImmediatePriority=1,T.unstable_LowPriority=4,T.unstable_NormalPriority=3,T.unstable_Profiling=null,T.unstable_UserBlockingPriority=2,T.unstable_cancelCallback=function(W){W.callback=null},T.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<W?Math.floor(1e3/W):5},T.unstable_getCurrentPriorityLevel=function(){return p},T.unstable_next=function(W){switch(p){case 1:case 2:case 3:var X=3;break;default:X=p}var re=p;p=X;try{return W()}finally{p=re}},T.unstable_requestPaint=function(){o=!0},T.unstable_runWithPriority=function(W,X){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var re=p;p=W;try{return X()}finally{p=re}},T.unstable_scheduleCallback=function(W,X,re){var D=T.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?D+re:D):re=D,W){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=re+H,W={id:g++,callback:X,priorityLevel:W,startTime:re,expirationTime:H,sortIndex:-1},re>D?(W.sortIndex=re,q(d,W),G(f)===null&&W===G(d)&&(m?(n(S),S=-1):m=!0,ce(C,re-D))):(W.sortIndex=H,q(f,W),E||b||(E=!0,w||(w=!0,j()))),W},T.unstable_shouldYield=B,T.unstable_wrapCallback=function(W){var X=p;return function(){var re=p;p=X;try{return W.apply(this,arguments)}finally{p=re}}}})(Mo)),Mo}var Zf;function Iv(){return Zf||(Zf=1,ko.exports=qv()),ko.exports}var Lo={exports:{}},ht={};/**
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 Wv(){if(Qf)return ht;Qf=1;var T=Ko();function q(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function G(){}var L={d:{f:G,r:function(){throw Error(q(522))},D:G,C:G,L:G,m:G,X:G,S:G,M:G},p:0,findDOMNode:null},te=Symbol.for("react.portal");function le(f,d,g){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:te,key:h==null?null:""+h,children:f,containerInfo:d,implementation:g}}var P=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ht.createPortal=function(f,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(q(299));return le(f,d,null,g)},ht.flushSync=function(f){var d=P.T,g=L.p;try{if(P.T=null,L.p=2,f)return f()}finally{P.T=d,L.p=g,L.d.f()}},ht.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,L.d.C(f,d))},ht.prefetchDNS=function(f){typeof f=="string"&&L.d.D(f)},ht.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var g=d.as,h=u(g,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?L.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:p,fetchPriority:b}):g==="script"&&L.d.X(f,{crossOrigin:h,integrity:p,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ht.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=u(d.as,d.crossOrigin);L.d.M(f,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&L.d.M(f)},ht.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,h=u(g,d.crossOrigin);L.d.L(f,g,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ht.preloadModule=function(f,d){if(typeof f=="string")if(d){var g=u(d.as,d.crossOrigin);L.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else L.d.m(f)},ht.requestFormReset=function(f){L.d.r(f)},ht.unstable_batchedUpdates=function(f,d){return f(d)},ht.useFormState=function(f,d,g){return P.H.useFormState(f,d,g)},ht.useFormStatus=function(){return P.H.useHostTransitionStatus()},ht.version="19.2.7",ht}var Jf;function Pv(){if(Jf)return Lo.exports;Jf=1;function T(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T)}catch(q){console.error(q)}}return T(),Lo.exports=Wv(),Lo.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 ed;function Kv(){if(ed)return Gr;ed=1;var T=Iv(),q=Ko(),G=Pv();function L(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 te(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function le(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 P(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 u(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 f(e){if(le(e)!==e)throw Error(L(188))}function d(e){var t=e.alternate;if(!t){if(t=le(e),t===null)throw Error(L(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===i)return f(r),e;if(a===s)return f(r),t;a=a.sibling}throw Error(L(188))}if(i.return!==s.return)i=r,s=a;else{for(var y=!1,k=r.child;k;){if(k===i){y=!0,i=r,s=a;break}if(k===s){y=!0,s=r,i=a;break}k=k.sibling}if(!y){for(k=a.child;k;){if(k===i){y=!0,i=a,s=r;break}if(k===s){y=!0,s=a,i=r;break}k=k.sibling}if(!y)throw Error(L(189))}}if(i.alternate!==s)throw Error(L(190))}if(i.tag!==3)throw Error(L(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 h=Object.assign,p=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),n=Symbol.for("react.consumer"),l=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function j(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var N=Symbol.for("react.client.reference");function J(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case c:return"Profiler";case o:return"StrictMode";case C:return"Suspense";case w:return"SuspenseList";case x:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case l:return e.displayName||"Context";case n:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case S:return t=e.displayName||null,t!==null?t:J(e.type)||"Memo";case v:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var ce=Array.isArray,W=q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=G.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},D=[],H=-1;function A(e){return{current:e}}function O(e){0>H||(e.current=D[H],D[H]=null,H--)}function $(e,t){H++,D[H]=e.current,e.current=t}var se=A(null),Y=A(null),F=A(null),z=A(null);function R(e,t){switch($(F,t),$(Y,e),$(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vf(t),e=mf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(se),$(se,e)}function ie(){O(se),O(Y),O(F)}function oe(e){e.memoizedState!==null&&$(z,e);var t=se.current,i=mf(t,e.type);t!==i&&($(Y,e),$(se,i))}function _e(e){Y.current===e&&(O(se),O(Y)),z.current===e&&(O(z),Ir._currentValue=re)}var de,we;function Le(e){if(de===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||"",we=-1<i.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+de+e+we}var Ue=!1;function it(e,t){if(!e||Ue)return"";Ue=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ne){var ee=ne}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(ne){ee=ne}e.call(fe.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=s.DetermineComponentFrameRoot(),y=a[0],k=a[1];if(y&&k){var I=y.split(`
44
- `),Q=k.split(`
45
- `);for(r=s=0;s<I.length&&!I[s].includes("DetermineComponentFrameRoot");)s++;for(;r<Q.length&&!Q[r].includes("DetermineComponentFrameRoot");)r++;if(s===I.length||r===Q.length)for(s=I.length-1,r=Q.length-1;1<=s&&0<=r&&I[s]!==Q[r];)r--;for(;1<=s&&0<=r;s--,r--)if(I[s]!==Q[r]){if(s!==1||r!==1)do if(s--,r--,0>r||I[s]!==Q[r]){var ue=`
46
- `+I[s].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=s&&0<=r);break}}}finally{Ue=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Le(i):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le("Lazy");case 13:return e.child!==t&&t!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return it(e.type,!1);case 11:return it(e.type.render,!1);case 1:return it(e.type,!0);case 31:return Le("Activity");default:return""}}function _i(e){try{var t="",i=null;do t+=Se(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
47
- Error generating stack: `+s.message+`
48
- `+s.stack}}var Wi=Object.prototype.hasOwnProperty,Pi=T.unstable_scheduleCallback,Ki=T.unstable_cancelCallback,ds=T.unstable_shouldYield,dt=T.unstable_requestPaint,et=T.unstable_now,Mt=T.unstable_getCurrentPriorityLevel,vi=T.unstable_ImmediatePriority,_s=T.unstable_UserBlockingPriority,bt=T.unstable_NormalPriority,vs=T.unstable_LowPriority,Wt=T.unstable_IdlePriority,Yi=T.log,qe=T.unstable_setDisableYieldValue,Gi=null,Ct=null;function mi(e){if(typeof Yi=="function"&&qe(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Gi,e)}catch{}}var wt=Math.clz32?Math.clz32:bd,Sd=Math.log,yd=Math.LN2;function bd(e){return e>>>=0,e===0?32:31-(Sd(e)/yd|0)|0}var Fr=256,Xr=262144,Vr=4194304;function Fi(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 $r(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,a=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var k=s&134217727;return k!==0?(s=k&~a,s!==0?r=Fi(s):(y&=k,y!==0?r=Fi(y):i||(i=k&~e,i!==0&&(r=Fi(i))))):(k=s&~a,k!==0?r=Fi(k):y!==0?r=Fi(y):i||(i=s&~e,i!==0&&(r=Fi(i)))),r===0?0:t!==0&&t!==r&&(t&a)===0&&(a=r&-r,i=t&-t,a>=i||a===32&&(i&4194048)!==0)?t:r}function er(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Cd(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 Vo(){var e=Vr;return Vr<<=1,(Vr&62914560)===0&&(Vr=4194304),e}function da(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function tr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wd(e,t,i,s,r,a){var y=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 k=e.entanglements,I=e.expirationTimes,Q=e.hiddenUpdates;for(i=y&~i;0<i;){var ue=31-wt(i),fe=1<<ue;k[ue]=0,I[ue]=-1;var ee=Q[ue];if(ee!==null)for(Q[ue]=null,ue=0;ue<ee.length;ue++){var ne=ee[ue];ne!==null&&(ne.lane&=-536870913)}i&=~fe}s!==0&&$o(e,s,0),a!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=a&~(y&~t))}function $o(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-wt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Zo(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-wt(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function Qo(e,t){var i=t&-t;return i=(i&42)!==0?1:_a(i),(i&(e.suspendedLanes|t))!==0?0:i}function _a(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 va(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jo(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:Uf(e.type))}function ec(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var pi=Math.random().toString(36).slice(2),nt="__reactFiber$"+pi,_t="__reactProps$"+pi,ms="__reactContainer$"+pi,ma="__reactEvents$"+pi,Ed="__reactListeners$"+pi,xd="__reactHandles$"+pi,tc="__reactResources$"+pi,ir="__reactMarker$"+pi;function pa(e){delete e[nt],delete e[_t],delete e[ma],delete e[Ed],delete e[xd]}function ps(e){var t=e[nt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ms]||i[nt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=wf(e);e!==null;){if(i=e[nt])return i;e=wf(e)}return t}e=i,i=e.parentNode}return null}function gs(e){if(e=e[nt]||e[ms]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function sr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(L(33))}function Ss(e){var t=e[tc];return t||(t=e[tc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function st(e){e[ir]=!0}var ic=new Set,sc={};function Xi(e,t){ys(e,t),ys(e+"Capture",t)}function ys(e,t){for(sc[e]=t,e=0;e<t.length;e++)ic.add(t[e])}var Ad=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]*$"),rc={},nc={};function Dd(e){return Wi.call(nc,e)?!0:Wi.call(rc,e)?!1:Ad.test(e)?nc[e]=!0:(rc[e]=!0,!1)}function Zr(e,t,i){if(Dd(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Qr(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 $t(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Lt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ac(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Td(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,a=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(y){i=""+y,a.call(this,y)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(y){i=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ga(e){if(!e._valueTracker){var t=ac(e)?"checked":"value";e._valueTracker=Td(e,t,""+e[t])}}function lc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ac(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Jr(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 Rd=/[\n"\\]/g;function Ot(e){return e.replace(Rd,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Sa(e,t,i,s,r,a,y,k){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Lt(t)):e.value!==""+Lt(t)&&(e.value=""+Lt(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?ya(e,y,Lt(t)):i!=null?ya(e,y,Lt(i)):s!=null&&e.removeAttribute("value"),r==null&&a!=null&&(e.defaultChecked=!!a),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Lt(k):e.removeAttribute("name")}function oc(e,t,i,s,r,a,y,k){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||i!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){ga(e);return}i=i!=null?""+Lt(i):"",t=t!=null?""+Lt(t):i,k||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=k?e.checked:!!s,e.defaultChecked=!!s,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),ga(e)}function ya(e,t,i){t==="number"&&Jr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function bs(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Lt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function cc(e,t,i){if(t!=null&&(t=""+Lt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Lt(i):""}function uc(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(L(92));if(ce(s)){if(1<s.length)throw Error(L(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Lt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),ga(e)}function Cs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var kd=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 hc(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||kd.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function fc(e,t,i){if(t!=null&&typeof t!="object")throw Error(L(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&hc(e,r,s)}else for(var a in t)t.hasOwnProperty(a)&&hc(e,a,t[a])}function ba(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 Md=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"]]),Ld=/^[\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 en(e){return Ld.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zt(){}var Ca=null;function wa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ws=null,Es=null;function dc(e){var t=gs(e);if(t&&(e=t.stateNode)){var i=e[_t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Sa(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="'+Ot(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[_t]||null;if(!r)throw Error(L(90));Sa(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&lc(s)}break e;case"textarea":cc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&bs(e,!!i.multiple,t,!1)}}}var Ea=!1;function _c(e,t,i){if(Ea)return e(t,i);Ea=!0;try{var s=e(t);return s}finally{if(Ea=!1,(ws!==null||Es!==null)&&(Wn(),ws&&(t=ws,e=Es,Es=ws=null,dc(t),e)))for(t=0;t<e.length;t++)dc(e[t])}}function rr(e,t){var i=e.stateNode;if(i===null)return null;var s=i[_t]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(L(231,t,typeof i));return i}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xa=!1;if(Qt)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){xa=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{xa=!1}var gi=null,Aa=null,tn=null;function vc(){if(tn)return tn;var e,t=Aa,i=t.length,s,r="value"in gi?gi.value:gi.textContent,a=r.length;for(e=0;e<i&&t[e]===r[e];e++);var y=i-e;for(s=1;s<=y&&t[i-s]===r[a-s];s++);return tn=r.slice(e,1<s?1-s:void 0)}function sn(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 rn(){return!0}function mc(){return!1}function vt(e){function t(i,s,r,a,y){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=y,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(i=e[k],this[k]=i?i(a):a[k]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?rn:mc,this.isPropagationStopped=mc,this}return h(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=rn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nn=vt(Vi),ar=h({},Vi,{view:0,detail:0}),Od=vt(ar),Da,Ta,lr,an=h({},ar,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ka,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!==lr&&(lr&&e.type==="mousemove"?(Da=e.screenX-lr.screenX,Ta=e.screenY-lr.screenY):Ta=Da=0,lr=e),Da)},movementY:function(e){return"movementY"in e?e.movementY:Ta}}),pc=vt(an),Bd=h({},an,{dataTransfer:0}),Hd=vt(Bd),Nd=h({},ar,{relatedTarget:0}),Ra=vt(Nd),zd=h({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),jd=vt(zd),Ud=h({},Vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qd=vt(Ud),Id=h({},Vi,{data:0}),gc=vt(Id),Wd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pd={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"},Kd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kd[e])?!!t[e]:!1}function ka(){return Yd}var Gd=h({},ar,{key:function(e){if(e.key){var t=Wd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ka,charCode:function(e){return e.type==="keypress"?sn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fd=vt(Gd),Xd=h({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sc=vt(Xd),Vd=h({},ar,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ka}),$d=vt(Vd),Zd=h({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qd=vt(Zd),Jd=h({},an,{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}),e_=vt(Jd),t_=h({},Vi,{newState:0,oldState:0}),i_=vt(t_),s_=[9,13,27,32],Ma=Qt&&"CompositionEvent"in window,or=null;Qt&&"documentMode"in document&&(or=document.documentMode);var r_=Qt&&"TextEvent"in window&&!or,yc=Qt&&(!Ma||or&&8<or&&11>=or),bc=" ",Cc=!1;function wc(e,t){switch(e){case"keyup":return s_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ec(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function n_(e,t){switch(e){case"compositionend":return Ec(t);case"keypress":return t.which!==32?null:(Cc=!0,bc);case"textInput":return e=t.data,e===bc&&Cc?null:e;default:return null}}function a_(e,t){if(xs)return e==="compositionend"||!Ma&&wc(e,t)?(e=vc(),tn=Aa=gi=null,xs=!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 yc&&t.locale!=="ko"?null:t.data;default:return null}}var l_={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 xc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!l_[e.type]:t==="textarea"}function Ac(e,t,i,s){ws?Es?Es.push(s):Es=[s]:ws=s,t=Vn(t,"onChange"),0<t.length&&(i=new nn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var cr=null,ur=null;function o_(e){cf(e,0)}function ln(e){var t=sr(e);if(lc(t))return e}function Dc(e,t){if(e==="change")return t}var Tc=!1;if(Qt){var La;if(Qt){var Oa="oninput"in document;if(!Oa){var Rc=document.createElement("div");Rc.setAttribute("oninput","return;"),Oa=typeof Rc.oninput=="function"}La=Oa}else La=!1;Tc=La&&(!document.documentMode||9<document.documentMode)}function kc(){cr&&(cr.detachEvent("onpropertychange",Mc),ur=cr=null)}function Mc(e){if(e.propertyName==="value"&&ln(ur)){var t=[];Ac(t,ur,e,wa(e)),_c(o_,t)}}function c_(e,t,i){e==="focusin"?(kc(),cr=t,ur=i,cr.attachEvent("onpropertychange",Mc)):e==="focusout"&&kc()}function u_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ln(ur)}function h_(e,t){if(e==="click")return ln(t)}function f_(e,t){if(e==="input"||e==="change")return ln(t)}function d_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:d_;function hr(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!Wi.call(t,r)||!Et(e[r],t[r]))return!1}return!0}function Lc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Oc(e,t){var i=Lc(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Lc(i)}}function Bc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(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=Jr(e.document)}return t}function Ba(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 __=Qt&&"documentMode"in document&&11>=document.documentMode,As=null,Ha=null,fr=null,Na=!1;function Nc(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Na||As==null||As!==Jr(s)||(s=As,"selectionStart"in s&&Ba(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),fr&&hr(fr,s)||(fr=s,s=Vn(Ha,"onSelect"),0<s.length&&(t=new nn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=As)))}function $i(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ds={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},za={},zc={};Qt&&(zc=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function Zi(e){if(za[e])return za[e];if(!Ds[e])return e;var t=Ds[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in zc)return za[e]=t[i];return e}var jc=Zi("animationend"),Uc=Zi("animationiteration"),qc=Zi("animationstart"),v_=Zi("transitionrun"),m_=Zi("transitionstart"),p_=Zi("transitioncancel"),Ic=Zi("transitionend"),Wc=new Map,ja="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(" ");ja.push("scrollEnd");function Pt(e,t){Wc.set(e,t),Xi(t,[e])}var on=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)},Bt=[],Ts=0,Ua=0;function cn(){for(var e=Ts,t=Ua=Ts=0;t<e;){var i=Bt[t];Bt[t++]=null;var s=Bt[t];Bt[t++]=null;var r=Bt[t];Bt[t++]=null;var a=Bt[t];if(Bt[t++]=null,s!==null&&r!==null){var y=s.pending;y===null?r.next=r:(r.next=y.next,y.next=r),s.pending=r}a!==0&&Pc(i,r,a)}}function un(e,t,i,s){Bt[Ts++]=e,Bt[Ts++]=t,Bt[Ts++]=i,Bt[Ts++]=s,Ua|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qa(e,t,i,s){return un(e,t,i,s),hn(e)}function Qi(e,t){return un(e,null,null,t),hn(e)}function Pc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,a=e.return;a!==null;)a.childLanes|=i,s=a.alternate,s!==null&&(s.childLanes|=i),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(r=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,r&&t!==null&&(r=31-wt(i),e=a.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),a):null}function hn(e){if(50<Br)throw Br=0,Vl=null,Error(L(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Rs={};function g_(e,t,i,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(e,t,i,s){return new g_(e,t,i,s)}function Ia(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jt(e,t){var i=e.alternate;return i===null?(i=xt(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 Kc(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 fn(e,t,i,s,r,a){var y=0;if(s=e,typeof e=="function")Ia(e)&&(y=1);else if(typeof e=="string")y=wv(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case x:return e=xt(31,i,t,r),e.elementType=x,e.lanes=a,e;case m:return Ji(i.children,r,a,t);case o:y=8,r|=24;break;case c:return e=xt(12,i,t,r|2),e.elementType=c,e.lanes=a,e;case C:return e=xt(13,i,t,r),e.elementType=C,e.lanes=a,e;case w:return e=xt(19,i,t,r),e.elementType=w,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l:y=10;break e;case n:y=9;break e;case _:y=11;break e;case S:y=14;break e;case v:y=16,s=null;break e}y=29,i=Error(L(130,e===null?"null":typeof e,"")),s=null}return t=xt(y,i,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function Ji(e,t,i,s){return e=xt(7,e,s,t),e.lanes=i,e}function Wa(e,t,i){return e=xt(6,e,null,t),e.lanes=i,e}function Yc(e){var t=xt(18,null,null,0);return t.stateNode=e,t}function Pa(e,t,i){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gc=new WeakMap;function Ht(e,t){if(typeof e=="object"&&e!==null){var i=Gc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:_i(t)},Gc.set(e,t),t)}return{value:e,source:t,stack:_i(t)}}var ks=[],Ms=0,dn=null,dr=0,Nt=[],zt=0,Si=null,Gt=1,Ft="";function ei(e,t){ks[Ms++]=dr,ks[Ms++]=dn,dn=e,dr=t}function Fc(e,t,i){Nt[zt++]=Gt,Nt[zt++]=Ft,Nt[zt++]=Si,Si=e;var s=Gt;e=Ft;var r=32-wt(s)-1;s&=~(1<<r),i+=1;var a=32-wt(t)+r;if(30<a){var y=r-r%5;a=(s&(1<<y)-1).toString(32),s>>=y,r-=y,Gt=1<<32-wt(t)+r|i<<r|s,Ft=a+e}else Gt=1<<a|i<<r|s,Ft=e}function Ka(e){e.return!==null&&(ei(e,1),Fc(e,1,0))}function Ya(e){for(;e===dn;)dn=ks[--Ms],ks[Ms]=null,dr=ks[--Ms],ks[Ms]=null;for(;e===Si;)Si=Nt[--zt],Nt[zt]=null,Ft=Nt[--zt],Nt[zt]=null,Gt=Nt[--zt],Nt[zt]=null}function Xc(e,t){Nt[zt++]=Gt,Nt[zt++]=Ft,Nt[zt++]=Si,Gt=t.id,Ft=t.overflow,Si=e}var at=null,Ie=null,Te=!1,yi=null,jt=!1,Ga=Error(L(519));function bi(e){var t=Error(L(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _r(Ht(t,e)),Ga}function Vc(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[nt]=e,t[_t]=s,i){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(i=0;i<Nr.length;i++)xe(Nr[i],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),oc(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),uc(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||df(t.textContent,i)?(s.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),s.onScroll!=null&&xe("scroll",t),s.onScrollEnd!=null&&xe("scrollend",t),s.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||bi(e,!0)}function $c(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:jt=!1;return;case 27:case 3:jt=!0;return;default:at=at.return}}function Ls(e){if(e!==at)return!1;if(!Te)return $c(e),Te=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||uo(e.type,e.memoizedProps)),i=!i),i&&Ie&&bi(e),$c(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));Ie=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(317));Ie=Cf(e)}else t===27?(t=Ie,Hi(e.type)?(e=mo,mo=null,Ie=e):Ie=t):Ie=at?qt(e.stateNode.nextSibling):null;return!0}function es(){Ie=at=null,Te=!1}function Fa(){var e=yi;return e!==null&&(St===null?St=e:St.push.apply(St,e),yi=null),e}function _r(e){yi===null?yi=[e]:yi.push(e)}var Xa=A(null),ts=null,ti=null;function Ci(e,t,i){$(Xa,t._currentValue),t._currentValue=i}function ii(e){e._currentValue=Xa.current,O(Xa)}function Va(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function $a(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var a=r.dependencies;if(a!==null){var y=r.child;a=a.firstContext;e:for(;a!==null;){var k=a;a=r;for(var I=0;I<t.length;I++)if(k.context===t[I]){a.lanes|=i,k=a.alternate,k!==null&&(k.lanes|=i),Va(a.return,i,e),s||(y=null);break e}a=k.next}}else if(r.tag===18){if(y=r.return,y===null)throw Error(L(341));y.lanes|=i,a=y.alternate,a!==null&&(a.lanes|=i),Va(y,i,e),y=null}else y=r.child;if(y!==null)y.return=r;else for(y=r;y!==null;){if(y===e){y=null;break}if(r=y.sibling,r!==null){r.return=y.return,y=r;break}y=y.return}r=y}}function Os(e,t,i,s){e=null;for(var r=t,a=!1;r!==null;){if(!a){if((r.flags&524288)!==0)a=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var y=r.alternate;if(y===null)throw Error(L(387));if(y=y.memoizedProps,y!==null){var k=r.type;Et(r.pendingProps.value,y.value)||(e!==null?e.push(k):e=[k])}}else if(r===z.current){if(y=r.alternate,y===null)throw Error(L(387));y.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Ir):e=[Ir])}r=r.return}e!==null&&$a(t,e,i,s),t.flags|=262144}function _n(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function is(e){ts=e,ti=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return Zc(ts,e)}function vn(e,t){return ts===null&&is(e),Zc(e,t)}function Zc(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ti===null){if(e===null)throw Error(L(308));ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ti=ti.next=t;return i}var S_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},y_=T.unstable_scheduleCallback,b_=T.unstable_NormalPriority,$e={$$typeof:l,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Za(){return{controller:new S_,data:new Map,refCount:0}}function vr(e){e.refCount--,e.refCount===0&&y_(b_,function(){e.controller.abort()})}var mr=null,Qa=0,Bs=0,Hs=null;function C_(e,t){if(mr===null){var i=mr=[];Qa=0,Bs=to(),Hs={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Qa++,t.then(Qc,Qc),t}function Qc(){if(--Qa===0&&mr!==null){Hs!==null&&(Hs.status="fulfilled");var e=mr;mr=null,Bs=0,Hs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function w_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var Jc=W.S;W.S=function(e,t){Nh=et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&C_(e,t),Jc!==null&&Jc(e,t)};var ss=A(null);function Ja(){var e=ss.current;return e!==null?e:je.pooledCache}function mn(e,t){t===null?$(ss,ss.current):$(ss,t.pool)}function eu(){var e=Ja();return e===null?null:{parent:$e._currentValue,pool:e}}var Ns=Error(L(460)),el=Error(L(474)),pn=Error(L(542)),gn={then:function(){}};function tu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function iu(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Zt,Zt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ru(e),e;default:if(typeof t.status=="string")t.then(Zt,Zt);else{if(e=je,e!==null&&100<e.shellSuspendCounter)throw Error(L(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ru(e),e}throw ns=t,Ns}}function rs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(ns=i,Ns):i}}var ns=null;function su(){if(ns===null)throw Error(L(459));var e=ns;return ns=null,e}function ru(e){if(e===Ns||e===pn)throw Error(L(483))}var zs=null,pr=0;function Sn(e){var t=pr;return pr+=1,zs===null&&(zs=[]),iu(zs,e,t)}function gr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function yn(e,t){throw t.$$typeof===p?Error(L(525)):(e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nu(e){function t(V,K){if(e){var Z=V.deletions;Z===null?(V.deletions=[K],V.flags|=16):Z.push(K)}}function i(V,K){if(!e)return null;for(;K!==null;)t(V,K),K=K.sibling;return null}function s(V){for(var K=new Map;V!==null;)V.key!==null?K.set(V.key,V):K.set(V.index,V),V=V.sibling;return K}function r(V,K){return V=Jt(V,K),V.index=0,V.sibling=null,V}function a(V,K,Z){return V.index=Z,e?(Z=V.alternate,Z!==null?(Z=Z.index,Z<K?(V.flags|=67108866,K):Z):(V.flags|=67108866,K)):(V.flags|=1048576,K)}function y(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function k(V,K,Z,he){return K===null||K.tag!==6?(K=Wa(Z,V.mode,he),K.return=V,K):(K=r(K,Z),K.return=V,K)}function I(V,K,Z,he){var pe=Z.type;return pe===m?ue(V,K,Z.props.children,he,Z.key):K!==null&&(K.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===v&&rs(pe)===K.type)?(K=r(K,Z.props),gr(K,Z),K.return=V,K):(K=fn(Z.type,Z.key,Z.props,null,V.mode,he),gr(K,Z),K.return=V,K)}function Q(V,K,Z,he){return K===null||K.tag!==4||K.stateNode.containerInfo!==Z.containerInfo||K.stateNode.implementation!==Z.implementation?(K=Pa(Z,V.mode,he),K.return=V,K):(K=r(K,Z.children||[]),K.return=V,K)}function ue(V,K,Z,he,pe){return K===null||K.tag!==7?(K=Ji(Z,V.mode,he,pe),K.return=V,K):(K=r(K,Z),K.return=V,K)}function fe(V,K,Z){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Wa(""+K,V.mode,Z),K.return=V,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return Z=fn(K.type,K.key,K.props,null,V.mode,Z),gr(Z,K),Z.return=V,Z;case E:return K=Pa(K,V.mode,Z),K.return=V,K;case v:return K=rs(K),fe(V,K,Z)}if(ce(K)||j(K))return K=Ji(K,V.mode,Z,null),K.return=V,K;if(typeof K.then=="function")return fe(V,Sn(K),Z);if(K.$$typeof===l)return fe(V,vn(V,K),Z);yn(V,K)}return null}function ee(V,K,Z,he){var pe=K!==null?K.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pe!==null?null:k(V,K,""+Z,he);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===pe?I(V,K,Z,he):null;case E:return Z.key===pe?Q(V,K,Z,he):null;case v:return Z=rs(Z),ee(V,K,Z,he)}if(ce(Z)||j(Z))return pe!==null?null:ue(V,K,Z,he,null);if(typeof Z.then=="function")return ee(V,K,Sn(Z),he);if(Z.$$typeof===l)return ee(V,K,vn(V,Z),he);yn(V,Z)}return null}function ne(V,K,Z,he,pe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return V=V.get(Z)||null,k(K,V,""+he,pe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case b:return V=V.get(he.key===null?Z:he.key)||null,I(K,V,he,pe);case E:return V=V.get(he.key===null?Z:he.key)||null,Q(K,V,he,pe);case v:return he=rs(he),ne(V,K,Z,he,pe)}if(ce(he)||j(he))return V=V.get(Z)||null,ue(K,V,he,pe,null);if(typeof he.then=="function")return ne(V,K,Z,Sn(he),pe);if(he.$$typeof===l)return ne(V,K,Z,vn(K,he),pe);yn(K,he)}return null}function ve(V,K,Z,he){for(var pe=null,Re=null,me=K,Ce=K=0,De=null;me!==null&&Ce<Z.length;Ce++){me.index>Ce?(De=me,me=null):De=me.sibling;var ke=ee(V,me,Z[Ce],he);if(ke===null){me===null&&(me=De);break}e&&me&&ke.alternate===null&&t(V,me),K=a(ke,K,Ce),Re===null?pe=ke:Re.sibling=ke,Re=ke,me=De}if(Ce===Z.length)return i(V,me),Te&&ei(V,Ce),pe;if(me===null){for(;Ce<Z.length;Ce++)me=fe(V,Z[Ce],he),me!==null&&(K=a(me,K,Ce),Re===null?pe=me:Re.sibling=me,Re=me);return Te&&ei(V,Ce),pe}for(me=s(me);Ce<Z.length;Ce++)De=ne(me,V,Ce,Z[Ce],he),De!==null&&(e&&De.alternate!==null&&me.delete(De.key===null?Ce:De.key),K=a(De,K,Ce),Re===null?pe=De:Re.sibling=De,Re=De);return e&&me.forEach(function(qi){return t(V,qi)}),Te&&ei(V,Ce),pe}function ge(V,K,Z,he){if(Z==null)throw Error(L(151));for(var pe=null,Re=null,me=K,Ce=K=0,De=null,ke=Z.next();me!==null&&!ke.done;Ce++,ke=Z.next()){me.index>Ce?(De=me,me=null):De=me.sibling;var qi=ee(V,me,ke.value,he);if(qi===null){me===null&&(me=De);break}e&&me&&qi.alternate===null&&t(V,me),K=a(qi,K,Ce),Re===null?pe=qi:Re.sibling=qi,Re=qi,me=De}if(ke.done)return i(V,me),Te&&ei(V,Ce),pe;if(me===null){for(;!ke.done;Ce++,ke=Z.next())ke=fe(V,ke.value,he),ke!==null&&(K=a(ke,K,Ce),Re===null?pe=ke:Re.sibling=ke,Re=ke);return Te&&ei(V,Ce),pe}for(me=s(me);!ke.done;Ce++,ke=Z.next())ke=ne(me,V,Ce,ke.value,he),ke!==null&&(e&&ke.alternate!==null&&me.delete(ke.key===null?Ce:ke.key),K=a(ke,K,Ce),Re===null?pe=ke:Re.sibling=ke,Re=ke);return e&&me.forEach(function(Bv){return t(V,Bv)}),Te&&ei(V,Ce),pe}function ze(V,K,Z,he){if(typeof Z=="object"&&Z!==null&&Z.type===m&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var pe=Z.key;K!==null;){if(K.key===pe){if(pe=Z.type,pe===m){if(K.tag===7){i(V,K.sibling),he=r(K,Z.props.children),he.return=V,V=he;break e}}else if(K.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===v&&rs(pe)===K.type){i(V,K.sibling),he=r(K,Z.props),gr(he,Z),he.return=V,V=he;break e}i(V,K);break}else t(V,K);K=K.sibling}Z.type===m?(he=Ji(Z.props.children,V.mode,he,Z.key),he.return=V,V=he):(he=fn(Z.type,Z.key,Z.props,null,V.mode,he),gr(he,Z),he.return=V,V=he)}return y(V);case E:e:{for(pe=Z.key;K!==null;){if(K.key===pe)if(K.tag===4&&K.stateNode.containerInfo===Z.containerInfo&&K.stateNode.implementation===Z.implementation){i(V,K.sibling),he=r(K,Z.children||[]),he.return=V,V=he;break e}else{i(V,K);break}else t(V,K);K=K.sibling}he=Pa(Z,V.mode,he),he.return=V,V=he}return y(V);case v:return Z=rs(Z),ze(V,K,Z,he)}if(ce(Z))return ve(V,K,Z,he);if(j(Z)){if(pe=j(Z),typeof pe!="function")throw Error(L(150));return Z=pe.call(Z),ge(V,K,Z,he)}if(typeof Z.then=="function")return ze(V,K,Sn(Z),he);if(Z.$$typeof===l)return ze(V,K,vn(V,Z),he);yn(V,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,K!==null&&K.tag===6?(i(V,K.sibling),he=r(K,Z),he.return=V,V=he):(i(V,K),he=Wa(Z,V.mode,he),he.return=V,V=he),y(V)):i(V,K)}return function(V,K,Z,he){try{pr=0;var pe=ze(V,K,Z,he);return zs=null,pe}catch(me){if(me===Ns||me===pn)throw me;var Re=xt(29,me,null,V.mode);return Re.lanes=he,Re.return=V,Re}finally{}}}var as=nu(!0),au=nu(!1),wi=!1;function tl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function il(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 Ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xi(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Me&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=hn(e),Pc(e,null,i),t}return un(e,s,t,i),hn(e)}function Sr(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Zo(e,i)}}function sl(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,a=null;if(i=i.firstBaseUpdate,i!==null){do{var y={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};a===null?r=a=y:a=a.next=y,i=i.next}while(i!==null);a===null?r=a=t:a=a.next=t}else r=a=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var rl=!1;function yr(){if(rl){var e=Hs;if(e!==null)throw e}}function br(e,t,i,s){rl=!1;var r=e.updateQueue;wi=!1;var a=r.firstBaseUpdate,y=r.lastBaseUpdate,k=r.shared.pending;if(k!==null){r.shared.pending=null;var I=k,Q=I.next;I.next=null,y===null?a=Q:y.next=Q,y=I;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,k=ue.lastBaseUpdate,k!==y&&(k===null?ue.firstBaseUpdate=Q:k.next=Q,ue.lastBaseUpdate=I))}if(a!==null){var fe=r.baseState;y=0,ue=Q=I=null,k=a;do{var ee=k.lane&-536870913,ne=ee!==k.lane;if(ne?(Ae&ee)===ee:(s&ee)===ee){ee!==0&&ee===Bs&&(rl=!0),ue!==null&&(ue=ue.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ve=e,ge=k;ee=t;var ze=i;switch(ge.tag){case 1:if(ve=ge.payload,typeof ve=="function"){fe=ve.call(ze,fe,ee);break e}fe=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ge.payload,ee=typeof ve=="function"?ve.call(ze,fe,ee):ve,ee==null)break e;fe=h({},fe,ee);break e;case 2:wi=!0}}ee=k.callback,ee!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=r.callbacks,ne===null?r.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ue===null?(Q=ue=ne,I=fe):ue=ue.next=ne,y|=ee;if(k=k.next,k===null){if(k=r.shared.pending,k===null)break;ne=k,k=ne.next,ne.next=null,r.lastBaseUpdate=ne,r.shared.pending=null}}while(!0);ue===null&&(I=fe),r.baseState=I,r.firstBaseUpdate=Q,r.lastBaseUpdate=ue,a===null&&(r.shared.lanes=0),ki|=y,e.lanes=y,e.memoizedState=fe}}function lu(e,t){if(typeof e!="function")throw Error(L(191,e));e.call(t)}function ou(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)lu(i[e],t)}var js=A(null),bn=A(0);function cu(e,t){e=hi,$(bn,e),$(js,t),hi=e|t.baseLanes}function nl(){$(bn,hi),$(js,js.current)}function al(){hi=bn.current,O(js),O(bn)}var At=A(null),Ut=null;function Ai(e){var t=e.alternate;$(Fe,Fe.current&1),$(At,e),Ut===null&&(t===null||js.current!==null||t.memoizedState!==null)&&(Ut=e)}function ll(e){$(Fe,Fe.current),$(At,e),Ut===null&&(Ut=e)}function uu(e){e.tag===22?($(Fe,Fe.current),$(At,e),Ut===null&&(Ut=e)):Di()}function Di(){$(Fe,Fe.current),$(At,At.current)}function Dt(e){O(At),Ut===e&&(Ut=null),O(Fe)}var Fe=A(0);function Cn(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||_o(i)||vo(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 si=0,be=null,He=null,Ze=null,wn=!1,Us=!1,ls=!1,En=0,Cr=0,qs=null,E_=0;function Ye(){throw Error(L(321))}function ol(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Et(e[i],t[i]))return!1;return!0}function cl(e,t,i,s,r,a){return si=a,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?Fu:El,ls=!1,a=i(s,r),ls=!1,Us&&(a=fu(t,i,s,r)),hu(e),a}function hu(e){W.H=xr;var t=He!==null&&He.next!==null;if(si=0,Ze=He=be=null,wn=!1,Cr=0,qs=null,t)throw Error(L(300));e===null||Qe||(e=e.dependencies,e!==null&&_n(e)&&(Qe=!0))}function fu(e,t,i,s){be=e;var r=0;do{if(Us&&(qs=null),Cr=0,Us=!1,25<=r)throw Error(L(301));if(r+=1,Ze=He=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}W.H=Xu,a=t(i,s)}while(Us);return a}function x_(){var e=W.H,t=e.useState()[0];return t=typeof t.then=="function"?wr(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(be.flags|=1024),t}function ul(){var e=En!==0;return En=0,e}function hl(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function fl(e){if(wn){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wn=!1}si=0,Ze=He=be=null,Us=!1,Cr=En=0,qs=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?be.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(He===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Ze===null?be.memoizedState:Ze.next;if(t!==null)Ze=t,He=e;else{if(e===null)throw be.alternate===null?Error(L(467)):Error(L(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Ze===null?be.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function xn(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wr(e){var t=Cr;return Cr+=1,qs===null&&(qs=[]),e=iu(qs,e,t),t=be,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?Fu:El),e}function An(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wr(e);if(e.$$typeof===l)return lt(e)}throw Error(L(438,String(e)))}function dl(e){var t=null,i=be.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=xn(),be.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=B;return t.index++,i}function ri(e,t){return typeof t=="function"?t(e):t}function Dn(e){var t=Xe();return _l(t,He,e)}function _l(e,t,i){var s=e.queue;if(s===null)throw Error(L(311));s.lastRenderedReducer=i;var r=e.baseQueue,a=s.pending;if(a!==null){if(r!==null){var y=r.next;r.next=a.next,a.next=y}t.baseQueue=r=a,s.pending=null}if(a=e.baseState,r===null)e.memoizedState=a;else{t=r.next;var k=y=null,I=null,Q=t,ue=!1;do{var fe=Q.lane&-536870913;if(fe!==Q.lane?(Ae&fe)===fe:(si&fe)===fe){var ee=Q.revertLane;if(ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),fe===Bs&&(ue=!0);else if((si&ee)===ee){Q=Q.next,ee===Bs&&(ue=!0);continue}else fe={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},I===null?(k=I=fe,y=a):I=I.next=fe,be.lanes|=ee,ki|=ee;fe=Q.action,ls&&i(a,fe),a=Q.hasEagerState?Q.eagerState:i(a,fe)}else ee={lane:fe,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},I===null?(k=I=ee,y=a):I=I.next=ee,be.lanes|=fe,ki|=fe;Q=Q.next}while(Q!==null&&Q!==t);if(I===null?y=a:I.next=k,!Et(a,e.memoizedState)&&(Qe=!0,ue&&(i=Hs,i!==null)))throw i;e.memoizedState=a,e.baseState=y,e.baseQueue=I,s.lastRenderedState=a}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function vl(e){var t=Xe(),i=t.queue;if(i===null)throw Error(L(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,a=t.memoizedState;if(r!==null){i.pending=null;var y=r=r.next;do a=e(a,y.action),y=y.next;while(y!==r);Et(a,t.memoizedState)||(Qe=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),i.lastRenderedState=a}return[a,s]}function du(e,t,i){var s=be,r=Xe(),a=Te;if(a){if(i===void 0)throw Error(L(407));i=i()}else i=t();var y=!Et((He||r).memoizedState,i);if(y&&(r.memoizedState=i,Qe=!0),r=r.queue,gl(mu.bind(null,s,r,e),[e]),r.getSnapshot!==t||y||Ze!==null&&Ze.memoizedState.tag&1){if(s.flags|=2048,Is(9,{destroy:void 0},vu.bind(null,s,r,i,t),null),je===null)throw Error(L(349));a||(si&127)!==0||_u(s,t,i)}return i}function _u(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=be.updateQueue,t===null?(t=xn(),be.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function vu(e,t,i,s){t.value=i,t.getSnapshot=s,pu(t)&&gu(e)}function mu(e,t,i){return i(function(){pu(t)&&gu(e)})}function pu(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Et(e,i)}catch{return!0}}function gu(e){var t=Qi(e,2);t!==null&&yt(t,e,2)}function ml(e){var t=ft();if(typeof e=="function"){var i=e;if(e=i(),ls){mi(!0);try{i()}finally{mi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:e},t}function Su(e,t,i,s){return e.baseState=i,_l(e,He,typeof s=="function"?s:ri)}function A_(e,t,i,s,r){if(kn(e))throw Error(L(485));if(e=t.action,e!==null){var a={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){a.listeners.push(y)}};W.T!==null?i(!0):a.isTransition=!1,s(a),i=t.pending,i===null?(a.next=t.pending=a,yu(t,a)):(a.next=i.next,t.pending=i.next=a)}}function yu(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var a=W.T,y={};W.T=y;try{var k=i(r,s),I=W.S;I!==null&&I(y,k),bu(e,t,k)}catch(Q){pl(e,t,Q)}finally{a!==null&&y.types!==null&&(a.types=y.types),W.T=a}}else try{a=i(r,s),bu(e,t,a)}catch(Q){pl(e,t,Q)}}function bu(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Cu(e,t,s)},function(s){return pl(e,t,s)}):Cu(e,t,i)}function Cu(e,t,i){t.status="fulfilled",t.value=i,wu(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,yu(e,i)))}function pl(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,wu(t),t=t.next;while(t!==s)}e.action=null}function wu(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Eu(e,t){return t}function xu(e,t){if(Te){var i=je.formState;if(i!==null){e:{var s=be;if(Te){if(Ie){t:{for(var r=Ie,a=jt;r.nodeType!==8;){if(!a){r=null;break t}if(r=qt(r.nextSibling),r===null){r=null;break t}}a=r.data,r=a==="F!"||a==="F"?r:null}if(r){Ie=qt(r.nextSibling),s=r.data==="F!";break e}}bi(s)}s=!1}s&&(t=i[0])}}return i=ft(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eu,lastRenderedState:t},i.queue=s,i=Ku.bind(null,be,s),s.dispatch=i,s=ml(!1),a=wl.bind(null,be,!1,s.queue),s=ft(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=A_.bind(null,be,r,a,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function Au(e){var t=Xe();return Du(t,He,e)}function Du(e,t,i){if(t=_l(e,t,Eu)[0],e=Dn(ri)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=wr(t)}catch(y){throw y===Ns?pn:y}else s=t;t=Xe();var r=t.queue,a=r.dispatch;return i!==t.memoizedState&&(be.flags|=2048,Is(9,{destroy:void 0},D_.bind(null,r,i),null)),[s,a,e]}function D_(e,t){e.action=t}function Tu(e){var t=Xe(),i=He;if(i!==null)return Du(t,i,e);Xe(),t=t.memoizedState,i=Xe();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Is(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=be.updateQueue,t===null&&(t=xn(),be.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Ru(){return Xe().memoizedState}function Tn(e,t,i,s){var r=ft();be.flags|=e,r.memoizedState=Is(1|t,{destroy:void 0},i,s===void 0?null:s)}function Rn(e,t,i,s){var r=Xe();s=s===void 0?null:s;var a=r.memoizedState.inst;He!==null&&s!==null&&ol(s,He.memoizedState.deps)?r.memoizedState=Is(t,a,i,s):(be.flags|=e,r.memoizedState=Is(1|t,a,i,s))}function ku(e,t){Tn(8390656,8,e,t)}function gl(e,t){Rn(2048,8,e,t)}function T_(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=xn(),be.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Mu(e){var t=Xe().memoizedState;return T_({ref:t,nextImpl:e}),function(){if((Me&2)!==0)throw Error(L(440));return t.impl.apply(void 0,arguments)}}function Lu(e,t){return Rn(4,2,e,t)}function Ou(e,t){return Rn(4,4,e,t)}function Bu(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 Hu(e,t,i){i=i!=null?i.concat([e]):null,Rn(4,4,Bu.bind(null,t,e),i)}function Sl(){}function Nu(e,t){var i=Xe();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&ol(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function zu(e,t){var i=Xe();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&ol(t,s[1]))return s[0];if(s=e(),ls){mi(!0);try{e()}finally{mi(!1)}}return i.memoizedState=[s,t],s}function yl(e,t,i){return i===void 0||(si&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=jh(),be.lanes|=e,ki|=e,i)}function ju(e,t,i,s){return Et(i,t)?i:js.current!==null?(e=yl(e,i,s),Et(e,t)||(Qe=!0),e):(si&42)===0||(si&1073741824)!==0&&(Ae&261930)===0?(Qe=!0,e.memoizedState=i):(e=jh(),be.lanes|=e,ki|=e,t)}function Uu(e,t,i,s,r){var a=X.p;X.p=a!==0&&8>a?a:8;var y=W.T,k={};W.T=k,wl(e,!1,t,i);try{var I=r(),Q=W.S;if(Q!==null&&Q(k,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ue=w_(I,s);Er(e,t,ue,kt(e))}else Er(e,t,s,kt(e))}catch(fe){Er(e,t,{then:function(){},status:"rejected",reason:fe},kt())}finally{X.p=a,y!==null&&k.types!==null&&(y.types=k.types),W.T=y}}function R_(){}function bl(e,t,i,s){if(e.tag!==5)throw Error(L(476));var r=qu(e).queue;Uu(e,r,t,re,i===null?R_:function(){return Iu(e),i(s)})}function qu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:re},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Iu(e){var t=qu(e);t.next===null&&(t=e.alternate.memoizedState),Er(e,t.next.queue,{},kt())}function Cl(){return lt(Ir)}function Wu(){return Xe().memoizedState}function Pu(){return Xe().memoizedState}function k_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=kt();e=Ei(i);var s=xi(t,e,i);s!==null&&(yt(s,t,i),Sr(s,t,i)),t={cache:Za()},e.payload=t;return}t=t.return}}function M_(e,t,i){var s=kt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},kn(e)?Yu(t,i):(i=qa(e,t,i,s),i!==null&&(yt(i,e,s),Gu(i,t,s)))}function Ku(e,t,i){var s=kt();Er(e,t,i,s)}function Er(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(kn(e))Yu(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var y=t.lastRenderedState,k=a(y,i);if(r.hasEagerState=!0,r.eagerState=k,Et(k,y))return un(e,t,r,0),je===null&&cn(),!1}catch{}finally{}if(i=qa(e,t,r,s),i!==null)return yt(i,e,s),Gu(i,t,s),!0}return!1}function wl(e,t,i,s){if(s={lane:2,revertLane:to(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},kn(e)){if(t)throw Error(L(479))}else t=qa(e,i,s,2),t!==null&&yt(t,e,2)}function kn(e){var t=e.alternate;return e===be||t!==null&&t===be}function Yu(e,t){Us=wn=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Gu(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Zo(e,i)}}var xr={readContext:lt,use:An,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};xr.useEffectEvent=Ye;var Fu={readContext:lt,use:An,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:ku,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Tn(4194308,4,Bu.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Tn(4194308,4,e,t)},useInsertionEffect:function(e,t){Tn(4,2,e,t)},useMemo:function(e,t){var i=ft();t=t===void 0?null:t;var s=e();if(ls){mi(!0);try{e()}finally{mi(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ft();if(i!==void 0){var r=i(t);if(ls){mi(!0);try{i(t)}finally{mi(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=M_.bind(null,be,e),[s.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=ml(e);var t=e.queue,i=Ku.bind(null,be,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Sl,useDeferredValue:function(e,t){var i=ft();return yl(i,e,t)},useTransition:function(){var e=ml(!1);return e=Uu.bind(null,be,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=be,r=ft();if(Te){if(i===void 0)throw Error(L(407));i=i()}else{if(i=t(),je===null)throw Error(L(349));(Ae&127)!==0||_u(s,t,i)}r.memoizedState=i;var a={value:i,getSnapshot:t};return r.queue=a,ku(mu.bind(null,s,a,e),[e]),s.flags|=2048,Is(9,{destroy:void 0},vu.bind(null,s,a,i,t),null),i},useId:function(){var e=ft(),t=je.identifierPrefix;if(Te){var i=Ft,s=Gt;i=(s&~(1<<32-wt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=En++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=E_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Cl,useFormState:xu,useActionState:xu,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=wl.bind(null,be,!0,i),i.dispatch=t,[e,t]},useMemoCache:dl,useCacheRefresh:function(){return ft().memoizedState=k_.bind(null,be)},useEffectEvent:function(e){var t=ft(),i={impl:e};return t.memoizedState=i,function(){if((Me&2)!==0)throw Error(L(440));return i.impl.apply(void 0,arguments)}}},El={readContext:lt,use:An,useCallback:Nu,useContext:lt,useEffect:gl,useImperativeHandle:Hu,useInsertionEffect:Lu,useLayoutEffect:Ou,useMemo:zu,useReducer:Dn,useRef:Ru,useState:function(){return Dn(ri)},useDebugValue:Sl,useDeferredValue:function(e,t){var i=Xe();return ju(i,He.memoizedState,e,t)},useTransition:function(){var e=Dn(ri)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:wr(e),t]},useSyncExternalStore:du,useId:Wu,useHostTransitionStatus:Cl,useFormState:Au,useActionState:Au,useOptimistic:function(e,t){var i=Xe();return Su(i,He,e,t)},useMemoCache:dl,useCacheRefresh:Pu};El.useEffectEvent=Mu;var Xu={readContext:lt,use:An,useCallback:Nu,useContext:lt,useEffect:gl,useImperativeHandle:Hu,useInsertionEffect:Lu,useLayoutEffect:Ou,useMemo:zu,useReducer:vl,useRef:Ru,useState:function(){return vl(ri)},useDebugValue:Sl,useDeferredValue:function(e,t){var i=Xe();return He===null?yl(i,e,t):ju(i,He.memoizedState,e,t)},useTransition:function(){var e=vl(ri)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:wr(e),t]},useSyncExternalStore:du,useId:Wu,useHostTransitionStatus:Cl,useFormState:Tu,useActionState:Tu,useOptimistic:function(e,t){var i=Xe();return He!==null?Su(i,He,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:dl,useCacheRefresh:Pu};Xu.useEffectEvent=Mu;function xl(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:h({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Al={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=kt(),r=Ei(s);r.payload=t,i!=null&&(r.callback=i),t=xi(e,r,s),t!==null&&(yt(t,e,s),Sr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=kt(),r=Ei(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=xi(e,r,s),t!==null&&(yt(t,e,s),Sr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=kt(),s=Ei(i);s.tag=2,t!=null&&(s.callback=t),t=xi(e,s,i),t!==null&&(yt(t,e,i),Sr(t,e,i))}};function Vu(e,t,i,s,r,a,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,y):t.prototype&&t.prototype.isPureReactComponent?!hr(i,s)||!hr(r,a):!0}function $u(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Al.enqueueReplaceState(t,t.state,null)}function os(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=h({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function Zu(e){on(e)}function Qu(e){console.error(e)}function Ju(e){on(e)}function Mn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function eh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Dl(e,t,i){return i=Ei(i),i.tag=3,i.payload={element:null},i.callback=function(){Mn(e,t)},i}function th(e){return e=Ei(e),e.tag=3,e}function ih(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var a=s.value;e.payload=function(){return r(a)},e.callback=function(){eh(t,i,s)}}var y=i.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){eh(t,i,s),typeof r!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var k=s.stack;this.componentDidCatch(s.value,{componentStack:k!==null?k:""})})}function L_(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Os(t,i,r,!0),i=At.current,i!==null){switch(i.tag){case 31:case 13:return Ut===null?Pn():i.alternate===null&&Ge===0&&(Ge=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===gn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Ql(e,s,r)),!1;case 22:return i.flags|=65536,s===gn?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Ql(e,s,r)),!1}throw Error(L(435,i.tag))}return Ql(e,s,r),Pn(),!1}if(Te)return t=At.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Ga&&(e=Error(L(422),{cause:s}),_r(Ht(e,i)))):(s!==Ga&&(t=Error(L(423),{cause:s}),_r(Ht(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Ht(s,i),r=Dl(e.stateNode,s,r),sl(e,r),Ge!==4&&(Ge=2)),!1;var a=Error(L(520),{cause:s});if(a=Ht(a,i),Or===null?Or=[a]:Or.push(a),Ge!==4&&(Ge=2),t===null)return!0;s=Ht(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=Dl(i.stateNode,s,e),sl(i,e),!1;case 1:if(t=i.type,a=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(Mi===null||!Mi.has(a))))return i.flags|=65536,r&=-r,i.lanes|=r,r=th(r),ih(r,e,i,s),sl(i,r),!1}i=i.return}while(i!==null);return!1}var Tl=Error(L(461)),Qe=!1;function ot(e,t,i,s){t.child=e===null?au(t,null,i,s):as(t,e.child,i,s)}function sh(e,t,i,s,r){i=i.render;var a=t.ref;if("ref"in s){var y={};for(var k in s)k!=="ref"&&(y[k]=s[k])}else y=s;return is(t),s=cl(e,t,i,y,a,r),k=ul(),e!==null&&!Qe?(hl(e,t,r),ni(e,t,r)):(Te&&k&&Ka(t),t.flags|=1,ot(e,t,s,r),t.child)}function rh(e,t,i,s,r){if(e===null){var a=i.type;return typeof a=="function"&&!Ia(a)&&a.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=a,nh(e,t,a,s,r)):(e=fn(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nl(e,r)){var y=a.memoizedProps;if(i=i.compare,i=i!==null?i:hr,i(y,s)&&e.ref===t.ref)return ni(e,t,r)}return t.flags|=1,e=Jt(a,s),e.ref=t.ref,e.return=t,t.child=e}function nh(e,t,i,s,r){if(e!==null){var a=e.memoizedProps;if(hr(a,s)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=s=a,Nl(e,r))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,ni(e,t,r)}return Rl(e,t,i,s,r)}function ah(e,t,i,s){var r=s.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(a=a!==null?a.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~a}else s=0,t.child=null;return lh(e,t,a,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mn(t,a!==null?a.cachePool:null),a!==null?cu(t,a):nl(),uu(t);else return s=t.lanes=536870912,lh(e,t,a!==null?a.baseLanes|i:i,i,s)}else a!==null?(mn(t,a.cachePool),cu(t,a),Di(),t.memoizedState=null):(e!==null&&mn(t,null),nl(),Di());return ot(e,t,r,i),t.child}function Ar(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lh(e,t,i,s,r){var a=Ja();return a=a===null?null:{parent:$e._currentValue,pool:a},t.memoizedState={baseLanes:i,cachePool:a},e!==null&&mn(t,null),nl(),uu(t),e!==null&&Os(e,t,s,!0),t.childLanes=r,null}function Ln(e,t){return t=Bn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function oh(e,t,i){return as(t,e.child,null,i),e=Ln(t,t.pendingProps),e.flags|=2,Dt(t),t.memoizedState=null,e}function O_(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Te){if(s.mode==="hidden")return e=Ln(t,s),t.lanes=536870912,Ar(null,e);if(ll(t),(e=Ie)?(e=bf(e,jt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si!==null?{id:Gt,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},i=Yc(e),i.return=t,t.child=i,at=t,Ie=null)):e=null,e===null)throw bi(t);return t.lanes=536870912,null}return Ln(t,s)}var a=e.memoizedState;if(a!==null){var y=a.dehydrated;if(ll(t),r)if(t.flags&256)t.flags&=-257,t=oh(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(L(558));else if(Qe||Os(e,t,i,!1),r=(i&e.childLanes)!==0,Qe||r){if(s=je,s!==null&&(y=Qo(s,i),y!==0&&y!==a.retryLane))throw a.retryLane=y,Qi(e,y),yt(s,e,y),Tl;Pn(),t=oh(e,t,i)}else e=a.treeContext,Ie=qt(y.nextSibling),at=t,Te=!0,yi=null,jt=!1,e!==null&&Xc(t,e),t=Ln(t,s),t.flags|=4096;return t}return e=Jt(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function On(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(L(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Rl(e,t,i,s,r){return is(t),i=cl(e,t,i,s,void 0,r),s=ul(),e!==null&&!Qe?(hl(e,t,r),ni(e,t,r)):(Te&&s&&Ka(t),t.flags|=1,ot(e,t,i,r),t.child)}function ch(e,t,i,s,r,a){return is(t),t.updateQueue=null,i=fu(t,s,i,r),hu(e),s=ul(),e!==null&&!Qe?(hl(e,t,a),ni(e,t,a)):(Te&&s&&Ka(t),t.flags|=1,ot(e,t,i,a),t.child)}function uh(e,t,i,s,r){if(is(t),t.stateNode===null){var a=Rs,y=i.contextType;typeof y=="object"&&y!==null&&(a=lt(y)),a=new i(s,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Al,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=s,a.state=t.memoizedState,a.refs={},tl(t),y=i.contextType,a.context=typeof y=="object"&&y!==null?lt(y):Rs,a.state=t.memoizedState,y=i.getDerivedStateFromProps,typeof y=="function"&&(xl(t,i,y,s),a.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(y=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),y!==a.state&&Al.enqueueReplaceState(a,a.state,null),br(t,s,a,r),yr(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){a=t.stateNode;var k=t.memoizedProps,I=os(i,k);a.props=I;var Q=a.context,ue=i.contextType;y=Rs,typeof ue=="object"&&ue!==null&&(y=lt(ue));var fe=i.getDerivedStateFromProps;ue=typeof fe=="function"||typeof a.getSnapshotBeforeUpdate=="function",k=t.pendingProps!==k,ue||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(k||Q!==y)&&$u(t,a,s,y),wi=!1;var ee=t.memoizedState;a.state=ee,br(t,s,a,r),yr(),Q=t.memoizedState,k||ee!==Q||wi?(typeof fe=="function"&&(xl(t,i,fe,s),Q=t.memoizedState),(I=wi||Vu(t,i,I,s,ee,Q,y))?(ue||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=Q),a.props=s,a.state=Q,a.context=y,s=I):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,il(e,t),y=t.memoizedProps,ue=os(i,y),a.props=ue,fe=t.pendingProps,ee=a.context,Q=i.contextType,I=Rs,typeof Q=="object"&&Q!==null&&(I=lt(Q)),k=i.getDerivedStateFromProps,(Q=typeof k=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(y!==fe||ee!==I)&&$u(t,a,s,I),wi=!1,ee=t.memoizedState,a.state=ee,br(t,s,a,r),yr();var ne=t.memoizedState;y!==fe||ee!==ne||wi||e!==null&&e.dependencies!==null&&_n(e.dependencies)?(typeof k=="function"&&(xl(t,i,k,s),ne=t.memoizedState),(ue=wi||Vu(t,i,ue,s,ee,ne,I)||e!==null&&e.dependencies!==null&&_n(e.dependencies))?(Q||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,ne,I),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,ne,I)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||y===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ne),a.props=s,a.state=ne,a.context=I,s=ue):(typeof a.componentDidUpdate!="function"||y===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),s=!1)}return a=s,On(e,t),s=(t.flags&128)!==0,a||s?(a=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&s?(t.child=as(t,e.child,null,r),t.child=as(t,null,i,r)):ot(e,t,i,r),t.memoizedState=a.state,e=t.child):e=ni(e,t,r),e}function hh(e,t,i,s){return es(),t.flags|=256,ot(e,t,i,s),t.child}var kl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ml(e){return{baseLanes:e,cachePool:eu()}}function Ll(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Rt),e}function fh(e,t,i){var s=t.pendingProps,r=!1,a=(t.flags&128)!==0,y;if((y=a)||(y=e!==null&&e.memoizedState===null?!1:(Fe.current&2)!==0),y&&(r=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Te){if(r?Ai(t):Di(),(e=Ie)?(e=bf(e,jt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si!==null?{id:Gt,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},i=Yc(e),i.return=t,t.child=i,at=t,Ie=null)):e=null,e===null)throw bi(t);return vo(e)?t.lanes=32:t.lanes=536870912,null}var k=s.children;return s=s.fallback,r?(Di(),r=t.mode,k=Bn({mode:"hidden",children:k},r),s=Ji(s,r,i,null),k.return=t,s.return=t,k.sibling=s,t.child=k,s=t.child,s.memoizedState=Ml(i),s.childLanes=Ll(e,y,i),t.memoizedState=kl,Ar(null,s)):(Ai(t),Ol(t,k))}var I=e.memoizedState;if(I!==null&&(k=I.dehydrated,k!==null)){if(a)t.flags&256?(Ai(t),t.flags&=-257,t=Bl(e,t,i)):t.memoizedState!==null?(Di(),t.child=e.child,t.flags|=128,t=null):(Di(),k=s.fallback,r=t.mode,s=Bn({mode:"visible",children:s.children},r),k=Ji(k,r,i,null),k.flags|=2,s.return=t,k.return=t,s.sibling=k,t.child=s,as(t,e.child,null,i),s=t.child,s.memoizedState=Ml(i),s.childLanes=Ll(e,y,i),t.memoizedState=kl,t=Ar(null,s));else if(Ai(t),vo(k)){if(y=k.nextSibling&&k.nextSibling.dataset,y)var Q=y.dgst;y=Q,s=Error(L(419)),s.stack="",s.digest=y,_r({value:s,source:null,stack:null}),t=Bl(e,t,i)}else if(Qe||Os(e,t,i,!1),y=(i&e.childLanes)!==0,Qe||y){if(y=je,y!==null&&(s=Qo(y,i),s!==0&&s!==I.retryLane))throw I.retryLane=s,Qi(e,s),yt(y,e,s),Tl;_o(k)||Pn(),t=Bl(e,t,i)}else _o(k)?(t.flags|=192,t.child=e.child,t=null):(e=I.treeContext,Ie=qt(k.nextSibling),at=t,Te=!0,yi=null,jt=!1,e!==null&&Xc(t,e),t=Ol(t,s.children),t.flags|=4096);return t}return r?(Di(),k=s.fallback,r=t.mode,I=e.child,Q=I.sibling,s=Jt(I,{mode:"hidden",children:s.children}),s.subtreeFlags=I.subtreeFlags&65011712,Q!==null?k=Jt(Q,k):(k=Ji(k,r,i,null),k.flags|=2),k.return=t,s.return=t,s.sibling=k,t.child=s,Ar(null,s),s=t.child,k=e.child.memoizedState,k===null?k=Ml(i):(r=k.cachePool,r!==null?(I=$e._currentValue,r=r.parent!==I?{parent:I,pool:I}:r):r=eu(),k={baseLanes:k.baseLanes|i,cachePool:r}),s.memoizedState=k,s.childLanes=Ll(e,y,i),t.memoizedState=kl,Ar(e.child,s)):(Ai(t),i=e.child,e=i.sibling,i=Jt(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=i,t.memoizedState=null,i)}function Ol(e,t){return t=Bn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bn(e,t){return e=xt(22,e,null,t),e.lanes=0,e}function Bl(e,t,i){return as(t,e.child,null,i),e=Ol(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dh(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Va(e.return,t,i)}function Hl(e,t,i,s,r,a){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:a}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=s,y.tail=i,y.tailMode=r,y.treeForkCount=a)}function _h(e,t,i){var s=t.pendingProps,r=s.revealOrder,a=s.tail;s=s.children;var y=Fe.current,k=(y&2)!==0;if(k?(y=y&1|2,t.flags|=128):y&=1,$(Fe,y),ot(e,t,s,i),s=Te?dr:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dh(e,i,t);else if(e.tag===19)dh(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(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&Cn(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),Hl(t,!1,r,i,a,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Cn(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}Hl(t,!0,i,null,a,s);break;case"together":Hl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function ni(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ki|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(L(153));if(t.child!==null){for(e=t.child,i=Jt(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Jt(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Nl(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_n(e)))}function B_(e,t,i){switch(t.tag){case 3:R(t,t.stateNode.containerInfo),Ci(t,$e,e.memoizedState.cache),es();break;case 27:case 5:oe(t);break;case 4:R(t,t.stateNode.containerInfo);break;case 10:Ci(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ll(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ai(t),t.flags|=128,null):(i&t.child.childLanes)!==0?fh(e,t,i):(Ai(t),e=ni(e,t,i),e!==null?e.sibling:null);Ai(t);break;case 19:var r=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Os(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return _h(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),$(Fe,Fe.current),s)break;return null;case 22:return t.lanes=0,ah(e,t,i,t.pendingProps);case 24:Ci(t,$e,e.memoizedState.cache)}return ni(e,t,i)}function vh(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!Nl(e,i)&&(t.flags&128)===0)return Qe=!1,B_(e,t,i);Qe=(e.flags&131072)!==0}else Qe=!1,Te&&(t.flags&1048576)!==0&&Fc(t,dr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=rs(t.elementType),t.type=e,typeof e=="function")Ia(e)?(s=os(e,s),t.tag=1,t=uh(null,t,e,s,i)):(t.tag=0,t=Rl(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===_){t.tag=11,t=sh(null,t,e,s,i);break e}else if(r===S){t.tag=14,t=rh(null,t,e,s,i);break e}}throw t=J(e)||e,Error(L(306,t,""))}}return t;case 0:return Rl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=os(s,t.pendingProps),uh(e,t,s,r,i);case 3:e:{if(R(t,t.stateNode.containerInfo),e===null)throw Error(L(387));s=t.pendingProps;var a=t.memoizedState;r=a.element,il(e,t),br(t,s,null,i);var y=t.memoizedState;if(s=y.cache,Ci(t,$e,s),s!==a.cache&&$a(t,[$e],i,!0),yr(),s=y.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=hh(e,t,s,i);break e}else if(s!==r){r=Ht(Error(L(424)),t),_r(r),t=hh(e,t,s,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(Ie=qt(e.firstChild),at=t,Te=!0,yi=null,jt=!0,i=au(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(es(),s===r){t=ni(e,t,i);break e}ot(e,t,s,i)}t=t.child}return t;case 26:return On(e,t),e===null?(i=Df(t.type,null,t.pendingProps,null))?t.memoizedState=i:Te||(i=t.type,e=t.pendingProps,s=$n(F.current).createElement(i),s[nt]=t,s[_t]=e,ct(s,i,e),st(s),t.stateNode=s):t.memoizedState=Df(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Te&&(s=t.stateNode=Ef(t.type,t.pendingProps,F.current),at=t,jt=!0,r=Ie,Hi(t.type)?(mo=r,Ie=qt(s.firstChild)):Ie=r),ot(e,t,t.pendingProps.children,i),On(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Te&&((r=s=Ie)&&(s=uv(s,t.type,t.pendingProps,jt),s!==null?(t.stateNode=s,at=t,Ie=qt(s.firstChild),jt=!1,r=!0):r=!1),r||bi(t)),oe(t),r=t.type,a=t.pendingProps,y=e!==null?e.memoizedProps:null,s=a.children,uo(r,a)?s=null:y!==null&&uo(r,y)&&(t.flags|=32),t.memoizedState!==null&&(r=cl(e,t,x_,null,null,i),Ir._currentValue=r),On(e,t),ot(e,t,s,i),t.child;case 6:return e===null&&Te&&((e=i=Ie)&&(i=hv(i,t.pendingProps,jt),i!==null?(t.stateNode=i,at=t,Ie=null,e=!0):e=!1),e||bi(t)),null;case 13:return fh(e,t,i);case 4:return R(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=as(t,null,s,i):ot(e,t,s,i),t.child;case 11:return sh(e,t,t.type,t.pendingProps,i);case 7:return ot(e,t,t.pendingProps,i),t.child;case 8:return ot(e,t,t.pendingProps.children,i),t.child;case 12:return ot(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Ci(t,t.type,s.value),ot(e,t,s.children,i),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,is(t),r=lt(r),s=s(r),t.flags|=1,ot(e,t,s,i),t.child;case 14:return rh(e,t,t.type,t.pendingProps,i);case 15:return nh(e,t,t.type,t.pendingProps,i);case 19:return _h(e,t,i);case 31:return O_(e,t,i);case 22:return ah(e,t,i,t.pendingProps);case 24:return is(t),s=lt($e),e===null?(r=Ja(),r===null&&(r=je,a=Za(),r.pooledCache=a,a.refCount++,a!==null&&(r.pooledCacheLanes|=i),r=a),t.memoizedState={parent:s,cache:r},tl(t),Ci(t,$e,r)):((e.lanes&i)!==0&&(il(e,t),br(t,null,null,i),yr()),r=e.memoizedState,a=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Ci(t,$e,s)):(s=a.cache,Ci(t,$e,s),s!==r.cache&&$a(t,[$e],i,!0))),ot(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(L(156,t.tag))}function ai(e){e.flags|=4}function zl(e,t,i,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Wh())e.flags|=8192;else throw ns=gn,el}else e.flags&=-16777217}function mh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lf(t))if(Wh())e.flags|=8192;else throw ns=gn,el}function Hn(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vo():536870912,e.lanes|=t,Ys|=t)}function Dr(e,t){if(!Te)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 s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function H_(e,t,i){var s=t.pendingProps;switch(Ya(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return We(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ii($e),ie(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ls(t)?ai(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fa())),We(t),null;case 26:var r=t.type,a=t.memoizedState;return e===null?(ai(t),a!==null?(We(t),mh(t,a)):(We(t),zl(t,r,null,s,i))):a?a!==e.memoizedState?(ai(t),We(t),mh(t,a)):(We(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ai(t),We(t),zl(t,r,e,s,i)),null;case 27:if(_e(t),i=F.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ai(t);else{if(!s){if(t.stateNode===null)throw Error(L(166));return We(t),null}e=se.current,Ls(t)?Vc(t):(e=Ef(r,s,i),t.stateNode=e,ai(t))}return We(t),null;case 5:if(_e(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ai(t);else{if(!s){if(t.stateNode===null)throw Error(L(166));return We(t),null}if(a=se.current,Ls(t))Vc(t);else{var y=$n(F.current);switch(a){case 1:a=y.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:a=y.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":a=y.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":a=y.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":a=y.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof s.is=="string"?y.createElement("select",{is:s.is}):y.createElement("select"),s.multiple?a.multiple=!0:s.size&&(a.size=s.size);break;default:a=typeof s.is=="string"?y.createElement(r,{is:s.is}):y.createElement(r)}}a[nt]=t,a[_t]=s;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)a.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=a;e:switch(ct(a,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ai(t)}}return We(t),zl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ai(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(L(166));if(e=F.current,Ls(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=at,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[nt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||df(e.nodeValue,i)),e||bi(t,!0)}else e=$n(e).createTextNode(s),e[nt]=t,t.stateNode=e}return We(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ls(t),i!==null){if(e===null){if(!s)throw Error(L(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(557));e[nt]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else i=Fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Dt(t),t):(Dt(t),null);if((t.flags&128)!==0)throw Error(L(558))}return We(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Ls(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(L(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(L(317));r[nt]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),r=!1}else r=Fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Dt(t),t):(Dt(t),null)}return Dt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Hn(t,t.updateQueue),We(t),null);case 4:return ie(),e===null&&no(t.stateNode.containerInfo),We(t),null;case 10:return ii(t.type),We(t),null;case 19:if(O(Fe),s=t.memoizedState,s===null)return We(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Dr(s,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=Cn(e),a!==null){for(t.flags|=128,Dr(s,!1),e=a.updateQueue,t.updateQueue=e,Hn(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Kc(i,e),i=i.sibling;return $(Fe,Fe.current&1|2),Te&&ei(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&et()>qn&&(t.flags|=128,r=!0,Dr(s,!1),t.lanes=4194304)}else{if(!r)if(e=Cn(a),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hn(t,e),Dr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Te)return We(t),null}else 2*et()-s.renderingStartTime>qn&&i!==536870912&&(t.flags|=128,r=!0,Dr(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(e=s.last,e!==null?e.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=et(),e.sibling=null,i=Fe.current,$(Fe,r?i&1|2:i&1),Te&&ei(t,s.treeForkCount),e):(We(t),null);case 22:case 23:return Dt(t),al(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),i=t.updateQueue,i!==null&&Hn(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&O(ss),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ii($e),We(t),null;case 25:return null;case 30:return null}throw Error(L(156,t.tag))}function N_(e,t){switch(Ya(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii($e),ie(),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(Dt(t),t.alternate===null)throw Error(L(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Dt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(Fe),null;case 4:return ie(),null;case 10:return ii(t.type),null;case 22:case 23:return Dt(t),al(),e!==null&&O(ss),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ii($e),null;case 25:return null;default:return null}}function ph(e,t){switch(Ya(t),t.tag){case 3:ii($e),ie();break;case 26:case 27:case 5:_e(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&Dt(t);break;case 13:Dt(t);break;case 19:O(Fe);break;case 10:ii(t.type);break;case 22:case 23:Dt(t),al(),e!==null&&O(ss);break;case 24:ii($e)}}function Tr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var a=i.create,y=i.inst;s=a(),y.destroy=s}i=i.next}while(i!==r)}}catch(k){Be(t,t.return,k)}}function Ti(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var a=r.next;s=a;do{if((s.tag&e)===e){var y=s.inst,k=y.destroy;if(k!==void 0){y.destroy=void 0,r=t;var I=i,Q=k;try{Q()}catch(ue){Be(r,I,ue)}}}s=s.next}while(s!==a)}}catch(ue){Be(t,t.return,ue)}}function gh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ou(t,i)}catch(s){Be(e,e.return,s)}}}function Sh(e,t,i){i.props=os(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Be(e,t,s)}}function Rr(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(r){Be(e,t,r)}}function Xt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){Be(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){Be(e,t,r)}else i.current=null}function yh(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){Be(e,e.return,r)}}function jl(e,t,i){try{var s=e.stateNode;rv(s,e.type,i,t),s[_t]=t}catch(r){Be(e,e.return,r)}}function bh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hi(e.type)||e.tag===4}function Ul(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bh(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&&Hi(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 ql(e,t,i){var s=e.tag;if(s===5||s===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=Zt));else if(s!==4&&(s===27&&Hi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(ql(e,t,i),e=e.sibling;e!==null;)ql(e,t,i),e=e.sibling}function Nn(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Hi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Nn(e,t,i),e=e.sibling;e!==null;)Nn(e,t,i),e=e.sibling}function Ch(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);ct(t,s,i),t[nt]=e,t[_t]=i}catch(a){Be(e,e.return,a)}}var li=!1,Je=!1,Il=!1,wh=typeof WeakSet=="function"?WeakSet:Set,rt=null;function z_(e,t){if(e=e.containerInfo,oo=sa,e=Hc(e),Ba(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{i.nodeType,a.nodeType}catch{i=null;break e}var y=0,k=-1,I=-1,Q=0,ue=0,fe=e,ee=null;t:for(;;){for(var ne;fe!==i||r!==0&&fe.nodeType!==3||(k=y+r),fe!==a||s!==0&&fe.nodeType!==3||(I=y+s),fe.nodeType===3&&(y+=fe.nodeValue.length),(ne=fe.firstChild)!==null;)ee=fe,fe=ne;for(;;){if(fe===e)break t;if(ee===i&&++Q===r&&(k=y),ee===a&&++ue===s&&(I=y),(ne=fe.nextSibling)!==null)break;fe=ee,ee=fe.parentNode}fe=ne}i=k===-1||I===-1?null:{start:k,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(co={focusedElem:e,selectionRange:i},sa=!1,rt=t;rt!==null;)if(t=rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rt=e;else for(;rt!==null;){switch(t=rt,a=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++)r=e[i],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&a!==null){e=void 0,i=t,r=a.memoizedProps,a=a.memoizedState,s=i.stateNode;try{var ve=os(i.type,r);e=s.getSnapshotBeforeUpdate(ve,a),s.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Be(i,i.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)fo(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fo(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(L(163))}if(e=t.sibling,e!==null){e.return=t.return,rt=e;break}rt=t.return}}function Eh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:ci(e,i),s&4&&Tr(5,i);break;case 1:if(ci(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(y){Be(i,i.return,y)}else{var r=os(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Be(i,i.return,y)}}s&64&&gh(i),s&512&&Rr(i,i.return);break;case 3:if(ci(e,i),s&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{ou(e,t)}catch(y){Be(i,i.return,y)}}break;case 27:t===null&&s&4&&Ch(i);case 26:case 5:ci(e,i),t===null&&s&4&&yh(i),s&512&&Rr(i,i.return);break;case 12:ci(e,i);break;case 31:ci(e,i),s&4&&Dh(e,i);break;case 13:ci(e,i),s&4&&Th(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=G_.bind(null,i),fv(e,i))));break;case 22:if(s=i.memoizedState!==null||li,!s){t=t!==null&&t.memoizedState!==null||Je,r=li;var a=Je;li=s,(Je=t)&&!a?ui(e,i,(i.subtreeFlags&8772)!==0):ci(e,i),li=r,Je=a}break;case 30:break;default:ci(e,i)}}function xh(e){var t=e.alternate;t!==null&&(e.alternate=null,xh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pa(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 Pe=null,mt=!1;function oi(e,t,i){for(i=i.child;i!==null;)Ah(e,t,i),i=i.sibling}function Ah(e,t,i){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Gi,i)}catch{}switch(i.tag){case 26:Je||Xt(i,t),oi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Je||Xt(i,t);var s=Pe,r=mt;Hi(i.type)&&(Pe=i.stateNode,mt=!1),oi(e,t,i),jr(i.stateNode),Pe=s,mt=r;break;case 5:Je||Xt(i,t);case 6:if(s=Pe,r=mt,Pe=null,oi(e,t,i),Pe=s,mt=r,Pe!==null)if(mt)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(i.stateNode)}catch(a){Be(i,t,a)}else try{Pe.removeChild(i.stateNode)}catch(a){Be(i,t,a)}break;case 18:Pe!==null&&(mt?(e=Pe,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Js(e)):Sf(Pe,i.stateNode));break;case 4:s=Pe,r=mt,Pe=i.stateNode.containerInfo,mt=!0,oi(e,t,i),Pe=s,mt=r;break;case 0:case 11:case 14:case 15:Ti(2,i,t),Je||Ti(4,i,t),oi(e,t,i);break;case 1:Je||(Xt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Sh(i,t,s)),oi(e,t,i);break;case 21:oi(e,t,i);break;case 22:Je=(s=Je)||i.memoizedState!==null,oi(e,t,i),Je=s;break;default:oi(e,t,i)}}function Dh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Js(e)}catch(i){Be(t,t.return,i)}}}function Th(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Js(e)}catch(i){Be(t,t.return,i)}}function j_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new wh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new wh),t;default:throw Error(L(435,e.tag))}}function zn(e,t){var i=j_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=F_.bind(null,e,s);s.then(r,r)}})}function pt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s],a=e,y=t,k=y;e:for(;k!==null;){switch(k.tag){case 27:if(Hi(k.type)){Pe=k.stateNode,mt=!1;break e}break;case 5:Pe=k.stateNode,mt=!1;break e;case 3:case 4:Pe=k.stateNode.containerInfo,mt=!0;break e}k=k.return}if(Pe===null)throw Error(L(160));Ah(a,y,r),Pe=null,mt=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rh(t,e),t=t.sibling}var Kt=null;function Rh(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pt(t,e),gt(e),s&4&&(Ti(3,e,e.return),Tr(3,e),Ti(5,e,e.return));break;case 1:pt(t,e),gt(e),s&512&&(Je||i===null||Xt(i,i.return)),s&64&&li&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var r=Kt;if(pt(t,e),gt(e),s&512&&(Je||i===null||Xt(i,i.return)),s&4){var a=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,r=r.ownerDocument||r;t:switch(s){case"title":a=r.getElementsByTagName("title")[0],(!a||a[ir]||a[nt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=r.createElement(s),r.head.insertBefore(a,r.querySelector("head > title"))),ct(a,s,i),a[nt]=e,st(a),s=a;break e;case"link":var y=kf("link","href",r).get(s+(i.href||""));if(y){for(var k=0;k<y.length;k++)if(a=y[k],a.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&a.getAttribute("rel")===(i.rel==null?null:i.rel)&&a.getAttribute("title")===(i.title==null?null:i.title)&&a.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){y.splice(k,1);break t}}a=r.createElement(s),ct(a,s,i),r.head.appendChild(a);break;case"meta":if(y=kf("meta","content",r).get(s+(i.content||""))){for(k=0;k<y.length;k++)if(a=y[k],a.getAttribute("content")===(i.content==null?null:""+i.content)&&a.getAttribute("name")===(i.name==null?null:i.name)&&a.getAttribute("property")===(i.property==null?null:i.property)&&a.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&a.getAttribute("charset")===(i.charSet==null?null:i.charSet)){y.splice(k,1);break t}}a=r.createElement(s),ct(a,s,i),r.head.appendChild(a);break;default:throw Error(L(468,s))}a[nt]=e,st(a),s=a}e.stateNode=s}else Mf(r,e.type,e.stateNode);else e.stateNode=Rf(r,s,e.memoizedProps);else a!==s?(a===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):a.count--,s===null?Mf(r,e.type,e.stateNode):Rf(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&jl(e,e.memoizedProps,i.memoizedProps)}break;case 27:pt(t,e),gt(e),s&512&&(Je||i===null||Xt(i,i.return)),i!==null&&s&4&&jl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(pt(t,e),gt(e),s&512&&(Je||i===null||Xt(i,i.return)),e.flags&32){r=e.stateNode;try{Cs(r,"")}catch(ve){Be(e,e.return,ve)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,jl(e,r,i!==null?i.memoizedProps:r)),s&1024&&(Il=!0);break;case 6:if(pt(t,e),gt(e),s&4){if(e.stateNode===null)throw Error(L(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(ve){Be(e,e.return,ve)}}break;case 3:if(Jn=null,r=Kt,Kt=Zn(t.containerInfo),pt(t,e),Kt=r,gt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(ve){Be(e,e.return,ve)}Il&&(Il=!1,kh(e));break;case 4:s=Kt,Kt=Zn(e.stateNode.containerInfo),pt(t,e),gt(e),Kt=s;break;case 12:pt(t,e),gt(e);break;case 31:pt(t,e),gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 13:pt(t,e),gt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Un=et()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 22:r=e.memoizedState!==null;var I=i!==null&&i.memoizedState!==null,Q=li,ue=Je;if(li=Q||r,Je=ue||I,pt(t,e),Je=ue,li=Q,gt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(i===null||I||li||Je||cs(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){I=i=t;try{if(a=I.stateNode,r)y=a.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{k=I.stateNode;var fe=I.memoizedProps.style,ee=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;k.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ve){Be(I,I.return,ve)}}}else if(t.tag===6){if(i===null){I=t;try{I.stateNode.nodeValue=r?"":I.memoizedProps}catch(ve){Be(I,I.return,ve)}}}else if(t.tag===18){if(i===null){I=t;try{var ne=I.stateNode;r?yf(ne,!0):yf(I.stateNode,!1)}catch(ve){Be(I,I.return,ve)}}}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}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,zn(e,i))));break;case 19:pt(t,e),gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 30:break;case 21:break;default:pt(t,e),gt(e)}}function gt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(bh(s)){i=s;break}s=s.return}if(i==null)throw Error(L(160));switch(i.tag){case 27:var r=i.stateNode,a=Ul(e);Nn(e,a,r);break;case 5:var y=i.stateNode;i.flags&32&&(Cs(y,""),i.flags&=-33);var k=Ul(e);Nn(e,k,y);break;case 3:case 4:var I=i.stateNode.containerInfo,Q=Ul(e);ql(e,Q,I);break;default:throw Error(L(161))}}catch(ue){Be(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ci(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eh(e,t.alternate,t),t=t.sibling}function cs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ti(4,t,t.return),cs(t);break;case 1:Xt(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Sh(t,t.return,i),cs(t);break;case 27:jr(t.stateNode);case 26:case 5:Xt(t,t.return),cs(t);break;case 22:t.memoizedState===null&&cs(t);break;case 30:cs(t);break;default:cs(t)}e=e.sibling}}function ui(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,a=t,y=a.flags;switch(a.tag){case 0:case 11:case 15:ui(r,a,i),Tr(4,a);break;case 1:if(ui(r,a,i),s=a,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(Q){Be(s,s.return,Q)}if(s=a,r=s.updateQueue,r!==null){var k=s.stateNode;try{var I=r.shared.hiddenCallbacks;if(I!==null)for(r.shared.hiddenCallbacks=null,r=0;r<I.length;r++)lu(I[r],k)}catch(Q){Be(s,s.return,Q)}}i&&y&64&&gh(a),Rr(a,a.return);break;case 27:Ch(a);case 26:case 5:ui(r,a,i),i&&s===null&&y&4&&yh(a),Rr(a,a.return);break;case 12:ui(r,a,i);break;case 31:ui(r,a,i),i&&y&4&&Dh(r,a);break;case 13:ui(r,a,i),i&&y&4&&Th(r,a);break;case 22:a.memoizedState===null&&ui(r,a,i),Rr(a,a.return);break;case 30:break;default:ui(r,a,i)}t=t.sibling}}function Wl(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&&vr(i))}function Pl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vr(e))}function Yt(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Mh(e,t,i,s),t=t.sibling}function Mh(e,t,i,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Yt(e,t,i,s),r&2048&&Tr(9,t);break;case 1:Yt(e,t,i,s);break;case 3:Yt(e,t,i,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vr(e)));break;case 12:if(r&2048){Yt(e,t,i,s),e=t.stateNode;try{var a=t.memoizedProps,y=a.id,k=a.onPostCommit;typeof k=="function"&&k(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(I){Be(t,t.return,I)}}else Yt(e,t,i,s);break;case 31:Yt(e,t,i,s);break;case 13:Yt(e,t,i,s);break;case 23:break;case 22:a=t.stateNode,y=t.alternate,t.memoizedState!==null?a._visibility&2?Yt(e,t,i,s):kr(e,t):a._visibility&2?Yt(e,t,i,s):(a._visibility|=2,Ws(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Wl(y,t);break;case 24:Yt(e,t,i,s),r&2048&&Pl(t.alternate,t);break;default:Yt(e,t,i,s)}}function Ws(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,y=t,k=i,I=s,Q=y.flags;switch(y.tag){case 0:case 11:case 15:Ws(a,y,k,I,r),Tr(8,y);break;case 23:break;case 22:var ue=y.stateNode;y.memoizedState!==null?ue._visibility&2?Ws(a,y,k,I,r):kr(a,y):(ue._visibility|=2,Ws(a,y,k,I,r)),r&&Q&2048&&Wl(y.alternate,y);break;case 24:Ws(a,y,k,I,r),r&&Q&2048&&Pl(y.alternate,y);break;default:Ws(a,y,k,I,r)}t=t.sibling}}function kr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:kr(i,s),r&2048&&Wl(s.alternate,s);break;case 24:kr(i,s),r&2048&&Pl(s.alternate,s);break;default:kr(i,s)}t=t.sibling}}var Mr=8192;function Ps(e,t,i){if(e.subtreeFlags&Mr)for(e=e.child;e!==null;)Lh(e,t,i),e=e.sibling}function Lh(e,t,i){switch(e.tag){case 26:Ps(e,t,i),e.flags&Mr&&e.memoizedState!==null&&Ev(i,Kt,e.memoizedState,e.memoizedProps);break;case 5:Ps(e,t,i);break;case 3:case 4:var s=Kt;Kt=Zn(e.stateNode.containerInfo),Ps(e,t,i),Kt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Mr,Mr=16777216,Ps(e,t,i),Mr=s):Ps(e,t,i));break;default:Ps(e,t,i)}}function Oh(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 Lr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];rt=s,Hh(s,e)}Oh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bh(e),e=e.sibling}function Bh(e){switch(e.tag){case 0:case 11:case 15:Lr(e),e.flags&2048&&Ti(9,e,e.return);break;case 3:Lr(e);break;case 12:Lr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jn(e)):Lr(e);break;default:Lr(e)}}function jn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];rt=s,Hh(s,e)}Oh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ti(8,t,t.return),jn(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,jn(t));break;default:jn(t)}e=e.sibling}}function Hh(e,t){for(;rt!==null;){var i=rt;switch(i.tag){case 0:case 11:case 15:Ti(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:vr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,rt=s;else e:for(i=e;rt!==null;){s=rt;var r=s.sibling,a=s.return;if(xh(s),s===i){rt=null;break e}if(r!==null){r.return=a,rt=r;break e}rt=a}}}var U_={getCacheForType:function(e){var t=lt($e),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return lt($e).controller.signal}},q_=typeof WeakMap=="function"?WeakMap:Map,Me=0,je=null,Ee=null,Ae=0,Oe=0,Tt=null,Ri=!1,Ks=!1,Kl=!1,hi=0,Ge=0,ki=0,us=0,Yl=0,Rt=0,Ys=0,Or=null,St=null,Gl=!1,Un=0,Nh=0,qn=1/0,In=null,Mi=null,tt=0,Li=null,Gs=null,fi=0,Fl=0,Xl=null,zh=null,Br=0,Vl=null;function kt(){return(Me&2)!==0&&Ae!==0?Ae&-Ae:W.T!==null?to():Jo()}function jh(){if(Rt===0)if((Ae&536870912)===0||Te){var e=Xr;Xr<<=1,(Xr&3932160)===0&&(Xr=262144),Rt=e}else Rt=536870912;return e=At.current,e!==null&&(e.flags|=32),Rt}function yt(e,t,i){(e===je&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)&&(Fs(e,0),Oi(e,Ae,Rt,!1)),tr(e,i),((Me&2)===0||e!==je)&&(e===je&&((Me&2)===0&&(us|=i),Ge===4&&Oi(e,Ae,Rt,!1)),Vt(e))}function Uh(e,t,i){if((Me&6)!==0)throw Error(L(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||er(e,t),r=s?P_(e,t):Zl(e,t,!0),a=s;do{if(r===0){Ks&&!s&&Oi(e,t,0,!1);break}else{if(i=e.current.alternate,a&&!I_(i)){r=Zl(e,t,!1),a=!1;continue}if(r===2){if(a=t,e.errorRecoveryDisabledLanes&a)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var k=e;r=Or;var I=k.current.memoizedState.isDehydrated;if(I&&(Fs(k,y).flags|=256),y=Zl(k,y,!1),y!==2){if(Kl&&!I){k.errorRecoveryDisabledLanes|=a,us|=a,r=4;break e}a=St,St=r,a!==null&&(St===null?St=a:St.push.apply(St,a))}r=y}if(a=!1,r!==2)continue}}if(r===1){Fs(e,0),Oi(e,t,0,!0);break}e:{switch(s=e,a=r,a){case 0:case 1:throw Error(L(345));case 4:if((t&4194048)!==t)break;case 6:Oi(s,t,Rt,!Ri);break e;case 2:St=null;break;case 3:case 5:break;default:throw Error(L(329))}if((t&62914560)===t&&(r=Un+300-et(),10<r)){if(Oi(s,t,Rt,!Ri),$r(s,0,!0)!==0)break e;fi=t,s.timeoutHandle=pf(qh.bind(null,s,i,St,In,Gl,t,Rt,us,Ys,Ri,a,"Throttled",-0,0),r);break e}qh(s,i,St,In,Gl,t,Rt,us,Ys,Ri,a,null,-0,0)}}break}while(!0);Vt(e)}function qh(e,t,i,s,r,a,y,k,I,Q,ue,fe,ee,ne){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zt},Lh(t,a,fe);var ve=(a&62914560)===a?Un-et():(a&4194048)===a?Nh-et():0;if(ve=xv(fe,ve),ve!==null){fi=a,e.cancelPendingCommit=ve(Xh.bind(null,e,t,a,i,s,r,y,k,I,ue,fe,null,ee,ne)),Oi(e,a,y,!Q);return}}Xh(e,t,a,i,s,r,y,k,I)}function I_(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 s=0;s<i.length;s++){var r=i[s],a=r.getSnapshot;r=r.value;try{if(!Et(a(),r))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 Oi(e,t,i,s){t&=~Yl,t&=~us,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var a=31-wt(r),y=1<<a;s[a]=-1,r&=~y}i!==0&&$o(e,i,t)}function Wn(){return(Me&6)===0?(Hr(0),!1):!0}function $l(){if(Ee!==null){if(Oe===0)var e=Ee.return;else e=Ee,ti=ts=null,fl(e),zs=null,pr=0,e=Ee;for(;e!==null;)ph(e.alternate,e),e=e.return;Ee=null}}function Fs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,lv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),fi=0,$l(),je=e,Ee=i=Jt(e.current,null),Ae=t,Oe=0,Tt=null,Ri=!1,Ks=er(e,t),Kl=!1,Ys=Rt=Yl=us=ki=Ge=0,St=Or=null,Gl=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-wt(s),a=1<<r;t|=e[r],s&=~a}return hi=t,cn(),i}function Ih(e,t){be=null,W.H=xr,t===Ns||t===pn?(t=su(),Oe=3):t===el?(t=su(),Oe=4):Oe=t===Tl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Tt=t,Ee===null&&(Ge=1,Mn(e,Ht(t,e.current)))}function Wh(){var e=At.current;return e===null?!0:(Ae&4194048)===Ae?Ut===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===Ut:!1}function Ph(){var e=W.H;return W.H=xr,e===null?xr:e}function Kh(){var e=W.A;return W.A=U_,e}function Pn(){Ge=4,Ri||(Ae&4194048)!==Ae&&At.current!==null||(Ks=!0),(ki&134217727)===0&&(us&134217727)===0||je===null||Oi(je,Ae,Rt,!1)}function Zl(e,t,i){var s=Me;Me|=2;var r=Ph(),a=Kh();(je!==e||Ae!==t)&&(In=null,Fs(e,t)),t=!1;var y=Ge;e:do try{if(Oe!==0&&Ee!==null){var k=Ee,I=Tt;switch(Oe){case 8:$l(),y=6;break e;case 3:case 2:case 9:case 6:At.current===null&&(t=!0);var Q=Oe;if(Oe=0,Tt=null,Xs(e,k,I,Q),i&&Ks){y=0;break e}break;default:Q=Oe,Oe=0,Tt=null,Xs(e,k,I,Q)}}W_(),y=Ge;break}catch(ue){Ih(e,ue)}while(!0);return t&&e.shellSuspendCounter++,ti=ts=null,Me=s,W.H=r,W.A=a,Ee===null&&(je=null,Ae=0,cn()),y}function W_(){for(;Ee!==null;)Yh(Ee)}function P_(e,t){var i=Me;Me|=2;var s=Ph(),r=Kh();je!==e||Ae!==t?(In=null,qn=et()+500,Fs(e,t)):Ks=er(e,t);e:do try{if(Oe!==0&&Ee!==null){t=Ee;var a=Tt;t:switch(Oe){case 1:Oe=0,Tt=null,Xs(e,t,a,1);break;case 2:case 9:if(tu(a)){Oe=0,Tt=null,Gh(t);break}t=function(){Oe!==2&&Oe!==9||je!==e||(Oe=7),Vt(e)},a.then(t,t);break e;case 3:Oe=7;break e;case 4:Oe=5;break e;case 7:tu(a)?(Oe=0,Tt=null,Gh(t)):(Oe=0,Tt=null,Xs(e,t,a,7));break;case 5:var y=null;switch(Ee.tag){case 26:y=Ee.memoizedState;case 5:case 27:var k=Ee;if(y?Lf(y):k.stateNode.complete){Oe=0,Tt=null;var I=k.sibling;if(I!==null)Ee=I;else{var Q=k.return;Q!==null?(Ee=Q,Kn(Q)):Ee=null}break t}}Oe=0,Tt=null,Xs(e,t,a,5);break;case 6:Oe=0,Tt=null,Xs(e,t,a,6);break;case 8:$l(),Ge=6;break e;default:throw Error(L(462))}}K_();break}catch(ue){Ih(e,ue)}while(!0);return ti=ts=null,W.H=s,W.A=r,Me=i,Ee!==null?0:(je=null,Ae=0,cn(),Ge)}function K_(){for(;Ee!==null&&!ds();)Yh(Ee)}function Yh(e){var t=vh(e.alternate,e,hi);e.memoizedProps=e.pendingProps,t===null?Kn(e):Ee=t}function Gh(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=ch(i,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=ch(i,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:fl(t);default:ph(i,t),t=Ee=Kc(t,hi),t=vh(i,t,hi)}e.memoizedProps=e.pendingProps,t===null?Kn(e):Ee=t}function Xs(e,t,i,s){ti=ts=null,fl(t),zs=null,pr=0;var r=t.return;try{if(L_(e,r,t,i,Ae)){Ge=1,Mn(e,Ht(i,e.current)),Ee=null;return}}catch(a){if(r!==null)throw Ee=r,a;Ge=1,Mn(e,Ht(i,e.current)),Ee=null;return}t.flags&32768?(Te||s===1?e=!0:Ks||(Ae&536870912)!==0?e=!1:(Ri=e=!0,(s===2||s===9||s===3||s===6)&&(s=At.current,s!==null&&s.tag===13&&(s.flags|=16384))),Fh(t,e)):Kn(t)}function Kn(e){var t=e;do{if((t.flags&32768)!==0){Fh(t,Ri);return}e=t.return;var i=H_(t.alternate,t,hi);if(i!==null){Ee=i;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Ge===0&&(Ge=5)}function Fh(e,t){do{var i=N_(e.alternate,e);if(i!==null){i.flags&=32767,Ee=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=i}while(e!==null);Ge=6,Ee=null}function Xh(e,t,i,s,r,a,y,k,I){e.cancelPendingCommit=null;do Yn();while(tt!==0);if((Me&6)!==0)throw Error(L(327));if(t!==null){if(t===e.current)throw Error(L(177));if(a=t.lanes|t.childLanes,a|=Ua,wd(e,i,a,y,k,I),e===je&&(Ee=je=null,Ae=0),Gs=t,Li=e,fi=i,Fl=a,Xl=r,zh=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,X_(bt,function(){return Jh(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null,r=X.p,X.p=2,y=Me,Me|=4;try{z_(e,t,i)}finally{Me=y,X.p=r,W.T=s}}tt=1,Vh(),$h(),Zh()}}function Vh(){if(tt===1){tt=0;var e=Li,t=Gs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=W.T,W.T=null;var s=X.p;X.p=2;var r=Me;Me|=4;try{Rh(t,e);var a=co,y=Hc(e.containerInfo),k=a.focusedElem,I=a.selectionRange;if(y!==k&&k&&k.ownerDocument&&Bc(k.ownerDocument.documentElement,k)){if(I!==null&&Ba(k)){var Q=I.start,ue=I.end;if(ue===void 0&&(ue=Q),"selectionStart"in k)k.selectionStart=Q,k.selectionEnd=Math.min(ue,k.value.length);else{var fe=k.ownerDocument||document,ee=fe&&fe.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),ve=k.textContent.length,ge=Math.min(I.start,ve),ze=I.end===void 0?ge:Math.min(I.end,ve);!ne.extend&&ge>ze&&(y=ze,ze=ge,ge=y);var V=Oc(k,ge),K=Oc(k,ze);if(V&&K&&(ne.rangeCount!==1||ne.anchorNode!==V.node||ne.anchorOffset!==V.offset||ne.focusNode!==K.node||ne.focusOffset!==K.offset)){var Z=fe.createRange();Z.setStart(V.node,V.offset),ne.removeAllRanges(),ge>ze?(ne.addRange(Z),ne.extend(K.node,K.offset)):(Z.setEnd(K.node,K.offset),ne.addRange(Z))}}}}for(fe=[],ne=k;ne=ne.parentNode;)ne.nodeType===1&&fe.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<fe.length;k++){var he=fe[k];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}sa=!!oo,co=oo=null}finally{Me=r,X.p=s,W.T=i}}e.current=t,tt=2}}function $h(){if(tt===2){tt=0;var e=Li,t=Gs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=W.T,W.T=null;var s=X.p;X.p=2;var r=Me;Me|=4;try{Eh(e,t.alternate,t)}finally{Me=r,X.p=s,W.T=i}}tt=3}}function Zh(){if(tt===4||tt===3){tt=0,dt();var e=Li,t=Gs,i=fi,s=zh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?tt=5:(tt=0,Gs=Li=null,Qh(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Mi=null),va(i),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Gi,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=W.T,r=X.p,X.p=2,W.T=null;try{for(var a=e.onRecoverableError,y=0;y<s.length;y++){var k=s[y];a(k.value,{componentStack:k.stack})}}finally{W.T=t,X.p=r}}(fi&3)!==0&&Yn(),Vt(e),r=e.pendingLanes,(i&261930)!==0&&(r&42)!==0?e===Vl?Br++:(Br=0,Vl=e):Br=0,Hr(0)}}function Qh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vr(t)))}function Yn(){return Vh(),$h(),Zh(),Jh()}function Jh(){if(tt!==5)return!1;var e=Li,t=Fl;Fl=0;var i=va(fi),s=W.T,r=X.p;try{X.p=32>i?32:i,W.T=null,i=Xl,Xl=null;var a=Li,y=fi;if(tt=0,Gs=Li=null,fi=0,(Me&6)!==0)throw Error(L(331));var k=Me;if(Me|=4,Bh(a.current),Mh(a,a.current,y,i),Me=k,Hr(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Gi,a)}catch{}return!0}finally{X.p=r,W.T=s,Qh(e,t)}}function ef(e,t,i){t=Ht(i,t),t=Dl(e.stateNode,t,2),e=xi(e,t,2),e!==null&&(tr(e,2),Vt(e))}function Be(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 s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Mi===null||!Mi.has(s))){e=Ht(i,e),i=th(2),s=xi(t,i,2),s!==null&&(ih(i,s,t,e),tr(s,2),Vt(s));break}}t=t.return}}function Ql(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new q_;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(Kl=!0,r.add(i),e=Y_.bind(null,e,t,i),t.then(e,e))}function Y_(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,je===e&&(Ae&i)===i&&(Ge===4||Ge===3&&(Ae&62914560)===Ae&&300>et()-Un?(Me&2)===0&&Fs(e,0):Yl|=i,Ys===Ae&&(Ys=0)),Vt(e)}function tf(e,t){t===0&&(t=Vo()),e=Qi(e,t),e!==null&&(tr(e,t),Vt(e))}function G_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),tf(e,i)}function F_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(L(314))}s!==null&&s.delete(t),tf(e,i)}function X_(e,t){return Pi(e,t)}var Gn=null,Vs=null,Jl=!1,Fn=!1,eo=!1,Bi=0;function Vt(e){e!==Vs&&e.next===null&&(Vs===null?Gn=Vs=e:Vs=Vs.next=e),Fn=!0,Jl||(Jl=!0,$_())}function Hr(e,t){if(!eo&&Fn){eo=!0;do for(var i=!1,s=Gn;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var a=0;else{var y=s.suspendedLanes,k=s.pingedLanes;a=(1<<31-wt(42|e)+1)-1,a&=r&~(y&~k),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(i=!0,af(s,a))}else a=Ae,a=$r(s,s===je?a:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(a&3)===0||er(s,a)||(i=!0,af(s,a));s=s.next}while(i);eo=!1}}function V_(){sf()}function sf(){Fn=Jl=!1;var e=0;Bi!==0&&av()&&(e=Bi);for(var t=et(),i=null,s=Gn;s!==null;){var r=s.next,a=rf(s,t);a===0?(s.next=null,i===null?Gn=r:i.next=r,r===null&&(Vs=i)):(i=s,(e!==0||(a&3)!==0)&&(Fn=!0)),s=r}tt!==0&&tt!==5||Hr(e),Bi!==0&&(Bi=0)}function rf(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var y=31-wt(a),k=1<<y,I=r[y];I===-1?((k&i)===0||(k&s)!==0)&&(r[y]=Cd(k,t)):I<=t&&(e.expiredLanes|=k),a&=~k}if(t=je,i=Ae,i=$r(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Oe===2||Oe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ki(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||er(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Ki(s),va(i)){case 2:case 8:i=_s;break;case 32:i=bt;break;case 268435456:i=Wt;break;default:i=bt}return s=nf.bind(null,e),i=Pi(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Ki(s),e.callbackPriority=2,e.callbackNode=null,2}function nf(e,t){if(tt!==0&&tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Yn()&&e.callbackNode!==i)return null;var s=Ae;return s=$r(e,e===je?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Uh(e,s,t),rf(e,et()),e.callbackNode!=null&&e.callbackNode===i?nf.bind(null,e):null)}function af(e,t){if(Yn())return null;Uh(e,t,!0)}function $_(){ov(function(){(Me&6)!==0?Pi(vi,V_):sf()})}function to(){if(Bi===0){var e=Bs;e===0&&(e=Fr,Fr<<=1,(Fr&261888)===0&&(Fr=256)),Bi=e}return Bi}function lf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:en(""+e)}function of(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 Z_(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var a=lf((r[_t]||null).action),y=s.submitter;y&&(t=(t=y[_t]||null)?lf(t.formAction):y.getAttribute("formAction"),t!==null&&(a=t,y=null));var k=new nn("action","action",null,s,r);e.push({event:k,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Bi!==0){var I=y?of(r,y):new FormData(r);bl(i,{pending:!0,data:I,method:r.method,action:a},null,I)}}else typeof a=="function"&&(k.preventDefault(),I=y?of(r,y):new FormData(r),bl(i,{pending:!0,data:I,method:r.method,action:a},a,I))},currentTarget:r}]})}}for(var io=0;io<ja.length;io++){var so=ja[io],Q_=so.toLowerCase(),J_=so[0].toUpperCase()+so.slice(1);Pt(Q_,"on"+J_)}Pt(jc,"onAnimationEnd"),Pt(Uc,"onAnimationIteration"),Pt(qc,"onAnimationStart"),Pt("dblclick","onDoubleClick"),Pt("focusin","onFocus"),Pt("focusout","onBlur"),Pt(v_,"onTransitionRun"),Pt(m_,"onTransitionStart"),Pt(p_,"onTransitionCancel"),Pt(Ic,"onTransitionEnd"),ys("onMouseEnter",["mouseout","mouseover"]),ys("onMouseLeave",["mouseout","mouseover"]),ys("onPointerEnter",["pointerout","pointerover"]),ys("onPointerLeave",["pointerout","pointerover"]),Xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nr="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(" "),ev=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nr));function cf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var y=s.length-1;0<=y;y--){var k=s[y],I=k.instance,Q=k.currentTarget;if(k=k.listener,I!==a&&r.isPropagationStopped())break e;a=k,r.currentTarget=Q;try{a(r)}catch(ue){on(ue)}r.currentTarget=null,a=I}else for(y=0;y<s.length;y++){if(k=s[y],I=k.instance,Q=k.currentTarget,k=k.listener,I!==a&&r.isPropagationStopped())break e;a=k,r.currentTarget=Q;try{a(r)}catch(ue){on(ue)}r.currentTarget=null,a=I}}}}function xe(e,t){var i=t[ma];i===void 0&&(i=t[ma]=new Set);var s=e+"__bubble";i.has(s)||(uf(t,e,2,!1),i.add(s))}function ro(e,t,i){var s=0;t&&(s|=4),uf(i,e,s,t)}var Xn="_reactListening"+Math.random().toString(36).slice(2);function no(e){if(!e[Xn]){e[Xn]=!0,ic.forEach(function(i){i!=="selectionchange"&&(ev.has(i)||ro(i,!1,e),ro(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xn]||(t[Xn]=!0,ro("selectionchange",!1,t))}}function uf(e,t,i,s){switch(Uf(t)){case 2:var r=Tv;break;case 8:r=Rv;break;default:r=bo}i=r.bind(null,t,i,e),r=void 0,!xa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function ao(e,t,i,s,r){var a=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var y=s.tag;if(y===3||y===4){var k=s.stateNode.containerInfo;if(k===r)break;if(y===4)for(y=s.return;y!==null;){var I=y.tag;if((I===3||I===4)&&y.stateNode.containerInfo===r)return;y=y.return}for(;k!==null;){if(y=ps(k),y===null)return;if(I=y.tag,I===5||I===6||I===26||I===27){s=a=y;continue e}k=k.parentNode}}s=s.return}_c(function(){var Q=a,ue=wa(i),fe=[];e:{var ee=Wc.get(e);if(ee!==void 0){var ne=nn,ve=e;switch(e){case"keypress":if(sn(i)===0)break e;case"keydown":case"keyup":ne=Fd;break;case"focusin":ve="focus",ne=Ra;break;case"focusout":ve="blur",ne=Ra;break;case"beforeblur":case"afterblur":ne=Ra;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":ne=pc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Hd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=$d;break;case jc:case Uc:case qc:ne=jd;break;case Ic:ne=Qd;break;case"scroll":case"scrollend":ne=Od;break;case"wheel":ne=e_;break;case"copy":case"cut":case"paste":ne=qd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Sc;break;case"toggle":case"beforetoggle":ne=i_}var ge=(t&4)!==0,ze=!ge&&(e==="scroll"||e==="scrollend"),V=ge?ee!==null?ee+"Capture":null:ee;ge=[];for(var K=Q,Z;K!==null;){var he=K;if(Z=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||Z===null||V===null||(he=rr(K,V),he!=null&&ge.push(zr(K,he,Z))),ze)break;K=K.return}0<ge.length&&(ee=new ne(ee,ve,null,i,ue),fe.push({event:ee,listeners:ge}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ee&&i!==Ca&&(ve=i.relatedTarget||i.fromElement)&&(ps(ve)||ve[ms]))break e;if((ne||ee)&&(ee=ue.window===ue?ue:(ee=ue.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(ve=i.relatedTarget||i.toElement,ne=Q,ve=ve?ps(ve):null,ve!==null&&(ze=le(ve),ge=ve.tag,ve!==ze||ge!==5&&ge!==27&&ge!==6)&&(ve=null)):(ne=null,ve=Q),ne!==ve)){if(ge=pc,he="onMouseLeave",V="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Sc,he="onPointerLeave",V="onPointerEnter",K="pointer"),ze=ne==null?ee:sr(ne),Z=ve==null?ee:sr(ve),ee=new ge(he,K+"leave",ne,i,ue),ee.target=ze,ee.relatedTarget=Z,he=null,ps(ue)===Q&&(ge=new ge(V,K+"enter",ve,i,ue),ge.target=Z,ge.relatedTarget=ze,he=ge),ze=he,ne&&ve)t:{for(ge=tv,V=ne,K=ve,Z=0,he=V;he;he=ge(he))Z++;he=0;for(var pe=K;pe;pe=ge(pe))he++;for(;0<Z-he;)V=ge(V),Z--;for(;0<he-Z;)K=ge(K),he--;for(;Z--;){if(V===K||K!==null&&V===K.alternate){ge=V;break t}V=ge(V),K=ge(K)}ge=null}else ge=null;ne!==null&&hf(fe,ee,ne,ge,!1),ve!==null&&ze!==null&&hf(fe,ze,ve,ge,!0)}}e:{if(ee=Q?sr(Q):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var Re=Dc;else if(xc(ee))if(Tc)Re=f_;else{Re=u_;var me=c_}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?Q&&ba(Q.elementType)&&(Re=Dc):Re=h_;if(Re&&(Re=Re(e,Q))){Ac(fe,Re,i,ue);break e}me&&me(e,ee,Q),e==="focusout"&&Q&&ee.type==="number"&&Q.memoizedProps.value!=null&&ya(ee,"number",ee.value)}switch(me=Q?sr(Q):window,e){case"focusin":(xc(me)||me.contentEditable==="true")&&(As=me,Ha=Q,fr=null);break;case"focusout":fr=Ha=As=null;break;case"mousedown":Na=!0;break;case"contextmenu":case"mouseup":case"dragend":Na=!1,Nc(fe,i,ue);break;case"selectionchange":if(__)break;case"keydown":case"keyup":Nc(fe,i,ue)}var Ce;if(Ma)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else xs?wc(e,i)&&(De="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(De="onCompositionStart");De&&(yc&&i.locale!=="ko"&&(xs||De!=="onCompositionStart"?De==="onCompositionEnd"&&xs&&(Ce=vc()):(gi=ue,Aa="value"in gi?gi.value:gi.textContent,xs=!0)),me=Vn(Q,De),0<me.length&&(De=new gc(De,e,null,i,ue),fe.push({event:De,listeners:me}),Ce?De.data=Ce:(Ce=Ec(i),Ce!==null&&(De.data=Ce)))),(Ce=r_?n_(e,i):a_(e,i))&&(De=Vn(Q,"onBeforeInput"),0<De.length&&(me=new gc("onBeforeInput","beforeinput",null,i,ue),fe.push({event:me,listeners:De}),me.data=Ce)),Z_(fe,e,Q,i,ue)}cf(fe,t)})}function zr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Vn(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||a===null||(r=rr(e,i),r!=null&&s.unshift(zr(e,r,a)),r=rr(e,t),r!=null&&s.push(zr(e,r,a))),e.tag===3)return s;e=e.return}return[]}function tv(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,s,r){for(var a=t._reactName,y=[];i!==null&&i!==s;){var k=i,I=k.alternate,Q=k.stateNode;if(k=k.tag,I!==null&&I===s)break;k!==5&&k!==26&&k!==27||Q===null||(I=Q,r?(Q=rr(i,a),Q!=null&&y.unshift(zr(i,Q,I))):r||(Q=rr(i,a),Q!=null&&y.push(zr(i,Q,I)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var iv=/\r\n?/g,sv=/\u0000|\uFFFD/g;function ff(e){return(typeof e=="string"?e:""+e).replace(iv,`
49
- `).replace(sv,"")}function df(e,t){return t=ff(t),ff(e)===t}function Ne(e,t,i,s,r,a){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Cs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Cs(e,""+s);break;case"className":Qr(e,"class",s);break;case"tabIndex":Qr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Qr(e,i,s);break;case"style":fc(e,s,a);break;case"data":if(t!=="object"){Qr(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="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 a=="function"&&(i==="formAction"?(t!=="input"&&Ne(e,t,"name",r.name,r,null),Ne(e,t,"formEncType",r.formEncType,r,null),Ne(e,t,"formMethod",r.formMethod,r,null),Ne(e,t,"formTarget",r.formTarget,r,null)):(Ne(e,t,"encType",r.encType,r,null),Ne(e,t,"method",r.method,r,null),Ne(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Zt);break;case"onScroll":s!=null&&xe("scroll",e);break;case"onScrollEnd":s!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(L(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(L(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=en(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Zr(e,"popover",s);break;case"xlinkActuate":$t(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":$t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":$t(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":$t(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":$t(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":$t(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":$t(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":$t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":$t(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Zr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Md.get(i)||i,Zr(e,i,s))}}function lo(e,t,i,s,r,a){switch(i){case"style":fc(e,s,a);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(L(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(L(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Cs(e,s):(typeof s=="number"||typeof s=="bigint")&&Cs(e,""+s);break;case"onScroll":s!=null&&xe("scroll",e);break;case"onScrollEnd":s!=null&&xe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Zt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sc.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),t=i.slice(2,r?i.length-7:void 0),a=e[_t]||null,a=a!=null?a[i]:null,typeof a=="function"&&e.removeEventListener(t,a,r),typeof s=="function")){typeof a!="function"&&a!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,r);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Zr(e,i,s)}}}function ct(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var s=!1,r=!1,a;for(a in i)if(i.hasOwnProperty(a)){var y=i[a];if(y!=null)switch(a){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(L(137,t));default:Ne(e,t,a,y,i,null)}}r&&Ne(e,t,"srcSet",i.srcSet,i,null),s&&Ne(e,t,"src",i.src,i,null);return;case"input":xe("invalid",e);var k=a=y=r=null,I=null,Q=null;for(s in i)if(i.hasOwnProperty(s)){var ue=i[s];if(ue!=null)switch(s){case"name":r=ue;break;case"type":y=ue;break;case"checked":I=ue;break;case"defaultChecked":Q=ue;break;case"value":a=ue;break;case"defaultValue":k=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(L(137,t));break;default:Ne(e,t,s,ue,i,null)}}oc(e,a,k,I,Q,y,r,!1);return;case"select":xe("invalid",e),s=y=a=null;for(r in i)if(i.hasOwnProperty(r)&&(k=i[r],k!=null))switch(r){case"value":a=k;break;case"defaultValue":y=k;break;case"multiple":s=k;default:Ne(e,t,r,k,i,null)}t=a,i=y,e.multiple=!!s,t!=null?bs(e,!!s,t,!1):i!=null&&bs(e,!!s,i,!0);return;case"textarea":xe("invalid",e),a=r=s=null;for(y in i)if(i.hasOwnProperty(y)&&(k=i[y],k!=null))switch(y){case"value":s=k;break;case"defaultValue":r=k;break;case"children":a=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(L(91));break;default:Ne(e,t,y,k,i,null)}uc(e,s,r,a);return;case"option":for(I in i)if(i.hasOwnProperty(I)&&(s=i[I],s!=null))switch(I){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ne(e,t,I,s,i,null)}return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(s=0;s<Nr.length;s++)xe(Nr[s],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("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(Q in i)if(i.hasOwnProperty(Q)&&(s=i[Q],s!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(L(137,t));default:Ne(e,t,Q,s,i,null)}return;default:if(ba(t)){for(ue in i)i.hasOwnProperty(ue)&&(s=i[ue],s!==void 0&&lo(e,t,ue,s,i,void 0));return}}for(k in i)i.hasOwnProperty(k)&&(s=i[k],s!=null&&Ne(e,t,k,s,i,null))}function rv(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,a=null,y=null,k=null,I=null,Q=null,ue=null;for(ne in i){var fe=i[ne];if(i.hasOwnProperty(ne)&&fe!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":I=fe;default:s.hasOwnProperty(ne)||Ne(e,t,ne,null,s,fe)}}for(var ee in s){var ne=s[ee];if(fe=i[ee],s.hasOwnProperty(ee)&&(ne!=null||fe!=null))switch(ee){case"type":a=ne;break;case"name":r=ne;break;case"checked":Q=ne;break;case"defaultChecked":ue=ne;break;case"value":y=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(L(137,t));break;default:ne!==fe&&Ne(e,t,ee,ne,s,fe)}}Sa(e,y,k,I,Q,ue,a,r);return;case"select":ne=y=k=ee=null;for(a in i)if(I=i[a],i.hasOwnProperty(a)&&I!=null)switch(a){case"value":break;case"multiple":ne=I;default:s.hasOwnProperty(a)||Ne(e,t,a,null,s,I)}for(r in s)if(a=s[r],I=i[r],s.hasOwnProperty(r)&&(a!=null||I!=null))switch(r){case"value":ee=a;break;case"defaultValue":k=a;break;case"multiple":y=a;default:a!==I&&Ne(e,t,r,a,s,I)}t=k,i=y,s=ne,ee!=null?bs(e,!!i,ee,!1):!!s!=!!i&&(t!=null?bs(e,!!i,t,!0):bs(e,!!i,i?[]:"",!1));return;case"textarea":ne=ee=null;for(k in i)if(r=i[k],i.hasOwnProperty(k)&&r!=null&&!s.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Ne(e,t,k,null,s,r)}for(y in s)if(r=s[y],a=i[y],s.hasOwnProperty(y)&&(r!=null||a!=null))switch(y){case"value":ee=r;break;case"defaultValue":ne=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(L(91));break;default:r!==a&&Ne(e,t,y,r,s,a)}cc(e,ee,ne);return;case"option":for(var ve in i)if(ee=i[ve],i.hasOwnProperty(ve)&&ee!=null&&!s.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:Ne(e,t,ve,null,s,ee)}for(I in s)if(ee=s[I],ne=i[I],s.hasOwnProperty(I)&&ee!==ne&&(ee!=null||ne!=null))switch(I){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:Ne(e,t,I,ee,s,ne)}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 ge in i)ee=i[ge],i.hasOwnProperty(ge)&&ee!=null&&!s.hasOwnProperty(ge)&&Ne(e,t,ge,null,s,ee);for(Q in s)if(ee=s[Q],ne=i[Q],s.hasOwnProperty(Q)&&ee!==ne&&(ee!=null||ne!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(L(137,t));break;default:Ne(e,t,Q,ee,s,ne)}return;default:if(ba(t)){for(var ze in i)ee=i[ze],i.hasOwnProperty(ze)&&ee!==void 0&&!s.hasOwnProperty(ze)&&lo(e,t,ze,void 0,s,ee);for(ue in s)ee=s[ue],ne=i[ue],!s.hasOwnProperty(ue)||ee===ne||ee===void 0&&ne===void 0||lo(e,t,ue,ee,s,ne);return}}for(var V in i)ee=i[V],i.hasOwnProperty(V)&&ee!=null&&!s.hasOwnProperty(V)&&Ne(e,t,V,null,s,ee);for(fe in s)ee=s[fe],ne=i[fe],!s.hasOwnProperty(fe)||ee===ne||ee==null&&ne==null||Ne(e,t,fe,ee,s,ne)}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 nv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],a=r.transferSize,y=r.initiatorType,k=r.duration;if(a&&k&&_f(y)){for(y=0,k=r.responseEnd,s+=1;s<i.length;s++){var I=i[s],Q=I.startTime;if(Q>k)break;var ue=I.transferSize,fe=I.initiatorType;ue&&_f(fe)&&(I=I.responseEnd,y+=ue*(I<k?1:(k-Q)/(I-Q)))}if(--s,t+=8*(a+y)/(r.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 oo=null,co=null;function $n(e){return e.nodeType===9?e:e.ownerDocument}function vf(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 mf(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 uo(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 ho=null;function av(){var e=window.event;return e&&e.type==="popstate"?e===ho?!1:(ho=e,!0):(ho=null,!1)}var pf=typeof setTimeout=="function"?setTimeout:void 0,lv=typeof clearTimeout=="function"?clearTimeout:void 0,gf=typeof Promise=="function"?Promise:void 0,ov=typeof queueMicrotask=="function"?queueMicrotask:typeof gf<"u"?function(e){return gf.resolve(null).then(e).catch(cv)}:pf;function cv(e){setTimeout(function(){throw e})}function Hi(e){return e==="head"}function Sf(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),Js(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")jr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,jr(i);for(var a=i.firstChild;a;){var y=a.nextSibling,k=a.nodeName;a[ir]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&a.rel.toLowerCase()==="stylesheet"||i.removeChild(a),a=y}}else i==="body"&&jr(e.ownerDocument.body);i=r}while(i);Js(t)}function yf(e,t){var i=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function fo(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":fo(i),pa(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function uv(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ir])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=qt(e.nextSibling),e===null)break}return null}function hv(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=qt(e.nextSibling),e===null))return null;return e}function bf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qt(e.nextSibling),e===null))return null;return e}function _o(e){return e.data==="$?"||e.data==="$~"}function vo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function fv(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function qt(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 mo=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 qt(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 Ef(e,t,i){switch(t=$n(i),e){case"html":if(e=t.documentElement,!e)throw Error(L(452));return e;case"head":if(e=t.head,!e)throw Error(L(453));return e;case"body":if(e=t.body,!e)throw Error(L(454));return e;default:throw Error(L(451))}}function jr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pa(e)}var It=new Map,xf=new Set;function Zn(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var di=X.d;X.d={f:dv,r:_v,D:vv,C:mv,L:pv,m:gv,X:yv,S:Sv,M:bv};function dv(){var e=di.f(),t=Wn();return e||t}function _v(e){var t=gs(e);t!==null&&t.tag===5&&t.type==="form"?Iu(t):di.r(e)}var $s=typeof document>"u"?null:document;function Af(e,t,i){var s=$s;if(s&&typeof t=="string"&&t){var r=Ot(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),xf.has(r)||(xf.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),ct(t,"link",e),st(t),s.head.appendChild(t)))}}function vv(e){di.D(e),Af("dns-prefetch",e,null)}function mv(e,t){di.C(e,t),Af("preconnect",e,t)}function pv(e,t,i){di.L(e,t,i);var s=$s;if(s&&e&&t){var r='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Ot(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Ot(i.imageSizes)+'"]')):r+='[href="'+Ot(e)+'"]';var a=r;switch(t){case"style":a=Zs(e);break;case"script":a=Qs(e)}It.has(a)||(e=h({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),It.set(a,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Ur(a))||t==="script"&&s.querySelector(qr(a))||(t=s.createElement("link"),ct(t,"link",e),st(t),s.head.appendChild(t)))}}function gv(e,t){di.m(e,t);var i=$s;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ot(s)+'"][href="'+Ot(e)+'"]',a=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Qs(e)}if(!It.has(a)&&(e=h({rel:"modulepreload",href:e},t),It.set(a,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(qr(a)))return}s=i.createElement("link"),ct(s,"link",e),st(s),i.head.appendChild(s)}}}function Sv(e,t,i){di.S(e,t,i);var s=$s;if(s&&e){var r=Ss(s).hoistableStyles,a=Zs(e);t=t||"default";var y=r.get(a);if(!y){var k={loading:0,preload:null};if(y=s.querySelector(Ur(a)))k.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":t},i),(i=It.get(a))&&po(e,i);var I=y=s.createElement("link");st(I),ct(I,"link",e),I._p=new Promise(function(Q,ue){I.onload=Q,I.onerror=ue}),I.addEventListener("load",function(){k.loading|=1}),I.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Qn(y,t,s)}y={type:"stylesheet",instance:y,count:1,state:k},r.set(a,y)}}}function yv(e,t){di.X(e,t);var i=$s;if(i&&e){var s=Ss(i).hoistableScripts,r=Qs(e),a=s.get(r);a||(a=i.querySelector(qr(r)),a||(e=h({src:e,async:!0},t),(t=It.get(r))&&go(e,t),a=i.createElement("script"),st(a),ct(a,"link",e),i.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},s.set(r,a))}}function bv(e,t){di.M(e,t);var i=$s;if(i&&e){var s=Ss(i).hoistableScripts,r=Qs(e),a=s.get(r);a||(a=i.querySelector(qr(r)),a||(e=h({src:e,async:!0,type:"module"},t),(t=It.get(r))&&go(e,t),a=i.createElement("script"),st(a),ct(a,"link",e),i.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},s.set(r,a))}}function Df(e,t,i,s){var r=(r=F.current)?Zn(r):null;if(!r)throw Error(L(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Zs(i.href),i=Ss(r).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Zs(i.href);var a=Ss(r).hoistableStyles,y=a.get(e);if(y||(r=r.ownerDocument||r,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,y),(a=r.querySelector(Ur(e)))&&!a._p&&(y.instance=a,y.state.loading=5),It.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},It.set(e,i),a||Cv(r,e,i,y.state))),t&&s===null)throw Error(L(528,""));return y}if(t&&s!==null)throw Error(L(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qs(i),i=Ss(r).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(L(444,e))}}function Zs(e){return'href="'+Ot(e)+'"'}function Ur(e){return'link[rel="stylesheet"]['+e+"]"}function Tf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Cv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ct(t,"link",i),st(t),e.head.appendChild(t))}function Qs(e){return'[src="'+Ot(e)+'"]'}function qr(e){return"script[async]"+e}function Rf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ot(i.href)+'"]');if(s)return t.instance=s,st(s),s;var r=h({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),st(s),ct(s,"style",r),Qn(s,i.precedence,e),t.instance=s;case"stylesheet":r=Zs(i.href);var a=e.querySelector(Ur(r));if(a)return t.state.loading|=4,t.instance=a,st(a),a;s=Tf(i),(r=It.get(r))&&po(s,r),a=(e.ownerDocument||e).createElement("link"),st(a);var y=a;return y._p=new Promise(function(k,I){y.onload=k,y.onerror=I}),ct(a,"link",s),t.state.loading|=4,Qn(a,i.precedence,e),t.instance=a;case"script":return a=Qs(i.src),(r=e.querySelector(qr(a)))?(t.instance=r,st(r),r):(s=i,(r=It.get(a))&&(s=h({},i),go(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),st(r),ct(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(L(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Qn(s,i.precedence,e));return t.instance}function Qn(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,a=r,y=0;y<s.length;y++){var k=s[y];if(k.dataset.precedence===t)a=k;else if(a!==r)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function po(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function go(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jn=null;function kf(e,t,i){if(Jn===null){var s=new Map,r=Jn=new Map;r.set(i,s)}else r=Jn,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var a=i[r];if(!(a[ir]||a[nt]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var y=a.getAttribute(t)||"";y=e+y;var k=s.get(y);k?k.push(a):s.set(y,[a])}}return s}function Mf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function wv(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 Lf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ev(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=Zs(s.href),a=t.querySelector(Ur(r));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ea.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=a,st(a);return}a=t.ownerDocument||t,s=Tf(s),(r=It.get(r))&&po(s,r),a=a.createElement("link"),st(a);var y=a;y._p=new Promise(function(k,I){y.onload=k,y.onerror=I}),ct(a,"link",s),i.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ea.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var So=0;function xv(e,t){return e.stylesheets&&e.count===0&&ia(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&So===0&&(So=62500*nv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>So?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function ea(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ia(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ta=null;function ia(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ta=new Map,t.forEach(Av,e),ta=null,ea.call(e))}function Av(e,t){if(!(t.state.loading&4)){var i=ta.get(e);if(i)var s=i.get(null);else{i=new Map,ta.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<r.length;a++){var y=r[a];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(i.set(y.dataset.precedence,y),s=y)}s&&i.set(null,s)}r=t.instance,y=r.getAttribute("data-precedence"),a=i.get(y)||s,a===s&&i.set(null,r),i.set(y,r),this.count++,s=ea.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),a?a.parentNode.insertBefore(r,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Ir={$$typeof:l,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function Dv(e,t,i,s,r,a,y,k,I){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=da(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.hiddenUpdates=da(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=a,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Of(e,t,i,s,r,a,y,k,I,Q,ue,fe){return e=new Dv(e,t,i,y,I,Q,ue,fe,k),t=1,a===!0&&(t|=24),a=xt(3,null,null,t),e.current=a,a.stateNode=e,t=Za(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:s,isDehydrated:i,cache:t},tl(a),e}function Bf(e){return e?(e=Rs,e):Rs}function Hf(e,t,i,s,r,a){r=Bf(r),s.context===null?s.context=r:s.pendingContext=r,s=Ei(t),s.payload={element:i},a=a===void 0?null:a,a!==null&&(s.callback=a),i=xi(e,s,t),i!==null&&(yt(i,e,t),Sr(i,e,t))}function Nf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function yo(e,t){Nf(e,t),(e=e.alternate)&&Nf(e,t)}function zf(e){if(e.tag===13||e.tag===31){var t=Qi(e,67108864);t!==null&&yt(t,e,67108864),yo(e,67108864)}}function jf(e){if(e.tag===13||e.tag===31){var t=kt();t=_a(t);var i=Qi(e,t);i!==null&&yt(i,e,t),yo(e,t)}}var sa=!0;function Tv(e,t,i,s){var r=W.T;W.T=null;var a=X.p;try{X.p=2,bo(e,t,i,s)}finally{X.p=a,W.T=r}}function Rv(e,t,i,s){var r=W.T;W.T=null;var a=X.p;try{X.p=8,bo(e,t,i,s)}finally{X.p=a,W.T=r}}function bo(e,t,i,s){if(sa){var r=Co(s);if(r===null)ao(e,t,s,ra,i),qf(e,s);else if(Mv(r,e,t,i,s))s.stopPropagation();else if(qf(e,s),t&4&&-1<kv.indexOf(e)){for(;r!==null;){var a=gs(r);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var y=Fi(a.pendingLanes);if(y!==0){var k=a;for(k.pendingLanes|=2,k.entangledLanes|=2;y;){var I=1<<31-wt(y);k.entanglements[1]|=I,y&=~I}Vt(a),(Me&6)===0&&(qn=et()+500,Hr(0))}}break;case 31:case 13:k=Qi(a,2),k!==null&&yt(k,a,2),Wn(),yo(a,2)}if(a=Co(s),a===null&&ao(e,t,s,ra,i),a===r)break;r=a}r!==null&&s.stopPropagation()}else ao(e,t,s,null,i)}}function Co(e){return e=wa(e),wo(e)}var ra=null;function wo(e){if(ra=null,e=ps(e),e!==null){var t=le(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=P(t),e!==null)return e;e=null}else if(i===31){if(e=u(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 ra=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(Mt()){case vi:return 2;case _s:return 8;case bt:case vs:return 32;case Wt:return 268435456;default:return 32}default:return 32}}var Eo=!1,Ni=null,zi=null,ji=null,Wr=new Map,Pr=new Map,Ui=[],kv="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 qf(e,t){switch(e){case"focusin":case"focusout":Ni=null;break;case"dragenter":case"dragleave":zi=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":Wr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pr.delete(t.pointerId)}}function Kr(e,t,i,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=gs(t),t!==null&&zf(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Mv(e,t,i,s,r){switch(t){case"focusin":return Ni=Kr(Ni,e,t,i,s,r),!0;case"dragenter":return zi=Kr(zi,e,t,i,s,r),!0;case"mouseover":return ji=Kr(ji,e,t,i,s,r),!0;case"pointerover":var a=r.pointerId;return Wr.set(a,Kr(Wr.get(a)||null,e,t,i,s,r)),!0;case"gotpointercapture":return a=r.pointerId,Pr.set(a,Kr(Pr.get(a)||null,e,t,i,s,r)),!0}return!1}function If(e){var t=ps(e.target);if(t!==null){var i=le(t);if(i!==null){if(t=i.tag,t===13){if(t=P(i),t!==null){e.blockedOn=t,ec(e.priority,function(){jf(i)});return}}else if(t===31){if(t=u(i),t!==null){e.blockedOn=t,ec(e.priority,function(){jf(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 na(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Co(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Ca=s,i.target.dispatchEvent(s),Ca=null}else return t=gs(i),t!==null&&zf(t),e.blockedOn=i,!1;t.shift()}return!0}function Wf(e,t,i){na(e)&&i.delete(t)}function Lv(){Eo=!1,Ni!==null&&na(Ni)&&(Ni=null),zi!==null&&na(zi)&&(zi=null),ji!==null&&na(ji)&&(ji=null),Wr.forEach(Wf),Pr.forEach(Wf)}function aa(e,t){e.blockedOn===t&&(e.blockedOn=null,Eo||(Eo=!0,T.unstable_scheduleCallback(T.unstable_NormalPriority,Lv)))}var la=null;function Pf(e){la!==e&&(la=e,T.unstable_scheduleCallback(T.unstable_NormalPriority,function(){la===e&&(la=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(wo(s||i)===null)continue;break}var a=gs(i);a!==null&&(e.splice(t,3),t-=3,bl(a,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function Js(e){function t(I){return aa(I,e)}Ni!==null&&aa(Ni,e),zi!==null&&aa(zi,e),ji!==null&&aa(ji,e),Wr.forEach(t),Pr.forEach(t);for(var i=0;i<Ui.length;i++){var s=Ui[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Ui.length&&(i=Ui[0],i.blockedOn===null);)If(i),i.blockedOn===null&&Ui.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],a=i[s+1],y=r[_t]||null;if(typeof a=="function")y||Pf(i);else if(y){var k=null;if(a&&a.hasAttribute("formAction")){if(r=a,y=a[_t]||null)k=y.formAction;else if(wo(r)!==null)continue}else k=y.action;typeof k=="function"?i[s+1]=k:(i.splice(s,3),s-=3),Pf(i)}}}function Kf(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(y){return r=y})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function xo(e){this._internalRoot=e}oa.prototype.render=xo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));var i=t.current,s=kt();Hf(i,s,e,t,null,null)},oa.prototype.unmount=xo.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),Wn(),t[ms]=null}};function oa(e){this._internalRoot=e}oa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jo();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ui.length&&t!==0&&t<Ui[i].priority;i++);Ui.splice(i,0,e),i===0&&If(e)}};var Yf=q.version;if(Yf!=="19.2.7")throw Error(L(527,Yf,"19.2.7"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=d(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Ov={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ca.isDisabled&&ca.supportsFiber)try{Gi=ca.inject(Ov),Ct=ca}catch{}}return Gr.createRoot=function(e,t){if(!te(e))throw Error(L(299));var i=!1,s="",r=Zu,a=Qu,y=Ju;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=Of(e,1,!1,null,null,i,s,null,r,a,y,Kf),e[ms]=t.current,no(e),new xo(t)},Gr.hydrateRoot=function(e,t,i){if(!te(e))throw Error(L(299));var s=!1,r="",a=Zu,y=Qu,k=Ju,I=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(a=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(k=i.onRecoverableError),i.formState!==void 0&&(I=i.formState)),t=Of(e,1,!0,t,i??null,s,r,I,a,y,k,Kf),t.context=Bf(null),i=t.current,s=kt(),s=_a(s),r=Ei(s),r.callback=null,xi(i,r,s),i=s,t.current.lanes=i,tr(t,i),Vt(t),e[ms]=t.current,no(e),new oa(t)},Gr.version="19.2.7",Gr}var td;function Yv(){if(td)return Ro.exports;td=1;function T(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(T)}catch(q){console.error(q)}}return T(),Ro.exports=Kv(),Ro.exports}var Gv=Yv();const Fv="data:image/svg+xml,%3csvg%20width='115'%20height='122'%20viewBox='0%200%20115%20122'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M105.267%2060.7219L98.8902%2071.7648L92.1353%2083.4669L83.3114%2098.7521L70.18%20121.491H0L13.1249%2098.7521H57.042L72.6274%2071.7648L79.0038%2060.7219L72.2619%2049.0459H98.5247L105.267%2060.7219Z'%20fill='%236BE195'/%3e%3cpath%20d='M114.072%200L100.954%2022.7189H57.0694L57.0498%2022.6928L57.0368%2022.7189L41.8365%2049.047L35.0945%2060.723L41.471%2071.7659H15.2016L8.8252%2060.723L15.5671%2049.047L21.9631%2037.978L30.774%2022.7189L43.8923%200H114.072Z'%20fill='%236BE195'/%3e%3c/svg%3e",cd="sapiom-harness-theme",Uo=new Set;function Xv(){var T;return typeof window<"u"&&((T=window.matchMedia)==null?void 0:T.call(window,"(prefers-color-scheme: dark)").matches)===!0}function Vv(){const T=typeof window<"u"?window.localStorage.getItem(cd):null;return T==="light"||T==="dark"?T:Xv()?"dark":"light"}let Yo=Vv();function ua(){return Yo}function $v(T){Yo=T,document.documentElement.dataset.theme=T,window.localStorage.setItem(cd,T),Uo.forEach(q=>q(T))}function Zv(){$v(Yo==="dark"?"light":"dark")}function Go(T){return Uo.add(T),()=>Uo.delete(T)}/**
50
- * @license lucide-react v1.23.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const ud=(...T)=>T.filter((q,G,L)=>!!q&&q.trim()!==""&&L.indexOf(q)===G).join(" ").trim();/**
55
- * @license lucide-react v1.23.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */const Qv=T=>T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
60
- * @license lucide-react v1.23.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const Jv=T=>T.replace(/^([A-Z])|[\s-_]+(\w)/g,(q,G,L)=>L?L.toUpperCase():G.toLowerCase());/**
65
- * @license lucide-react v1.23.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const id=T=>{const q=Jv(T);return q.charAt(0).toUpperCase()+q.slice(1)};/**
70
- * @license lucide-react v1.23.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */var Oo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
75
- * @license lucide-react v1.23.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const em=T=>{for(const q in T)if(q.startsWith("aria-")||q==="role"||q==="title")return!0;return!1},tm=ae.createContext({}),im=()=>ae.useContext(tm),sm=ae.forwardRef(({color:T,size:q,strokeWidth:G,absoluteStrokeWidth:L,className:te="",children:le,iconNode:P,...u},f)=>{const{size:d=24,strokeWidth:g=2,absoluteStrokeWidth:h=!1,color:p="currentColor",className:b=""}=im()??{},E=L??h?Number(G??g)*24/Number(q??d):G??g;return ae.createElement("svg",{ref:f,...Oo,width:q??d??Oo.width,height:q??d??Oo.height,stroke:T??p,strokeWidth:E,className:ud("lucide",b,te),...!le&&!em(u)&&{"aria-hidden":"true"},...u},[...P.map(([m,o])=>ae.createElement(m,o)),...Array.isArray(le)?le:[le]])});/**
80
- * @license lucide-react v1.23.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */const Ke=(T,q)=>{const G=ae.forwardRef(({className:L,...te},le)=>ae.createElement(sm,{ref:le,iconNode:q,className:ud(`lucide-${Qv(id(T))}`,`lucide-${T}`,L),...te}));return G.displayName=id(T),G};/**
85
- * @license lucide-react v1.23.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */const rm=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],nm=Ke("arrow-left",rm);/**
90
- * @license lucide-react v1.23.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const am=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lm=Ke("chevron-down",am);/**
95
- * @license lucide-react v1.23.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */const om=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],cm=Ke("circle-question-mark",om);/**
100
- * @license lucide-react v1.23.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const um=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],hm=Ke("cloud",um);/**
105
- * @license lucide-react v1.23.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const fm=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],dm=Ke("corner-left-up",fm);/**
110
- * @license lucide-react v1.23.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const _m=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],vm=Ke("external-link",_m);/**
115
- * @license lucide-react v1.23.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const mm=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],pm=Ke("folder",mm);/**
120
- * @license lucide-react v1.23.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const gm=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Sm=Ke("history",gm);/**
125
- * @license lucide-react v1.23.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const ym=[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],bm=Ke("image-up",ym);/**
130
- * @license lucide-react v1.23.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const Cm=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],wm=Ke("moon",Cm);/**
135
- * @license lucide-react v1.23.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const Em=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],xm=Ke("paperclip",Em);/**
140
- * @license lucide-react v1.23.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const Am=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Dm=Ke("play",Am);/**
145
- * @license lucide-react v1.23.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const Tm=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],Rm=Ke("plug",Tm);/**
150
- * @license lucide-react v1.23.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const km=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mm=Ke("plus",km);/**
155
- * @license lucide-react v1.23.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const Lm=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Om=Ke("radio",Lm);/**
160
- * @license lucide-react v1.23.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const Bm=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Hm=Ke("refresh-cw",Bm);/**
165
- * @license lucide-react v1.23.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const Nm=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],zm=Ke("search",Nm);/**
170
- * @license lucide-react v1.23.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const jm=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Um=Ke("settings",jm);/**
175
- * @license lucide-react v1.23.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const qm=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Im=Ke("sparkles",qm);/**
180
- * @license lucide-react v1.23.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const Wm=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Pm=Ke("sun",Wm);/**
185
- * @license lucide-react v1.23.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const Km=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ym=Ke("triangle-alert",Km);/**
190
- * @license lucide-react v1.23.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const Gm=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Fm=Ke("wand-sparkles",Gm);/**
195
- * @license lucide-react v1.23.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const Xm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vm=Ke("x",Xm);/**
200
- * @license lucide-react v1.23.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const $m=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Zm=Ke("zap",$m),Qm={ArrowLeft:nm,ChevronDown:lm,Cloud:hm,CornerLeftUp:dm,ExternalLink:vm,Folder:pm,History:Sm,ImageUp:bm,Moon:wm,Paperclip:xm,Play:Dm,Plug:Rm,Plus:Mm,Radio:Om,RefreshCw:Hm,Search:zm,Settings:Um,Sparkles:Im,Sun:Pm,TriangleAlert:Ym,Wand2:Fm,X:Vm,Zap:Zm};function Ve({name:T,size:q=16}){const G=Qm[T]??cm;return M.jsx(G,{size:q,strokeWidth:1.75,"aria-hidden":"true"})}const Jm=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),ep=Jm?"⌘K":"Ctrl+K";function tp(T,q){return q==="env-forced-off"?"analytics off (env)":T?"analytics on":"analytics off"}function ip(T,q,G){return q==="env-forced-off"?`Remote analytics disabled by ${G?`$${G}`:"environment variable"}. Click to open settings.`:T?"Remote analytics enabled. Click to open settings.":"Remote analytics disabled. Click to open settings."}function sp(T,q){return q==="env-forced-off"?"env":T?"on":"off"}function rp({authenticated:T,organizationName:q,onOpenPalette:G,telemetryOptIn:L,consentSource:te,consentEnvReason:le,onOpenSettings:P}){const[u,f]=ae.useState(ua());ae.useEffect(()=>Go(f),[]);const d=sp(L,te),g=tp(L,te),h=ip(L,te,le);return M.jsxs("header",{className:"brand-header",children:[M.jsxs("div",{className:"brand-lockup",children:[M.jsx("img",{src:Fv,alt:"",className:"brand-mark"}),M.jsx("span",{className:"brand-name",children:"Sapiom"}),M.jsx("span",{className:"brand-divider"}),M.jsx("span",{className:"brand-product",children:"Harness"})]}),M.jsxs("div",{className:"brand-header-right",children:[M.jsxs("button",{className:"palette-trigger","data-testid":"palette-trigger","aria-label":"Jump to session, workflow, or path",onClick:G,children:[M.jsx(Ve,{name:"Search",size:13}),"Jump",M.jsx("span",{className:"palette-trigger-hint",children:ep})]}),M.jsxs("button",{className:"telemetry-chip","data-testid":"telemetry-chip","data-state":d,"aria-label":h,title:h,onClick:P,children:[M.jsx("span",{className:"telemetry-chip-dot","aria-hidden":"true"}),M.jsx("span",{className:"telemetry-chip-label",children:g})]}),M.jsx("button",{className:"theme-toggle","data-testid":"theme-toggle","aria-label":u==="dark"?"Switch to light mode":"Switch to dark mode",title:u==="dark"?"Switch to light mode":"Switch to dark mode",onClick:Zv,children:M.jsx(Ve,{name:u==="dark"?"Sun":"Moon",size:15})}),M.jsxs("div",{className:"brand-identity","data-testid":"brand-identity",children:[M.jsx("span",{className:"identity-dot","data-authenticated":T}),T?q??"Signed in":"Not signed in"]})]})]})}const hd=Date.now(),hs=T=>new Date(hd-T*6e4).toISOString(),ha=T=>new Date(hd-T*24*60*6e4).toISOString(),np="/Users/demo/acme-app";hs(1),hs(1),hs(42),hs(20),ha(2),ha(1),hs(0),hs(0);hs(1),ha(1),ha(1);function ap(){return!1}function fd(T){return(T==null?void 0:T.boundWorkflowPath)??null}class fs extends Error{constructor(G,L,te){super(L);Ao(this,"status");Ao(this,"reason");this.name="ApiError",this.status=G,this.reason=te}}function fa(){const T=window.__HARNESS__;return T!=null&&T.token?T.token:new URLSearchParams(window.location.search).get("token")??""}class lp{async request(q,G){const L=await fetch(q,{...G,headers:{"Content-Type":"application/json","X-Harness-Token":fa(),...G==null?void 0:G.headers}});if(!L.ok){const te=await L.text().catch(()=>"");let le;try{const P=te?JSON.parse(te):void 0;P&&typeof P=="object"&&typeof P.error=="string"&&(le=P.error)}catch{}throw new fs(L.status,`${(G==null?void 0:G.method)??"GET"} ${q} → ${L.status}${te?`: ${te}`:""}`,le)}if(L.status!==204)return await L.json()}getState(){return this.request("/api/state")}createSession(q){return this.request("/api/sessions",{method:"POST",body:JSON.stringify(q)})}listSessions(){return this.request("/api/sessions")}sessionHistory(q){return this.request(`/api/sessions/history?cwd=${encodeURIComponent(q)}`)}resumeSession(q){return this.request(`/api/sessions/${encodeURIComponent(q)}/resume`,{method:"POST"})}async killSession(q){await this.request(`/api/sessions/${encodeURIComponent(q)}`,{method:"DELETE"})}async injectInput(q,G){await this.request(`/api/sessions/${encodeURIComponent(q)}/input`,{method:"POST",body:JSON.stringify(G)})}attachImage(q,G){return this.request(`/api/sessions/${encodeURIComponent(q)}/image`,{method:"POST",body:JSON.stringify(G)})}listHarnesses(){return this.request("/api/harnesses")}listWorkflows(){return this.request("/api/workflows")}connectWorkflow(q){return this.request("/api/workflows/connect",{method:"POST",body:JSON.stringify({path:q})})}scanWorkflows(q){return this.request("/api/workflows/scan",{method:"POST",body:JSON.stringify({root:q})})}listMacros(){return this.request("/api/macros")}async runMacro(q,G){await this.request(`/api/macros/${encodeURIComponent(q)}/run`,{method:"POST",body:JSON.stringify(G)})}getSettings(){return this.request("/api/settings")}updateSettings(q){return this.request("/api/settings",{method:"PATCH",body:JSON.stringify(q)})}listDir(q){const G=q?`?path=${encodeURIComponent(q)}`:"";return this.request(`/api/fs/list${G}`)}bindWorkflow(q,G){const L={workflowPath:G};return this.request(`/api/sessions/${encodeURIComponent(q)}/workflow`,{method:"PATCH",body:JSON.stringify(L)})}seedSampleProject(){return this.request("/api/sample-project",{method:"POST"})}listSkills(){return this.request("/api/skills")}getSkill(q){return this.request(`/api/skills/${encodeURIComponent(q)}`)}}function op(){return new lp}function cp(T){return T.find(q=>q.id==="visualize")}function dd(T,q,G){if(T.requiresWorkflow){if(!q)return"Select a workflow first";if(T.action.kind==="open-url"&&T.action.url.includes("{{workflow.definitionId}}")&&q.definitionId==null)return"Not deployed yet"}return T.action.kind!=="open-url"&&!G?"Start a session first":null}function up(T,q){return T.replace("{{workflow.definitionId}}",String((q==null?void 0:q.definitionId)??""))}function Ii(T,q,G){const L={event:T,...q?{data:q}:{},...G?{harnessSessionId:G}:{}};fetch("/api/track",{method:"POST",headers:{"Content-Type":"application/json","X-Harness-Token":fa()},body:JSON.stringify(L),keepalive:!0}).catch(()=>{})}function hp({workflow:T,onReVisualize:q,reVisualizeDisabledReason:G}){return M.jsxs("div",{className:"workflow-actions-header","data-testid":"workflow-actions-header",children:[M.jsx("span",{className:"workflow-actions-name",children:T.name}),T.definitionId!=null&&M.jsx("span",{className:"workflow-dot workflow-dot-pinned","data-tooltip":"Deployed to production"}),M.jsx("button",{className:"macro-icon-btn canvas-refresh-btn","aria-label":"Re-visualize","data-testid":"canvas-revisualize","data-tooltip":G??"Re-visualize",disabled:!!G,onClick:q,children:M.jsx(Ve,{name:"RefreshCw",size:14})})]})}function fp({sessionId:T,lastMessage:q,boundWorkflow:G,activeSessionId:L,macros:te,tasks:le,onRunMacro:P}){const[u,f]=ae.useState(!1),[d,g]=ae.useState(0),[h,p]=ae.useState(ua()),[b,E]=ae.useState(!1),[m,o]=ae.useState(!0),[c,n]=ae.useState(new Set);ae.useEffect(()=>Go(p),[]),ae.useEffect(()=>{if(f(!1),o(!0),!T||ap())return;let j=!1;return E(!0),fetch(`/canvas/${T}/`,{method:"HEAD"}).then(N=>!j&&f(N.ok)).catch(()=>{}).finally(()=>!j&&E(!1)),()=>{j=!0}},[T]),ae.useEffect(()=>{!q||!T||q.type==="canvas.reload"&&q.harnessSessionId===T&&(f(!0),o(!0),g(j=>j+1))},[q,T]);const l=(G==null?void 0:G.path)??null;ae.useEffect(()=>{o(!0),g(j=>j+1)},[l]);const _=cp(te),C=_?dd(_,G,L):null,w=le.filter(j=>j.harnessSessionId===T&&(j.workflowPath==null||j.workflowPath===l)),S=w.find(j=>j.status==="running")??null,v=w.filter(j=>j.status!=="running").sort((j,N)=>(N.endedAt??"").localeCompare(j.endedAt??""))[0],x=!S&&(v==null?void 0:v.status)==="failed"&&!c.has(v.id)?v:null,B=x?te.find(j=>j.id===x.macroId)??null:null,U=()=>{_&&(P(_),Ii("visualize.triggered"))};return M.jsxs("aside",{className:"canvas-pane",children:[G&&M.jsx(hp,{workflow:G,onReVisualize:U,reVisualizeDisabledReason:C}),T?x?M.jsxs("div",{className:"canvas-task-failed","data-testid":"canvas-task-failed",children:[M.jsxs("p",{className:"canvas-task-title",children:[M.jsx(Ve,{name:"TriangleAlert",size:14})," ",x.label," failed."]}),x.errorTail&&M.jsx("pre",{className:"canvas-task-error",children:x.errorTail}),M.jsxs("div",{className:"canvas-task-actions",children:[B&&M.jsx("button",{className:"btn-primary","data-testid":"canvas-task-retry",onClick:()=>P(B),children:"Retry"}),M.jsx("button",{className:"btn-ghost","data-testid":"canvas-task-dismiss",onClick:()=>n(j=>{const N=new Set(j);return N.add(x.id),N}),children:"Dismiss"})]})]}):S&&!u?M.jsxs("div",{className:"canvas-task-activity","data-testid":"canvas-task-activity",children:[M.jsxs("div",{className:"canvas-task-title",children:[M.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),M.jsxs("span",{children:[S.label," is running…"]})]}),S.statusLines.length>0&&M.jsx("ul",{className:"canvas-task-lines","data-testid":"canvas-task-lines",children:S.statusLines.slice(-8).map((j,N)=>M.jsx("li",{children:j},`${N}-${j}`))}),M.jsx("p",{className:"canvas-empty-hint",children:"Running as a background task — your session stays free. The canvas reloads here when it finishes."})]}):b?M.jsxs("div",{className:"canvas-loading","data-testid":"canvas-loading",children:[M.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),M.jsx("p",{className:"canvas-empty-hint",children:"Loading canvas…"})]}):u?M.jsxs("div",{className:"canvas-frame-wrap",children:[m&&M.jsxs("div",{className:"canvas-loading canvas-loading--overlay","data-testid":"canvas-loading",children:[M.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),M.jsx("p",{className:"canvas-empty-hint",children:"Rendering diagram…"})]}),S&&M.jsxs("div",{className:"canvas-task-activity canvas-task-activity--overlay","data-testid":"canvas-task-activity",children:[M.jsxs("div",{className:"canvas-task-title",children:[M.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),M.jsxs("span",{children:[S.label," is running…"]})]}),S.statusLines.length>0&&M.jsx("ul",{className:"canvas-task-lines","data-testid":"canvas-task-lines",children:S.statusLines.slice(-8).map((j,N)=>M.jsx("li",{children:j},`${N}-${j}`))}),M.jsx("p",{className:"canvas-empty-hint",children:"Running as a background task — your session stays free. The canvas reloads here when it finishes."})]}),M.jsx("iframe",{className:"canvas-iframe",src:`/canvas/${T}/?theme=${h}`,sandbox:"allow-scripts",onLoad:()=>o(!1)},`${T}:${d}`)]}):M.jsxs("div",{className:"canvas-empty",children:[M.jsx("p",{children:"Nothing generated yet."}),_&&M.jsxs("button",{className:"btn-primary canvas-visualize-cta","data-testid":"canvas-visualize-cta","data-tooltip":C??_.label,disabled:!!C,onClick:()=>{P(_),Ii("visualize.triggered")},children:[M.jsx(Ve,{name:"Sparkles",size:14})," Visualize"]}),M.jsxs("p",{className:"canvas-empty-hint",children:["Ask your agent to visualize, or write HTML directly to ",M.jsx("code",{children:".sapiom/canvas/index.html"})," — this pane hot-reloads whenever it changes."]})]}):M.jsx("div",{className:"canvas-empty",children:"Start a session to see its canvas here."})]})}function dp(T,q){if(!T)return 0;const G=T.toLowerCase(),L=q.toLowerCase();let te=0,le=0,P=0;for(let u=0;u<G.length;u++){const f=G[u],d=L.indexOf(f,le);if(d===-1)return null;P=d===le?P+1:0,te+=10-Math.min(d-le,8),te+=P*3,d===0&&(te+=5),le=d+1}return te}const _p={session:"Radio",workflow:"Folder",recent:"Folder",path:"Folder"};function vp({sessions:T,workflows:q,recentDirs:G,listDir:L,onSelectSession:te,onOpenPath:le,onClose:P}){const[u,f]=ae.useState(""),[d,g]=ae.useState([]),[h,p]=ae.useState(!1),[b,E]=ae.useState(0),m=ae.useRef(null);ae.useEffect(()=>{var _;(_=m.current)==null||_.focus()},[]);const o=u.startsWith("/")||u.startsWith("~");ae.useEffect(()=>{if(!o){g([]);return}let _=!1;p(!0);const C=setTimeout(()=>{L(u).then(w=>{_||g(w.dirs)}).catch(()=>{}).finally(()=>!_&&p(!1))},150);return()=>{_=!0,clearTimeout(C)}},[u,o,L]);const c=ae.useMemo(()=>{if(o){const x=u.trim(),B=x?[{id:`confirm:${x}`,kind:"path",label:x,meta:"Open this path",path:x}]:[],U=d.map(j=>({id:`dir:${j.path}`,kind:"path",label:j.name,meta:j.path,path:j.path}));return[...B,...U]}const _=T.filter(x=>x.status!=="exited").map(x=>({id:`session:${x.id}`,kind:"session",label:x.title,meta:x.cwd,sessionId:x.id})),C=q.map(x=>({id:`workflow:${x.path}`,kind:"workflow",label:x.name,meta:x.path,path:x.path})),w=new Set(q.map(x=>x.path)),S=G.filter(x=>!w.has(x)).map(x=>({id:`recent:${x}`,kind:"recent",label:x.split("/").filter(Boolean).pop()??x,meta:x,path:x})),v=[..._,...C,...S];return u?v.map(x=>({item:x,score:dp(u,`${x.label} ${x.meta}`)})).filter(x=>x.score!==null).sort((x,B)=>B.score-x.score).map(x=>x.item).slice(0,20):v.slice(0,20)},[u,o,d,T,q,G]);ae.useEffect(()=>E(0),[c.length,u]);const n=_=>{_.kind==="session"&&_.sessionId?te(_.sessionId):_.path&&le(_.path),P()},l=_=>{if(_.key==="ArrowDown")_.preventDefault(),E(C=>Math.min(C+1,c.length-1));else if(_.key==="ArrowUp")_.preventDefault(),E(C=>Math.max(C-1,0));else if(_.key==="Enter"){_.preventDefault();const C=c[b];C&&n(C)}else _.key==="Escape"&&P()};return M.jsx("div",{className:"modal-backdrop",onClick:P,children:M.jsxs("div",{className:"modal command-palette",onClick:_=>_.stopPropagation(),children:[M.jsx("input",{ref:m,className:"command-palette-input","data-testid":"command-palette-input",placeholder:"Jump to a session, workflow, or path…",value:u,onChange:_=>f(_.target.value),onKeyDown:l}),M.jsxs("div",{className:"command-palette-list","data-testid":"command-palette-list",children:[o&&h&&M.jsx("div",{className:"command-palette-empty",children:"Loading…"}),c.length===0&&!h&&M.jsx("div",{className:"command-palette-empty",children:"No matches"}),c.map((_,C)=>M.jsxs("button",{type:"button",className:"command-palette-item"+(C===b?" is-selected":""),"data-testid":`command-palette-item-${C}`,onMouseEnter:()=>E(C),onClick:()=>n(_),children:[M.jsx(Ve,{name:_p[_.kind],size:14}),M.jsx("span",{className:"command-palette-item-label",children:_.label}),M.jsx("span",{className:"command-palette-item-meta",children:_.meta})]},_.id))]})]})})}function mp({session:T,onResume:q,onClose:G}){const L=T.agentSessionId!=null;return M.jsxs("div",{className:"dead-session-pane","data-testid":"dead-session-pane",children:[M.jsx("div",{className:"dead-session-title",children:"Session exited"}),M.jsxs("div",{className:"dead-session-meta",children:[T.cwd,T.exitCode!=null&&` · exit code ${T.exitCode}`]}),M.jsxs("div",{className:"dead-session-actions",children:[M.jsx("button",{className:"btn-primary","data-testid":"dead-session-resume",onClick:q,disabled:!L,title:L?void 0:"This session can't be resumed — it exited before establishing a session id",children:"Resume"}),M.jsx("button",{className:"btn-ghost","data-testid":"dead-session-close",onClick:G,children:"Close"})]}),!L&&M.jsx("div",{className:"dead-session-resume-reason","data-testid":"dead-session-resume-reason",children:"This session can't be resumed — it exited before establishing a session id."})]})}const pp="~/.sapiom/harness",gp={events:`${pp}/events.ndjson`},Sp=["image/png","image/jpeg","image/gif","image/webp"],sd=10*1024*1024,Bo=T=>T<1024?`${T} B`:T<1024*1024?`${Math.round(T/1024)} KB`:`${(T/(1024*1024)).toFixed(1)} MB`,yp=T=>new Promise((q,G)=>{const L=new FileReader;L.onload=()=>q(String(L.result)),L.onerror=()=>G(L.error??new Error("could not read file")),L.readAsDataURL(T)}),bp=({sessionId:T,harness:q,api:G,showToast:L,children:te})=>{const[le,P]=ae.useState(null),[u,f]=ae.useState([]),[d,g]=ae.useState(!1),[h,p]=ae.useState(!1),b=ae.useRef(null),E=ae.useRef(0);ae.useEffect(()=>{let S=!1;return G.listHarnesses().then(v=>{S||P(v)}).catch(()=>{}),()=>{S=!0}},[G]);const m=ae.useMemo(()=>{var S;return le?((S=le.find(v=>v.id===q))==null?void 0:S.imageInput)??!1:!0},[le,q]);ae.useEffect(()=>{f([]),E.current=0,g(!1)},[T]);const o=ae.useCallback(async S=>{const v=S.filter(B=>B.type.startsWith("image/"));if(v.length===0)return;const x=[];for(const B of v){if(!Sp.includes(B.type)){L(`${B.name||"image"}: ${B.type} isn't a supported image type.`);continue}if(B.size>sd){L(`${B.name||"image"} is ${Bo(B.size)} — over the ${Bo(sd)} limit.`);continue}try{const U=await yp(B);x.push({id:crypto.randomUUID(),dataUrl:U,filename:B.name||"pasted-image",mediaType:B.type,bytes:B.size})}catch{L(`Could not read ${B.name||"image"}.`)}}x.length>0&&f(B=>[...B,...x])},[L]);ae.useEffect(()=>{if(!m)return;const S=v=>{var U;const x=(U=v.clipboardData)==null?void 0:U.items;if(!x)return;const B=[];for(let j=0;j<x.length;j+=1){const N=x[j];if(N.kind==="file"&&N.type.startsWith("image/")){const J=N.getAsFile();J&&B.push(J)}}B.length!==0&&(v.preventDefault(),o(B))};return window.addEventListener("paste",S),()=>window.removeEventListener("paste",S)},[m,o]);const c=ae.useCallback(S=>{f(v=>v.filter(x=>x.id!==S))},[]),n=ae.useCallback(async()=>{if(u.length===0||h)return;p(!0);let S=null;for(const v of u)try{await G.attachImage(T,{dataUrl:v.dataUrl,filename:v.filename}),f(x=>x.filter(B=>B.id!==v.id))}catch(x){S=x instanceof fs&&x.reason?x.reason:x.message;break}p(!1),S&&L(S)},[u,h,G,T,L]),l=ae.useCallback(S=>{Array.from(S.dataTransfer.types).includes("Files")&&(E.current+=1,g(!0))},[]),_=ae.useCallback(S=>{Array.from(S.dataTransfer.types).includes("Files")&&S.preventDefault()},[]),C=ae.useCallback(()=>{E.current=Math.max(0,E.current-1),E.current===0&&g(!1)},[]),w=ae.useCallback(S=>{Array.from(S.dataTransfer.types).includes("Files")&&(S.preventDefault(),E.current=0,g(!1),o(Array.from(S.dataTransfer.files)))},[o]);return m?M.jsxs("div",{className:"image-composer","data-testid":"image-composer",onDragEnter:l,onDragOver:_,onDragLeave:C,onDrop:w,children:[M.jsx("div",{className:"image-composer-pane",children:te}),d&&M.jsxs("div",{className:"image-composer-dropzone","data-testid":"image-composer-dropzone",children:[M.jsx(Ve,{name:"ImageUp",size:28}),M.jsx("span",{children:"Drop an image to attach it"})]}),M.jsxs("div",{className:"image-composer-bar",children:[M.jsxs("button",{type:"button",className:"image-composer-attach btn-ghost",onClick:()=>{var S;return(S=b.current)==null?void 0:S.click()},disabled:h,"data-testid":"image-composer-attach","aria-label":"Attach an image",title:"Attach an image (or paste / drag-drop onto the terminal)",children:[M.jsx(Ve,{name:"Paperclip",size:14}),M.jsx("span",{children:"Attach image"})]}),u.length>0&&M.jsxs(M.Fragment,{children:[M.jsx("ul",{className:"image-composer-thumbs","data-testid":"image-composer-thumbs",children:u.map(S=>M.jsxs("li",{className:"image-composer-thumb",title:`${S.filename} · ${Bo(S.bytes)}`,children:[M.jsx("img",{src:S.dataUrl,alt:S.filename}),M.jsx("button",{type:"button",className:"image-composer-thumb-remove",onClick:()=>c(S.id),disabled:h,"aria-label":`Remove ${S.filename}`,"data-testid":"image-composer-thumb-remove",children:M.jsx(Ve,{name:"X",size:11})})]},S.id))}),M.jsx("button",{type:"button",className:"image-composer-send btn-primary",onClick:()=>void n(),disabled:h,"data-testid":"image-composer-send",children:h?"Sending…":`Send ${u.length} to agent`})]})]}),M.jsx("input",{ref:b,type:"file",accept:"image/*",multiple:!0,hidden:!0,"data-testid":"image-composer-file-input",onChange:S=>{const v=S.target.files?Array.from(S.target.files):[];o(v),S.target.value=""}})]}):M.jsx(M.Fragment,{children:te})};function qo(T,{onDismiss:q,containerRef:G,triggerRef:L}){ae.useEffect(()=>{if(!T)return;const te=P=>{const u=G.current;u&&P.target instanceof Node&&!u.contains(P.target)&&q()},le=P=>{var u;P.key==="Escape"&&(q(),(u=L==null?void 0:L.current)==null||u.focus())};return document.addEventListener("mousedown",te),document.addEventListener("keydown",le),()=>{document.removeEventListener("mousedown",te),document.removeEventListener("keydown",le)}},[T,q,G,L])}function Cp({value:T,onChange:q,onSubmit:G,recentDirs:L,listDir:te}){const[le,P]=ae.useState(T),[u,f]=ae.useState([]),[d,g]=ae.useState(T),[h,p]=ae.useState(!1);ae.useEffect(()=>{let c=!1;p(!0);const n=setTimeout(()=>{te(T||void 0).then(l=>{c||(P(l.path),f(l.dirs),g(l.parent))}).catch(()=>{}).finally(()=>!c&&p(!1))},150);return()=>{c=!0,clearTimeout(n)}},[T]);const b=T.startsWith(le)?T.slice(le.length).replace(/^\//,""):"",E=b?u.filter(c=>c.name.toLowerCase().startsWith(b.toLowerCase())):u,m=c=>q(c),o=c=>{c.key==="Enter"&&(E.length>0?m(E[0].path):G())};return M.jsxs("div",{className:"dir-picker",children:[M.jsxs("div",{className:"dir-picker-inputrow",children:[M.jsx("button",{type:"button",className:"dir-picker-up","data-testid":"dir-picker-up",disabled:d===le,onClick:()=>m(d),title:"Up to parent directory",children:M.jsx(Ve,{name:"CornerLeftUp",size:14})}),M.jsx("input",{id:"new-session-cwd",autoFocus:!0,className:"modal-input dir-picker-input","data-testid":"dir-picker-input",value:T,placeholder:"/path/to/project",onChange:c=>q(c.target.value),onKeyDown:o})]}),L.length>0&&M.jsx("div",{className:"recent-dirs",children:L.map(c=>M.jsx("button",{type:"button",className:"recent-dir-chip",onClick:()=>m(c),children:c},c))}),M.jsxs("div",{className:"dir-picker-listing","data-testid":"dir-picker-listing",children:[M.jsx("div",{className:"dir-picker-path",children:le}),h&&M.jsx("div",{className:"dir-picker-empty",children:"Loading…"}),!h&&E.length===0&&M.jsx("div",{className:"dir-picker-empty",children:"No subdirectories"}),!h&&E.map(c=>M.jsxs("button",{type:"button",className:"dir-picker-item","data-testid":`dir-picker-item-${c.name}`,onClick:()=>m(c.path),children:[M.jsx(Ve,{name:"Folder",size:13}),c.name]},c.path))]})]})}const wp=[{id:"claude-code",label:"Claude Code"},{id:"codex",label:"Codex"}];function _d({recentDirs:T,launchDir:q,listDir:G,onClose:L,onCreate:te,triggerRef:le}){const[P,u]=ae.useState(q??T[0]??""),[f,d]=ae.useState("claude-code"),[g,h]=ae.useState(!1),[p,b]=ae.useState(null),E=ae.useRef(null);qo(!0,{onDismiss:L,containerRef:E,triggerRef:le});const m=async()=>{const o=P.trim();if(o){h(!0),b(null);try{await te(o,f),Ii("session.created"),L()}catch(c){b(c.message)}finally{h(!1)}}};return M.jsx("div",{className:"modal-backdrop",children:M.jsxs("div",{className:"modal modal-new-session",ref:E,children:[M.jsx("div",{className:"modal-header",children:"New session"}),M.jsx("label",{className:"modal-label",htmlFor:"new-session-cwd",children:"Directory"}),M.jsx(Cp,{value:P,onChange:u,onSubmit:()=>void m(),recentDirs:T,listDir:G}),M.jsx("div",{className:"modal-label",children:"Harness"}),M.jsx("div",{className:"harness-picker",children:wp.map(o=>M.jsx("button",{type:"button",className:"harness-option"+(f===o.id?" is-selected":""),onClick:()=>d(o.id),children:o.label},o.id))}),p&&M.jsx("div",{className:"modal-error",children:p}),M.jsxs("div",{className:"modal-actions",children:[M.jsx("button",{className:"btn-ghost",onClick:L,disabled:g,children:"Cancel"}),M.jsx("button",{className:"btn-primary",onClick:()=>void m(),disabled:g||!P.trim(),children:g?"Starting…":"Start session"})]})]})})}function Ep({authenticated:T,organizationName:q,telemetryOptIn:G,onToggleTelemetry:L,onClose:te}){const[le,P]=ae.useState(!1),u=async()=>{const f=!G;P(!0);try{await L(f),Ii("consent.changed",{optIn:f})}finally{P(!1)}};return M.jsxs("div",{className:"settings-popover","data-testid":"settings-popover",children:[M.jsx("div",{className:"settings-identity",children:T?q??"Signed in":"Not signed in"}),M.jsxs("label",{className:"settings-toggle-row",children:[M.jsx("span",{children:"Send usage analytics to Sapiom"}),M.jsx("button",{type:"button",role:"switch","aria-checked":G,"data-testid":"telemetry-toggle",className:"toggle-switch"+(G?" is-on":""),disabled:le,onClick:()=>void u(),children:M.jsx("span",{className:"toggle-knob"})})]}),M.jsxs("p",{className:"settings-note",children:["Prompts, tool calls, and session lifecycle events are always written locally to"," ",M.jsx("code",{children:gp.events}),". With your consent, they’re also sent to Sapiom."]}),M.jsx("button",{className:"btn-ghost settings-close",onClick:te,children:"Close"})]})}function xp({sessions:T,activeSessionId:q,onSelectSession:G,onResumeHistory:L,history:te,historyLoading:le,onOpenHistory:P,recentDirs:u,launchDir:f,listDir:d,onCreateSession:g,boundWorkflowName:h,authenticated:p,organizationName:b,telemetryOptIn:E,onToggleTelemetry:m,busySessionIds:o,settingsOpen:c,onSetSettingsOpen:n}){const[l,_]=ae.useState(!1),[C,w]=ae.useState(!1),S=ae.useRef(null),v=ae.useRef(null),x=ae.useRef(null),B=ae.useRef(null),U=ae.useRef(null),j=ae.useCallback(()=>_(!1),[]),N=ae.useCallback(()=>n(!1),[n]);qo(l,{onDismiss:j,containerRef:S,triggerRef:v}),qo(c,{onDismiss:N,containerRef:x,triggerRef:B});const J=ae.useMemo(()=>T.filter(X=>X.status!=="exited").sort((X,re)=>X.createdAt.localeCompare(re.createdAt)),[T]),ce=T.filter(X=>X.status==="exited"),W=()=>{const X=!l;if(_(X),X){const re=T.find(H=>H.id===q)??null,D=(re==null?void 0:re.cwd)??u[0];D&&P(D)}};return M.jsxs("div",{className:"session-bar",children:[M.jsxs("div",{className:"session-tabs",role:"tablist","data-testid":"session-tabs",children:[J.map(X=>{const re=X.id===q;return M.jsxs("button",{role:"tab","aria-selected":re,className:"session-tab"+(re?" is-active":""),"data-testid":`session-tab-${X.id}`,onClick:()=>{G(X.id),Ii("session.switched",{},X.id)},children:[M.jsx("span",{className:"session-dot","data-status":X.status}),M.jsx("span",{className:"session-tab-title",children:X.title}),o.has(X.id)&&M.jsx("span",{className:"session-tab-busy","data-testid":`session-tab-busy-${X.id}`,"aria-hidden":"true"}),re&&h&&M.jsxs("span",{className:"session-workflow-chip","data-testid":"session-workflow-chip",children:["▸ working on ",h]})]},X.id)}),M.jsx("button",{ref:U,className:"session-tab-add","data-testid":"new-session-btn",onClick:()=>w(!0),"aria-label":"New session",title:"New session",children:M.jsx(Ve,{name:"Plus",size:14})})]}),M.jsxs("div",{className:"session-history-wrap",ref:S,children:[M.jsxs("button",{ref:v,className:"session-history-trigger","data-testid":"history-trigger",onClick:W,"aria-label":"Session history",title:"Session history",children:[M.jsx(Ve,{name:"History",size:14}),ce.length>0&&M.jsx("span",{className:"session-history-badge","data-testid":"session-history-badge",children:ce.length})]}),l&&M.jsxs("div",{className:"session-dropdown-menu","data-testid":"history-menu",children:[M.jsx("div",{className:"session-dropdown-section",children:"Exited"}),ce.length===0&&M.jsx("div",{className:"session-dropdown-empty",children:"No exited sessions"}),ce.map(X=>M.jsxs("button",{"data-testid":`exited-session-${X.id}`,className:"session-dropdown-item"+(X.id===q?" is-selected":""),onClick:()=>{G(X.id),_(!1)},children:[M.jsx("span",{className:"session-dot","data-status":X.status}),M.jsx("span",{className:"session-item-title",children:X.title}),M.jsx("span",{className:"session-item-cwd",children:X.cwd})]},X.id)),M.jsx("div",{className:"session-dropdown-section",children:"History"}),le&&M.jsx("div",{className:"session-dropdown-empty",children:"Loading…"}),!le&&te.length===0&&M.jsx("div",{className:"session-dropdown-empty",children:"No past sessions for this directory"}),!le&&te.map(X=>M.jsxs("button",{className:"session-dropdown-item","data-testid":`history-${X.agentSessionId}`,onClick:()=>{L(X),_(!1)},children:[M.jsx("span",{className:"session-item-title",children:X.title}),M.jsx("span",{className:"session-item-meta","data-testid":`history-meta-${X.agentSessionId}`,children:Ap(X)})]},X.agentSessionId))]})]}),M.jsxs("div",{className:"settings-wrap",ref:x,children:[M.jsx("button",{ref:B,className:"gear-btn","aria-label":"Settings","data-testid":"settings-trigger",onClick:()=>n(!c),children:M.jsx(Ve,{name:"Settings",size:16})}),c&&M.jsx(Ep,{authenticated:p,organizationName:b,telemetryOptIn:E,onToggleTelemetry:m,onClose:()=>n(!1)})]}),C&&M.jsx(_d,{recentDirs:u,launchDir:f,listDir:d,onClose:()=>w(!1),onCreate:g,triggerRef:U})]})}function Ap(T){const q=[];return T.gitBranch&&q.push(T.gitBranch),typeof T.messageCount=="number"&&q.push(`${T.messageCount} ${T.messageCount===1?"turn":"turns"}`),q.push(Dp(T.lastActiveAt)),q.length===1&&q.unshift(T.harness),q.join(" · ")}function Dp(T){const q=new Date(T).getTime();if(Number.isNaN(q))return T;const G=Math.round((Date.now()-q)/1e3);if(G<45)return"just now";if(G<90)return"1 min ago";const L=Math.round(G/60);if(L<60)return`${L} min ago`;const te=Math.round(L/60);return te<24?`${te}h ago`:new Date(T).toLocaleDateString()}function Tp({text:T}){const q=T.split(`
205
- `),G=[];let L=0,te=0;function le(){return te++}function P(u){const f=[],d=/(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*)/g;let g=0,h;for(;(h=d.exec(u))!==null;){h.index>g&&f.push(u.slice(g,h.index));const p=h[0];p.startsWith("`")&&p.endsWith("`")?f.push(M.jsx("code",{className:"chat-inline-code",children:p.slice(1,-1)},le())):p.startsWith("**")&&p.endsWith("**")?f.push(M.jsx("strong",{children:p.slice(2,-2)},le())):p.startsWith("*")&&p.endsWith("*")?f.push(M.jsx("em",{children:p.slice(1,-1)},le())):f.push(p),g=h.index+p.length}return g<u.length&&f.push(u.slice(g)),f}for(;L<q.length;){const u=q[L];if(u.startsWith("```")){const d=u.slice(3).trim(),g=[];for(L++;L<q.length&&!q[L].startsWith("```");)g.push(q[L]),L++;L++,G.push(M.jsx("pre",{className:"chat-code-block","data-lang":d||void 0,children:M.jsx("code",{className:d?`language-${d}`:void 0,children:g.join(`
206
- `)})},le()));continue}const f=u.match(/^(#{1,3})\s+(.+)/);if(f){const g=`h${f[1].length}`;G.push(M.jsx(g,{className:"chat-heading",children:P(f[2])},le())),L++;continue}if(u.startsWith("> ")){G.push(M.jsx("blockquote",{className:"chat-blockquote",children:P(u.slice(2))},le())),L++;continue}if(/^- \[[ x]\]/.test(u)){const d=[];for(;L<q.length&&/^- \[[ x]\]/.test(q[L]);){const g=q[L][3]==="x";d.push({text:q[L].replace(/^- \[[ x]\]\s?/,""),checked:g}),L++}G.push(M.jsx("ul",{className:"chat-list chat-checklist",children:d.map((g,h)=>M.jsx("li",{children:P(g.text)},h))},le()));continue}if(/^[-*+]\s+/.test(u)){const d=[];for(;L<q.length&&/^[-*+]\s+/.test(q[L]);){const g=q[L].replace(/^[-*+]\s+/,"");d.push(M.jsx("li",{children:P(g)},le())),L++}G.push(M.jsx("ul",{className:"chat-list",children:d},le()));continue}if(!u.trim()){L++;continue}G.push(M.jsx("p",{className:"chat-paragraph",children:P(u)},le())),L++}return M.jsx(M.Fragment,{children:G})}function Rp(T){return T.source==="package"?`/${T.id} `:`Use the "${T.name}" skill: ${T.description}`}function kp({skill:T,onBack:q,activeSession:G,onUseSkill:L}){const te=(G==null?void 0:G.ready)===!0&&G.status!=="exited",le=G?G.status==="exited"?"Session has exited":G.ready?null:"Session is starting":"No active session",P=()=>{te&&(Ii("skill.used",{skillId:T.id,source:T.source}),L(Rp(T)))};return M.jsxs("div",{className:"skill-detail","data-testid":"skill-detail",children:[M.jsxs("div",{className:"skill-detail-header",children:[M.jsx("button",{className:"skill-back btn-ghost",onClick:q,"data-testid":"skill-back","aria-label":"Back to skills list",children:M.jsx(Ve,{name:"ArrowLeft",size:13})}),M.jsx("span",{className:"skill-detail-name",children:T.name}),M.jsx("span",{className:"skill-source-badge skill-source-"+T.source,children:T.source==="user"?"user":"pkg"})]}),M.jsxs("div",{className:"skill-detail-actions",children:[M.jsx("button",{className:"skill-use-btn","data-testid":"skill-use-btn",disabled:!te,title:le??"Populate the terminal with this skill",onClick:P,"aria-label":le?`Use skill — ${le}`:"Use skill",children:"Use skill"}),le&&M.jsx("span",{className:"skill-use-disabled-reason","data-testid":"skill-use-disabled-reason",children:le})]}),M.jsx("div",{className:"skill-detail-body",children:M.jsx(Tp,{text:T.body})})]})}function Mp({skills:T,loading:q,error:G,onSelectSkill:L}){if(q)return M.jsx("div",{className:"skills-loading",children:"Loading skills…"});if(G)return M.jsx("div",{className:"skills-error",children:G});if(T.length===0)return M.jsxs("div",{className:"skills-empty",children:[M.jsx("p",{children:"No skills found yet."}),M.jsxs("p",{children:["Browse Sapiom's skills and your own here. Create your own under"," ",M.jsx("code",{children:"~/.claude/skills/<id>/SKILL.md"})," in the terminal (claude-code or codex) and they appear here. Tell your agent to use a skill when you want it."]})]});const te=T.filter(u=>u.source==="user"),le=T.filter(u=>u.source==="package"),P=(u,f)=>u.length===0?null:M.jsxs("div",{className:"skills-group",children:[M.jsx("div",{className:"skills-group-header",children:f}),u.map(d=>M.jsxs("button",{className:"skill-card","data-testid":`skill-card-${d.id}`,onClick:()=>L(d.id),children:[M.jsx("span",{className:"skill-card-name",children:d.name}),M.jsx("span",{className:"skill-card-desc",children:d.description})]},d.id))]},f);return M.jsxs("div",{className:"skills-list","data-testid":"skills-list",children:[P(te,"Your skills"),P(le,"Sapiom")]})}function Lp({listSkills:T,getSkill:q,isActive:G,activeSession:L,onUseSkill:te}){const[le,P]=ae.useState([]),[u,f]=ae.useState(!0),[d,g]=ae.useState(null),[h,p]=ae.useState(null),[b,E]=ae.useState(!1);ae.useEffect(()=>{if(!G)return;let o=!1;return f(!0),g(null),T().then(c=>{o||P(c)}).catch(c=>{o||g(c.message)}).finally(()=>{o||f(!1)}),()=>{o=!0}},[G,T]);const m=ae.useCallback(async o=>{E(!0),Ii("skill.viewed",{skillId:o});try{const c=await q(o);p(c)}catch(c){const n=c instanceof fs?c.reason??c.message:c.message;g(n)}finally{E(!1)}},[q]);return M.jsxs("aside",{className:"rail rail-skills","data-testid":"skills-panel",children:[M.jsx("div",{className:"rail-header",children:"Skills"}),M.jsx("div",{className:"rail-body",children:b?M.jsx("div",{className:"skills-loading",children:"Loading…"}):h?M.jsx(kp,{skill:h,onBack:()=>p(null),activeSession:L,onUseSkill:o=>{L&&te(L.id,o)}}):M.jsx(Mp,{skills:le,loading:u,error:d,onSelectSkill:o=>void m(o)})})]})}function Op({onDismiss:T,onOpenSettings:q}){return M.jsxs("div",{className:"telemetry-notice",role:"status","data-testid":"telemetry-notice",children:[M.jsx("div",{className:"telemetry-notice-body",children:M.jsxs("p",{className:"telemetry-notice-text",children:["Analytics are ",M.jsx("strong",{children:"on by default"})," — usage events (including prompts and tool calls) are collected locally and sent to Sapiom to help improve the product. Change this any time in"," ",M.jsx("button",{className:"telemetry-notice-settings-link",onClick:()=>{q(),T()},children:"Settings"}),", or use the indicator in the top bar."]})}),M.jsx("button",{className:"telemetry-notice-dismiss","aria-label":"Dismiss analytics notice","data-testid":"telemetry-notice-dismiss",onClick:T,children:"×"})]})}var Ho={exports:{}},rd;function Bp(){return rd||(rd=1,(function(T,q){(function(G,L){T.exports=L()})(globalThis,(()=>(()=>{var G={4567:function(P,u,f){var d=this&&this.__decorate||function(n,l,_,C){var w,S=arguments.length,v=S<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(n,l,_,C);else for(var x=n.length-1;x>=0;x--)(w=n[x])&&(v=(S<3?w(v):S>3?w(l,_,v):w(l,_))||v);return S>3&&v&&Object.defineProperty(l,_,v),v},g=this&&this.__param||function(n,l){return function(_,C){l(_,C,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.AccessibilityManager=void 0;const h=f(9042),p=f(9924),b=f(844),E=f(4725),m=f(2585),o=f(3656);let c=u.AccessibilityManager=class extends b.Disposable{constructor(n,l,_,C){super(),this._terminal=n,this._coreBrowserService=_,this._renderService=C,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=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((w=>this._handleResize(w.rows)))),this.register(this._terminal.onRender((w=>this._refreshRows(w.start,w.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((w=>this._handleChar(w)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
207
- `)))),this.register(this._terminal.onA11yTab((w=>this._handleTab(w)))),this.register(this._terminal.onKey((w=>this._handleKey(w.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(n){for(let l=0;l<n;l++)this._handleChar(" ")}_handleChar(n){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==n&&(this._charsToAnnounce+=n):this._charsToAnnounce+=n,n===`
208
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(n){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(n)||this._charsToConsume.push(n)}_refreshRows(n,l){this._liveRegionDebouncer.refresh(n,l,this._terminal.rows)}_renderRows(n,l){const _=this._terminal.buffer,C=_.lines.length.toString();for(let w=n;w<=l;w++){const S=_.lines.get(_.ydisp+w),v=[],x=(S==null?void 0:S.translateToString(!0,void 0,void 0,v))||"",B=(_.ydisp+w+1).toString(),U=this._rowElements[w];U&&(x.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=x,this._rowColumns.set(U,v)),U.setAttribute("aria-posinset",B),U.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(n,l){const _=n.target,C=this._rowElements[l===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||n.relatedTarget!==C)return;let w,S;if(l===0?(w=_,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(w=this._rowElements.shift(),S=_,this._rowContainer.removeChild(w)),w.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{const v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),n.preventDefault(),n.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const n=document.getSelection();if(!n)return;if(n.isCollapsed)return void(this._rowContainer.contains(n.anchorNode)&&this._terminal.clearSelection());if(!n.anchorNode||!n.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:n.anchorNode,offset:n.anchorOffset},_={node:n.focusNode,offset:n.focusOffset};if((l.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===_.node&&l.offset>_.offset)&&([l,_]=[_,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const C=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:C,offset:((x=C.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(_.node))return;const w=({node:B,offset:U})=>{const j=B instanceof Text?B.parentNode:B;let N=parseInt(j==null?void 0:j.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get(j);if(!J)return console.warn("columns is null. Race condition?"),null;let ce=U<J.length?J[U]:J.slice(-1)[0]+1;return ce>=this._terminal.cols&&(++N,ce=0),{row:N,column:ce}},S=w(l),v=w(_);if(S&&v){if(S.row>v.row||S.row===v.row&&S.column>=v.column)throw new Error("invalid range");this._terminal.select(S.column,S.row,(v.row-S.row)*this._terminal.cols-S.column+v.column)}}_handleResize(n){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>n;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const n=this._coreBrowserService.mainDocument.createElement("div");return n.setAttribute("role","listitem"),n.tabIndex=-1,this._refreshRowDimensions(n),n}_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 n=0;n<this._terminal.rows;n++)this._refreshRowDimensions(this._rowElements[n])}}_refreshRowDimensions(n){n.style.height=`${this._renderService.dimensions.css.cell.height}px`}};u.AccessibilityManager=c=d([g(1,m.IInstantiationService),g(2,E.ICoreBrowserService),g(3,E.IRenderService)],c)},3614:(P,u)=>{function f(p){return p.replace(/\r?\n/g,"\r")}function d(p,b){return b?"\x1B[200~"+p+"\x1B[201~":p}function g(p,b,E,m){p=d(p=f(p),E.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(p,!0),b.value=""}function h(p,b,E){const m=E.getBoundingClientRect(),o=p.clientX-m.left-10,c=p.clientY-m.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${o}px`,b.style.top=`${c}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(u,"__esModule",{value:!0}),u.rightClickHandler=u.moveTextAreaUnderMouseCursor=u.paste=u.handlePasteEvent=u.copyHandler=u.bracketTextForPaste=u.prepareTextForTerminal=void 0,u.prepareTextForTerminal=f,u.bracketTextForPaste=d,u.copyHandler=function(p,b){p.clipboardData&&p.clipboardData.setData("text/plain",b.selectionText),p.preventDefault()},u.handlePasteEvent=function(p,b,E,m){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),b,E,m)},u.paste=g,u.moveTextAreaUnderMouseCursor=h,u.rightClickHandler=function(p,b,E,m,o){h(p,b,E),o&&m.rightClickSelect(p),b.value=m.selectionText,b.select()}},7239:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorContrastCache=void 0;const d=f(1505);u.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,h,p){this._css.set(g,h,p)}getCss(g,h){return this._css.get(g,h)}setColor(g,h,p){this._color.set(g,h,p)}getColor(g,h){return this._color.get(g,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.addDisposableDomListener=void 0,u.addDisposableDomListener=function(f,d,g,h){f.addEventListener(d,g,h);let p=!1;return{dispose:()=>{p||(p=!0,f.removeEventListener(d,g,h))}}}},3551:function(P,u,f){var d=this&&this.__decorate||function(c,n,l,_){var C,w=arguments.length,S=w<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(c,n,l,_);else for(var v=c.length-1;v>=0;v--)(C=c[v])&&(S=(w<3?C(S):w>3?C(n,l,S):C(n,l))||S);return w>3&&S&&Object.defineProperty(n,l,S),S},g=this&&this.__param||function(c,n){return function(l,_){n(l,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Linkifier=void 0;const h=f(3656),p=f(8460),b=f(844),E=f(2585),m=f(4725);let o=u.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(c,n,l,_,C){super(),this._element=c,this._mouseService=n,this._renderService=l,this._bufferService=_,this._linkProviderService=C,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,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var w;this._lastMouseEvent=void 0,(w=this._activeProviderReplies)==null||w.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const n=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!n)return;this._isMouseOut=!1;const l=c.composedPath();for(let _=0;_<l.length;_++){const C=l[_];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&n.x===this._lastBufferCell.x&&n.y===this._lastBufferCell.y||(this._handleHover(n),this._lastBufferCell=n)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,n){var _,C;this._activeProviderReplies&&n||((_=this._activeProviderReplies)==null||_.forEach((w=>{w==null||w.forEach((S=>{S.link.dispose&&S.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let l=!1;for(const[w,S]of this._linkProviderService.linkProviders.entries())n?(C=this._activeProviderReplies)!=null&&C.get(w)&&(l=this._checkLinkProviderResult(w,c,l)):S.provideLinks(c.y,(v=>{var B,U;if(this._isMouseOut)return;const x=v==null?void 0:v.map((j=>({link:j})));(B=this._activeProviderReplies)==null||B.set(w,x),l=this._checkLinkProviderResult(w,c,l),((U=this._activeProviderReplies)==null?void 0:U.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,n){const l=new Set;for(let _=0;_<n.size;_++){const C=n.get(_);if(C)for(let w=0;w<C.length;w++){const S=C[w],v=S.link.range.start.y<c?0:S.link.range.start.x,x=S.link.range.end.y>c?this._bufferService.cols:S.link.range.end.x;for(let B=v;B<=x;B++){if(l.has(B)){C.splice(w--,1);break}l.add(B)}}}}_checkLinkProviderResult(c,n,l){var w;if(!this._activeProviderReplies)return l;const _=this._activeProviderReplies.get(c);let C=!1;for(let S=0;S<c;S++)this._activeProviderReplies.has(S)&&!this._activeProviderReplies.get(S)||(C=!0);if(!C&&_){const S=_.find((v=>this._linkAtPosition(v.link,n)));S&&(l=!0,this._handleNewLink(S))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let S=0;S<this._activeProviderReplies.size;S++){const v=(w=this._activeProviderReplies.get(S))==null?void 0:w.find((x=>this._linkAtPosition(x.link,n)));if(v){l=!0,this._handleNewLink(v);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const n=this._positionFromMouseEvent(c,this._element,this._mouseService);n&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,n){this._currentLink&&this._lastMouseEvent&&(!c||!n||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(c.link,n)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var l,_;return(_=(l=this._currentLink)==null?void 0:l.state)==null?void 0:_.decorations.pointerCursor},set:l=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,_;return(_=(l=this._currentLink)==null?void 0:l.state)==null?void 0:_.decorations.underline},set:l=>{var _,C,w;(_=this._currentLink)!=null&&_.state&&((w=(C=this._currentLink)==null?void 0:C.state)==null?void 0:w.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const _=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(_,C),this._lastMouseEvent)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}}))))}_linkHover(c,n,l){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(l,n.text)}_fireUnderlineEvent(c,n){const l=c.range,_=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-_-1,l.end.x,l.end.y-_-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(c,n,l){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(l,n.text)}_linkAtPosition(c,n){const l=c.range.start.y*this._bufferService.cols+c.range.start.x,_=c.range.end.y*this._bufferService.cols+c.range.end.x,C=n.y*this._bufferService.cols+n.x;return l<=C&&C<=_}_positionFromMouseEvent(c,n,l){const _=l.getCoords(c,n,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,n,l,_,C){return{x1:c,y1:n,x2:l,y2:_,cols:this._bufferService.cols,fg:C}}};u.Linkifier=o=d([g(1,m.IMouseService),g(2,m.IRenderService),g(3,E.IBufferService),g(4,m.ILinkProviderService)],o)},9042:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.tooMuchOutput=u.promptLabel=void 0,u.promptLabel="Terminal input",u.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(P,u,f){var d=this&&this.__decorate||function(m,o,c,n){var l,_=arguments.length,C=_<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,o,c,n);else for(var w=m.length-1;w>=0;w--)(l=m[w])&&(C=(_<3?l(C):_>3?l(o,c,C):l(o,c))||C);return _>3&&C&&Object.defineProperty(o,c,C),C},g=this&&this.__param||function(m,o){return function(c,n){o(c,n,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkProvider=void 0;const h=f(511),p=f(2585);let b=u.OscLinkProvider=class{constructor(m,o,c){this._bufferService=m,this._optionsService=o,this._oscLinkService=c}provideLinks(m,o){var x;const c=this._bufferService.buffer.lines.get(m-1);if(!c)return void o(void 0);const n=[],l=this._optionsService.rawOptions.linkHandler,_=new h.CellData,C=c.getTrimmedLength();let w=-1,S=-1,v=!1;for(let B=0;B<C;B++)if(S!==-1||c.hasContent(B)){if(c.loadCell(B,_),_.hasExtendedAttrs()&&_.extended.urlId){if(S===-1){S=B,w=_.extended.urlId;continue}v=_.extended.urlId!==w}else S!==-1&&(v=!0);if(v||S!==-1&&B===C-1){const U=(x=this._oscLinkService.getLinkData(w))==null?void 0:x.uri;if(U){const j={start:{x:S+1,y:m},end:{x:B+(v||B!==C-1?0:1),y:m}};let N=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const J=new URL(U);["http:","https:"].includes(J.protocol)||(N=!0)}catch{N=!0}N||n.push({text:U,range:j,activate:(J,ce)=>l?l.activate(J,ce,j):E(0,ce),hover:(J,ce)=>{var W;return(W=l==null?void 0:l.hover)==null?void 0:W.call(l,J,ce,j)},leave:(J,ce)=>{var W;return(W=l==null?void 0:l.leave)==null?void 0:W.call(l,J,ce,j)}})}v=!1,_.hasExtendedAttrs()&&_.extended.urlId?(S=B,w=_.extended.urlId):(S=-1,w=-1)}}o(n)}};function E(m,o){if(confirm(`Do you want to navigate to ${o}?
209
-
210
- WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}u.OscLinkProvider=b=d([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],b)},6193:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.RenderDebouncer=void 0,u.RenderDebouncer=class{constructor(f,d){this._renderCallback=f,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(f){return this._refreshCallbacks.push(f),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(f,d,g){this._rowCount=g,f=f!==void 0?f:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const f of this._refreshCallbacks)f(0);this._refreshCallbacks=[]}}},3236:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const d=f(3614),g=f(3656),h=f(3551),p=f(9042),b=f(3730),E=f(1680),m=f(3107),o=f(5744),c=f(2950),n=f(1296),l=f(428),_=f(4269),C=f(5114),w=f(8934),S=f(3230),v=f(9312),x=f(4725),B=f(6731),U=f(8055),j=f(8969),N=f(8460),J=f(844),ce=f(6114),W=f(8437),X=f(2584),re=f(7399),D=f(5941),H=f(9074),A=f(2585),O=f(5435),$=f(4567),se=f(779);class Y extends j.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(z={}){super(z),this.browser=ce,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(H.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(se.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((R,ie)=>this.refresh(R,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((R=>this._reportWindowsOptions(R)))),this.register(this._inputHandler.onColor((R=>this._handleColorEvent(R)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((R=>this._afterResize(R.cols,R.rows)))),this.register((0,J.toDisposable)((()=>{var R,ie;this._customKeyEventHandler=void 0,(ie=(R=this.element)==null?void 0:R.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(z){if(this._themeService)for(const R of z){let ie,oe="";switch(R.index){case 256:ie="foreground",oe="10";break;case 257:ie="background",oe="11";break;case 258:ie="cursor",oe="12";break;default:ie="ansi",oe="4;"+R.index}switch(R.type){case 0:const _e=U.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${oe};${(0,D.toRgbString)(_e)}${X.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((de=>de.ansi[R.index]=U.channels.toColor(...R.color)));else{const de=ie;this._themeService.modifyColors((we=>we[de]=U.channels.toColor(...R.color)))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(z){z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var z;return(z=this.textarea)==null?void 0:z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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 z=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(z);if(!R)return;const ie=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,_e=R.getWidth(ie),de=this._renderService.dimensions.css.cell.width*_e,we=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=we+"px",this.textarea.style.width=de+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(R=>{this.hasSelection()&&(0,d.copyHandler)(R,this._selectionService)})));const z=R=>(0,d.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",z)),this.register((0,g.addDisposableDomListener)(this.element,"paste",z)),ce.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(R=>{R.button===2&&(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(R=>{(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ce.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(R=>{R.button===1&&(0,d.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(z=>this._keyUp(z)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(z=>this._keyDown(z)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(z=>this._keyPress(z)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(z=>this._compositionHelper.compositionupdate(z)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(z=>this._inputEvent(z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(z){var ie;if(!z)throw new Error("Terminal requires a parent element.");if(z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=z.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"),z.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.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",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),ce.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(C.CoreBrowserService,this.textarea,z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(w.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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($.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(n.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const z=this,R=this.element;function ie(de){const we=z._mouseService.getMouseReportCoords(de,z.screenElement);if(!we)return!1;let Le,Ue;switch(de.overrideType||de.type){case"mousemove":Ue=32,de.buttons===void 0?(Le=3,de.button!==void 0&&(Le=de.button<3?de.button:3)):Le=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":Ue=0,Le=de.button<3?de.button:3;break;case"mousedown":Ue=1,Le=de.button<3?de.button:3;break;case"wheel":if(z._customWheelEventHandler&&z._customWheelEventHandler(de)===!1||z.viewport.getLinesScrolled(de)===0)return!1;Ue=de.deltaY<0?0:1,Le=4;break;default:return!1}return!(Ue===void 0||Le===void 0||Le>4)&&z.coreMouseService.triggerMouseEvent({col:we.col,row:we.row,x:we.x,y:we.y,button:Le,action:Ue,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:de=>(ie(de),de.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(de)),wheel:de=>(ie(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&ie(de)},mousemove:de=>{de.buttons||ie(de)}};this.register(this.coreMouseService.onProtocolChange((de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),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&de?oe.mousemove||(R.addEventListener("mousemove",_e.mousemove),oe.mousemove=_e.mousemove):(R.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&de?oe.wheel||(R.addEventListener("wheel",_e.wheel,{passive:!1}),oe.wheel=_e.wheel):(R.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&de?oe.mouseup||(oe.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&de?oe.mousedrag||(oe.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(R,"mousedown",(de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return ie(de),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(de)}))),this.register((0,g.addDisposableDomListener)(R,"wheel",(de=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(de)===!1)return!1;if(!this.buffer.hasScrollback){const we=this.viewport.getLinesScrolled(de);if(we===0)return;const Le=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let Ue="";for(let it=0;it<Math.abs(we);it++)Ue+=Le;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(de,!0)}return this.viewport.handleWheel(de)?this.cancel(de):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(R,"touchstart",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(R,"touchmove",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)}),{passive:!1}))}refresh(z,R){var ie;(ie=this._renderService)==null||ie.refreshRows(z,R)}updateCursorStyle(z){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(z)?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(z,R,ie=0){var oe;ie===1?(super.scrollLines(z,R,ie),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(z)}paste(z){(0,d.paste)(z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(z){this._customKeyEventHandler=z}attachCustomWheelEventHandler(z){this._customWheelEventHandler=z}registerLinkProvider(z){return this._linkProviderService.registerLinkProvider(z)}registerCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(z);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+z)}registerDecoration(z){return this._decorationService.registerDecoration(z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(z,R,ie){this._selectionService.setSelection(z,R,ie)}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 z;(z=this._selectionService)==null||z.clearSelection()}selectAll(){var z;(z=this._selectionService)==null||z.selectAll()}selectLines(z,R){var ie;(ie=this._selectionService)==null||ie.selectLines(z,R)}_keyDown(z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&z.altKey;if(!R&&!this._compositionHelper.keydown(z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||z.key!=="Dead"&&z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,re.evaluateKeyboardEvent)(z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(z),ie.type===3||ie.type===2){const oe=this.rows-1;return this.scrollLines(ie.type===2?-oe:oe),this.cancel(z,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,z)||(ie.cancel&&this.cancel(z,!0),!ie.key||!!(z.key&&!z.ctrlKey&&!z.altKey&&!z.metaKey&&z.key.length===1&&z.key.charCodeAt(0)>=65&&z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==X.C0.ETX&&ie.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||z.altKey||z.ctrlKey?this.cancel(z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(z,R){const ie=z.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||z.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||z.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?ie:ie&&(!R.keyCode||R.keyCode>47)}_keyUp(z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1||((function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18})(z)||this.focus(),this.updateCursorStyle(z),this._keyPressHandled=!1)}_keyPress(z){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;if(this.cancel(z),z.charCode)R=z.charCode;else if(z.which===null||z.which===void 0)R=z.keyCode;else{if(z.which===0||z.charCode===0)return!1;R=z.which}return!(!R||(z.altKey||z.ctrlKey||z.metaKey)&&!this._isThirdLevelShift(this.browser,z)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(z){if(z.data&&z.inputType==="insertText"&&(!z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=z.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(z),!0}return!1}resize(z,R){z!==this.cols||R!==this.rows?super.resize(z,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(z,R){var ie,oe;(ie=this._charSizeService)==null||ie.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var z;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(z=this.viewport)==null||z.reset(),this.refresh(0,this.rows-1)}}reset(){var R,ie;this.options.rows=this.rows,this.options.cols=this.cols;const z=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var z;(z=this._renderService)==null||z.clearTextureAtlas()}_reportFocus(){var z;(z=this.element)!=null&&z.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(z){if(this._renderService)switch(z){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${ie};${R}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${_e};${oe}t`)}}cancel(z,R){if(this.options.cancelEvents||R)return z.preventDefault(),z.stopPropagation(),!1}}u.Terminal=Y},9924:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TimeBasedDebouncer=void 0,u.TimeBasedDebouncer=class{constructor(f,d=1e3){this._renderCallback=f,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(f,d,g){this._rowCount=g,f=f!==void 0?f:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=h-this._lastRefreshMs,b=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d)}}},1680:function(P,u,f){var d=this&&this.__decorate||function(c,n,l,_){var C,w=arguments.length,S=w<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(c,n,l,_);else for(var v=c.length-1;v>=0;v--)(C=c[v])&&(S=(w<3?C(S):w>3?C(n,l,S):C(n,l))||S);return w>3&&S&&Object.defineProperty(n,l,S),S},g=this&&this.__param||function(c,n){return function(l,_){n(l,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Viewport=void 0;const h=f(3656),p=f(4725),b=f(8460),E=f(844),m=f(2585);let o=u.Viewport=class extends E.Disposable{constructor(c,n,l,_,C,w,S,v){super(),this._viewportElement=c,this._scrollArea=n,this._bufferService=l,this._optionsService=_,this._charSizeService=C,this._renderService=w,this._coreBrowserService=S,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((x=>this._renderDimensions=x))),this._handleThemeChange(v.colors),this.register(v.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.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(c){if(c)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 n=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==n&&(this._lastRecordedBufferHeight=n,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){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 n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:n,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<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(c,n){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&l<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const n=this._getPixelsScrolled(c);return n!==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+n:this._smoothScrollState.target+=n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=n,this._bubbleScroll(c,n))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const n=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let n=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._currentRowHeight*this._bufferService.rows),n}getBufferElements(c,n){var v;let l,_="";const C=[],w=n??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let x=c;x<w;x++){const B=S.get(x);if(!B)continue;const U=(v=S.get(x+1))==null?void 0:v.isWrapped;if(_+=B.translateToString(!U),!U||x===S.length-1){const j=document.createElement("div");j.textContent=_,C.push(j),_.length>0&&(l=j),_=""}}return{bufferElements:C,cursorElement:l}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let n=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=this._currentRowHeight+0,this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(c,n){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&n.altKey||l==="ctrl"&&n.ctrlKey||l==="shift"&&n.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const n=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(c,n))}};u.Viewport=o=d([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],o)},3107:function(P,u,f){var d=this&&this.__decorate||function(m,o,c,n){var l,_=arguments.length,C=_<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,o,c,n);else for(var w=m.length-1;w>=0;w--)(l=m[w])&&(C=(_<3?l(C):_>3?l(o,c,C):l(o,c))||C);return _>3&&C&&Object.defineProperty(o,c,C),C},g=this&&this.__param||function(m,o){return function(c,n){o(c,n,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferDecorationRenderer=void 0;const h=f(4725),p=f(844),b=f(2585);let E=u.BufferDecorationRenderer=class extends p.Disposable{constructor(m,o,c,n,l){super(),this._screenElement=m,this._bufferService=o,this._coreBrowserService=c,this._decorationService=n,this._renderService=l,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((_=>this._removeDecoration(_)))),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 m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var n;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((n=m==null?void 0:m.options)==null?void 0:n.layer)==="top"),o.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=m.options.x??0;return c&&c>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(m,o),o}_refreshStyle(m){const o=m.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let c=this._decorationElements.get(m);c||(c=this._createElement(m),m.element=c,this._decorationElements.set(m,c),this._container.appendChild(c),m.onDispose((()=>{this._decorationElements.delete(m),c.remove()}))),c.style.top=o*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(c)}}_refreshXPosition(m,o=m.element){if(!o)return;const c=m.options.x??0;(m.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var o;(o=this._decorationElements.get(m))==null||o.remove(),this._decorationElements.delete(m),m.dispose()}};u.BufferDecorationRenderer=E=d([g(1,b.IBufferService),g(2,h.ICoreBrowserService),g(3,b.IDecorationService),g(4,h.IRenderService)],E)},5871:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorZoneStore=void 0,u.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(f){if(f.options.overviewRulerOptions){for(const d of this._zones)if(d.color===f.options.overviewRulerOptions.color&&d.position===f.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,f.marker.line))return;if(this._lineAdjacentToZone(d,f.marker.line,f.options.overviewRulerOptions.position))return void this._addLineToZone(d,f.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=f.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=f.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=f.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=f.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:f.options.overviewRulerOptions.color,position:f.options.overviewRulerOptions.position,startBufferLine:f.marker.line,endBufferLine:f.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(f){this._linePadding=f}_lineIntersectsZone(f,d){return d>=f.startBufferLine&&d<=f.endBufferLine}_lineAdjacentToZone(f,d,g){return d>=f.startBufferLine-this._linePadding[g||"full"]&&d<=f.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(f,d){f.startBufferLine=Math.min(f.startBufferLine,d),f.endBufferLine=Math.max(f.endBufferLine,d)}}},5744:function(P,u,f){var d=this&&this.__decorate||function(l,_,C,w){var S,v=arguments.length,x=v<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,_,C,w);else for(var B=l.length-1;B>=0;B--)(S=l[B])&&(x=(v<3?S(x):v>3?S(_,C,x):S(_,C))||x);return v>3&&x&&Object.defineProperty(_,C,x),x},g=this&&this.__param||function(l,_){return function(C,w){_(C,w,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OverviewRulerRenderer=void 0;const h=f(5871),p=f(4725),b=f(844),E=f(2585),m={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let n=u.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,_,C,w,S,v,x){var U;super(),this._viewportElement=l,this._screenElement=_,this._bufferService=C,this._decorationService=w,this._renderService=S,this._optionsService=v,this._coreBrowserService=x,this._colorZoneStore=new h.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(),(U=this._viewportElement.parentElement)==null||U.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var j;(j=this._canvas)==null||j.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 l=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=l,o.center=_,o.right=l,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=o.left,c.right=o.left+o.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);m.left=_,m.center=_,m.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const _ of l)_.position!=="full"&&this._renderColorZone(_);for(const _ of l)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(c[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-m[l.position||"full"]/2),o[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[l.position||"full"]))}_queueRefresh(l,_){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u.OverviewRulerRenderer=n=d([g(2,E.IBufferService),g(3,E.IDecorationService),g(4,p.IRenderService),g(5,E.IOptionsService),g(6,p.ICoreBrowserService)],n)},2950:function(P,u,f){var d=this&&this.__decorate||function(m,o,c,n){var l,_=arguments.length,C=_<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,c):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,o,c,n);else for(var w=m.length-1;w>=0;w--)(l=m[w])&&(C=(_<3?l(C):_>3?l(o,c,C):l(o,c))||C);return _>3&&C&&Object.defineProperty(o,c,C),C},g=this&&this.__param||function(m,o){return function(c,n){o(c,n,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CompositionHelper=void 0;const h=f(4725),p=f(2585),b=f(2584);let E=u.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,o,c,n,l,_){this._textarea=m,this._compositionView=o,this._bufferService=c,this._optionsService=n,this._coreService=l,this._renderService=_,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(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,c=o.replace(m,"");this._dataAlreadySent=c,o.length>m.length?this._coreService.triggerDataEvent(c,!0):o.length<m.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):o.length===m.length&&o!==m&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};u.CompositionHelper=E=d([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,h.IRenderService)],E)},9806:(P,u)=>{function f(d,g,h){const p=h.getBoundingClientRect(),b=d.getComputedStyle(h),E=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[g.clientX-p.left-E,g.clientY-p.top-m]}Object.defineProperty(u,"__esModule",{value:!0}),u.getCoords=u.getCoordsRelativeToElement=void 0,u.getCoordsRelativeToElement=f,u.getCoords=function(d,g,h,p,b,E,m,o,c){if(!E)return;const n=f(d,g,h);return n?(n[0]=Math.ceil((n[0]+(c?m/2:0))/m),n[1]=Math.ceil(n[1]/o),n[0]=Math.min(Math.max(n[0],1),p+(c?1:0)),n[1]=Math.min(Math.max(n[1],1),b),n):void 0}},9504:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.moveToCellSequence=void 0;const d=f(2584);function g(o,c,n,l){const _=o-h(o,n),C=c-h(c,n),w=Math.abs(_-C)-(function(S,v,x){let B=0;const U=S-h(S,x),j=v-h(v,x);for(let N=0;N<Math.abs(U-j);N++){const J=p(S,v)==="A"?-1:1,ce=x.buffer.lines.get(U+J*N);ce!=null&&ce.isWrapped&&B++}return B})(o,c,n);return m(w,E(p(o,c),l))}function h(o,c){let n=0,l=c.buffer.lines.get(o),_=l==null?void 0:l.isWrapped;for(;_&&o>=0&&o<c.rows;)n++,l=c.buffer.lines.get(--o),_=l==null?void 0:l.isWrapped;return n}function p(o,c){return o>c?"A":"B"}function b(o,c,n,l,_,C){let w=o,S=c,v="";for(;w!==n||S!==l;)w+=_?1:-1,_&&w>C.cols-1?(v+=C.buffer.translateBufferLineToString(S,!1,o,w),w=0,o=0,S++):!_&&w<0&&(v+=C.buffer.translateBufferLineToString(S,!1,0,o+1),w=C.cols-1,o=w,S--);return v+C.buffer.translateBufferLineToString(S,!1,o,w)}function E(o,c){const n=c?"O":"[";return d.C0.ESC+n+o}function m(o,c){o=Math.floor(o);let n="";for(let l=0;l<o;l++)n+=c;return n}u.moveToCellSequence=function(o,c,n,l){const _=n.buffer.x,C=n.buffer.y;if(!n.buffer.hasScrollback)return(function(v,x,B,U,j,N){return g(x,U,j,N).length===0?"":m(b(v,x,v,x-h(x,j),!1,j).length,E("D",N))})(_,C,0,c,n,l)+g(C,c,n,l)+(function(v,x,B,U,j,N){let J;J=g(x,U,j,N).length>0?U-h(U,j):x;const ce=U,W=(function(X,re,D,H,A,O){let $;return $=g(D,H,A,O).length>0?H-h(H,A):re,X<D&&$<=H||X>=D&&$<H?"C":"D"})(v,x,B,U,j,N);return m(b(v,J,B,ce,W==="C",j).length,E(W,N))})(_,C,o,c,n,l);let w;if(C===c)return w=_>o?"D":"C",m(Math.abs(_-o),E(w,l));w=C>c?"D":"C";const S=Math.abs(C-c);return m((function(v,x){return x.cols-v})(C>c?o:_,n)+(S-1)*n.cols+1+((C>c?_:o)-1),E(w,l))}},1296:function(P,u,f){var d=this&&this.__decorate||function(N,J,ce,W){var X,re=arguments.length,D=re<3?J:W===null?W=Object.getOwnPropertyDescriptor(J,ce):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(N,J,ce,W);else for(var H=N.length-1;H>=0;H--)(X=N[H])&&(D=(re<3?X(D):re>3?X(J,ce,D):X(J,ce))||D);return re>3&&D&&Object.defineProperty(J,ce,D),D},g=this&&this.__param||function(N,J){return function(ce,W){J(ce,W,N)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRenderer=void 0;const h=f(3787),p=f(2550),b=f(2223),E=f(6171),m=f(6052),o=f(4725),c=f(8055),n=f(8460),l=f(844),_=f(2585),C="xterm-dom-renderer-owner-",w="xterm-rows",S="xterm-fg-",v="xterm-bg-",x="xterm-focus",B="xterm-selection";let U=1,j=u.DomRenderer=class extends l.Disposable{constructor(N,J,ce,W,X,re,D,H,A,O,$,se,Y){super(),this._terminal=N,this._document=J,this._element=ce,this._screenElement=W,this._viewportElement=X,this._helperContainer=re,this._linkifier2=D,this._charSizeService=A,this._optionsService=O,this._bufferService=$,this._coreBrowserService=se,this._themeService=Y,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new n.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(w),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((F=>this._injectCss(F)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((F=>this._handleLinkHover(F)))),this.register(this._linkifier2.onHideLinkUnderline((F=>this._handleLinkLeave(F)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(C+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 N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),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/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),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 ce of this._rowElements)ce.style.width=`${this.dimensions.css.canvas.width}px`,ce.style.height=`${this.dimensions.css.cell.height}px`,ce.style.lineHeight=`${this.dimensions.css.cell.height}px`,ce.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${w} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${w} .xterm-dim { color: ${c.color.multiplyOpacity(N.foreground,.5).css};}`,J+=`${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 ce=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;J+=`@keyframes ${ce} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${W} { 50% { box-shadow: none; }}`,J+=`@keyframes ${X} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,J+=`${this._terminalSelector} .${w}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ce} 1s step-end infinite;}${this._terminalSelector} .${w}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${w}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[re,D]of N.ansi.entries())J+=`${this._terminalSelector} .${S}${re} { color: ${D.css}; }${this._terminalSelector} .${S}${re}.xterm-dim { color: ${c.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${v}${re} { background-color: ${D.css}; }`;J+=`${this._terminalSelector} .${S}${b.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(N.background).css}; }${this._terminalSelector} .${S}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${v}${b.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,J){for(let ce=this._rowElements.length;ce<=J;ce++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,J){this._refreshRowElements(N,J),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(x),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,J,ce){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,J,ce),this.renderRows(0,this._bufferService.rows-1),!N||!J)return;this._selectionRenderModel.update(this._terminal,N,J,ce);const W=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,re=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(re>=this._bufferService.rows||D<0)return;const H=this._document.createDocumentFragment();if(ce){const A=N[0]>J[0];H.appendChild(this._createSelectionElement(re,A?J[0]:N[0],A?N[0]:J[0],D-re+1))}else{const A=W===re?N[0]:0,O=re===X?J[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(re,A,O));const $=D-re-1;if(H.appendChild(this._createSelectionElement(re+1,0,this._bufferService.cols,$)),re!==D){const se=X===D?J[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(D,0,se))}}this._selectionContainer.appendChild(H)}_createSelectionElement(N,J,ce,W=1){const X=this._document.createElement("div"),re=J*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(ce-J);return re+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-re),X.style.height=W*this.dimensions.css.cell.height+"px",X.style.top=N*this.dimensions.css.cell.height+"px",X.style.left=`${re}px`,X.style.width=`${D}px`,X}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 N of this._rowElements)N.replaceChildren()}renderRows(N,J){const ce=this._bufferService.buffer,W=ce.ybase+ce.y,X=Math.min(ce.x,this._bufferService.cols-1),re=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,H=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=N;A<=J;A++){const O=A+ce.ydisp,$=this._rowElements[A],se=ce.lines.get(O);if(!$||!se)break;$.replaceChildren(...this._rowFactory.createRow(se,O,O===W,D,H,X,re,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,J,ce,W,X,re){ce<0&&(N=0),W<0&&(J=0);const D=this._bufferService.rows-1;ce=Math.max(Math.min(ce,D),0),W=Math.max(Math.min(W,D),0),X=Math.min(X,this._bufferService.cols);const H=this._bufferService.buffer,A=H.ybase+H.y,O=Math.min(H.x,X-1),$=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=ce;F<=W;++F){const z=F+H.ydisp,R=this._rowElements[F],ie=H.lines.get(z);if(!R||!ie)break;R.replaceChildren(...this._rowFactory.createRow(ie,z,z===A,se,Y,O,$,this.dimensions.css.cell.width,this._widthCache,re?F===ce?N:0:-1,re?(F===W?J:X)-1:-1))}}};u.DomRenderer=j=d([g(7,_.IInstantiationService),g(8,o.ICharSizeService),g(9,_.IOptionsService),g(10,_.IBufferService),g(11,o.ICoreBrowserService),g(12,o.IThemeService)],j)},3787:function(P,u,f){var d=this&&this.__decorate||function(w,S,v,x){var B,U=arguments.length,j=U<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(w,S,v,x);else for(var N=w.length-1;N>=0;N--)(B=w[N])&&(j=(U<3?B(j):U>3?B(S,v,j):B(S,v))||j);return U>3&&j&&Object.defineProperty(S,v,j),j},g=this&&this.__param||function(w,S){return function(v,x){S(v,x,w)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRendererRowFactory=void 0;const h=f(2223),p=f(643),b=f(511),E=f(2585),m=f(8055),o=f(4725),c=f(4269),n=f(6171),l=f(3734);let _=u.DomRendererRowFactory=class{constructor(w,S,v,x,B,U,j){this._document=w,this._characterJoinerService=S,this._optionsService=v,this._coreBrowserService=x,this._coreService=B,this._decorationService=U,this._themeService=j,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,S,v){this._selectionStart=w,this._selectionEnd=S,this._columnSelectMode=v}createRow(w,S,v,x,B,U,j,N,J,ce,W){const X=[],re=this._characterJoinerService.getJoinedCharacters(S),D=this._themeService.colors;let H,A=w.getNoBgTrimmedLength();v&&A<U+1&&(A=U+1);let O=0,$="",se=0,Y=0,F=0,z=!1,R=0,ie=!1,oe=0;const _e=[],de=ce!==-1&&W!==-1;for(let we=0;we<A;we++){w.loadCell(we,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let Ue=!1,it=we,Se=this._workCell;if(re.length>0&&we===re[0][0]){Ue=!0;const qe=re.shift();Se=new c.JoinedCellData(this._workCell,w.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),it=qe[1]-1,Le=Se.getWidth()}const _i=this._isCellInSelection(we,S),Wi=v&&we===U,Pi=de&&we>=ce&&we<=W;let Ki=!1;this._decorationService.forEachDecorationAtCell(we,S,void 0,(qe=>{Ki=!0}));let ds=Se.getChars()||p.WHITESPACE_CELL_CHAR;if(ds===" "&&(Se.isUnderline()||Se.isOverline())&&(ds=" "),oe=Le*N-J.get(ds,Se.isBold(),Se.isItalic()),H){if(O&&(_i&&ie||!_i&&!ie&&Se.bg===se)&&(_i&&ie&&D.selectionForeground||Se.fg===Y)&&Se.extended.ext===F&&Pi===z&&oe===R&&!Wi&&!Ue&&!Ki){Se.isInvisible()?$+=p.WHITESPACE_CELL_CHAR:$+=ds,O++;continue}O&&(H.textContent=$),H=this._document.createElement("span"),O=0,$=""}else H=this._document.createElement("span");if(se=Se.bg,Y=Se.fg,F=Se.extended.ext,z=Pi,R=oe,ie=_i,Ue&&U>=we&&U<=it&&(U=we),!this._coreService.isCursorHidden&&Wi&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)j&&_e.push("xterm-cursor-blink"),_e.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){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"),$=Se.isInvisible()?p.WHITESPACE_CELL_CHAR:Se.getChars()||p.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(_e.push(`xterm-underline-${Se.extended.underlineStyle}`),$===" "&&($=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())H.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let qe=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&qe<8&&(qe+=8),H.style.textDecorationColor=D.ansi[qe].css}Se.isOverline()&&(_e.push("xterm-overline"),$===" "&&($=" ")),Se.isStrikethrough()&&_e.push("xterm-strikethrough"),Pi&&(H.style.textDecoration="underline");let dt=Se.getFgColor(),et=Se.getFgColorMode(),Mt=Se.getBgColor(),vi=Se.getBgColorMode();const _s=!!Se.isInverse();if(_s){const qe=dt;dt=Mt,Mt=qe;const Gi=et;et=vi,vi=Gi}let bt,vs,Wt,Yi=!1;switch(this._decorationService.forEachDecorationAtCell(we,S,void 0,(qe=>{qe.options.layer!=="top"&&Yi||(qe.backgroundColorRGB&&(vi=50331648,Mt=qe.backgroundColorRGB.rgba>>8&16777215,bt=qe.backgroundColorRGB),qe.foregroundColorRGB&&(et=50331648,dt=qe.foregroundColorRGB.rgba>>8&16777215,vs=qe.foregroundColorRGB),Yi=qe.options.layer==="top")})),!Yi&&_i&&(bt=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Mt=bt.rgba>>8&16777215,vi=50331648,Yi=!0,D.selectionForeground&&(et=50331648,dt=D.selectionForeground.rgba>>8&16777215,vs=D.selectionForeground)),Yi&&_e.push("xterm-decoration-top"),vi){case 16777216:case 33554432:Wt=D.ansi[Mt],_e.push(`xterm-bg-${Mt}`);break;case 50331648:Wt=m.channels.toColor(Mt>>16,Mt>>8&255,255&Mt),this._addStyle(H,`background-color:#${C((Mt>>>0).toString(16),"0",6)}`);break;default:_s?(Wt=D.foreground,_e.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Wt=D.background}switch(bt||Se.isDim()&&(bt=m.color.multiplyOpacity(Wt,.5)),et){case 16777216:case 33554432:Se.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(H,Wt,D.ansi[dt],Se,bt,void 0)||_e.push(`xterm-fg-${dt}`);break;case 50331648:const qe=m.channels.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(H,Wt,qe,Se,bt,vs)||this._addStyle(H,`color:#${C(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(H,Wt,D.foreground,Se,bt,vs)||_s&&_e.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}_e.length&&(H.className=_e.join(" "),_e.length=0),Wi||Ue||Ki?H.textContent=$:O++,oe!==this.defaultSpacing&&(H.style.letterSpacing=`${oe}px`),X.push(H),we=it}return H&&O&&(H.textContent=$),X}_applyMinimumContrast(w,S,v,x,B,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,n.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const j=this._getContrastCache(x);let N;if(B||U||(N=j.getColor(S.rgba,v.rgba)),N===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);N=m.color.ensureContrastRatio(B||S,U||v,J),j.setColor((B||S).rgba,(U||v).rgba,N??null)}return!!N&&(this._addStyle(w,`color:${N.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,S){w.setAttribute("style",`${w.getAttribute("style")||""}${S};`)}_isCellInSelection(w,S){const v=this._selectionStart,x=this._selectionEnd;return!(!v||!x)&&(this._columnSelectMode?v[0]<=x[0]?w>=v[0]&&S>=v[1]&&w<x[0]&&S<=x[1]:w<v[0]&&S>=v[1]&&w>=x[0]&&S<=x[1]:S>v[1]&&S<x[1]||v[1]===x[1]&&S===v[1]&&w>=v[0]&&w<x[0]||v[1]<x[1]&&S===x[1]&&w<x[0]||v[1]<x[1]&&S===v[1]&&w>=v[0])}};function C(w,S,v){for(;w.length<v;)w=S+w;return w}u.DomRendererRowFactory=_=d([g(1,o.ICharacterJoinerService),g(2,E.IOptionsService),g(3,o.ICoreBrowserService),g(4,E.ICoreService),g(5,E.IDecorationService),g(6,o.IThemeService)],_)},2550:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WidthCache=void 0,u.WidthCache=class{constructor(f,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=f.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=f.createElement("span");g.classList.add("xterm-char-measure-element");const h=f.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const p=f.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const b=f.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[g,h,p,b],this._container.appendChild(g),this._container.appendChild(h),this._container.appendChild(p),this._container.appendChild(b),d.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(f,d,g,h){f===this._font&&d===this._fontSize&&g===this._weight&&h===this._weightBold||(this._font=f,this._fontSize=d,this._weight=g,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(f,d,g){let h=0;if(!d&&!g&&f.length===1&&(h=f.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const E=this._measure(f,0);return E>0&&(this._flat[h]=E),E}let p=f;d&&(p+="B"),g&&(p+="I");let b=this._holey.get(p);if(b===void 0){let E=0;d&&(E|=1),g&&(E|=2),b=this._measure(f,E),b>0&&this._holey.set(p,b)}return b}_measure(f,d){const g=this._measureElements[d];return g.textContent=f.repeat(32),g.offsetWidth/32}}},2223:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TEXT_BASELINE=u.DIM_OPACITY=u.INVERTED_DEFAULT_COLOR=void 0;const d=f(6114);u.INVERTED_DEFAULT_COLOR=257,u.DIM_OPACITY=.5,u.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(P,u)=>{function f(g){return 57508<=g&&g<=57558}function d(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(u,"__esModule",{value:!0}),u.computeNextVariantOffset=u.createRenderDimensions=u.treatGlyphAsBackgroundColor=u.allowRescaling=u.isEmoji=u.isRestrictedPowerlineGlyph=u.isPowerlineGlyph=u.throwIfFalsy=void 0,u.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},u.isPowerlineGlyph=f,u.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},u.isEmoji=d,u.allowRescaling=function(g,h,p,b){return h===1&&p>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!d(g)&&!f(g)&&!(function(E){return 57344<=E&&E<=63743})(g)},u.treatGlyphAsBackgroundColor=function(g){return f(g)||(function(h){return 9472<=h&&h<=9631})(g)},u.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}}}},u.computeNextVariantOffset=function(g,h,p=0){return(g-(2*Math.round(h)-p))%(2*Math.round(h))}},6052:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createSelectionRenderModel=void 0;class f{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,h,p,b=!1){if(this.selectionStart=h,this.selectionEnd=p,!h||!p||h[0]===p[0]&&h[1]===p[1])return void this.clear();const E=g.buffers.active.ydisp,m=h[1]-E,o=p[1]-E,c=Math.max(m,0),n=Math.min(o,g.rows-1);c>=g.rows||n<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=m,this.viewportEndRow=o,this.viewportCappedStartRow=c,this.viewportCappedEndRow=n,this.startCol=h[0],this.endCol=p[0])}isCellSelected(g,h,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&p>=this.viewportCappedStartRow&&h<this.endCol&&p<=this.viewportCappedEndRow:h<this.startCol&&p>=this.viewportCappedStartRow&&h>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&h>=this.startCol)}}u.createSelectionRenderModel=function(){return new f}},456:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionModel=void 0,u.SelectionModel=class{constructor(f){this._bufferService=f,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 f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?f%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)-1]:[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[Math.max(f,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const f=this.selectionStart,d=this.selectionEnd;return!(!f||!d)&&(f[1]>d[1]||f[1]===d[1]&&f[0]>d[0])}handleTrim(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(P,u,f){var d=this&&this.__decorate||function(n,l,_,C){var w,S=arguments.length,v=S<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(n,l,_,C);else for(var x=n.length-1;x>=0;x--)(w=n[x])&&(v=(S<3?w(v):S>3?w(l,_,v):w(l,_))||v);return S>3&&v&&Object.defineProperty(l,_,v),v},g=this&&this.__param||function(n,l){return function(_,C){l(_,C,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharSizeService=void 0;const h=f(2585),p=f(8460),b=f(844);let E=u.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,l,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new o(n,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};u.CharSizeService=E=d([g(2,h.IOptionsService)],E);class m extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,_){l!==void 0&&l>0&&_!==void 0&&_>0&&(this._result.width=l,this._result.height=_)}}class o extends m{constructor(l,_,C){super(),this._document=l,this._parentElement=_,this._optionsService=C,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 c extends m{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(P,u,f){var d=this&&this.__decorate||function(c,n,l,_){var C,w=arguments.length,S=w<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(c,n,l,_);else for(var v=c.length-1;v>=0;v--)(C=c[v])&&(S=(w<3?C(S):w>3?C(n,l,S):C(n,l))||S);return w>3&&S&&Object.defineProperty(n,l,S),S},g=this&&this.__param||function(c,n){return function(l,_){n(l,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharacterJoinerService=u.JoinedCellData=void 0;const h=f(3734),p=f(643),b=f(511),E=f(2585);class m extends h.AttributeData{constructor(n,l,_){super(),this.content=0,this.combinedData="",this.fg=n.fg,this.bg=n.bg,this.combinedData=l,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(n){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.JoinedCellData=m;let o=u.CharacterJoinerService=class vd{constructor(n){this._bufferService=n,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(n){const l={id:this._nextCharacterJoinerId++,handler:n};return this._characterJoiners.push(l),l.id}deregister(n){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===n)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(n){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(n);if(!l||l.length===0)return[];const _=[],C=l.translateToString(!0);let w=0,S=0,v=0,x=l.getFg(0),B=l.getBg(0);for(let U=0;U<l.getTrimmedLength();U++)if(l.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==B){if(U-w>1){const j=this._getJoinedRanges(C,v,S,l,w);for(let N=0;N<j.length;N++)_.push(j[N])}w=U,v=S,x=this._workCell.fg,B=this._workCell.bg}S+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const U=this._getJoinedRanges(C,v,S,l,w);for(let j=0;j<U.length;j++)_.push(U[j])}return _}_getJoinedRanges(n,l,_,C,w){const S=n.substring(l,_);let v=[];try{v=this._characterJoiners[0].handler(S)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const B=this._characterJoiners[x].handler(S);for(let U=0;U<B.length;U++)vd._mergeRanges(v,B[U])}catch(B){console.error(B)}return this._stringRangesToCellRanges(v,C,w),v}_stringRangesToCellRanges(n,l,_){let C=0,w=!1,S=0,v=n[C];if(v){for(let x=_;x<this._bufferService.cols;x++){const B=l.getWidth(x),U=l.getString(x).length||p.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!w&&v[0]<=S&&(v[0]=x,w=!0),v[1]<=S){if(v[1]=x,v=n[++C],!v)break;v[0]<=S?(v[0]=x,w=!0):w=!1}S+=U}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(n,l){let _=!1;for(let C=0;C<n.length;C++){const w=n[C];if(_){if(l[1]<=w[0])return n[C-1][1]=l[1],n;if(l[1]<=w[1])return n[C-1][1]=Math.max(l[1],w[1]),n.splice(C,1),n;n.splice(C,1),C--}else{if(l[1]<=w[0])return n.splice(C,0,l),n;if(l[1]<=w[1])return w[0]=Math.min(l[0],w[0]),n;l[0]<w[1]&&(w[0]=Math.min(l[0],w[0]),_=!0)}}return _?n[n.length-1][1]=l[1]:n.push(l),n}};u.CharacterJoinerService=o=d([g(0,E.IBufferService)],o)},5114:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreBrowserService=void 0;const d=f(844),g=f(8460),h=f(3656);class p extends d.Disposable{constructor(m,o,c){super(),this._textarea=m,this._window=o,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(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((n=>this._screenDprMonitor.setWindow(n)))),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(m){this._window!==m&&(this._window=m,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}}u.CoreBrowserService=p;class b extends d.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new d.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,d.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.LinkProviderService=void 0;const d=f(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const b=this.linkProviders.indexOf(p);b!==-1&&this.linkProviders.splice(b,1)}}}}u.LinkProviderService=g},8934:function(P,u,f){var d=this&&this.__decorate||function(E,m,o,c){var n,l=arguments.length,_=l<3?m:c===null?c=Object.getOwnPropertyDescriptor(m,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(E,m,o,c);else for(var C=E.length-1;C>=0;C--)(n=E[C])&&(_=(l<3?n(_):l>3?n(m,o,_):n(m,o))||_);return l>3&&_&&Object.defineProperty(m,o,_),_},g=this&&this.__param||function(E,m){return function(o,c){m(o,c,E)}};Object.defineProperty(u,"__esModule",{value:!0}),u.MouseService=void 0;const h=f(4725),p=f(9806);let b=u.MouseService=class{constructor(E,m){this._renderService=E,this._charSizeService=m}getCoords(E,m,o,c,n){return(0,p.getCoords)(window,E,m,o,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(E,m){const o=(0,p.getCoordsRelativeToElement)(window,E,m);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};u.MouseService=b=d([g(0,h.IRenderService),g(1,h.ICharSizeService)],b)},3230:function(P,u,f){var d=this&&this.__decorate||function(n,l,_,C){var w,S=arguments.length,v=S<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(n,l,_,C);else for(var x=n.length-1;x>=0;x--)(w=n[x])&&(v=(S<3?w(v):S>3?w(l,_,v):w(l,_))||v);return S>3&&v&&Object.defineProperty(l,_,v),v},g=this&&this.__param||function(n,l){return function(_,C){l(_,C,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.RenderService=void 0;const h=f(6193),p=f(4725),b=f(8460),E=f(844),m=f(7226),o=f(2585);let c=u.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(n,l,_,C,w,S,v,x){super(),this._rowCount=n,this._charSizeService=C,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((B,U)=>this._renderRows(B,U)),v),this.register(this._renderDebouncer),this.register(v.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(S.onResize((()=>this._fullRefresh()))),this.register(S.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(w.onDecorationRegistered((()=>this._fullRefresh()))),this.register(w.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(S.cols,S.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(S.buffer.y,S.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(v.window,l),this.register(v.onWindowChange((B=>this._registerIntersectionObserver(B,l))))}_registerIntersectionObserver(n,l){if("IntersectionObserver"in n){const _=new n.IntersectionObserver((C=>this._handleIntersectionChange(C[C.length-1])),{threshold:0});_.observe(l),this._observerDisposable.value=(0,E.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,l,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,l,this._rowCount))}_renderRows(n,l){this._renderer.value&&(n=Math.min(n,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(n,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:l}),this._onRender.fire({start:n,end:l}),this._isNextRenderRedrawOnly=!0)}resize(n,l){this._rowCount=l,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(n){this._renderer.value=n,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,l;this._renderer.value&&((l=(n=this._renderer.value).clearTextureAtlas)==null||l.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(n,l)})):this._renderer.value.handleResize(n,l),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer.value)==null||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer.value)==null||n.handleBlur()}handleFocus(){var n;(n=this._renderer.value)==null||n.handleFocus()}handleSelectionChanged(n,l,_){var C;this._selectionState.start=n,this._selectionState.end=l,this._selectionState.columnSelectMode=_,(C=this._renderer.value)==null||C.handleSelectionChanged(n,l,_)}handleCursorMove(){var n;(n=this._renderer.value)==null||n.handleCursorMove()}clear(){var n;(n=this._renderer.value)==null||n.clear()}};u.RenderService=c=d([g(2,o.IOptionsService),g(3,p.ICharSizeService),g(4,o.IDecorationService),g(5,o.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],c)},9312:function(P,u,f){var d=this&&this.__decorate||function(v,x,B,U){var j,N=arguments.length,J=N<3?x:U===null?U=Object.getOwnPropertyDescriptor(x,B):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(v,x,B,U);else for(var ce=v.length-1;ce>=0;ce--)(j=v[ce])&&(J=(N<3?j(J):N>3?j(x,B,J):j(x,B))||J);return N>3&&J&&Object.defineProperty(x,B,J),J},g=this&&this.__param||function(v,x){return function(B,U){x(B,U,v)}};Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionService=void 0;const h=f(9806),p=f(9504),b=f(456),E=f(4725),m=f(8460),o=f(844),c=f(6114),n=f(4841),l=f(511),_=f(2585),C=" ",w=new RegExp(C,"g");let S=u.SelectionService=class extends o.Disposable{constructor(v,x,B,U,j,N,J,ce,W){super(),this._element=v,this._screenElement=x,this._linkifier=B,this._bufferService=U,this._coreService=j,this._mouseService=N,this._optionsService=J,this._renderService=ce,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.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 v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!v||!x||v[0]===x[0]&&v[1]===x[1])}get selectionText(){const v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!v||!x)return"";const B=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(v[0]===x[0])return"";const j=v[0]<x[0]?v[0]:x[0],N=v[0]<x[0]?x[0]:v[0];for(let J=v[1];J<=x[1];J++){const ce=B.translateBufferLineToString(J,!0,j,N);U.push(ce)}}else{const j=v[1]===x[1]?x[0]:void 0;U.push(B.translateBufferLineToString(v[1],!0,v[0],j));for(let N=v[1]+1;N<=x[1]-1;N++){const J=B.lines.get(N),ce=B.translateBufferLineToString(N,!0);J!=null&&J.isWrapped?U[U.length-1]+=ce:U.push(ce)}if(v[1]!==x[1]){const N=B.lines.get(x[1]),J=B.translateBufferLineToString(x[1],!0,0,x[0]);N&&N.isWrapped?U[U.length-1]+=J:U.push(J)}}return U.map((j=>j.replace(w," "))).join(c.isWindows?`\r
211
- `:`
212
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&v&&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(v){const x=this._getMouseBufferCoords(v),B=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(B&&U&&x)&&this._areCoordsInSelection(x,B,U)}isCellInSelection(v,x){const B=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!B||!U)&&this._areCoordsInSelection([v,x],B,U)}_areCoordsInSelection(v,x,B){return v[1]>x[1]&&v[1]<B[1]||x[1]===B[1]&&v[1]===x[1]&&v[0]>=x[0]&&v[0]<B[0]||x[1]<B[1]&&v[1]===B[1]&&v[0]<B[0]||x[1]<B[1]&&v[1]===x[1]&&v[0]>=x[0]}_selectWordAtCursor(v,x){var j,N;const B=(N=(j=this._linkifier.currentLink)==null?void 0:j.link)==null?void 0:N.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(v);return!!U&&(this._selectWordAt(U,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,x){this._model.clearSelection(),v=Math.max(v,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(v){this._model.handleTrim(v)&&this.refresh()}_getMouseBufferCoords(v){const x=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(v){let x=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=B?0:(x>B&&(x-=B),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(v){return c.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}handleMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._handleIncrementalClick(v):v.detail===1?this._handleSingleClick(v):v.detail===2?this._handleDoubleClick(v):v.detail===3&&this._handleTripleClick(v),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(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_handleSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(v){const x=this._getMouseBufferCoords(v);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(v){return v.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!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(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const U=B.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[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 v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_handleMouseUp(v){const x=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const U=(0,p.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const v=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,B=!(!v||!x||v[0]===x[0]&&v[1]===x[1]);B?v&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,x,B)):this._oldHasSelection&&this._fireOnSelectionChange(v,x,B)}_fireOnSelectionChange(v,x,B){this._oldSelectionStart=v,this._oldSelectionEnd=x,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(v,x){let B=x;for(let U=0;x>=U;U++){const j=v.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:j>1&&x!==U&&(B+=j-1)}return B}setSelection(v,x,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,x],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,x,B=!0,U=!0){if(v[0]>=this._bufferService.cols)return;const j=this._bufferService.buffer,N=j.lines.get(v[1]);if(!N)return;const J=j.translateBufferLineToString(v[1],!1);let ce=this._convertViewportColToCharacterIndex(N,v[0]),W=ce;const X=v[0]-ce;let re=0,D=0,H=0,A=0;if(J.charAt(ce)===" "){for(;ce>0&&J.charAt(ce-1)===" ";)ce--;for(;W<J.length&&J.charAt(W+1)===" ";)W++}else{let se=v[0],Y=v[0];N.getWidth(se)===0&&(re++,se--),N.getWidth(Y)===2&&(D++,Y++);const F=N.getString(Y).length;for(F>1&&(A+=F-1,W+=F-1);se>0&&ce>0&&!this._isCharWordSeparator(N.loadCell(se-1,this._workCell));){N.loadCell(se-1,this._workCell);const z=this._workCell.getChars().length;this._workCell.getWidth()===0?(re++,se--):z>1&&(H+=z-1,ce-=z-1),ce--,se--}for(;Y<N.length&&W+1<J.length&&!this._isCharWordSeparator(N.loadCell(Y+1,this._workCell));){N.loadCell(Y+1,this._workCell);const z=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,Y++):z>1&&(A+=z-1,W+=z-1),W++,Y++}}W++;let O=ce+X-re+H,$=Math.min(this._bufferService.cols,W-ce+re+D-H-A);if(x||J.slice(ce,W).trim()!==""){if(B&&O===0&&N.getCodePoint(0)!==32){const se=j.lines.get(v[1]-1);if(se&&N.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(Y){const F=this._bufferService.cols-Y.start;O-=F,$+=F}}}if(U&&O+$===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const se=j.lines.get(v[1]+1);if(se!=null&&se.isWrapped&&se.getCodePoint(0)!==32){const Y=this._getWordAt([0,v[1]+1],!1,!1,!0);Y&&($+=Y.length)}}return{start:O,length:$}}}_selectWordAt(v,x){const B=this._getWordAt(v,x);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[B.start,v[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(v){const x=this._getWordAt(v,!0);if(x){let B=v[1];for(;x.start<0;)x.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,B]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){const x=this._bufferService.buffer.getWrappedRangeForLine(v),B={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(B,this._bufferService.cols)}};u.SelectionService=S=d([g(3,_.IBufferService),g(4,_.ICoreService),g(5,E.IMouseService),g(6,_.IOptionsService),g(7,E.IRenderService),g(8,E.ICoreBrowserService)],S)},4725:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ILinkProviderService=u.IThemeService=u.ICharacterJoinerService=u.ISelectionService=u.IRenderService=u.IMouseService=u.ICoreBrowserService=u.ICharSizeService=void 0;const d=f(8343);u.ICharSizeService=(0,d.createDecorator)("CharSizeService"),u.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),u.IMouseService=(0,d.createDecorator)("MouseService"),u.IRenderService=(0,d.createDecorator)("RenderService"),u.ISelectionService=(0,d.createDecorator)("SelectionService"),u.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),u.IThemeService=(0,d.createDecorator)("ThemeService"),u.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(P,u,f){var d=this&&this.__decorate||function(S,v,x,B){var U,j=arguments.length,N=j<3?v:B===null?B=Object.getOwnPropertyDescriptor(v,x):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,v,x,B);else for(var J=S.length-1;J>=0;J--)(U=S[J])&&(N=(j<3?U(N):j>3?U(v,x,N):U(v,x))||N);return j>3&&N&&Object.defineProperty(v,x,N),N},g=this&&this.__param||function(S,v){return function(x,B){v(x,B,S)}};Object.defineProperty(u,"__esModule",{value:!0}),u.ThemeService=u.DEFAULT_ANSI_COLORS=void 0;const h=f(7239),p=f(8055),b=f(8460),E=f(844),m=f(2585),o=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),n=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};u.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const S=[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")],v=[0,95,135,175,215,255];for(let x=0;x<216;x++){const B=v[x/36%6|0],U=v[x/6%6|0],j=v[x%6];S.push({css:p.channels.toCss(B,U,j),rgba:p.channels.toRgba(B,U,j)})}for(let x=0;x<24;x++){const B=8+10*x;S.push({css:p.channels.toCss(B,B,B),rgba:p.channels.toRgba(B,B,B)})}return S})());let C=u.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(S){super(),this._optionsService=S,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:c,cursor:n,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:p.color.blend(c,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:p.color.blend(c,_),ansi:u.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(S={}){const v=this._colors;if(v.foreground=w(S.foreground,o),v.background=w(S.background,c),v.cursor=w(S.cursor,n),v.cursorAccent=w(S.cursorAccent,l),v.selectionBackgroundTransparent=w(S.selectionBackground,_),v.selectionBackgroundOpaque=p.color.blend(v.background,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundTransparent=w(S.selectionInactiveBackground,v.selectionBackgroundTransparent),v.selectionInactiveBackgroundOpaque=p.color.blend(v.background,v.selectionInactiveBackgroundTransparent),v.selectionForeground=S.selectionForeground?w(S.selectionForeground,p.NULL_COLOR):void 0,v.selectionForeground===p.NULL_COLOR&&(v.selectionForeground=void 0),p.color.isOpaque(v.selectionBackgroundTransparent)&&(v.selectionBackgroundTransparent=p.color.opacity(v.selectionBackgroundTransparent,.3)),p.color.isOpaque(v.selectionInactiveBackgroundTransparent)&&(v.selectionInactiveBackgroundTransparent=p.color.opacity(v.selectionInactiveBackgroundTransparent,.3)),v.ansi=u.DEFAULT_ANSI_COLORS.slice(),v.ansi[0]=w(S.black,u.DEFAULT_ANSI_COLORS[0]),v.ansi[1]=w(S.red,u.DEFAULT_ANSI_COLORS[1]),v.ansi[2]=w(S.green,u.DEFAULT_ANSI_COLORS[2]),v.ansi[3]=w(S.yellow,u.DEFAULT_ANSI_COLORS[3]),v.ansi[4]=w(S.blue,u.DEFAULT_ANSI_COLORS[4]),v.ansi[5]=w(S.magenta,u.DEFAULT_ANSI_COLORS[5]),v.ansi[6]=w(S.cyan,u.DEFAULT_ANSI_COLORS[6]),v.ansi[7]=w(S.white,u.DEFAULT_ANSI_COLORS[7]),v.ansi[8]=w(S.brightBlack,u.DEFAULT_ANSI_COLORS[8]),v.ansi[9]=w(S.brightRed,u.DEFAULT_ANSI_COLORS[9]),v.ansi[10]=w(S.brightGreen,u.DEFAULT_ANSI_COLORS[10]),v.ansi[11]=w(S.brightYellow,u.DEFAULT_ANSI_COLORS[11]),v.ansi[12]=w(S.brightBlue,u.DEFAULT_ANSI_COLORS[12]),v.ansi[13]=w(S.brightMagenta,u.DEFAULT_ANSI_COLORS[13]),v.ansi[14]=w(S.brightCyan,u.DEFAULT_ANSI_COLORS[14]),v.ansi[15]=w(S.brightWhite,u.DEFAULT_ANSI_COLORS[15]),S.extendedAnsi){const x=Math.min(v.ansi.length-16,S.extendedAnsi.length);for(let B=0;B<x;B++)v.ansi[B+16]=w(S.extendedAnsi[B],u.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(S){this._restoreColor(S),this._onChangeColors.fire(this.colors)}_restoreColor(S){if(S!==void 0)switch(S){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[S]=this._restoreColors.ansi[S]}else for(let v=0;v<this._restoreColors.ansi.length;++v)this._colors.ansi[v]=this._restoreColors.ansi[v]}modifyColors(S){S(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 w(S,v){if(S!==void 0)try{return p.css.toColor(S)}catch{}return v}u.ThemeService=C=d([g(0,m.IOptionsService)],C)},6349:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CircularList=void 0;const d=f(8460),g=f(844);class h extends g.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const E=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)E[m]=this._array[this._getCyclicIndex(m)];this._array=E,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let E=this._length;E<b;E++)this._array[E]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,E){this._array[this._getCyclicIndex(b)]=E}push(b){this._array[this._getCyclicIndex(this._length)]=b,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(b,E,...m){if(E){for(let o=b;o<this._length-E;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+E)];this._length-=E,this.onDeleteEmitter.fire({index:b,amount:E})}for(let o=this._length-1;o>=b;o--)this._array[this._getCyclicIndex(o+m.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<m.length;o++)this._array[this._getCyclicIndex(b+o)]=m[o];if(m.length&&this.onInsertEmitter.fire({index:b,amount:m.length}),this._length+m.length>this._maxLength){const o=this._length+m.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=m.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,E,m){if(!(E<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let c=E-1;c>=0;c--)this.set(b+c+m,this.get(b+c));const o=b+E+m-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<E;o++)this.set(b+o+m,this.get(b+o))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}u.CircularList=h},1439:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.clone=void 0,u.clone=function f(d,g=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const p in d)h[p]=g<=1?d[p]:d[p]&&f(d[p],g-1);return h}},8055:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.contrastRatio=u.toPaddedHex=u.rgba=u.rgb=u.css=u.color=u.channels=u.NULL_COLOR=void 0;let f=0,d=0,g=0,h=0;var p,b,E,m,o;function c(l){const _=l.toString(16);return _.length<2?"0"+_:_}function n(l,_){return l<_?(_+.05)/(l+.05):(l+.05)/(_+.05)}u.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(_,C,w,S){return S!==void 0?`#${c(_)}${c(C)}${c(w)}${c(S)}`:`#${c(_)}${c(C)}${c(w)}`},l.toRgba=function(_,C,w,S=255){return(_<<24|C<<16|w<<8|S)>>>0},l.toColor=function(_,C,w,S){return{css:l.toCss(_,C,w,S),rgba:l.toRgba(_,C,w,S)}}})(p||(u.channels=p={})),(function(l){function _(C,w){return h=Math.round(255*w),[f,d,g]=o.toChannels(C.rgba),{css:p.toCss(f,d,g,h),rgba:p.toRgba(f,d,g,h)}}l.blend=function(C,w){if(h=(255&w.rgba)/255,h===1)return{css:w.css,rgba:w.rgba};const S=w.rgba>>24&255,v=w.rgba>>16&255,x=w.rgba>>8&255,B=C.rgba>>24&255,U=C.rgba>>16&255,j=C.rgba>>8&255;return f=B+Math.round((S-B)*h),d=U+Math.round((v-U)*h),g=j+Math.round((x-j)*h),{css:p.toCss(f,d,g),rgba:p.toRgba(f,d,g)}},l.isOpaque=function(C){return(255&C.rgba)==255},l.ensureContrastRatio=function(C,w,S){const v=o.ensureContrastRatio(C.rgba,w.rgba,S);if(v)return p.toColor(v>>24&255,v>>16&255,v>>8&255)},l.opaque=function(C){const w=(255|C.rgba)>>>0;return[f,d,g]=o.toChannels(w),{css:p.toCss(f,d,g),rgba:w}},l.opacity=_,l.multiplyOpacity=function(C,w){return h=255&C.rgba,_(C,h*w/255)},l.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}})(b||(u.color=b={})),(function(l){let _,C;try{const w=document.createElement("canvas");w.width=1,w.height=1;const S=w.getContext("2d",{willReadFrequently:!0});S&&(_=S,_.globalCompositeOperation="copy",C=_.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return f=parseInt(w.slice(1,2).repeat(2),16),d=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),p.toColor(f,d,g);case 5:return f=parseInt(w.slice(1,2).repeat(2),16),d=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),h=parseInt(w.slice(4,5).repeat(2),16),p.toColor(f,d,g,h);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const S=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(S)return f=parseInt(S[1]),d=parseInt(S[2]),g=parseInt(S[3]),h=Math.round(255*(S[5]===void 0?1:parseFloat(S[5]))),p.toColor(f,d,g,h);if(!_||!C)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=C,_.fillStyle=w,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[f,d,g,h]=_.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(f,d,g,h),css:w}}})(E||(u.css=E={})),(function(l){function _(C,w,S){const v=C/255,x=w/255,B=S/255;return .2126*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}l.relativeLuminance=function(C){return _(C>>16&255,C>>8&255,255&C)},l.relativeLuminance2=_})(m||(u.rgb=m={})),(function(l){function _(w,S,v){const x=w>>24&255,B=w>>16&255,U=w>>8&255;let j=S>>24&255,N=S>>16&255,J=S>>8&255,ce=n(m.relativeLuminance2(j,N,J),m.relativeLuminance2(x,B,U));for(;ce<v&&(j>0||N>0||J>0);)j-=Math.max(0,Math.ceil(.1*j)),N-=Math.max(0,Math.ceil(.1*N)),J-=Math.max(0,Math.ceil(.1*J)),ce=n(m.relativeLuminance2(j,N,J),m.relativeLuminance2(x,B,U));return(j<<24|N<<16|J<<8|255)>>>0}function C(w,S,v){const x=w>>24&255,B=w>>16&255,U=w>>8&255;let j=S>>24&255,N=S>>16&255,J=S>>8&255,ce=n(m.relativeLuminance2(j,N,J),m.relativeLuminance2(x,B,U));for(;ce<v&&(j<255||N<255||J<255);)j=Math.min(255,j+Math.ceil(.1*(255-j))),N=Math.min(255,N+Math.ceil(.1*(255-N))),J=Math.min(255,J+Math.ceil(.1*(255-J))),ce=n(m.relativeLuminance2(j,N,J),m.relativeLuminance2(x,B,U));return(j<<24|N<<16|J<<8|255)>>>0}l.blend=function(w,S){if(h=(255&S)/255,h===1)return S;const v=S>>24&255,x=S>>16&255,B=S>>8&255,U=w>>24&255,j=w>>16&255,N=w>>8&255;return f=U+Math.round((v-U)*h),d=j+Math.round((x-j)*h),g=N+Math.round((B-N)*h),p.toRgba(f,d,g)},l.ensureContrastRatio=function(w,S,v){const x=m.relativeLuminance(w>>8),B=m.relativeLuminance(S>>8);if(n(x,B)<v){if(B<x){const N=_(w,S,v),J=n(x,m.relativeLuminance(N>>8));if(J<v){const ce=C(w,S,v);return J>n(x,m.relativeLuminance(ce>>8))?N:ce}return N}const U=C(w,S,v),j=n(x,m.relativeLuminance(U>>8));if(j<v){const N=_(w,S,v);return j>n(x,m.relativeLuminance(N>>8))?U:N}return U}},l.reduceLuminance=_,l.increaseLuminance=C,l.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(o||(u.rgba=o={})),u.toPaddedHex=c,u.contrastRatio=n},8969:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreTerminal=void 0;const d=f(844),g=f(2585),h=f(4348),p=f(7866),b=f(744),E=f(7302),m=f(6975),o=f(8460),c=f(1753),n=f(1480),l=f(7994),_=f(9282),C=f(5435),w=f(5981),S=f(2660);let v=!1;class x extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((U=>{var j;(j=this._onScrollApi)==null||j.fire(U.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(U){for(const j in U)this.optionsService.options[j]=U[j]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new E.OptionsService(U)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.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(m.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(n.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.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((j=>{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((j=>{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 w.WriteBuffer(((j,N)=>this._inputHandler.parse(j,N)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,j){this._writeBuffer.write(U,j)}writeSync(U,j){this._logService.logLevel<=g.LogLevelEnum.WARN&&!v&&(this._logService.warn("writeSync is unreliable and will be removed soon."),v=!0),this._writeBuffer.writeSync(U,j)}input(U,j=!0){this.coreService.triggerDataEvent(U,j)}resize(U,j){isNaN(U)||isNaN(j)||(U=Math.max(U,b.MINIMUM_COLS),j=Math.max(j,b.MINIMUM_ROWS),this._bufferService.resize(U,j))}scroll(U,j=!1){this._bufferService.scroll(U,j)}scrollLines(U,j,N){this._bufferService.scrollLines(U,j,N)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const j=U-this._bufferService.buffer.ydisp;j!==0&&this.scrollLines(j)}registerEscHandler(U,j){return this._inputHandler.registerEscHandler(U,j)}registerDcsHandler(U,j){return this._inputHandler.registerDcsHandler(U,j)}registerCsiHandler(U,j){return this._inputHandler.registerCsiHandler(U,j)}registerOscHandler(U,j){return this._inputHandler.registerOscHandler(U,j)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const j=this.optionsService.rawOptions.windowsPty;j&&j.buildNumber!==void 0&&j.buildNumber!==void 0?U=j.backend==="conpty"&&j.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const j of U)j.dispose()}))}}}u.CoreTerminal=x},8460:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.runAndSubscribe=u.forwardEvent=u.EventEmitter=void 0,u.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=f=>(this._listeners.push(f),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===f)return void this._listeners.splice(d,1)}}})),this._event}fire(f,d){const g=[];for(let h=0;h<this._listeners.length;h++)g.push(this._listeners[h]);for(let h=0;h<g.length;h++)g[h].call(void 0,f,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},u.forwardEvent=function(f,d){return f((g=>d.fire(g)))},u.runAndSubscribe=function(f,d){return d(void 0),f((g=>d(g)))}},5435:function(P,u,f){var d=this&&this.__decorate||function(re,D,H,A){var O,$=arguments.length,se=$<3?D:A===null?A=Object.getOwnPropertyDescriptor(D,H):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(re,D,H,A);else for(var Y=re.length-1;Y>=0;Y--)(O=re[Y])&&(se=($<3?O(se):$>3?O(D,H,se):O(D,H))||se);return $>3&&se&&Object.defineProperty(D,H,se),se},g=this&&this.__param||function(re,D){return function(H,A){D(H,A,re)}};Object.defineProperty(u,"__esModule",{value:!0}),u.InputHandler=u.WindowsOptionsReportType=void 0;const h=f(2584),p=f(7116),b=f(2015),E=f(844),m=f(482),o=f(8437),c=f(8460),n=f(643),l=f(511),_=f(3734),C=f(2585),w=f(1480),S=f(6242),v=f(6351),x=f(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function j(re,D){if(re>24)return D.setWinLines||!1;switch(re){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var N;(function(re){re[re.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",re[re.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(u.WindowsOptionsReportType=N={}));let J=0;class ce extends E.Disposable{getAttrData(){return this._curAttrData}constructor(D,H,A,O,$,se,Y,F,z=new b.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=H,this._coreService=A,this._logService=O,this._optionsService=$,this._oscLinkService=se,this._coreMouseService=Y,this._unicodeService=F,this._parser=z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._parser.setCsiHandlerFallback(((R,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:ie.toArray()})})),this._parser.setEscHandlerFallback((R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})})),this._parser.setExecuteHandlerFallback((R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})})),this._parser.setOscHandlerFallback(((R,ie,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:ie,data:oe})})),this._parser.setDcsHandlerFallback(((R,ie,oe)=>{ie==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:ie,payload:oe})})),this._parser.setPrintHandler(((R,ie,oe)=>this.print(R,ie,oe))),this._parser.registerCsiHandler({final:"@"},(R=>this.insertChars(R))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(R=>this.scrollLeft(R))),this._parser.registerCsiHandler({final:"A"},(R=>this.cursorUp(R))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(R=>this.scrollRight(R))),this._parser.registerCsiHandler({final:"B"},(R=>this.cursorDown(R))),this._parser.registerCsiHandler({final:"C"},(R=>this.cursorForward(R))),this._parser.registerCsiHandler({final:"D"},(R=>this.cursorBackward(R))),this._parser.registerCsiHandler({final:"E"},(R=>this.cursorNextLine(R))),this._parser.registerCsiHandler({final:"F"},(R=>this.cursorPrecedingLine(R))),this._parser.registerCsiHandler({final:"G"},(R=>this.cursorCharAbsolute(R))),this._parser.registerCsiHandler({final:"H"},(R=>this.cursorPosition(R))),this._parser.registerCsiHandler({final:"I"},(R=>this.cursorForwardTab(R))),this._parser.registerCsiHandler({final:"J"},(R=>this.eraseInDisplay(R,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(R=>this.eraseInDisplay(R,!0))),this._parser.registerCsiHandler({final:"K"},(R=>this.eraseInLine(R,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(R=>this.eraseInLine(R,!0))),this._parser.registerCsiHandler({final:"L"},(R=>this.insertLines(R))),this._parser.registerCsiHandler({final:"M"},(R=>this.deleteLines(R))),this._parser.registerCsiHandler({final:"P"},(R=>this.deleteChars(R))),this._parser.registerCsiHandler({final:"S"},(R=>this.scrollUp(R))),this._parser.registerCsiHandler({final:"T"},(R=>this.scrollDown(R))),this._parser.registerCsiHandler({final:"X"},(R=>this.eraseChars(R))),this._parser.registerCsiHandler({final:"Z"},(R=>this.cursorBackwardTab(R))),this._parser.registerCsiHandler({final:"`"},(R=>this.charPosAbsolute(R))),this._parser.registerCsiHandler({final:"a"},(R=>this.hPositionRelative(R))),this._parser.registerCsiHandler({final:"b"},(R=>this.repeatPrecedingCharacter(R))),this._parser.registerCsiHandler({final:"c"},(R=>this.sendDeviceAttributesPrimary(R))),this._parser.registerCsiHandler({prefix:">",final:"c"},(R=>this.sendDeviceAttributesSecondary(R))),this._parser.registerCsiHandler({final:"d"},(R=>this.linePosAbsolute(R))),this._parser.registerCsiHandler({final:"e"},(R=>this.vPositionRelative(R))),this._parser.registerCsiHandler({final:"f"},(R=>this.hVPosition(R))),this._parser.registerCsiHandler({final:"g"},(R=>this.tabClear(R))),this._parser.registerCsiHandler({final:"h"},(R=>this.setMode(R))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(R=>this.setModePrivate(R))),this._parser.registerCsiHandler({final:"l"},(R=>this.resetMode(R))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(R=>this.resetModePrivate(R))),this._parser.registerCsiHandler({final:"m"},(R=>this.charAttributes(R))),this._parser.registerCsiHandler({final:"n"},(R=>this.deviceStatus(R))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(R=>this.deviceStatusPrivate(R))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(R=>this.softReset(R))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(R=>this.setCursorStyle(R))),this._parser.registerCsiHandler({final:"r"},(R=>this.setScrollRegion(R))),this._parser.registerCsiHandler({final:"s"},(R=>this.saveCursor(R))),this._parser.registerCsiHandler({final:"t"},(R=>this.windowOptions(R))),this._parser.registerCsiHandler({final:"u"},(R=>this.restoreCursor(R))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(R=>this.insertColumns(R))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(R=>this.deleteColumns(R))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(R=>this.selectProtected(R))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(R=>this.requestMode(R,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(R=>this.requestMode(R,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new S.OscHandler((R=>(this.setTitle(R),this.setIconName(R),!0)))),this._parser.registerOscHandler(1,new S.OscHandler((R=>this.setIconName(R)))),this._parser.registerOscHandler(2,new S.OscHandler((R=>this.setTitle(R)))),this._parser.registerOscHandler(4,new S.OscHandler((R=>this.setOrReportIndexedColor(R)))),this._parser.registerOscHandler(8,new S.OscHandler((R=>this.setHyperlink(R)))),this._parser.registerOscHandler(10,new S.OscHandler((R=>this.setOrReportFgColor(R)))),this._parser.registerOscHandler(11,new S.OscHandler((R=>this.setOrReportBgColor(R)))),this._parser.registerOscHandler(12,new S.OscHandler((R=>this.setOrReportCursorColor(R)))),this._parser.registerOscHandler(104,new S.OscHandler((R=>this.restoreIndexedColor(R)))),this._parser.registerOscHandler(110,new S.OscHandler((R=>this.restoreFgColor(R)))),this._parser.registerOscHandler(111,new S.OscHandler((R=>this.restoreBgColor(R)))),this._parser.registerOscHandler(112,new S.OscHandler((R=>this.restoreCursorColor(R)))),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 R in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},(()=>this.selectCharset("("+R))),this._parser.registerEscHandler({intermediates:")",final:R},(()=>this.selectCharset(")"+R))),this._parser.registerEscHandler({intermediates:"*",final:R},(()=>this.selectCharset("*"+R))),this._parser.registerEscHandler({intermediates:"+",final:R},(()=>this.selectCharset("+"+R))),this._parser.registerEscHandler({intermediates:"-",final:R},(()=>this.selectCharset("-"+R))),this._parser.registerEscHandler({intermediates:".",final:R},(()=>this.selectCharset("."+R))),this._parser.registerEscHandler({intermediates:"/",final:R},(()=>this.selectCharset("/"+R)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((R=>(this._logService.error("Parsing error: ",R),R))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((R,ie)=>this.requestStatusString(R,ie))))}_preserveStack(D,H,A,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=H,this._parseStack.decodedLength=A,this._parseStack.position=O}_logSlowResolvingAsync(D){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([D,new Promise(((H,A)=>setTimeout((()=>A("#SLOW_TIMEOUT")),5e3)))]).catch((H=>{if(H!=="#SLOW_TIMEOUT")throw H;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,H){let A,O=this._activeBuffer.x,$=this._activeBuffer.y,se=0;const Y=this._parseStack.paused;if(Y){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,H))return this._logSlowResolvingAsync(A),A;O=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>U&&(se=this._parseStack.position+U)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(R=>String.fromCharCode(R))).join("")}"`),typeof D=="string"?D.split("").map((R=>R.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(D.length,U))),Y||this._dirtyRowTracker.clearRange(),D.length>U)for(let R=se;R<D.length;R+=U){const ie=R+U<D.length?R+U:D.length,oe=typeof D=="string"?this._stringDecoder.decode(D.substring(R,ie),this._parseBuffer):this._utf8Decoder.decode(D.subarray(R,ie),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(O,$,oe,R),this._logSlowResolvingAsync(A),A}else if(!Y){const R=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,R))return this._preserveStack(O,$,R,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===O&&this._activeBuffer.y===$||this._onCursorMove.fire();const F=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(z,this._bufferService.rows-1),Math.min(F,this._bufferService.rows-1))}print(D,H,A){let O,$;const se=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,F=this._bufferService.cols,z=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,ie=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-H>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let _e=this._parser.precedingJoinState;for(let de=H;de<A;++de){if(O=D[de],O<127&&se){const it=se[String.fromCharCode(O)];it&&(O=it.charCodeAt(0))}const we=this._unicodeService.charProperties(O,_e);$=w.UnicodeService.extractWidth(we);const Le=w.UnicodeService.extractShouldJoin(we),Ue=Le?w.UnicodeService.extractWidth(_e):0;if(_e=we,Y&&this._onA11yChar.fire((0,m.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+$-Ue>F){if(z){const it=oe;let Se=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ue>0&&oe instanceof o.BufferLine&&oe.copyCellsFrom(it,Se,0,Ue,!1);Se<F;)it.setCellFromCodepoint(Se++,0,1,ie)}else if(this._activeBuffer.x=F-1,$===2)continue}if(Le&&this._activeBuffer.x){const it=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-it,O,$);for(let Se=$-Ue;--Se>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(R&&(oe.insertCells(this._activeBuffer.x,$-Ue,this._activeBuffer.getNullCell(ie)),oe.getWidth(F-1)===2&&oe.setCellFromCodepoint(F-1,n.NULL_CELL_CODE,n.NULL_CELL_WIDTH,ie)),oe.setCellFromCodepoint(this._activeBuffer.x++,O,$,ie),$>0)for(;--$;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=_e,this._activeBuffer.x<F&&A-H>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,H){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,H):this._parser.registerCsiHandler(D,(A=>!j(A.params[0],this._optionsService.rawOptions.windowOptions)||H(A)))}registerDcsHandler(D,H){return this._parser.registerDcsHandler(D,new v.DcsHandler(H))}registerEscHandler(D,H){return this._parser.registerEscHandler(D,H)}registerOscHandler(D,H){return this._parser.registerOscHandler(D,new S.OscHandler(H))}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 D;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&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);H.hasWidth(this._activeBuffer.x)&&!H.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,H){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+H):(this._activeBuffer.x=D,this._activeBuffer.y=H),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,H){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+H)}cursorUp(D){const H=this._activeBuffer.y-this._activeBuffer.scrollTop;return H>=0?this._moveCursor(0,-Math.min(H,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const H=this._activeBuffer.scrollBottom-this._activeBuffer.y;return H>=0?this._moveCursor(0,Math.min(H,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const H=D.params[0];return H===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:H===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=D.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=D.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const H=D.params[0];return H===1&&(this._curAttrData.bg|=536870912),H!==2&&H!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,H,A,O=!1,$=!1){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);se.replaceCells(H,A,this._activeBuffer.getNullCell(this._eraseAttrData()),$),O&&(se.isWrapped=!1)}_resetBufferLine(D,H=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),H),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),A.isWrapped=!1)}eraseInDisplay(D,H=!1){let A;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);A<this._bufferService.rows;A++)this._resetBufferLine(A,H);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,H),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,H);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,H);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(D,H=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,H);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,H)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let H=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;H--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let H=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;H--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let H=D.params[0]||1;for(;H--;)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(D){let H=D.params[0]||1;for(;H--;)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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);O.deleteCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const H=this._parser.precedingJoinState;if(!H)return!0;const A=D.params[0]||1,O=w.UnicodeService.extractWidth(H),$=this._activeBuffer.x-O,se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString($),Y=new Uint32Array(se.length*A);let F=0;for(let R=0;R<se.length;){const ie=se.codePointAt(R)||0;Y[F++]=ie,R+=ie>65535?2:1}let z=F;for(let R=1;R<A;++R)Y.copyWithin(z,0,F),z+=F;return this.print(Y,0,z),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let H=0;H<D.length;H++)switch(D.params[H]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let H=0;H<D.length;H++)switch(D.params[H]){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(D){for(let H=0;H<D.length;H++)switch(D.params[H]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let H=0;H<D.length;H++)switch(D.params[H]){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(),D.params[H]===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(D,H){const A=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:$}=this._coreMouseService,se=this._coreService,{buffers:Y,cols:F}=this._bufferService,{active:z,alt:R}=Y,ie=this._optionsService.rawOptions,oe=Le=>Le?1:2,_e=D.params[0];return de=_e,we=H?_e===2?4:_e===4?oe(se.modes.insertMode):_e===12?3:_e===20?oe(ie.convertEol):0:_e===1?oe(A.applicationCursorKeys):_e===3?ie.windowOptions.setWinLines?F===80?2:F===132?1:0:0:_e===6?oe(A.origin):_e===7?oe(A.wraparound):_e===8?3:_e===9?oe(O==="X10"):_e===12?oe(ie.cursorBlink):_e===25?oe(!se.isCursorHidden):_e===45?oe(A.reverseWraparound):_e===66?oe(A.applicationKeypad):_e===67?4:_e===1e3?oe(O==="VT200"):_e===1002?oe(O==="DRAG"):_e===1003?oe(O==="ANY"):_e===1004?oe(A.sendFocus):_e===1005?4:_e===1006?oe($==="SGR"):_e===1015?4:_e===1016?oe($==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?oe(z===R):_e===2004?oe(A.bracketedPasteMode):0,se.triggerDataEvent(`${h.C0.ESC}[${H?"":"?"}${de};${we}$y`),!0;var de,we}_updateAttrColor(D,H,A,O,$){return H===2?(D|=50331648,D&=-16777216,D|=_.AttributeData.fromColorRGB([A,O,$])):H===5&&(D&=-50331904,D|=33554432|255&A),D}_extractColor(D,H,A){const O=[0,0,-1,0,0,0];let $=0,se=0;do{if(O[se+$]=D.params[H+se],D.hasSubParams(H+se)){const Y=D.getSubParams(H+se);let F=0;do O[1]===5&&($=1),O[se+F+1+$]=Y[F];while(++F<Y.length&&F+se+1+$<O.length);break}if(O[1]===5&&se+$>=2||O[1]===2&&se+$>=5)break;O[1]&&($=1)}while(++se+H<D.length&&se+$<O.length);for(let Y=2;Y<O.length;++Y)O[Y]===-1&&(O[Y]=0);switch(O[0]){case 38:A.fg=this._updateAttrColor(A.fg,O[1],O[3],O[4],O[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,O[1],O[3],O[4],O[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,O[1],O[3],O[4],O[5])}return se}_processUnderline(D,H){H.extended=H.extended.clone(),(!~D||D>5)&&(D=1),H.extended.underlineStyle=D,H.fg|=268435456,D===0&&(H.fg&=-268435457),H.updateExtended()}_processSGR0(D){D.fg=o.DEFAULT_ATTR_DATA.fg,D.bg=o.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const H=D.length;let A;const O=this._curAttrData;for(let $=0;$<H;$++)A=D.params[$],A>=30&&A<=37?(O.fg&=-50331904,O.fg|=16777216|A-30):A>=40&&A<=47?(O.bg&=-50331904,O.bg|=16777216|A-40):A>=90&&A<=97?(O.fg&=-50331904,O.fg|=16777224|A-90):A>=100&&A<=107?(O.bg&=-50331904,O.bg|=16777224|A-100):A===0?this._processSGR0(O):A===1?O.fg|=134217728:A===3?O.bg|=67108864:A===4?(O.fg|=268435456,this._processUnderline(D.hasSubParams($)?D.getSubParams($)[0]:1,O)):A===5?O.fg|=536870912:A===7?O.fg|=67108864:A===8?O.fg|=1073741824:A===9?O.fg|=2147483648:A===2?O.bg|=134217728:A===21?this._processUnderline(2,O):A===22?(O.fg&=-134217729,O.bg&=-134217729):A===23?O.bg&=-67108865:A===24?(O.fg&=-268435457,this._processUnderline(0,O)):A===25?O.fg&=-536870913:A===27?O.fg&=-67108865:A===28?O.fg&=-1073741825:A===29?O.fg&=2147483647:A===39?(O.fg&=-67108864,O.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):A===49?(O.bg&=-67108864,O.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?$+=this._extractColor(D,$,O):A===53?O.bg|=1073741824:A===55?O.bg&=-1073741825:A===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):A===100?(O.fg&=-67108864,O.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const H=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${H};${A}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const H=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${H};${A}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.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(D){const H=D.params[0]||1;switch(H){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 A=H%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(D){const H=D.params[0]||1;let A;return(D.length<2||(A=D.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>H&&(this._activeBuffer.scrollTop=H-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(D){if(!j(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const H=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:H!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:H!==0&&H!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),H!==0&&H!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:H!==0&&H!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),H!==0&&H!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const H=[],A=D.split(";");for(;A.length>1;){const O=A.shift(),$=A.shift();if(/^\d+$/.exec(O)){const se=parseInt(O);if(X(se))if($==="?")H.push({type:0,index:se});else{const Y=(0,x.parseColor)($);Y&&H.push({type:1,index:se,color:Y})}}}return H.length&&this._onColor.fire(H),!0}setHyperlink(D){const H=D.split(";");return!(H.length<2)&&(H[1]?this._createHyperlink(H[0],H[1]):!H[0]&&this._finishHyperlink())}_createHyperlink(D,H){this._getCurrentLinkId()&&this._finishHyperlink();const A=D.split(":");let O;const $=A.findIndex((se=>se.startsWith("id=")));return $!==-1&&(O=A[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:H}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,H){const A=D.split(";");for(let O=0;O<A.length&&!(H>=this._specialColors.length);++O,++H)if(A[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[H]}]);else{const $=(0,x.parseColor)(A[O]);$&&this._onColor.fire([{type:1,index:this._specialColors[H],color:$}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const H=[],A=D.split(";");for(let O=0;O<A.length;++O)if(/^\d+$/.exec(A[O])){const $=parseInt(A[O]);X($)&&H.push({type:2,index:$})}return H.length&&this._onColor.fire(H),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(B[D[0]],p.CHARSETS[D[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 D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new l.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let H=0;H<this._bufferService.rows;++H){const A=this._activeBuffer.ybase+this._activeBuffer.y+H,O=this._activeBuffer.lines.get(A);O&&(O.fill(D),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,H){const A=this._bufferService.buffer,O=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${$}${h.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,H){this._dirtyRowTracker.markRangeDirty(D,H)}}u.InputHandler=ce;let W=class{constructor(re){this._bufferService=re,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(re){re<this.start?this.start=re:re>this.end&&(this.end=re)}markRangeDirty(re,D){re>D&&(J=re,re=D,D=J),re<this.start&&(this.start=re),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(re){return 0<=re&&re<256}W=d([g(0,C.IBufferService)],W)},844:(P,u)=>{function f(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(u,"__esModule",{value:!0}),u.getDisposeArrayDisposable=u.disposeArray=u.toDisposable=u.MutableDisposable=u.Disposable=void 0,u.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},u.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},u.toDisposable=function(d){return{dispose:d}},u.disposeArray=f,u.getDisposeArrayDisposable=function(d){return{dispose:()=>f(d)}}},1505:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.FourKeyMap=u.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(g,h,p){this._data[g]||(this._data[g]={}),this._data[g][h]=p}get(g,h){return this._data[g]?this._data[g][h]:void 0}clear(){this._data={}}}u.TwoKeyMap=f,u.FourKeyMap=class{constructor(){this._data=new f}set(d,g,h,p,b){this._data.get(d,g)||this._data.set(d,g,new f),this._data.get(d,g).set(h,p,b)}get(d,g,h,p){var b;return(b=this._data.get(d,g))==null?void 0:b.get(h,p)}clear(){this._data.clear()}}},6114:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.isChromeOS=u.isLinux=u.isWindows=u.isIphone=u.isIpad=u.isMac=u.getSafariVersion=u.isSafari=u.isLegacyEdge=u.isFirefox=u.isNode=void 0,u.isNode=typeof process<"u"&&"title"in process;const f=u.isNode?"node":navigator.userAgent,d=u.isNode?"node":navigator.platform;u.isFirefox=f.includes("Firefox"),u.isLegacyEdge=f.includes("Edge"),u.isSafari=/^((?!chrome|android).)*safari/i.test(f),u.getSafariVersion=function(){if(!u.isSafari)return 0;const g=f.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},u.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),u.isIpad=d==="iPad",u.isIphone=d==="iPhone",u.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),u.isLinux=d.indexOf("Linux")>=0,u.isChromeOS=/\bCrOS\b/.test(f)},6106:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SortedList=void 0;let f=0;u.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(f=this._search(this._getKey(d)),this._array.splice(f,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(f=this._search(g),f===-1)||this._getKey(this._array[f])!==g)return!1;do if(this._array[f]===d)return this._array.splice(f,1),!0;while(++f<this._array.length&&this._getKey(this._array[f])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do yield this._array[f];while(++f<this._array.length&&this._getKey(this._array[f])===d)}forEachByKey(d,g){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do g(this._array[f]);while(++f<this._array.length&&this._getKey(this._array[f])===d)}values(){return[...this._array].values()}_search(d){let g=0,h=this._array.length-1;for(;h>=g;){let p=g+h>>1;const b=this._getKey(this._array[p]);if(b>d)h=p-1;else{if(!(b<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}g=p+1}}return g}}},7226:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DebouncedIdleTask=u.IdleTaskQueue=u.PriorityTaskQueue=void 0;const d=f(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let E=0,m=0,o=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),m=Math.max(E,m),c=b.timeRemaining(),1.5*m>c)return o-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-E))}ms`),void this._start();o=c}this.clear()}}class h extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const E=Date.now()+b;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}u.PriorityTaskQueue=h,u.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:h,u.DebouncedIdleTask=class{constructor(){this._queue=new u.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.updateWindowsModeWrappedState=void 0;const d=f(643);u.updateWindowsModeWrappedState=function(g){const h=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=h==null?void 0:h.get(g.cols-1),b=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);b&&p&&(b.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ExtendedAttrs=u.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new f;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}u.AttributeData=f;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,p=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}u.ExtendedAttrs=d},9092:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Buffer=u.MAX_BUFFER_SIZE=void 0;const d=f(6349),g=f(7226),h=f(3734),p=f(8437),b=f(4634),E=f(511),m=f(643),o=f(4863),c=f(7116);u.MAX_BUFFER_SIZE=4294967295,u.Buffer=class{constructor(n,l,_){this._hasScrollback=n,this._optionsService=l,this._bufferService=_,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=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(n){return n?(this._nullCell.fg=n.fg,this._nullCell.bg=n.bg,this._nullCell.extended=n.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(n){return n?(this._whitespaceCell.fg=n.fg,this._whitespaceCell.bg=n.bg,this._whitespaceCell.extended=n.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(n,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(n),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const n=this.ybase+this.y-this.ydisp;return n>=0&&n<this._rows}_getCorrectBufferLength(n){if(!this._hasScrollback)return n;const l=n+this._optionsService.rawOptions.scrollback;return l>u.MAX_BUFFER_SIZE?u.MAX_BUFFER_SIZE:l}fillViewportRows(n){if(this.lines.length===0){n===void 0&&(n=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(n))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(n,l){const _=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=0;const w=this._getCorrectBufferLength(l);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<n)for(let v=0;v<this.lines.length;v++)C+=+this.lines.get(v).resize(n,_);let S=0;if(this._rows<l)for(let v=this._rows;v<l;v++)this.lines.length<l+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(n,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+S+1?(this.ybase--,S++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(n,_)));else for(let v=this._rows;v>l;v--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(w<this.lines.maxLength){const v=this.lines.length-w;v>0&&(this.lines.trimStart(v),this.ybase=Math.max(this.ybase-v,0),this.ydisp=Math.max(this.ydisp-v,0),this.savedY=Math.max(this.savedY-v,0)),this.lines.maxLength=w}this.x=Math.min(this.x,n-1),this.y=Math.min(this.y,l-1),S&&(this.y+=S),this.savedX=Math.min(this.savedX,n-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(n,l),this._cols>n))for(let S=0;S<this.lines.length;S++)C+=+this.lines.get(S).resize(n,_);this._cols=n,this._rows=l,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let n=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,n=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return n}get _isReflowEnabled(){const n=this._optionsService.rawOptions.windowsPty;return n&&n.buildNumber?this._hasScrollback&&n.backend==="conpty"&&n.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(n,l){this._cols!==n&&(n>this._cols?this._reflowLarger(n,l):this._reflowSmaller(n,l))}_reflowLarger(n,l){const _=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,n,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(_.length>0){const C=(0,b.reflowLargerCreateNewLayout)(this.lines,_);(0,b.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(n,l,C.countRemoved)}}_reflowLargerAdjustViewport(n,l,_){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let w=_;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(n,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(n,l){const _=this.getNullCell(p.DEFAULT_ATTR_DATA),C=[];let w=0;for(let S=this.lines.length-1;S>=0;S--){let v=this.lines.get(S);if(!v||!v.isWrapped&&v.getTrimmedLength()<=n)continue;const x=[v];for(;v.isWrapped&&S>0;)v=this.lines.get(--S),x.unshift(v);const B=this.ybase+this.y;if(B>=S&&B<S+x.length)continue;const U=x[x.length-1].getTrimmedLength(),j=(0,b.reflowSmallerGetNewLineLengths)(x,this._cols,n),N=j.length-x.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const ce=[];for(let A=0;A<N;A++){const O=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);ce.push(O)}ce.length>0&&(C.push({start:S+x.length+w,newLines:ce}),w+=ce.length),x.push(...ce);let W=j.length-1,X=j[W];X===0&&(W--,X=j[W]);let re=x.length-N-1,D=U;for(;re>=0;){const A=Math.min(D,X);if(x[W]===void 0)break;if(x[W].copyCellsFrom(x[re],D-A,X-A,A,!0),X-=A,X===0&&(W--,X=j[W]),D-=A,D===0){re--;const O=Math.max(re,0);D=(0,b.getWrappedLineTrimmedLength)(x,O,this._cols)}}for(let A=0;A<x.length;A++)j[A]<n&&x[A].setCell(j[A],_);let H=N-J;for(;H-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+w)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+l-1)}if(C.length>0){const S=[],v=[];for(let W=0;W<this.lines.length;W++)v.push(this.lines.get(W));const x=this.lines.length;let B=x-1,U=0,j=C[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let N=0;for(let W=Math.min(this.lines.maxLength-1,x+w-1);W>=0;W--)if(j&&j.start>B+N){for(let X=j.newLines.length-1;X>=0;X--)this.lines.set(W--,j.newLines[X]);W++,S.push({index:B+1,amount:j.newLines.length}),N+=j.newLines.length,j=C[++U]}else this.lines.set(W,v[B--]);let J=0;for(let W=S.length-1;W>=0;W--)S[W].index+=J,this.lines.onInsertEmitter.fire(S[W]),J+=S[W].amount;const ce=Math.max(0,x+w-this.lines.maxLength);ce>0&&this.lines.onTrimEmitter.fire(ce)}}translateBufferLineToString(n,l,_=0,C){const w=this.lines.get(n);return w?w.translateToString(l,_,C):""}getWrappedRangeForLine(n){let l=n,_=n;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:l,last:_}}setupTabStops(n){for(n!=null?this.tabs[n]||(n=this.prevStop(n)):(this.tabs={},n=0);n<this._cols;n+=this._optionsService.rawOptions.tabStopWidth)this.tabs[n]=!0}prevStop(n){for(n==null&&(n=this.x);!this.tabs[--n]&&n>0;);return n>=this._cols?this._cols-1:n<0?0:n}nextStop(n){for(n==null&&(n=this.x);!this.tabs[++n]&&n<this._cols;);return n>=this._cols?this._cols-1:n<0?0:n}clearMarkers(n){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===n&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].dispose(),this.markers.splice(n--,1);this._isClearing=!1}addMarker(n){const l=new o.Marker(n);return this.markers.push(l),l.register(this.lines.onTrim((_=>{l.line-=_,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((_=>{l.line>=_.index&&(l.line+=_.amount)}))),l.register(this.lines.onDelete((_=>{l.line>=_.index&&l.line<_.index+_.amount&&l.dispose(),l.line>_.index&&(l.line-=_.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(n){this._isClearing||this.markers.splice(this.markers.indexOf(n),1)}}},8437:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLine=u.DEFAULT_ATTR_DATA=void 0;const d=f(3734),g=f(511),h=f(643),p=f(482);u.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class E{constructor(o,c,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const l=c||g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let _=0;_<o;++_)this.setCell(_,l);this.length=o}get(o){const c=this._data[3*o+0],n=2097151&c;return[this._data[3*o+1],2097152&c?this._combined[o]:n?(0,p.stringFromCodePoint)(n):"",c>>22,2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):n]}set(o,c){this._data[3*o+1]=c[h.CHAR_DATA_ATTR_INDEX],c[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=c[1],this._data[3*o+0]=2097152|o|c[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=c[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&c}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o]:2097151&c?(0,p.stringFromCodePoint)(2097151&c):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,c){return b=3*o,c.content=this._data[b+0],c.fg=this._data[b+1],c.bg=this._data[b+2],2097152&c.content&&(c.combinedData=this._combined[o]),268435456&c.bg&&(c.extended=this._extendedAttrs[o]),c}setCell(o,c){2097152&c.content&&(this._combined[o]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[o]=c.extended),this._data[3*o+0]=c.content,this._data[3*o+1]=c.fg,this._data[3*o+2]=c.bg}setCellFromCodepoint(o,c,n,l){268435456&l.bg&&(this._extendedAttrs[o]=l.extended),this._data[3*o+0]=c|n<<22,this._data[3*o+1]=l.fg,this._data[3*o+2]=l.bg}addCodepointToCell(o,c,n){let l=this._data[3*o+0];2097152&l?this._combined[o]+=(0,p.stringFromCodePoint)(c):2097151&l?(this._combined[o]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(c),l&=-2097152,l|=2097152):l=c|4194304,n&&(l&=-12582913,l|=n<<22),this._data[3*o+0]=l}insertCells(o,c,n){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,n),c<this.length-o){const l=new g.CellData;for(let _=this.length-o-c-1;_>=0;--_)this.setCell(o+c+_,this.loadCell(o+_,l));for(let _=0;_<c;++_)this.setCell(o+_,n)}else for(let l=o;l<this.length;++l)this.setCell(l,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(o,c,n){if(o%=this.length,c<this.length-o){const l=new g.CellData;for(let _=0;_<this.length-o-c;++_)this.setCell(o+_,this.loadCell(o+c+_,l));for(let _=this.length-c;_<this.length;++_)this.setCell(_,n)}else for(let l=o;l<this.length;++l)this.setCell(l,n);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,n),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,n)}replaceCells(o,c,n,l=!1){if(l)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,n),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,n);o<c&&o<this.length;)this.isProtected(o)||this.setCell(o,n),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,n),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,n);o<c&&o<this.length;)this.setCell(o++,n)}resize(o,c){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const n=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{const l=new Uint32Array(n);l.set(this._data),this._data=l}for(let l=this.length;l<o;++l)this.setCell(l,c)}else{this._data=this._data.subarray(0,n);const l=Object.keys(this._combined);for(let C=0;C<l.length;C++){const w=parseInt(l[C],10);w>=o&&delete this._combined[w]}const _=Object.keys(this._extendedAttrs);for(let C=0;C<_.length;C++){const w=parseInt(_[C],10);w>=o&&delete this._extendedAttrs[w]}}return this.length=o,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,c=!1){if(c)for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,o);else{this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const c in o._combined)this._combined[c]=o._combined[c];this._extendedAttrs={};for(const c in o._extendedAttrs)this._extendedAttrs[c]=o._extendedAttrs[c];this.isWrapped=o.isWrapped}clone(){const o=new E(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const c in this._combined)o._combined[c]=this._combined[c];for(const c in this._extendedAttrs)o._extendedAttrs[c]=this._extendedAttrs[c];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,c,n,l,_){const C=o._data;if(_)for(let S=l-1;S>=0;S--){for(let v=0;v<3;v++)this._data[3*(n+S)+v]=C[3*(c+S)+v];268435456&C[3*(c+S)+2]&&(this._extendedAttrs[n+S]=o._extendedAttrs[c+S])}else for(let S=0;S<l;S++){for(let v=0;v<3;v++)this._data[3*(n+S)+v]=C[3*(c+S)+v];268435456&C[3*(c+S)+2]&&(this._extendedAttrs[n+S]=o._extendedAttrs[c+S])}const w=Object.keys(o._combined);for(let S=0;S<w.length;S++){const v=parseInt(w[S],10);v>=c&&(this._combined[v-c+n]=o._combined[v])}}translateToString(o,c,n,l){c=c??0,n=n??this.length,o&&(n=Math.min(n,this.getTrimmedLength())),l&&(l.length=0);let _="";for(;c<n;){const C=this._data[3*c+0],w=2097151&C,S=2097152&C?this._combined[c]:w?(0,p.stringFromCodePoint)(w):h.WHITESPACE_CELL_CHAR;if(_+=S,l)for(let v=0;v<S.length;++v)l.push(c);c+=C>>22||1}return l&&l.push(c),_}}u.BufferLine=E},4841:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getRangeLength=void 0,u.getRangeLength=function(f,d){if(f.start.y>f.end.y)throw new Error(`Buffer range end (${f.end.x}, ${f.end.y}) cannot be before start (${f.start.x}, ${f.start.y})`);return d*(f.end.y-f.start.y)+(f.end.x-f.start.x+1)}},4634:(P,u)=>{function f(d,g,h){if(g===d.length-1)return d[g].getTrimmedLength();const p=!d[g].hasContent(h-1)&&d[g].getWidth(h-1)===1,b=d[g+1].getWidth(0)===2;return p&&b?h-1:h}Object.defineProperty(u,"__esModule",{value:!0}),u.getWrappedLineTrimmedLength=u.reflowSmallerGetNewLineLengths=u.reflowLargerApplyNewLayout=u.reflowLargerCreateNewLayout=u.reflowLargerGetLinesToRemove=void 0,u.reflowLargerGetLinesToRemove=function(d,g,h,p,b){const E=[];for(let m=0;m<d.length-1;m++){let o=m,c=d.get(++o);if(!c.isWrapped)continue;const n=[d.get(m)];for(;o<d.length&&c.isWrapped;)n.push(c),c=d.get(++o);if(p>=m&&p<o){m+=n.length-1;continue}let l=0,_=f(n,l,g),C=1,w=0;for(;C<n.length;){const v=f(n,C,g),x=v-w,B=h-_,U=Math.min(x,B);n[l].copyCellsFrom(n[C],w,_,U,!1),_+=U,_===h&&(l++,_=0),w+=U,w===v&&(C++,w=0),_===0&&l!==0&&n[l-1].getWidth(h-1)===2&&(n[l].copyCellsFrom(n[l-1],h-1,_++,1,!1),n[l-1].setCell(h-1,b))}n[l].replaceCells(_,h,b);let S=0;for(let v=n.length-1;v>0&&(v>l||n[v].getTrimmedLength()===0);v--)S++;S>0&&(E.push(m+n.length-S),E.push(S)),m+=n.length-1}return E},u.reflowLargerCreateNewLayout=function(d,g){const h=[];let p=0,b=g[p],E=0;for(let m=0;m<d.length;m++)if(b===m){const o=g[++p];d.onDeleteEmitter.fire({index:m-E,amount:o}),m+=o-1,E+=o,b=g[++p]}else h.push(m);return{layout:h,countRemoved:E}},u.reflowLargerApplyNewLayout=function(d,g){const h=[];for(let p=0;p<g.length;p++)h.push(d.get(g[p]));for(let p=0;p<h.length;p++)d.set(p,h[p]);d.length=g.length},u.reflowSmallerGetNewLineLengths=function(d,g,h){const p=[],b=d.map(((c,n)=>f(d,n,g))).reduce(((c,n)=>c+n));let E=0,m=0,o=0;for(;o<b;){if(b-o<h){p.push(b-o);break}E+=h;const c=f(d,m,g);E>c&&(E-=c,m++);const n=d[m].getWidth(E-1)===2;n&&E--;const l=n?h-1:h;p.push(l),o+=l}return p},u.getWrappedLineTrimmedLength=f},5295:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferSet=void 0;const d=f(8460),g=f(844),h=f(9092);class p extends g.Disposable{constructor(E,m){super(),this._optionsService=E,this._bufferService=m,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(E,m){this._normal.resize(E,m),this._alt.resize(E,m),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}u.BufferSet=p},511:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CellData=void 0;const d=f(482),g=f(643),h=f(3734);class p extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const m=new p;return m.setFromCharData(E),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(E){this.fg=E[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(E[g.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(E[g.CHAR_DATA_CHAR_INDEX].length===2){const o=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|E[g.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=E[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[g.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=E[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.CellData=p},643:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WHITESPACE_CELL_CODE=u.WHITESPACE_CELL_WIDTH=u.WHITESPACE_CELL_CHAR=u.NULL_CELL_CODE=u.NULL_CELL_WIDTH=u.NULL_CELL_CHAR=u.CHAR_DATA_CODE_INDEX=u.CHAR_DATA_WIDTH_INDEX=u.CHAR_DATA_CHAR_INDEX=u.CHAR_DATA_ATTR_INDEX=u.DEFAULT_EXT=u.DEFAULT_ATTR=u.DEFAULT_COLOR=void 0,u.DEFAULT_COLOR=0,u.DEFAULT_ATTR=256|u.DEFAULT_COLOR<<9,u.DEFAULT_EXT=0,u.CHAR_DATA_ATTR_INDEX=0,u.CHAR_DATA_CHAR_INDEX=1,u.CHAR_DATA_WIDTH_INDEX=2,u.CHAR_DATA_CODE_INDEX=3,u.NULL_CELL_CHAR="",u.NULL_CELL_WIDTH=1,u.NULL_CELL_CODE=0,u.WHITESPACE_CELL_CHAR=" ",u.WHITESPACE_CELL_WIDTH=1,u.WHITESPACE_CELL_CODE=32},4863:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Marker=void 0;const d=f(8460),g=f(844);class h{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}u.Marker=h,h._nextId=1},7116:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DEFAULT_CHARSET=u.CHARSETS=void 0,u.CHARSETS={},u.DEFAULT_CHARSET=u.CHARSETS.B,u.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:"≥","{":"π","|":"≠","}":"£","~":"·"},u.CHARSETS.A={"#":"£"},u.CHARSETS.B=void 0,u.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},u.CHARSETS.C=u.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},u.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},u.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},u.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},u.CHARSETS.E=u.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},u.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},u.CHARSETS.H=u.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(P,u)=>{var f,d,g;Object.defineProperty(u,"__esModule",{value:!0}),u.C1_ESCAPED=u.C1=u.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
213
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(f||(u.C0=f={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(d||(u.C1=d={})),(function(h){h.ST=`${f.ESC}\\`})(g||(u.C1_ESCAPED=g={}))},7399:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.evaluateKeyboardEvent=void 0;const d=f(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:["'",'"']};u.evaluateKeyboardEvent=function(h,p,b,E){const m={type:0,cancel:!1,key:void 0},o=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?m.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?m.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?m.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(m.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:m.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(m.key=d.C0.ESC+m.key);break;case 9:if(h.shiftKey){m.key=d.C0.ESC+"[Z";break}m.key=d.C0.HT,m.cancel=!0;break;case 13:m.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,m.cancel=!0;break;case 27:m.key=d.C0.ESC,h.altKey&&(m.key=d.C0.ESC+d.C0.ESC),m.cancel=!0;break;case 37:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"D",m.key===d.C0.ESC+"[1;3D"&&(m.key=d.C0.ESC+(b?"b":"[1;5D"))):m.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"C",m.key===d.C0.ESC+"[1;3C"&&(m.key=d.C0.ESC+(b?"f":"[1;5C"))):m.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"A",b||m.key!==d.C0.ESC+"[1;3A"||(m.key=d.C0.ESC+"[1;5A")):m.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"B",b||m.key!==d.C0.ESC+"[1;3B"||(m.key=d.C0.ESC+"[1;5B")):m.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(m.key=d.C0.ESC+"[2~");break;case 46:m.key=o?d.C0.ESC+"[3;"+(o+1)+"~":d.C0.ESC+"[3~";break;case 36:m.key=o?d.C0.ESC+"[1;"+(o+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:m.key=o?d.C0.ESC+"[1;"+(o+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?m.type=2:h.ctrlKey?m.key=d.C0.ESC+"[5;"+(o+1)+"~":m.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?m.type=3:h.ctrlKey?m.key=d.C0.ESC+"[6;"+(o+1)+"~":m.key=d.C0.ESC+"[6~";break;case 112:m.key=o?d.C0.ESC+"[1;"+(o+1)+"P":d.C0.ESC+"OP";break;case 113:m.key=o?d.C0.ESC+"[1;"+(o+1)+"Q":d.C0.ESC+"OQ";break;case 114:m.key=o?d.C0.ESC+"[1;"+(o+1)+"R":d.C0.ESC+"OR";break;case 115:m.key=o?d.C0.ESC+"[1;"+(o+1)+"S":d.C0.ESC+"OS";break;case 116:m.key=o?d.C0.ESC+"[15;"+(o+1)+"~":d.C0.ESC+"[15~";break;case 117:m.key=o?d.C0.ESC+"[17;"+(o+1)+"~":d.C0.ESC+"[17~";break;case 118:m.key=o?d.C0.ESC+"[18;"+(o+1)+"~":d.C0.ESC+"[18~";break;case 119:m.key=o?d.C0.ESC+"[19;"+(o+1)+"~":d.C0.ESC+"[19~";break;case 120:m.key=o?d.C0.ESC+"[20;"+(o+1)+"~":d.C0.ESC+"[20~";break;case 121:m.key=o?d.C0.ESC+"[21;"+(o+1)+"~":d.C0.ESC+"[21~";break;case 122:m.key=o?d.C0.ESC+"[23;"+(o+1)+"~":d.C0.ESC+"[23~";break;case 123:m.key=o?d.C0.ESC+"[24;"+(o+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(b&&!E||!h.altKey||h.metaKey)!b||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?m.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(m.key=d.C0.US),h.key==="@"&&(m.key=d.C0.NUL)):h.keyCode===65&&(m.type=1);else{const c=g[h.keyCode],n=c==null?void 0:c[h.shiftKey?1:0];if(n)m.key=d.C0.ESC+n;else if(h.keyCode>=65&&h.keyCode<=90){const l=h.ctrlKey?h.keyCode-64:h.keyCode+32;let _=String.fromCharCode(l);h.shiftKey&&(_=_.toUpperCase()),m.key=d.C0.ESC+_}else if(h.keyCode===32)m.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let l=h.code.slice(3,4);h.shiftKey||(l=l.toLowerCase()),m.key=d.C0.ESC+l,m.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?m.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?m.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?m.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?m.key=d.C0.DEL:h.keyCode===219?m.key=d.C0.ESC:h.keyCode===220?m.key=d.C0.FS:h.keyCode===221&&(m.key=d.C0.GS)}return m}},482:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Utf8ToUtf32=u.StringToUtf32=u.utf32ToString=u.stringFromCodePoint=void 0,u.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},u.utf32ToString=function(f,d=0,g=f.length){let h="";for(let p=d;p<g;++p){let b=f[p];b>65535?(b-=65536,h+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):h+=String.fromCharCode(b)}return h},u.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,d){const g=f.length;if(!g)return 0;let h=0,p=0;if(this._interim){const b=f.charCodeAt(p++);56320<=b&&b<=57343?d[h++]=1024*(this._interim-55296)+b-56320+65536:(d[h++]=this._interim,d[h++]=b),this._interim=0}for(let b=p;b<g;++b){const E=f.charCodeAt(b);if(55296<=E&&E<=56319){if(++b>=g)return this._interim=E,h;const m=f.charCodeAt(b);56320<=m&&m<=57343?d[h++]=1024*(E-55296)+m-56320+65536:(d[h++]=E,d[h++]=m)}else E!==65279&&(d[h++]=E)}return h}},u.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,d){const g=f.length;if(!g)return 0;let h,p,b,E,m=0,o=0,c=0;if(this.interim[0]){let _=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let w,S=0;for(;(w=63&this.interim[++S])&&S<4;)C<<=6,C|=w;const v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=v-S;for(;c<x;){if(c>=g)return 0;if(w=f[c++],(192&w)!=128){c--,_=!0;break}this.interim[S++]=w,C<<=6,C|=63&w}_||(v===2?C<128?c--:d[m++]=C:v===3?C<2048||C>=55296&&C<=57343||C===65279||(d[m++]=C):C<65536||C>1114111||(d[m++]=C)),this.interim.fill(0)}const n=g-4;let l=c;for(;l<g;){for(;!(!(l<n)||128&(h=f[l])||128&(p=f[l+1])||128&(b=f[l+2])||128&(E=f[l+3]));)d[m++]=h,d[m++]=p,d[m++]=b,d[m++]=E,l+=4;if(h=f[l++],h<128)d[m++]=h;else if((224&h)==192){if(l>=g)return this.interim[0]=h,m;if(p=f[l++],(192&p)!=128){l--;continue}if(o=(31&h)<<6|63&p,o<128){l--;continue}d[m++]=o}else if((240&h)==224){if(l>=g)return this.interim[0]=h,m;if(p=f[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=h,this.interim[1]=p,m;if(b=f[l++],(192&b)!=128){l--;continue}if(o=(15&h)<<12|(63&p)<<6|63&b,o<2048||o>=55296&&o<=57343||o===65279)continue;d[m++]=o}else if((248&h)==240){if(l>=g)return this.interim[0]=h,m;if(p=f[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=h,this.interim[1]=p,m;if(b=f[l++],(192&b)!=128){l--;continue}if(l>=g)return this.interim[0]=h,this.interim[1]=p,this.interim[2]=b,m;if(E=f[l++],(192&E)!=128){l--;continue}if(o=(7&h)<<18|(63&p)<<12|(63&b)<<6|63&E,o<65536||o>1114111)continue;d[m++]=o}}return m}}},225:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeV6=void 0;const d=f(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]],h=[[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;u.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 b=0;b<g.length;++b)p.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?p[b]:(function(E,m){let o,c=0,n=m.length-1;if(E<m[0][0]||E>m[n][1])return!1;for(;n>=c;)if(o=c+n>>1,E>m[o][1])c=o+1;else{if(!(E<m[o][0]))return!0;n=o-1}return!1})(b,h)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,E){let m=this.wcwidth(b),o=m===0&&E!==0;if(o){const c=d.UnicodeService.extractWidth(E);c===0?o=!1:c>m&&(m=c)}return d.UnicodeService.createPropertyValue(0,m,o)}}},5981:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WriteBuffer=void 0;const d=f(8460),g=f(844);class h extends g.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,E){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(E)}_innerWrite(b=0,E=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],c=this._action(o,E);if(c){const l=_=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(m,_);return void c.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(l)}const n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-m>=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()}}u.WriteBuffer=h},5941:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.toRgbString=u.parseColor=void 0;const f=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function g(h,p){const b=h.toString(16),E=b.length<2?"0"+b:b;switch(p){case 4:return b[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}u.parseColor=function(h){if(!h)return;let p=h.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const b=f.exec(p);if(b){const E=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/E*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/E*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/E*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const b=p.length/3,E=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(p.slice(b*m,b*m+b),16);E[m]=b===1?o<<4:b===2?o:b===3?o>>4:o>>8}return E}},u.toRgbString=function(h,p=16){const[b,E,m]=h;return`rgb:${g(b,p)}/${g(E,p)}/${g(m,p)}`}},5770:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.PAYLOAD_LIMIT=void 0,u.PAYLOAD_LIMIT=1e7},6351:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DcsHandler=u.DcsParser=void 0;const d=f(482),g=f(8742),h=f(5770),p=[];u.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(E,m){this._handlers[E]===void 0&&(this._handlers[E]=[]);const o=this._handlers[E];return o.push(m),{dispose:()=>{const c=o.indexOf(m);c!==-1&&o.splice(c,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(E,m){if(this.reset(),this._ident=E,this._active=this._handlers[E]||p,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(E,m,o){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(E,m,o);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(E,m,o))}unhook(E,m=!0){if(this._active.length){let o=!1,c=this._active.length-1,n=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,o=m,n=this._stack.fallThrough,this._stack.paused=!1),!n&&o===!1){for(;c>=0&&(o=this._active[c].unhook(E),o!==!0);c--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,o;c--}for(;c>=0;c--)if(o=this._active[c].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",E);this._active=p,this._ident=0}};const b=new g.Params;b.addParam(0),u.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=b,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():b,this._data="",this._hitLimit=!1}put(E,m,o){this._hitLimit||(this._data+=(0,d.utf32ToString)(E,m,o),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let m=!1;if(this._hitLimit)m=!1;else if(E&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((o=>(this._params=b,this._data="",this._hitLimit=!1,o)));return this._params=b,this._data="",this._hitLimit=!1,m}}},2015:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.EscapeSequenceParser=u.VT500_TRANSITION_TABLE=u.TransitionTable=void 0;const d=f(844),g=f(8742),h=f(6242),p=f(6351);class b{constructor(c){this.table=new Uint8Array(c)}setDefault(c,n){this.table.fill(c<<4|n)}add(c,n,l,_){this.table[n<<8|c]=l<<4|_}addMany(c,n,l,_){for(let C=0;C<c.length;C++)this.table[n<<8|c[C]]=l<<4|_}}u.TransitionTable=b;const E=160;u.VT500_TRANSITION_TABLE=(function(){const o=new b(4095),c=Array.apply(null,Array(256)).map(((S,v)=>v)),n=(S,v)=>c.slice(S,v),l=n(32,127),_=n(0,24);_.push(25),_.push.apply(_,n(28,32));const C=n(0,14);let w;for(w in o.setDefault(1,0),o.addMany(l,0,2,0),C)o.addMany([24,26,153,154],w,3,0),o.addMany(n(128,144),w,3,0),o.addMany(n(144,152),w,3,0),o.add(156,w,0,0),o.add(27,w,11,1),o.add(157,w,4,8),o.addMany([152,158,159],w,0,7),o.add(155,w,11,3),o.add(144,w,11,9);return o.addMany(_,0,3,0),o.addMany(_,1,3,1),o.add(127,1,0,1),o.addMany(_,8,0,8),o.addMany(_,3,3,3),o.add(127,3,0,3),o.addMany(_,4,3,4),o.add(127,4,0,4),o.addMany(_,6,3,6),o.addMany(_,5,3,5),o.add(127,5,0,5),o.addMany(_,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(l,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(n(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(l,7,0,7),o.addMany(_,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(n(64,127),3,7,0),o.addMany(n(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(n(48,60),4,8,4),o.addMany(n(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(n(32,64),6,0,6),o.add(127,6,0,6),o.addMany(n(64,127),6,0,0),o.addMany(n(32,48),3,9,5),o.addMany(n(32,48),5,9,5),o.addMany(n(48,64),5,0,6),o.addMany(n(64,127),5,7,0),o.addMany(n(32,48),4,9,5),o.addMany(n(32,48),1,9,2),o.addMany(n(32,48),2,9,2),o.addMany(n(48,127),2,10,0),o.addMany(n(48,80),1,10,0),o.addMany(n(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(n(96,127),1,10,0),o.add(80,1,11,9),o.addMany(_,9,0,9),o.add(127,9,0,9),o.addMany(n(28,32),9,0,9),o.addMany(n(32,48),9,9,12),o.addMany(n(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(_,11,0,11),o.addMany(n(32,128),11,0,11),o.addMany(n(28,32),11,0,11),o.addMany(_,10,0,10),o.add(127,10,0,10),o.addMany(n(28,32),10,0,10),o.addMany(n(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(n(32,48),10,9,12),o.addMany(_,12,0,12),o.add(127,12,0,12),o.addMany(n(28,32),12,0,12),o.addMany(n(32,48),12,9,12),o.addMany(n(48,64),12,0,11),o.addMany(n(64,127),12,12,13),o.addMany(n(64,127),10,12,13),o.addMany(n(64,127),9,12,13),o.addMany(_,13,13,13),o.addMany(l,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(E,0,2,0),o.add(E,8,5,8),o.add(E,6,0,6),o.add(E,11,0,11),o.add(E,13,13,13),o})();class m extends d.Disposable{constructor(c=u.VT500_TRANSITION_TABLE){super(),this._transitions=c,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=(n,l,_)=>{},this._executeHandlerFb=n=>{},this._csiHandlerFb=(n,l)=>{},this._escHandlerFb=n=>{},this._errorHandlerFb=n=>n,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,n=[64,126]){let l=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=c.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<c.intermediates.length;++C){const w=c.intermediates.charCodeAt(C);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=w}}if(c.final.length!==1)throw new Error("final must be a single byte");const _=c.final.charCodeAt(0);if(n[0]>_||_>n[1])throw new Error(`final must be in range ${n[0]} .. ${n[1]}`);return l<<=8,l|=_,l}identToString(c){const n=[];for(;c;)n.push(String.fromCharCode(255&c)),c>>=8;return n.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,n){const l=this._identifier(c,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const _=this._escHandlers[l];return _.push(n),{dispose:()=>{const C=_.indexOf(n);C!==-1&&_.splice(C,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,n){this._executeHandlers[c.charCodeAt(0)]=n}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,n){const l=this._identifier(c);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const _=this._csiHandlers[l];return _.push(n),{dispose:()=>{const C=_.indexOf(n);C!==-1&&_.splice(C,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,n){return this._dcsParser.registerHandler(this._identifier(c),n)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,n){return this._oscParser.registerHandler(c,n)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,n,l,_,C){this._parseStack.state=c,this._parseStack.handlers=n,this._parseStack.handlerPos=l,this._parseStack.transition=_,this._parseStack.chunkPos=C}parse(c,n,l){let _,C=0,w=0,S=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,S=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const v=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&x>-1){for(;x>=0&&(_=v[x](this._params),_!==!0);x--)if(_ instanceof Promise)return this._parseStack.handlerPos=x,_}this._parseStack.handlers=[];break;case 4:if(l===!1&&x>-1){for(;x>=0&&(_=v[x](),_!==!0);x--)if(_ instanceof Promise)return this._parseStack.handlerPos=x,_}this._parseStack.handlers=[];break;case 6:if(C=c[this._parseStack.chunkPos],_=this._dcsParser.unhook(C!==24&&C!==26,l),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=c[this._parseStack.chunkPos],_=this._oscParser.end(C!==24&&C!==26,l),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,S=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let v=S;v<n;++v){switch(C=c[v],w=this._transitions.table[this.currentState<<8|(C<160?C:E)],w>>4){case 2:for(let N=v+1;;++N){if(N>=n||(C=c[N])<32||C>126&&C<E){this._printHandler(c,v,N),v=N-1;break}if(++N>=n||(C=c[N])<32||C>126&&C<E){this._printHandler(c,v,N),v=N-1;break}if(++N>=n||(C=c[N])<32||C>126&&C<E){this._printHandler(c,v,N),v=N-1;break}if(++N>=n||(C=c[N])<32||C>126&&C<E){this._printHandler(c,v,N),v=N-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:v,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|C];let B=x?x.length-1:-1;for(;B>=0&&(_=x[B](this._params),_!==!0);B--)if(_ instanceof Promise)return this._preserveStack(3,x,B,w,v),_;B<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++v<n&&(C=c[v])>47&&C<60);v--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const U=this._escHandlers[this._collect<<8|C];let j=U?U.length-1:-1;for(;j>=0&&(_=U[j](),_!==!0);j--)if(_ instanceof Promise)return this._preserveStack(4,U,j,w,v),_;j<0&&this._escHandlerFb(this._collect<<8|C),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|C,this._params);break;case 13:for(let N=v+1;;++N)if(N>=n||(C=c[N])===24||C===26||C===27||C>127&&C<E){this._dcsParser.put(c,v,N),v=N-1;break}break;case 14:if(_=this._dcsParser.unhook(C!==24&&C!==26),_)return this._preserveStack(6,[],0,w,v),_;C===27&&(w|=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 N=v+1;;N++)if(N>=n||(C=c[N])<32||C>127&&C<E){this._oscParser.put(c,v,N),v=N-1;break}break;case 6:if(_=this._oscParser.end(C!==24&&C!==26),_)return this._preserveStack(5,[],0,w,v),_;C===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}u.EscapeSequenceParser=m},6242:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OscHandler=u.OscParser=void 0;const d=f(5770),g=f(482),h=[];u.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,b){this._handlers[p]===void 0&&(this._handlers[p]=[]);const E=this._handlers[p];return E.push(b),{dispose:()=>{const m=E.indexOf(b);m!==-1&&E.splice(m,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=h}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=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,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,b,E){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(p,b,E);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,b,E))}start(){this.reset(),this._state=1}put(p,b,E){if(this._state!==3){if(this._state===1)for(;b<E;){const m=p[b++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&E-b>0&&this._put(p,b,E)}}end(p,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,E=b,o=this._stack.fallThrough,this._stack.paused=!1),!o&&E===!1){for(;m>=0&&(E=this._active[m].end(p),E!==!0);m--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,E;m--}for(;m>=0;m--)if(E=this._active[m].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",p);this._active=h,this._id=-1,this._state=0}}},u.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,b,E){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,b,E),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let b=!1;if(this._hitLimit)b=!1;else if(p&&(b=this._handler(this._data),b instanceof Promise))return b.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,b}}},8742:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Params=void 0;const f=2147483647;class d{static fromArray(h){const p=new d;if(!h.length)return p;for(let b=Array.isArray(h[0])?1:0;b<h.length;++b){const E=h[b];if(Array.isArray(E))for(let m=0;m<E.length;++m)p.addSubParam(E[m]);else p.addParam(E)}return p}constructor(h=32,p=32){if(this.maxLength=h,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let p=0;p<this.length;++p){h.push(this.params[p]);const b=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];E-b>0&&h.push(Array.prototype.slice.call(this._subParams,b,E))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>f?f:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>f?f:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const p=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];return b-p>0?this._subParams.subarray(p,b):null}getSubParamsAll(){const h={};for(let p=0;p<this.length;++p){const b=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];E-b>0&&(h[p]=this._subParams.slice(b,E))}return h}addDigit(h){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,E=b[p-1];b[p-1]=~E?Math.min(10*E+h,f):h}}u.Params=d},5741:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.AddonManager=void 0,u.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()}loadAddon(f,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(f)}_wrappedAddonDispose(f){if(f.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===f){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");f.isDisposed=!0,f.dispose.apply(f.instance),this._addons.splice(d,1)}}},8771:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferApiView=void 0;const d=f(3785),g=f(511);u.BufferApiView=class{constructor(h,p){this._buffer=h,this.type=p}init(h){return this._buffer=h,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(h){const p=this._buffer.lines.get(h);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLineApiView=void 0;const d=f(511);u.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,h){if(!(g<0||g>=this._line.length))return h?(this._line.loadCell(g,h),h):this._line.loadCell(g,new d.CellData)}translateToString(g,h,p){return this._line.translateToString(g,h,p)}}},8285:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferNamespaceApi=void 0;const d=f(8771),g=f(8460),h=f(844);class p extends h.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}u.BufferNamespaceApi=p},7975:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ParserApi=void 0,u.ParserApi=class{constructor(f){this._core=f}registerCsiHandler(f,d){return this._core.registerCsiHandler(f,(g=>d(g.toArray())))}addCsiHandler(f,d){return this.registerCsiHandler(f,d)}registerDcsHandler(f,d){return this._core.registerDcsHandler(f,((g,h)=>d(g,h.toArray())))}addDcsHandler(f,d){return this.registerDcsHandler(f,d)}registerEscHandler(f,d){return this._core.registerEscHandler(f,d)}addEscHandler(f,d){return this.registerEscHandler(f,d)}registerOscHandler(f,d){return this._core.registerOscHandler(f,d)}addOscHandler(f,d){return this.registerOscHandler(f,d)}}},7090:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeApi=void 0,u.UnicodeApi=class{constructor(f){this._core=f}register(f){this._core.unicodeService.register(f)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(f){this._core.unicodeService.activeVersion=f}}},744:function(P,u,f){var d=this&&this.__decorate||function(o,c,n,l){var _,C=arguments.length,w=C<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(o,c,n,l);else for(var S=o.length-1;S>=0;S--)(_=o[S])&&(w=(C<3?_(w):C>3?_(c,n,w):_(c,n))||w);return C>3&&w&&Object.defineProperty(c,n,w),w},g=this&&this.__param||function(o,c){return function(n,l){c(n,l,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferService=u.MINIMUM_ROWS=u.MINIMUM_COLS=void 0;const h=f(8460),p=f(844),b=f(5295),E=f(2585);u.MINIMUM_COLS=2,u.MINIMUM_ROWS=1;let m=u.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,u.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,u.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(o,this))}resize(o,c){this.cols=o,this.rows=c,this.buffers.resize(o,c),this._onResize.fire({cols:o,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,c=!1){const n=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===o.fg&&l.getBg(0)===o.bg||(l=n.getBlankLine(o,c),this._cachedBlankLine=l),l.isWrapped=c;const _=n.ybase+n.scrollTop,C=n.ybase+n.scrollBottom;if(n.scrollTop===0){const w=n.lines.isFull;C===n.lines.length-1?w?n.lines.recycle().copyFrom(l):n.lines.push(l.clone()):n.lines.splice(C+1,0,l.clone()),w?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{const w=C-_+1;n.lines.shiftElements(_+1,w-1,-1),n.lines.set(C,l.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(o,c,n){const l=this.buffer;if(o<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else o+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const _=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+o,l.ybase),0),_!==l.ydisp&&(c||this._onScroll.fire(l.ydisp))}};u.BufferService=m=d([g(0,E.IOptionsService)],m)},7994:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CharsetService=void 0,u.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(f){this.glevel=f,this.charset=this._charsets[f]}setgCharset(f,d){this._charsets[f]=d,this.glevel===f&&(this.charset=d)}}},1753:function(P,u,f){var d=this&&this.__decorate||function(l,_,C,w){var S,v=arguments.length,x=v<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,_,C,w);else for(var B=l.length-1;B>=0;B--)(S=l[B])&&(x=(v<3?S(x):v>3?S(_,C,x):S(_,C))||x);return v>3&&x&&Object.defineProperty(_,C,x),x},g=this&&this.__param||function(l,_){return function(C,w){_(C,w,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreMouseService=void 0;const h=f(2585),p=f(8460),b=f(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function m(l,_){let C=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(C|=64,C|=l.action):(C|=3&l.button,4&l.button&&(C|=64),8&l.button&&(C|=128),l.action===32?C|=32:l.action!==0||_||(C|=3)),C}const o=String.fromCharCode,c={DEFAULT:l=>{const _=[m(l,!1)+32,l.col+32,l.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${o(_[0])}${o(_[1])}${o(_[2])}`},SGR:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${m(l,!0)};${l.col};${l.row}${_}`},SGR_PIXELS:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${m(l,!0)};${l.x};${l.y}${_}`}};let n=u.CoreMouseService=class extends b.Disposable{constructor(l,_){super(),this._bufferService=l,this._coreService=_,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 C of Object.keys(E))this.addProtocol(C,E[C]);for(const C of Object.keys(c))this.addEncoding(C,c[C]);this.reset()}addProtocol(l,_){this._protocols[l]=_}addEncoding(l,_){this._encodings[l]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const _=this._encodings[this._activeEncoding](l);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,_,C){if(C){if(l.x!==_.x||l.y!==_.y)return!1}else if(l.col!==_.col||l.row!==_.row)return!1;return l.button===_.button&&l.action===_.action&&l.ctrl===_.ctrl&&l.alt===_.alt&&l.shift===_.shift}};u.CoreMouseService=n=d([g(0,h.IBufferService),g(1,h.ICoreService)],n)},6975:function(P,u,f){var d=this&&this.__decorate||function(n,l,_,C){var w,S=arguments.length,v=S<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(n,l,_,C);else for(var x=n.length-1;x>=0;x--)(w=n[x])&&(v=(S<3?w(v):S>3?w(l,_,v):w(l,_))||v);return S>3&&v&&Object.defineProperty(l,_,v),v},g=this&&this.__param||function(n,l){return function(_,C){l(_,C,n)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreService=void 0;const h=f(1439),p=f(8460),b=f(844),E=f(2585),m=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=u.CoreService=class extends b.Disposable{constructor(n,l,_){super(),this._bufferService=n,this._logService=l,this._optionsService=_,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,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}reset(){this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}triggerDataEvent(n,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${n}"`,(()=>n.split("").map((C=>C.charCodeAt(0))))),this._onData.fire(n)}triggerBinaryEvent(n){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${n}"`,(()=>n.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(n))}};u.CoreService=c=d([g(0,E.IBufferService),g(1,E.ILogService),g(2,E.IOptionsService)],c)},9074:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DecorationService=void 0;const d=f(8055),g=f(8460),h=f(844),p=f(6106);let b=0,E=0;class m extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((n=>n==null?void 0:n.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,h.toDisposable)((()=>this.reset())))}registerDecoration(n){if(n.marker.isDisposed)return;const l=new o(n);if(l){const _=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),_.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const n of this._decorations.values())n.dispose();this._decorations.clear()}*getDecorationsAtCell(n,l,_){let C=0,w=0;for(const S of this._decorations.getKeyIterator(l))C=S.options.x??0,w=C+(S.options.width??1),n>=C&&n<w&&(!_||(S.options.layer??"bottom")===_)&&(yield S)}forEachDecorationAtCell(n,l,_,C){this._decorations.forEachByKey(l,(w=>{b=w.options.x??0,E=b+(w.options.width??1),n>=b&&n<E&&(!_||(w.options.layer??"bottom")===_)&&C(w)}))}}u.DecorationService=m;class o extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(n){super(),this.options=n,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=n.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.InstantiationService=u.ServiceCollection=void 0;const d=f(2585),g=f(8343);class h{constructor(...b){this._entries=new Map;for(const[E,m]of b)this.set(E,m)}set(b,E){const m=this._entries.get(b);return this._entries.set(b,E),m}forEach(b){for(const[E,m]of this._entries.entries())b(E,m)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}u.ServiceCollection=h,u.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(p,b){this._services.set(p,b)}getService(p){return this._services.get(p)}createInstance(p,...b){const E=(0,g.getServiceDependencies)(p).sort(((c,n)=>c.index-n.index)),m=[];for(const c of E){const n=this._services.get(c.id);if(!n)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${c.id}.`);m.push(n)}const o=E.length>0?E[0].index:b.length;if(b.length!==o)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${o+1} conflicts with ${b.length} static arguments`);return new p(...b,...m)}}},7866:function(P,u,f){var d=this&&this.__decorate||function(o,c,n,l){var _,C=arguments.length,w=C<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(o,c,n,l);else for(var S=o.length-1;S>=0;S--)(_=o[S])&&(w=(C<3?_(w):C>3?_(c,n,w):_(c,n))||w);return C>3&&w&&Object.defineProperty(c,n,w),w},g=this&&this.__param||function(o,c){return function(n,l){c(n,l,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.traceCall=u.setTraceLogger=u.LogService=void 0;const h=f(844),p=f(2585),b={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 E,m=u.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let c=0;c<o.length;c++)typeof o[c]=="function"&&(o[c]=o[c]())}_log(o,c,n){this._evalLazyOptionalParams(n),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...n)}trace(o,...c){var n;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,o,c)}debug(o,...c){var n;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,o,c)}info(o,...c){var n;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,o,c)}warn(o,...c){var n;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,o,c)}error(o,...c){var n;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,o,c)}};u.LogService=m=d([g(0,p.IOptionsService)],m),u.setTraceLogger=function(o){E=o},u.traceCall=function(o,c,n){if(typeof n.value!="function")throw new Error("not supported");const l=n.value;n.value=function(..._){if(E.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,_);E.trace(`GlyphRenderer#${l.name}(${_.map((w=>JSON.stringify(w))).join(", ")})`);const C=l.apply(this,_);return E.trace(`GlyphRenderer#${l.name} return`,C),C}}},7302:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OptionsService=u.DEFAULT_OPTIONS=void 0;const d=f(8460),g=f(844),h=f(6114);u.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:h.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 b extends g.Disposable{constructor(m){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...u.DEFAULT_OPTIONS};for(const c in m)if(c in o)try{const n=m[c];o[c]=this._sanitizeAndValidateOption(c,n)}catch(n){console.error(n)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,o){return this.onOptionChange((c=>{c===m&&o(this.rawOptions[m])}))}onMultipleOptionChange(m,o){return this.onOptionChange((c=>{m.indexOf(c)!==-1&&o()}))}_setupOptions(){const m=c=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},o=(c,n)=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);n=this._sanitizeAndValidateOption(c,n),this.rawOptions[c]!==n&&(this.rawOptions[c]=n,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const n={get:m.bind(this,c),set:o.bind(this,c)};Object.defineProperty(this.options,c,n)}}_sanitizeAndValidateOption(m,o){switch(m){case"cursorStyle":if(o||(o=u.DEFAULT_OPTIONS[m]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${m}`);break;case"wordSeparator":o||(o=u.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=p.includes(o)?o:u.DEFAULT_OPTIONS[m];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${m} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${m} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}u.OptionsService=b},2660:function(P,u,f){var d=this&&this.__decorate||function(b,E,m,o){var c,n=arguments.length,l=n<3?E:o===null?o=Object.getOwnPropertyDescriptor(E,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(b,E,m,o);else for(var _=b.length-1;_>=0;_--)(c=b[_])&&(l=(n<3?c(l):n>3?c(E,m,l):c(E,m))||l);return n>3&&l&&Object.defineProperty(E,m,l),l},g=this&&this.__param||function(b,E){return function(m,o){E(m,o,b)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkService=void 0;const h=f(2585);let p=u.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const E=this._bufferService.buffer;if(b.id===void 0){const _=E.addMarker(E.ybase+E.y),C={data:b,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(C,_))),this._dataByLinkId.set(C.id,C),C.id}const m=b,o=this._getEntryIdKey(m),c=this._entriesWithId.get(o);if(c)return this.addLineToLink(c.id,E.ybase+E.y),c.id;const n=E.addMarker(E.ybase+E.y),l={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(l,n))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(b,E){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((o=>o.line!==E))){const o=this._bufferService.buffer.addMarker(E);m.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(m,o)))}}getLinkData(b){var E;return(E=this._dataByLinkId.get(b))==null?void 0:E.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,E){const m=b.lines.indexOf(E);m!==-1&&(b.lines.splice(m,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};u.OscLinkService=p=d([g(0,h.IBufferService)],p)},8343:(P,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createDecorator=u.getServiceDependencies=u.serviceRegistry=void 0;const f="di$target",d="di$dependencies";u.serviceRegistry=new Map,u.getServiceDependencies=function(g){return g[d]||[]},u.createDecorator=function(g){if(u.serviceRegistry.has(g))return u.serviceRegistry.get(g);const h=function(p,b,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,c){o[f]===o?o[d].push({id:m,index:c}):(o[d]=[{id:m,index:c}],o[f]=o)})(h,p,E)};return h.toString=()=>g,u.serviceRegistry.set(g,h),h}},2585:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.IDecorationService=u.IUnicodeService=u.IOscLinkService=u.IOptionsService=u.ILogService=u.LogLevelEnum=u.IInstantiationService=u.ICharsetService=u.ICoreService=u.ICoreMouseService=u.IBufferService=void 0;const d=f(8343);var g;u.IBufferService=(0,d.createDecorator)("BufferService"),u.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),u.ICoreService=(0,d.createDecorator)("CoreService"),u.ICharsetService=(0,d.createDecorator)("CharsetService"),u.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(g||(u.LogLevelEnum=g={})),u.ILogService=(0,d.createDecorator)("LogService"),u.IOptionsService=(0,d.createDecorator)("OptionsService"),u.IOscLinkService=(0,d.createDecorator)("OscLinkService"),u.IUnicodeService=(0,d.createDecorator)("UnicodeService"),u.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(P,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeService=void 0;const d=f(8460),g=f(225);class h{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,E,m=!1){return(16777215&b)<<3|(3&E)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let E=0,m=0;const o=b.length;for(let c=0;c<o;++c){let n=b.charCodeAt(c);if(55296<=n&&n<=56319){if(++c>=o)return E+this.wcwidth(n);const C=b.charCodeAt(c);56320<=C&&C<=57343?n=1024*(n-55296)+C-56320+65536:E+=this.wcwidth(C)}const l=this.charProperties(n,m);let _=h.extractWidth(l);h.extractShouldJoin(l)&&(_-=h.extractWidth(m)),E+=_,m=l}return E}charProperties(b,E){return this._activeProvider.charProperties(b,E)}}u.UnicodeService=h}},L={};function te(P){var u=L[P];if(u!==void 0)return u.exports;var f=L[P]={exports:{}};return G[P].call(f.exports,f,f.exports,te),f.exports}var le={};return(()=>{var P=le;Object.defineProperty(P,"__esModule",{value:!0}),P.Terminal=void 0;const u=te(9042),f=te(3236),d=te(844),g=te(5741),h=te(8285),p=te(7975),b=te(7090),E=["cols","rows"];class m extends d.Disposable{constructor(c){super(),this._core=this.register(new f.Terminal(c)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const n=_=>this._core.options[_],l=(_,C)=>{this._checkReadonlyOptions(_),this._core.options[_]=C};for(const _ in this._core.options){const C={get:n.bind(this,_),set:l.bind(this,_)};Object.defineProperty(this._publicOptions,_,C)}}_checkReadonlyOptions(c){if(E.includes(c))throw new Error(`Option "${c}" 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 b.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let n="none";switch(this._core.coreMouseService.activeProtocol){case"X10":n="x10";break;case"VT200":n="vt200";break;case"DRAG":n="drag";break;case"ANY":n="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:n,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const n in c)this._publicOptions[n]=c[n]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,n=!0){this._core.input(c,n)}resize(c,n){this._verifyIntegers(c,n),this._core.resize(c,n)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,n,l){this._verifyIntegers(c,n,l),this._core.select(c,n,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,n){this._verifyIntegers(c,n),this._core.selectLines(c,n)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,n){this._core.write(c,n)}writeln(c,n){this._core.write(c),this._core.write(`\r
214
- `,n)}paste(c){this._core.paste(c)}refresh(c,n){this._verifyIntegers(c,n),this._core.refresh(c,n)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return u}_verifyIntegers(...c){for(const n of c)if(n===1/0||isNaN(n)||n%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const n of c)if(n&&(n===1/0||isNaN(n)||n%1!=0||n<0))throw new Error("This API only accepts positive integers")}}P.Terminal=m})(),le})()))})(Ho)),Ho.exports}var Hp=Bp(),No={exports:{}},nd;function Np(){return nd||(nd=1,(function(T,q){(function(G,L){T.exports=L()})(self,(()=>(()=>{var G={};return(()=>{var L=G;Object.defineProperty(L,"__esModule",{value:!0}),L.FitAddon=void 0,L.FitAddon=class{activate(te){this._terminal=te}dispose(){}fit(){const te=this.proposeDimensions();if(!te||!this._terminal||isNaN(te.cols)||isNaN(te.rows))return;const le=this._terminal._core;this._terminal.rows===te.rows&&this._terminal.cols===te.cols||(le._renderService.clear(),this._terminal.resize(te.cols,te.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const te=this._terminal._core,le=te._renderService.dimensions;if(le.css.cell.width===0||le.css.cell.height===0)return;const P=this._terminal.options.scrollback===0?0:te.viewport.scrollBarWidth,u=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(u.getPropertyValue("height")),d=Math.max(0,parseInt(u.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),h=f-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-P;return{cols:Math.max(2,Math.floor(p/le.css.cell.width)),rows:Math.max(1,Math.floor(h/le.css.cell.height))}}}})(),G})()))})(No)),No.exports}var zp=Np(),zo={exports:{}},ad;function jp(){return ad||(ad=1,(function(T,q){(function(G,L){T.exports=L()})(self,(()=>(()=>{var G={6:(P,u)=>{function f(g){try{const h=new URL(g),p=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(u,"__esModule",{value:!0}),u.LinkComputer=u.WebLinkProvider=void 0,u.WebLinkProvider=class{constructor(g,h,p,b={}){this._terminal=g,this._regex=h,this._handler=p,this._options=b}provideLinks(g,h){const p=d.computeLink(g,this._regex,this._terminal,this._handler);h(this._addCallbacks(p))}_addCallbacks(g){return g.map((h=>(h.leave=this._options.leave,h.hover=(p,b)=>{if(this._options.hover){const{range:E}=h;this._options.hover(p,b,E)}},h)))}};class d{static computeLink(h,p,b,E){const m=new RegExp(p.source,(p.flags||"")+"g"),[o,c]=d._getWindowedLineStrings(h-1,b),n=o.join("");let l;const _=[];for(;l=m.exec(n);){const C=l[0];if(!f(C))continue;const[w,S]=d._mapStrIdx(b,c,0,l.index),[v,x]=d._mapStrIdx(b,w,S,C.length);if(w===-1||S===-1||v===-1||x===-1)continue;const B={start:{x:S+1,y:w+1},end:{x,y:v+1}};_.push({range:B,text:C,activate:E})}return _}static _getWindowedLineStrings(h,p){let b,E=h,m=h,o=0,c="";const n=[];if(b=p.buffer.active.getLine(h)){const l=b.translateToString(!0);if(b.isWrapped&&l[0]!==" "){for(o=0;(b=p.buffer.active.getLine(--E))&&o<2048&&(c=b.translateToString(!0),o+=c.length,n.push(c),b.isWrapped&&c.indexOf(" ")===-1););n.reverse()}for(n.push(l),o=0;(b=p.buffer.active.getLine(++m))&&b.isWrapped&&o<2048&&(c=b.translateToString(!0),o+=c.length,n.push(c),c.indexOf(" ")===-1););}return[n,E]}static _mapStrIdx(h,p,b,E){const m=h.buffer.active,o=m.getNullCell();let c=b;for(;E;){const n=m.getLine(p);if(!n)return[-1,-1];for(let l=c;l<n.length;++l){n.getCell(l,o);const _=o.getChars();if(o.getWidth()&&(E-=_.length||1,l===n.length-1&&_==="")){const C=m.getLine(p+1);C&&C.isWrapped&&(C.getCell(0,o),o.getWidth()===2&&(E+=1))}if(E<0)return[p,l]}p++,c=0}return[p,c]}}u.LinkComputer=d}},L={};function te(P){var u=L[P];if(u!==void 0)return u.exports;var f=L[P]={exports:{}};return G[P](f,f.exports,te),f.exports}var le={};return(()=>{var P=le;Object.defineProperty(P,"__esModule",{value:!0}),P.WebLinksAddon=void 0;const u=te(6),f=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,h){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}P.WebLinksAddon=class{constructor(g=d,h={}){this._handler=g,this._options=h}activate(g){this._terminal=g;const h=this._options,p=h.urlRegex||f;this._linkProvider=this._terminal.registerLinkProvider(new u.WebLinkProvider(this._terminal,p,this._handler,h))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),le})()))})(zo)),zo.exports}var Up=jp();function qp(T,q){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal?session=${encodeURIComponent(T)}&token=${encodeURIComponent(q)}`}const Ip=15e3,Wp=new Set([4001,4004]),Pp="#10B981",Kp="#F59E0B",Yp="#EF4444",ld='"SF Mono", Menlo, Monaco, Inconsolata, "Source Code Pro", Consolas, "Liberation Mono", "Ubuntu Mono", "Courier Prime", "JetBrains Mono", "Courier New", monospace',Gp={panelBackground:"#0E0E0E",textMuted:"#A1A1AA",borderSubtle:"#2E2E2E",xterm:{background:"#0E0E0E",foreground:"#FAFAFA",cursor:"#6BE195",cursorAccent:"#0E0E0E",selectionBackground:"rgba(107, 225, 149, 0.25)",black:"#1A1A1A",red:"#f87171",green:"#6BE195",yellow:"#f59e0b",blue:"#3b82f6",magenta:"#a78bfa",cyan:"#22d3ee",white:"#FAFAFA",brightBlack:"#404040",brightRed:"#ff9b96",brightGreen:"#8bd4a6",brightYellow:"#ffd966",brightBlue:"#60a5fa",brightMagenta:"#c4b5fd",brightCyan:"#67e8f9",brightWhite:"#ffffff"}},Fp={panelBackground:"#FFFFFF",textMuted:"#737373",borderSubtle:"#E5E5E5",xterm:{background:"#FFFFFF",foreground:"#1A1A1A",cursor:"#05A9BC",cursorAccent:"#FFFFFF",selectionBackground:"rgba(5, 169, 188, 0.18)",black:"#3A3A3A",red:"#dc2626",green:"#05A9BC",yellow:"#b45309",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#d4d4d8",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#06b6d4",brightYellow:"#f59e0b",brightBlue:"#3b82f6",brightMagenta:"#a78bfa",brightCyan:"#22d3ee",brightWhite:"#ffffff"}},jo=T=>T==="dark"?Gp:Fp,Xp=({sessionId:T,token:q})=>{const G=ae.useRef(null),L=ae.useRef(null),[te,le]=ae.useState("connecting"),[P,u]=ae.useState(null),[f,d]=ae.useState(ua());ae.useEffect(()=>Go(d),[]),ae.useEffect(()=>{L.current&&(L.current.options.theme=jo(f).xterm)},[f]),ae.useEffect(()=>{const b=G.current;if(!b)return;let E=!1,m=0,o=null,c=null;const n=new Hp.Terminal({cursorBlink:!0,fontSize:13,fontFamily:ld,theme:jo(ua()).xterm,scrollback:1e4,allowProposedApi:!0});L.current=n;const l=new zp.FitAddon;n.loadAddon(l),n.loadAddon(new Up.WebLinksAddon),n.parser.registerCsiHandler({prefix:">",final:"q"},()=>(n.write("\x1BP>|XTerm(370)\x1B\\"),!0)),n.parser.registerOscHandler(52,v=>{var U;const x=v.split(";");if(x.length<2)return!1;const B=x[x.length-1];try{const j=atob(B),N=Uint8Array.from(j,ce=>ce.charCodeAt(0)),J=new TextDecoder().decode(N);(U=navigator.clipboard)==null||U.writeText(J).catch(()=>{})}catch{}return!0}),n.open(b),l.fit();const _=n.onData(v=>{(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(v)}),C=()=>{(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"resize",cols:n.cols,rows:n.rows}))},w=new ResizeObserver(()=>{l.fit(),C()});w.observe(b);function S(){if(E)return;const v=new WebSocket(qp(T,q));c=v,v.onopen=()=>{m=0,le("connected"),u(null),l.fit(),C()},v.onmessage=x=>{const B=typeof x.data=="string"?x.data:new TextDecoder().decode(x.data);n.write(B)},v.onclose=x=>{if(E)return;if(Wp.has(x.code)){le("error"),u(x.reason||`Connection refused (${x.code})`);return}const B=Math.min(1e3*2**m,Ip);m+=1,le("connecting"),o=setTimeout(S,B)}}return S(),()=>{E=!0,o&&clearTimeout(o),w.disconnect(),_.dispose(),c==null||c.close(),n.dispose(),L.current=null}},[T,q]);const g=te==="connected"?Pp:te==="error"?Yp:Kp,h=te==="connected"?"Connected":te==="error"?P??"Error":"Connecting…",p=jo(f);return M.jsxs("div",{className:"harness-terminal",style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",background:p.panelBackground,borderRadius:8,border:`1px solid ${p.borderSubtle}`,overflow:"hidden"},children:[M.jsxs("div",{"data-status":te,style:{display:"flex",alignItems:"center",gap:6,flexShrink:0,padding:"6px 10px",borderBottom:`1px solid ${p.borderSubtle}`,fontFamily:ld,fontSize:11},children:[M.jsx("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:"50%",background:g,boxShadow:te==="connecting"?`0 0 0 3px ${g}33`:"none",flexShrink:0}}),M.jsx("span",{style:{color:p.textMuted},children:h})]}),M.jsx("div",{ref:G,style:{flex:1,minHeight:0,padding:8,overflow:"hidden"}})]})},Vp=8e3;function $p({message:T,onDismiss:q}){return ae.useEffect(()=>{const G=window.setTimeout(q,Vp);return()=>window.clearTimeout(G)},[T,q]),M.jsxs("div",{className:"toast",role:"alert","data-testid":"toast",children:[M.jsx("span",{className:"toast-message",children:T}),M.jsx("button",{className:"toast-dismiss","aria-label":"Dismiss",onClick:q,children:"×"})]})}function Zp({recentDirs:T,launchDir:q,listDir:G,onCreateSession:L,onRunSample:te,onDismiss:le}){const[P,u]=ae.useState(!1),[f,d]=ae.useState(!1),[g,h]=ae.useState(null),p=ae.useRef(null),b=async()=>{d(!0),h(null);try{await te()}catch(E){h(E.message),d(!1)}};return M.jsxs("div",{className:"welcome-panel","data-testid":"welcome-panel",children:[M.jsxs("div",{className:"welcome-card",children:[M.jsx("div",{className:"welcome-eyebrow",children:"Welcome"}),M.jsx("h1",{className:"welcome-title",children:"Your coding agent, wired into Sapiom"}),M.jsx("p",{className:"welcome-intro",children:"This is your own coding agent — Claude Code or Codex — running in a Sapiom-configured workspace. Agent workflows you build here show up in the rail, get visualized live on the canvas, and can be run locally or deployed with one click."}),M.jsxs("div",{className:"welcome-actions",children:[M.jsx("button",{ref:p,className:"btn-primary welcome-action","data-testid":"welcome-start-project",onClick:()=>u(!0),children:"Start a new project"}),M.jsx("button",{className:"btn-ghost welcome-action","data-testid":"welcome-run-sample",onClick:()=>void b(),disabled:f,children:f?"Setting up the sample…":"Run the sample project"})]}),M.jsxs("p",{className:"welcome-sample-note",children:["The sample is ",M.jsx("code",{children:"order-triage"}),", a small support-ticket triage agent — ready to visualize, run, and deploy."]}),g&&M.jsx("div",{className:"welcome-error",children:g}),M.jsxs("div",{className:"welcome-hints","data-testid":"welcome-hints",children:[M.jsx("span",{className:"welcome-hints-label",children:"In a project you can"}),M.jsxs("span",{className:"welcome-hint-chip",children:[M.jsx(Ve,{name:"Sparkles",size:11})," Visualize"]}),M.jsxs("span",{className:"welcome-hint-chip",children:[M.jsx(Ve,{name:"Play",size:11})," Run local"]}),M.jsxs("span",{className:"welcome-hint-chip",children:[M.jsx(Ve,{name:"Cloud",size:11})," Deploy"]}),M.jsxs("span",{className:"welcome-hints-kbd",children:["— or press ",M.jsx("kbd",{children:"⌘K"})]})]}),M.jsx("button",{className:"welcome-dismiss","data-testid":"welcome-dismiss",onClick:le,children:"Skip for now"})]}),P&&M.jsx(_d,{recentDirs:T,launchDir:q,listDir:G,onClose:()=>u(!1),onCreate:L,triggerRef:p})]})}function Qp({workflow:T,top:q,height:G,activeSessionId:L,boundWorkflowPath:te,macros:le,onBind:P,onRunMacro:u}){const f={top:q,height:G},d={top:q},g=T.path===te,h=L?g?"You're working on this":null:"Start a session first",p=g?"Working on this":"Work on this";return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"workflow-action-strip-notch",style:f,"data-testid":"workflow-action-strip-notch"}),M.jsxs("div",{className:"workflow-action-strip",style:d,"data-testid":"workflow-action-strip",children:[M.jsxs("button",{className:"strip-item strip-item-bind"+(g?" is-bound":""),"data-testid":"workflow-bind","aria-label":h?`${p}: ${h}`:p,"aria-pressed":g,disabled:!!h,onClick:P,children:[M.jsx("span",{className:"strip-item-icon",children:M.jsx(Ve,{name:g?"Radio":"Plug",size:15})}),M.jsxs("span",{className:"strip-item-text",children:[M.jsx("span",{className:"strip-item-label",children:p}),h&&!L&&M.jsx("span",{className:"strip-item-reason",children:h})]})]}),le.map(b=>{const E=dd(b,T,L);return M.jsxs("button",{className:"strip-item","data-testid":`macro-${b.id}`,"aria-label":E?`${b.label}: ${E}`:b.label,disabled:!!E,onClick:()=>{u(b),Ii("macro.invoked",{macroId:b.id})},children:[M.jsx("span",{className:"strip-item-icon",children:M.jsx(Ve,{name:b.icon,size:15})}),M.jsxs("span",{className:"strip-item-text",children:[M.jsx("span",{className:"strip-item-label",children:b.label}),E&&M.jsx("span",{className:"strip-item-reason",children:E})]})]},b.id)})]})]})}const Jp=T=>T.split("/").filter(Boolean).pop()??T,eg=(T,q)=>T===q||T.startsWith(`${q}/`);function tg(T,q,G){const L=q.find(f=>f.id===G)??null,te=new Set(T),le=[],P=new Set,u=[...L?[L.cwd]:[],...q.map(f=>f.cwd).filter(f=>f!==(L==null?void 0:L.cwd))].filter(f=>P.has(f)?!1:(P.add(f),!0));for(const f of u){const d=T.filter(h=>te.has(h)&&eg(h.path,f)),g=f===(L==null?void 0:L.cwd);d.length===0&&!g||(d.forEach(h=>te.delete(h)),le.push({cwd:f,label:Jp(f),isActive:g,workflows:d}))}return{groups:le,ungrouped:Array.from(te)}}function ig({workflow:T,isSelected:q,onSelect:G,onSelectedRowElement:L}){return M.jsx("div",{ref:q?L:void 0,className:"workflow-item"+(q?" is-selected":""),"data-testid":`workflow-${T.name}`,children:M.jsxs("button",{className:"workflow-item-trigger",onClick:()=>G(T.path),title:T.path,children:[M.jsx("span",{className:"workflow-caret",children:"▸"}),M.jsx("span",{className:"workflow-name",children:T.name}),T.definitionId!=null&&M.jsx("span",{className:"workflow-dot",title:"Deployed"})]})})}function sg({workflows:T,sessions:q,activeSessionId:G,selectedPath:L,onSelect:te,onSelectedRowElement:le,onConnect:P}){const[u,f]=ae.useState(!1),[d,g]=ae.useState(""),[h,p]=ae.useState(!1),[b,E]=ae.useState(null),m=async()=>{const l=d.trim();if(l){p(!0),E(null);try{await P(l),g(""),f(!1)}catch(_){E(_.message)}finally{p(!1)}}},{groups:o,ungrouped:c}=tg(T,q,G),n=l=>M.jsx(ig,{workflow:l,isSelected:l.path===L,onSelect:te,onSelectedRowElement:le},l.path);return M.jsxs("aside",{className:"rail rail-workflows",children:[M.jsx("div",{className:"rail-header",children:"Workspace"}),M.jsxs("div",{className:"rail-list",children:[o.length===0&&c.length===0&&M.jsx("div",{className:"rail-empty",children:"No workflows yet"}),o.map(l=>M.jsxs("div",{className:"workspace-group"+(l.isActive?" is-active":""),children:[M.jsxs("div",{className:"workspace-group-header","data-testid":`workspace-group-${l.label}`,children:[M.jsx(Ve,{name:l.isActive?"Radio":"Folder",size:11}),l.label]}),l.workflows.length===0&&M.jsx("div",{className:"workspace-group-empty",children:"No workflows here yet"}),l.workflows.map(n)]},l.cwd)),c.length>0&&M.jsxs("div",{className:"workspace-group",children:[M.jsx("div",{className:"workspace-group-header",children:"Other"}),c.map(n)]})]}),u?M.jsxs("div",{className:"connect-form",children:[M.jsx("input",{autoFocus:!0,className:"connect-input",placeholder:"/path/to/project",value:d,onChange:l=>g(l.target.value),onKeyDown:l=>{l.key==="Enter"&&m(),l.key==="Escape"&&f(!1)}}),b&&M.jsx("div",{className:"connect-error",children:b}),M.jsxs("div",{className:"connect-actions",children:[M.jsx("button",{className:"btn-ghost",onClick:()=>f(!1),disabled:h,children:"Cancel"}),M.jsx("button",{className:"btn-primary",onClick:()=>void m(),disabled:h||!d.trim(),children:h?"Connecting…":"Connect"})]})]}):M.jsx("button",{className:"connect-trigger",onClick:()=>f(!0),children:"+ Connect"})]})}function rg(T,q){const[G,L]=ae.useState(null);return ae.useLayoutEffect(()=>{if(!T||!q){L(null);return}const te=()=>{const u=T.getBoundingClientRect(),f=q.getBoundingClientRect();L({top:u.top-f.top,height:u.height})};te();const le=T.closest(".rail-list");le==null||le.addEventListener("scroll",te),window.addEventListener("resize",te);const P=new ResizeObserver(te);return P.observe(T),P.observe(q),()=>{le==null||le.removeEventListener("scroll",te),window.removeEventListener("resize",te),P.disconnect()}},[T,q]),G}const md="sapiom-harness-pane-widths",Fo=180,pd=480,Io=220,Xo=280,gd=720,Wo=420;function Po(T,q,G){return Math.min(Math.max(T,q),G)}function ng(){const T={rail:Io,canvas:Wo};if(typeof window>"u")return T;try{const q=window.localStorage.getItem(md);if(!q)return T;const G=JSON.parse(q);return{rail:Po(typeof G.rail=="number"?G.rail:Io,Fo,pd),canvas:Po(typeof G.canvas=="number"?G.canvas:Wo,Xo,gd)}}catch{return T}}function od(T){window.localStorage.setItem(md,JSON.stringify(T))}function ag(){const[T,q]=ae.useState(ng),G=(te,le,P,u)=>f=>{const d=f.currentTarget;d.setPointerCapture(f.pointerId);const g=f.clientX,h=T[te],p=E=>{const m=Po(h+(E.clientX-g)*le,P,u);q(o=>o[te]===m?o:{...o,[te]:m})},b=()=>{d.removeEventListener("pointermove",p),d.removeEventListener("pointerup",b),q(E=>(od(E),E))};d.addEventListener("pointermove",p),d.addEventListener("pointerup",b)},L=(te,le)=>{q(P=>{const u={...P,[te]:le};return od(u),u})};return{widths:T,startRailDrag:G("rail",1,Fo,pd),startCanvasDrag:G("canvas",-1,Xo,gd),resetRail:()=>L("rail",Io),resetCanvas:()=>L("canvas",Wo)}}const lg=2e3;function og(T){const q=new URL("/ws/events",window.location.href);q.protocol=q.protocol==="https:"?"wss:":"ws:",q.searchParams.set("token",fa());let G=null,L=null,te=!1;const le=()=>{G=new WebSocket(q),G.addEventListener("message",P=>{try{T(JSON.parse(P.data))}catch{}}),G.addEventListener("close",()=>{te||(L=setTimeout(le,lg))})};return le(),()=>{te=!0,L&&clearTimeout(L),G==null||G.close()}}const ut=op(),cg=3e3;function ug(){const[T,q]=ae.useState(null),[G,L]=ae.useState(null),[te,le]=ae.useState(!0),[P,u]=ae.useState(null),[f,d]=ae.useState(null),[g,h]=ae.useState(null),[p,b]=ae.useState([]),[E,m]=ae.useState(null),[o,c]=ae.useState(!1),[n,l]=ae.useState(null),[_,C]=ae.useState(new Set),[w,S]=ae.useState([]),v=ae.useRef(new Map);ae.useEffect(()=>{const Y=v.current;return()=>{Y.forEach(F=>clearTimeout(F)),Y.clear()}},[]),ae.useEffect(()=>{let Y=!1;return Promise.all([ut.getState(),ut.getSettings()]).then(([F,z])=>{if(Y)return;q(F),L(z),F.tasks&&S(F.tasks);const R=F.sessions.find(ie=>ie.status!=="exited");R&&h(R.id),F.workflows[0]&&d(F.workflows[0].path)}).catch(F=>!Y&&u(F.message)).finally(()=>!Y&&le(!1)),()=>{Y=!0}},[]),ae.useEffect(()=>{if(!g)return;const Y=T==null?void 0:T.sessions.find(F=>F.id===g);d(fd(Y))},[g]);const x=ae.useCallback(async()=>{const Y=await ut.listWorkflows();q(F=>F&&{...F,workflows:Y})},[]);ae.useEffect(()=>og(Y=>{if(l(Y),Y.type==="session.status"){if(q(F=>{if(!F)return F;const R=F.sessions.some(ie=>ie.id===Y.session.id)?F.sessions.map(ie=>ie.id===Y.session.id?Y.session:ie):[...F.sessions,Y.session];return{...F,sessions:R}}),Y.session.status==="exited"){const F=Y.session.id,z=v.current.get(F);z&&(clearTimeout(z),v.current.delete(F)),C(R=>{if(!R.has(F))return R;const ie=new Set(R);return ie.delete(F),ie})}}else if(Y.type==="workflows.changed")x();else if(Y.type==="task.status")S(F=>F.some(R=>R.id===Y.task.id)?F.map(R=>R.id===Y.task.id?Y.task:R):[...F,Y.task]);else if(Y.type==="session.activity"){const F=Y.harnessSessionId;C(R=>R.has(F)?R:new Set(R).add(F));const z=v.current.get(F);z&&clearTimeout(z),v.current.set(F,setTimeout(()=>{v.current.delete(F),C(R=>{if(!R.has(F))return R;const ie=new Set(R);return ie.delete(F),ie})},cg))}}),[x]);const B=ae.useCallback(async Y=>{c(!0);try{b(await ut.sessionHistory(Y))}finally{c(!1)}},[]),U=ae.useCallback(async Y=>{const F=await ut.createSession(Y);q(R=>R&&!R.sessions.some(ie=>ie.id===F.id)?{...R,sessions:[...R.sessions,F]}:R),h(F.id);let z=[];L(R=>(z=[Y.cwd,...((R==null?void 0:R.recentDirs)??[]).filter(ie=>ie!==Y.cwd)].slice(0,8),R&&{...R,recentDirs:z}));try{const R=await ut.updateSettings({recentDirs:z});L(ie=>ie&&{...ie,recentDirs:R.recentDirs})}catch{}return F},[]),j=ae.useCallback(async()=>{var z;const Y=await ut.seedSampleProject(),F=((z=T==null?void 0:T.availableHarnesses)==null?void 0:z[0])??"claude-code";return U({cwd:Y.root,harness:F})},[T==null?void 0:T.availableHarnesses,U]),N=ae.useCallback(async Y=>{try{const F=await ut.resumeSession(Y);return q(z=>z&&{...z,sessions:z.sessions.map(R=>R.id===F.id?F:R)}),h(F.id),F}catch(F){throw m(F instanceof fs&&F.reason?F.reason:F.message),F}},[]),J=ae.useCallback(async Y=>{var z;const F=Y.harnessSessionId??((z=T==null?void 0:T.sessions.find(R=>R.agentSessionId===Y.agentSessionId))==null?void 0:z.id);return F?N(F):U({cwd:Y.cwd,harness:Y.harness})},[T,N,U]),ce=ae.useCallback(async Y=>{try{await ut.killSession(Y)}catch(z){throw m(z instanceof fs&&z.reason?z.reason:z.message),z}const F=((T==null?void 0:T.sessions)??[]).filter(z=>z.id!==Y);if(q(z=>z&&{...z,sessions:F}),g===Y){const z=F.find(R=>R.status!=="exited");h(z?z.id:null)}},[T,g]),W=ae.useCallback(async Y=>{const F=await ut.connectWorkflow(Y);return q(z=>z&&{...z,workflows:[...z.workflows.filter(R=>R.path!==F.path),F]}),F},[]),X=ae.useCallback(async(Y,F)=>{const z=await ut.bindWorkflow(Y,F);q(R=>R&&{...R,sessions:R.sessions.map(ie=>ie.id===z.id?z:ie)})},[]),re=ae.useCallback(async Y=>{const F=await ut.updateSettings(Y);return L(F),Y.telemetryOptIn!==void 0&&q(z=>z&&{...z,telemetryOptIn:F.telemetryOptIn}),F},[]),D=ae.useCallback(async(Y,F)=>{try{await ut.runMacro(Y,F)}catch(z){m(z instanceof fs&&z.reason?z.reason:z.message)}},[]),H=ae.useCallback(()=>m(null),[]),A=ae.useCallback(async(Y,F)=>{await ut.injectInput(Y,{text:F,submit:!0})},[]),O=ae.useCallback(async(Y,F)=>{try{await ut.injectInput(Y,{text:F,submit:!1}),m("Typed into the terminal — edit and press Enter.")}catch(z){m(z instanceof fs&&z.reason?z.reason:z.message)}},[]),$=ae.useCallback(Y=>{m(Y)},[]),se=ae.useCallback(Y=>ut.listDir(Y),[]);return{state:T,loading:te,error:P,settings:G,bootToken:fa(),selectedWorkflowPath:f,setSelectedWorkflowPath:d,activeSessionId:g,setActiveSessionId:h,history:p,historyLoading:o,loadHistory:B,createSession:U,createSampleSession:j,resumeSession:N,resumeFromHistory:J,closeSession:ce,connectWorkflow:W,bindWorkflow:X,updateSettings:re,runMacro:D,injectInput:A,useSkill:O,showToast:$,listDir:se,lastMessage:n,toast:E,dismissToast:H,busySessionIds:_,tasks:w,api:ut}}const hg=()=>{var re,D,H,A,O,$,se;const T=ug(),[q,G]=ae.useState(!1),[L,te]=ae.useState(!1),[le,P]=ae.useState(!1),[u,f]=ae.useState(null),[d,g]=ae.useState(null),[h,p]=ae.useState("canvas"),[b,E]=ae.useState(!1),m=rg(u,d),o=ae.useMemo(()=>T.api.listSkills.bind(T.api),[T.api]),c=ae.useMemo(()=>T.api.getSkill.bind(T.api),[T.api]),{widths:n,startRailDrag:l,startCanvasDrag:_,resetRail:C,resetCanvas:w}=ag();if(ae.useEffect(()=>{const Y=F=>{var R;const z=F.key.toLowerCase();if((F.metaKey||F.ctrlKey)&&(z==="k"||z==="p")){F.preventDefault(),G(!0);return}if((F.metaKey||F.ctrlKey)&&/^[1-9]$/.test(F.key)){const ie=(R=T.state)==null?void 0:R.sessions.filter(_e=>_e.status!=="exited").sort((_e,de)=>_e.createdAt.localeCompare(de.createdAt)),oe=ie==null?void 0:ie[Number(F.key)-1];oe&&(F.preventDefault(),T.setActiveSessionId(oe.id))}};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[(re=T.state)==null?void 0:re.sessions]),T.loading)return M.jsx("div",{className:"app-status",children:"Loading Sapiom Harness…"});if(T.error||!T.state)return M.jsxs("div",{className:"app-status app-status-error",children:["Failed to load: ",T.error]});const{state:S}=T,v=S.sessions.find(Y=>Y.id===T.activeSessionId)??null,x=fd(v),B=S.workflows.find(Y=>Y.path===x)??null,U=S.workflows.find(Y=>Y.path===T.selectedWorkflowPath)??null,j=S.sessions.some(Y=>Y.status!=="exited"),N=S.firstRun===!0&&!j&&!L,J=async(Y,F)=>{await T.createSession({cwd:Y,harness:F})},ce=Y=>{T.setSelectedWorkflowPath(Y)},W=Y=>{T.setSelectedWorkflowPath(Y),T.activeSessionId&&T.bindWorkflow(T.activeSessionId,Y)},X=(Y,F)=>{if(Y&&W(Y.path),F.action.kind==="open-url"){window.open(up(F.action.url,Y),"_blank","noopener,noreferrer");return}T.activeSessionId&&T.runMacro(F.id,{harnessSessionId:T.activeSessionId,workflowPath:Y==null?void 0:Y.path})};return M.jsxs("div",{className:"app-shell",children:[M.jsx(rp,{authenticated:S.authenticated,organizationName:S.organizationName,onOpenPalette:()=>G(!0),telemetryOptIn:((D=T.settings)==null?void 0:D.telemetryOptIn)??S.telemetryOptIn,consentSource:S.consentSource,consentEnvReason:S.consentEnvReason,onOpenSettings:()=>P(!0)}),S.consentSource==="default-silent"&&!((H=T.settings)!=null&&H.telemetryNoticeDismissed)&&M.jsx(Op,{onDismiss:()=>{T.updateSettings({telemetryNoticeDismissed:!0})},onOpenSettings:()=>P(!0)}),M.jsxs("div",{className:"app",style:{gridTemplateColumns:`minmax(${Fo}px, ${n.rail}px) 32px minmax(360px, 1fr) minmax(${Xo}px, ${n.canvas}px)`},children:[M.jsx(sg,{workflows:S.workflows,sessions:S.sessions,activeSessionId:T.activeSessionId,selectedPath:T.selectedWorkflowPath,onSelect:ce,onSelectedRowElement:f,onConnect:async Y=>{await T.connectWorkflow(Y)}}),M.jsx("div",{className:"workflow-action-strip-col",ref:g,children:U&&m&&M.jsx(Qp,{workflow:U,top:m.top,height:m.height,activeSessionId:T.activeSessionId,boundWorkflowPath:x,macros:S.macros,onBind:()=>W(U.path),onRunMacro:Y=>X(U,Y)})}),M.jsx("div",{className:"pane-resize-handle pane-resize-handle-rail",style:{left:n.rail+32},onPointerDown:l,onDoubleClick:C,role:"separator","aria-orientation":"vertical","aria-label":"Resize workspace rail","data-testid":"resize-handle-rail"}),M.jsxs("div",{className:"center-pane",children:[M.jsx(xp,{sessions:S.sessions,activeSessionId:T.activeSessionId,onSelectSession:T.setActiveSessionId,onResumeHistory:Y=>void T.resumeFromHistory(Y),history:T.history,historyLoading:T.historyLoading,onOpenHistory:Y=>void T.loadHistory(Y),recentDirs:((A=T.settings)==null?void 0:A.recentDirs)??[],launchDir:S.launchDir??null,listDir:T.listDir,onCreateSession:J,boundWorkflowName:(B==null?void 0:B.name)??null,authenticated:S.authenticated,organizationName:S.organizationName,telemetryOptIn:((O=T.settings)==null?void 0:O.telemetryOptIn)??S.telemetryOptIn,onToggleTelemetry:async Y=>{await T.updateSettings({telemetryOptIn:Y})},busySessionIds:T.busySessionIds,settingsOpen:le,onSetSettingsOpen:P}),M.jsx("div",{className:"terminal-slot",children:(v==null?void 0:v.status)==="exited"?M.jsx(mp,{session:v,onResume:()=>void T.resumeSession(v.id),onClose:()=>void T.closeSession(v.id)}):T.activeSessionId?M.jsx(bp,{sessionId:T.activeSessionId,harness:(v==null?void 0:v.harness)??"claude-code",api:T.api,showToast:T.showToast,children:M.jsx(Xp,{sessionId:T.activeSessionId,token:T.bootToken})}):N?M.jsx(Zp,{recentDirs:(($=T.settings)==null?void 0:$.recentDirs)??[],launchDir:S.launchDir??null,listDir:T.listDir,onCreateSession:J,onRunSample:async()=>{await T.createSampleSession()},onDismiss:()=>te(!0)}):M.jsx("div",{className:"terminal-empty",children:'No active session — click "+ new" to start one.'})})]}),M.jsx("div",{className:"pane-resize-handle pane-resize-handle-canvas",style:{right:n.canvas},onPointerDown:_,onDoubleClick:w,role:"separator","aria-orientation":"vertical","aria-label":"Resize canvas pane","data-testid":"resize-handle-canvas"}),M.jsxs("div",{className:"right-pane",children:[M.jsxs("div",{className:"right-pane-tabs",role:"tablist","aria-label":"Right pane",children:[M.jsx("button",{role:"tab","aria-selected":h==="canvas",className:"right-pane-tab"+(h==="canvas"?" is-active":""),onClick:()=>p("canvas"),"data-testid":"right-tab-canvas",children:"Canvas"}),M.jsx("button",{role:"tab","aria-selected":h==="skills",className:"right-pane-tab"+(h==="skills"?" is-active":""),onClick:()=>{p("skills"),E(!0)},"data-testid":"right-tab-skills",children:"Skills"})]}),M.jsx("div",{className:"right-pane-panel"+(h==="canvas"?"":" is-hidden"),"data-testid":"right-panel-canvas",children:M.jsx(fp,{sessionId:T.activeSessionId,lastMessage:T.lastMessage,boundWorkflow:B,activeSessionId:T.activeSessionId,macros:S.macros,tasks:T.tasks,onRunMacro:Y=>X(B,Y)})}),(h==="skills"||b)&&M.jsx("div",{className:"right-pane-panel"+(h==="skills"?"":" is-hidden"),"data-testid":"right-panel-skills",children:M.jsx(Lp,{listSkills:o,getSkill:c,isActive:h==="skills",activeSession:v,onUseSkill:(Y,F)=>void T.useSkill(Y,F)})})]})]}),q&&M.jsx(vp,{sessions:S.sessions,workflows:S.workflows,recentDirs:((se=T.settings)==null?void 0:se.recentDirs)??[],listDir:T.listDir,onSelectSession:T.setActiveSessionId,onOpenPath:Y=>void J(Y,"claude-code"),onClose:()=>G(!1)}),T.toast&&M.jsx($p,{message:T.toast,onDismiss:T.dismissToast})]})};window.addEventListener("scroll",()=>{(window.scrollX!==0||window.scrollY!==0)&&window.scrollTo(0,0)},{passive:!0});Gv.createRoot(document.getElementById("root")).render(M.jsx(ae.StrictMode,{children:M.jsx(hg,{})}));