@sapiom/harness 0.1.5 → 0.1.6

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 (86) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cli/bin.js +24 -7
  3. package/dist/cli/bin.js.map +1 -1
  4. package/dist/cli/consent.js +1 -1
  5. package/dist/core/adapters/adapter.d.ts +2 -2
  6. package/dist/core/api-key-provider.d.ts +79 -0
  7. package/dist/core/api-key-provider.d.ts.map +1 -0
  8. package/dist/core/api-key-provider.js +91 -0
  9. package/dist/core/api-key-provider.js.map +1 -0
  10. package/dist/core/canvas-run-state.d.ts +9 -5
  11. package/dist/core/canvas-run-state.d.ts.map +1 -1
  12. package/dist/core/canvas-run-state.js +42 -13
  13. package/dist/core/canvas-run-state.js.map +1 -1
  14. package/dist/core/definition-slug-resolver.d.ts +13 -0
  15. package/dist/core/definition-slug-resolver.d.ts.map +1 -1
  16. package/dist/core/definition-slug-resolver.js +29 -0
  17. package/dist/core/definition-slug-resolver.js.map +1 -1
  18. package/dist/core/render-local-run.d.ts +82 -0
  19. package/dist/core/render-local-run.d.ts.map +1 -0
  20. package/dist/core/render-local-run.js +105 -0
  21. package/dist/core/render-local-run.js.map +1 -0
  22. package/dist/core/render-log-slice.d.ts +30 -0
  23. package/dist/core/render-log-slice.d.ts.map +1 -0
  24. package/dist/core/render-log-slice.js +49 -0
  25. package/dist/core/render-log-slice.js.map +1 -0
  26. package/dist/core/render-run-state.d.ts.map +1 -1
  27. package/dist/core/render-run-state.js +30 -49
  28. package/dist/core/render-run-state.js.map +1 -1
  29. package/dist/core/run-local-bootstrap.d.ts +93 -0
  30. package/dist/core/run-local-bootstrap.d.ts.map +1 -0
  31. package/dist/core/run-local-bootstrap.js +155 -0
  32. package/dist/core/run-local-bootstrap.js.map +1 -0
  33. package/dist/core/run-state.d.ts +16 -1
  34. package/dist/core/run-state.d.ts.map +1 -1
  35. package/dist/core/run-state.js +75 -25
  36. package/dist/core/run-state.js.map +1 -1
  37. package/dist/core/stub-feedback.d.ts +52 -0
  38. package/dist/core/stub-feedback.d.ts.map +1 -0
  39. package/dist/core/stub-feedback.js +33 -0
  40. package/dist/core/stub-feedback.js.map +1 -0
  41. package/dist/server/actions.d.ts +139 -0
  42. package/dist/server/actions.d.ts.map +1 -0
  43. package/dist/server/actions.js +430 -0
  44. package/dist/server/actions.js.map +1 -0
  45. package/dist/server/auth-routes.d.ts +92 -0
  46. package/dist/server/auth-routes.d.ts.map +1 -0
  47. package/dist/server/auth-routes.js +151 -0
  48. package/dist/server/auth-routes.js.map +1 -0
  49. package/dist/server/index.d.ts.map +1 -1
  50. package/dist/server/index.js +0 -0
  51. package/dist/server/index.js.map +1 -1
  52. package/dist/server/rest.d.ts.map +1 -1
  53. package/dist/server/rest.js +0 -2
  54. package/dist/server/rest.js.map +1 -1
  55. package/dist/server/runs.d.ts +16 -15
  56. package/dist/server/runs.d.ts.map +1 -1
  57. package/dist/server/runs.js +15 -80
  58. package/dist/server/runs.js.map +1 -1
  59. package/dist/server/static.d.ts +15 -1
  60. package/dist/server/static.d.ts.map +1 -1
  61. package/dist/server/static.js +54 -4
  62. package/dist/server/static.js.map +1 -1
  63. package/dist/shared/types.d.ts +79 -35
  64. package/dist/shared/types.d.ts.map +1 -1
  65. package/dist/shared/types.js.map +1 -1
  66. package/dist/web/assets/index-DCtyI4VW.css +32 -0
  67. package/dist/web/assets/index-WSw5RvYR.js +445 -0
  68. package/dist/web/canvas/sess-boot/index.html +305 -0
  69. package/dist/web/index.html +4 -9
  70. package/dist/web/welcome-hero-dark.png +0 -0
  71. package/dist/web/welcome-hero-light.png +0 -0
  72. package/package.json +6 -3
  73. package/dist/core/run-spend.d.ts +0 -55
  74. package/dist/core/run-spend.d.ts.map +0 -1
  75. package/dist/core/run-spend.js +0 -109
  76. package/dist/core/run-spend.js.map +0 -1
  77. package/dist/core/run-transactions.d.ts +0 -60
  78. package/dist/core/run-transactions.d.ts.map +0 -1
  79. package/dist/core/run-transactions.js +0 -129
  80. package/dist/core/run-transactions.js.map +0 -1
  81. package/dist/server/skills.d.ts +0 -51
  82. package/dist/server/skills.d.ts.map +0 -1
  83. package/dist/server/skills.js +0 -312
  84. package/dist/server/skills.js.map +0 -1
  85. package/dist/web/assets/index-DM84J83Y.js +0 -234
  86. package/dist/web/assets/index-DemtWW4L.css +0 -32
@@ -0,0 +1,445 @@
1
+ var z_=Object.defineProperty;var U_=(h,b,M)=>b in h?z_(h,b,{enumerable:!0,configurable:!0,writable:!0,value:M}):h[b]=M;var lc=(h,b,M)=>U_(h,typeof b!="symbol"?b+"":b,M);(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const U of document.querySelectorAll('link[rel="modulepreload"]'))x(U);new MutationObserver(U=>{for(const K of U)if(K.type==="childList")for(const H of K.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&x(H)}).observe(document,{childList:!0,subtree:!0});function M(U){const K={};return U.integrity&&(K.integrity=U.integrity),U.referrerPolicy&&(K.referrerPolicy=U.referrerPolicy),U.crossOrigin==="use-credentials"?K.credentials="include":U.crossOrigin==="anonymous"?K.credentials="omit":K.credentials="same-origin",K}function x(U){if(U.ep)return;U.ep=!0;const K=M(U);fetch(U.href,K)}})();var oc={exports:{}},Ea={};/**
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 xf;function I_(){if(xf)return Ea;xf=1;var h=Symbol.for("react.transitional.element"),b=Symbol.for("react.fragment");function M(x,U,K){var H=null;if(K!==void 0&&(H=""+K),U.key!==void 0&&(H=""+U.key),"key"in U){K={};for(var c in U)c!=="key"&&(K[c]=U[c])}else K=U;return U=K.ref,{$$typeof:h,type:x,key:H,ref:U!==void 0?U:null,props:K}}return Ea.Fragment=b,Ea.jsx=M,Ea.jsxs=M,Ea}var Ef;function q_(){return Ef||(Ef=1,oc.exports=I_()),oc.exports}var a=q_(),cc={exports:{}},Oe={};/**
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 kf;function $_(){if(kf)return Oe;kf=1;var h=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),H=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),_=Symbol.iterator;function C(T){return T===null||typeof T!="object"?null:(T=_&&T[_]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,d={};function f(T,O,Z){this.props=T,this.context=O,this.refs=d,this.updater=Z||w}f.prototype.isReactComponent={},f.prototype.setState=function(T,O){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,O,"setState")},f.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function r(){}r.prototype=f.prototype;function u(T,O,Z){this.props=T,this.context=O,this.refs=d,this.updater=Z||w}var S=u.prototype=new r;S.constructor=u,g(S,f.prototype),S.isPureReactComponent=!0;var A=Array.isArray;function E(){}var R={H:null,A:null,T:null,S:null},y=Object.prototype.hasOwnProperty;function D(T,O,Z){var ae=Z.ref;return{$$typeof:h,type:T,key:O,ref:ae!==void 0?ae:null,props:Z}}function I(T,O){return D(T.type,O,T.props)}function P(T){return typeof T=="object"&&T!==null&&T.$$typeof===h}function $(T){var O={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(Z){return O[Z]})}var z=/\/+/g;function Q(T,O){return typeof T=="object"&&T!==null&&T.key!=null?$(""+T.key):O.toString(36)}function ne(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(E,E):(T.status="pending",T.then(function(O){T.status==="pending"&&(T.status="fulfilled",T.value=O)},function(O){T.status==="pending"&&(T.status="rejected",T.reason=O)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function F(T,O,Z,ae,_e){var ge=typeof T;(ge==="undefined"||ge==="boolean")&&(T=null);var X=!1;if(T===null)X=!0;else switch(ge){case"bigint":case"string":case"number":X=!0;break;case"object":switch(T.$$typeof){case h:case b:X=!0;break;case v:return X=T._init,F(X(T._payload),O,Z,ae,_e)}}if(X)return _e=_e(T),X=ae===""?"."+Q(T,0):ae,A(_e)?(Z="",X!=null&&(Z=X.replace(z,"$&/")+"/"),F(_e,O,Z,"",function(le){return le})):_e!=null&&(P(_e)&&(_e=I(_e,Z+(_e.key==null||T&&T.key===_e.key?"":(""+_e.key).replace(z,"$&/")+"/")+X)),O.push(_e)),1;X=0;var N=ae===""?".":ae+":";if(A(T))for(var ce=0;ce<T.length;ce++)ae=T[ce],ge=N+Q(ae,ce),X+=F(ae,O,Z,ge,_e);else if(ce=C(T),typeof ce=="function")for(T=ce.call(T),ce=0;!(ae=T.next()).done;)ae=ae.value,ge=N+Q(ae,ce++),X+=F(ae,O,Z,ge,_e);else if(ge==="object"){if(typeof T.then=="function")return F(ne(T),O,Z,ae,_e);throw O=String(T),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return X}function W(T,O,Z){if(T==null)return T;var ae=[],_e=0;return F(T,ae,"","",function(ge){return O.call(Z,ge,_e++)}),ae}function Y(T){if(T._status===-1){var O=T._result;O=O(),O.then(function(Z){(T._status===0||T._status===-1)&&(T._status=1,T._result=Z)},function(Z){(T._status===0||T._status===-1)&&(T._status=2,T._result=Z)}),T._status===-1&&(T._status=0,T._result=O)}if(T._status===1)return T._result.default;throw T._result}var j=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},B={map:W,forEach:function(T,O,Z){W(T,function(){O.apply(this,arguments)},Z)},count:function(T){var O=0;return W(T,function(){O++}),O},toArray:function(T){return W(T,function(O){return O})||[]},only:function(T){if(!P(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Oe.Activity=l,Oe.Children=B,Oe.Component=f,Oe.Fragment=M,Oe.Profiler=U,Oe.PureComponent=u,Oe.StrictMode=x,Oe.Suspense=p,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(T){return R.H.useMemoCache(T)}},Oe.cache=function(T){return function(){return T.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(T,O,Z){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ae=g({},T.props),_e=T.key;if(O!=null)for(ge in O.key!==void 0&&(_e=""+O.key),O)!y.call(O,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&O.ref===void 0||(ae[ge]=O[ge]);var ge=arguments.length-2;if(ge===1)ae.children=Z;else if(1<ge){for(var X=Array(ge),N=0;N<ge;N++)X[N]=arguments[N+2];ae.children=X}return D(T.type,_e,ae)},Oe.createContext=function(T){return T={$$typeof:H,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:K,_context:T},T},Oe.createElement=function(T,O,Z){var ae,_e={},ge=null;if(O!=null)for(ae in O.key!==void 0&&(ge=""+O.key),O)y.call(O,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(_e[ae]=O[ae]);var X=arguments.length-2;if(X===1)_e.children=Z;else if(1<X){for(var N=Array(X),ce=0;ce<X;ce++)N[ce]=arguments[ce+2];_e.children=N}if(T&&T.defaultProps)for(ae in X=T.defaultProps,X)_e[ae]===void 0&&(_e[ae]=X[ae]);return D(T,ge,_e)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(T){return{$$typeof:c,render:T}},Oe.isValidElement=P,Oe.lazy=function(T){return{$$typeof:v,_payload:{_status:-1,_result:T},_init:Y}},Oe.memo=function(T,O){return{$$typeof:m,type:T,compare:O===void 0?null:O}},Oe.startTransition=function(T){var O=R.T,Z={};R.T=Z;try{var ae=T(),_e=R.S;_e!==null&&_e(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(E,j)}catch(ge){j(ge)}finally{O!==null&&Z.types!==null&&(O.types=Z.types),R.T=O}},Oe.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Oe.use=function(T){return R.H.use(T)},Oe.useActionState=function(T,O,Z){return R.H.useActionState(T,O,Z)},Oe.useCallback=function(T,O){return R.H.useCallback(T,O)},Oe.useContext=function(T){return R.H.useContext(T)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(T,O){return R.H.useDeferredValue(T,O)},Oe.useEffect=function(T,O){return R.H.useEffect(T,O)},Oe.useEffectEvent=function(T){return R.H.useEffectEvent(T)},Oe.useId=function(){return R.H.useId()},Oe.useImperativeHandle=function(T,O,Z){return R.H.useImperativeHandle(T,O,Z)},Oe.useInsertionEffect=function(T,O){return R.H.useInsertionEffect(T,O)},Oe.useLayoutEffect=function(T,O){return R.H.useLayoutEffect(T,O)},Oe.useMemo=function(T,O){return R.H.useMemo(T,O)},Oe.useOptimistic=function(T,O){return R.H.useOptimistic(T,O)},Oe.useReducer=function(T,O,Z){return R.H.useReducer(T,O,Z)},Oe.useRef=function(T){return R.H.useRef(T)},Oe.useState=function(T){return R.H.useState(T)},Oe.useSyncExternalStore=function(T,O,Z){return R.H.useSyncExternalStore(T,O,Z)},Oe.useTransition=function(){return R.H.useTransition()},Oe.version="19.2.7",Oe}var Af;function kc(){return Af||(Af=1,cc.exports=$_()),cc.exports}var q=kc(),uc={exports:{}},ka={},hc={exports:{}},dc={};/**
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 Df;function P_(){return Df||(Df=1,(function(h){function b(F,W){var Y=F.length;F.push(W);e:for(;0<Y;){var j=Y-1>>>1,B=F[j];if(0<U(B,W))F[j]=W,F[Y]=B,Y=j;else break e}}function M(F){return F.length===0?null:F[0]}function x(F){if(F.length===0)return null;var W=F[0],Y=F.pop();if(Y!==W){F[0]=Y;e:for(var j=0,B=F.length,T=B>>>1;j<T;){var O=2*(j+1)-1,Z=F[O],ae=O+1,_e=F[ae];if(0>U(Z,Y))ae<B&&0>U(_e,Z)?(F[j]=_e,F[ae]=Y,j=ae):(F[j]=Z,F[O]=Y,j=O);else if(ae<B&&0>U(_e,Y))F[j]=_e,F[ae]=Y,j=ae;else break e}}return W}function U(F,W){var Y=F.sortIndex-W.sortIndex;return Y!==0?Y:F.id-W.id}if(h.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var K=performance;h.unstable_now=function(){return K.now()}}else{var H=Date,c=H.now();h.unstable_now=function(){return H.now()-c}}var p=[],m=[],v=1,l=null,_=3,C=!1,w=!1,g=!1,d=!1,f=typeof setTimeout=="function"?setTimeout:null,r=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;function S(F){for(var W=M(m);W!==null;){if(W.callback===null)x(m);else if(W.startTime<=F)x(m),W.sortIndex=W.expirationTime,b(p,W);else break;W=M(m)}}function A(F){if(g=!1,S(F),!w)if(M(p)!==null)w=!0,E||(E=!0,$());else{var W=M(m);W!==null&&ne(A,W.startTime-F)}}var E=!1,R=-1,y=5,D=-1;function I(){return d?!0:!(h.unstable_now()-D<y)}function P(){if(d=!1,E){var F=h.unstable_now();D=F;var W=!0;try{e:{w=!1,g&&(g=!1,r(R),R=-1),C=!0;var Y=_;try{t:{for(S(F),l=M(p);l!==null&&!(l.expirationTime>F&&I());){var j=l.callback;if(typeof j=="function"){l.callback=null,_=l.priorityLevel;var B=j(l.expirationTime<=F);if(F=h.unstable_now(),typeof B=="function"){l.callback=B,S(F),W=!0;break t}l===M(p)&&x(p),S(F)}else x(p);l=M(p)}if(l!==null)W=!0;else{var T=M(m);T!==null&&ne(A,T.startTime-F),W=!1}}break e}finally{l=null,_=Y,C=!1}W=void 0}}finally{W?$():E=!1}}}var $;if(typeof u=="function")$=function(){u(P)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,Q=z.port2;z.port1.onmessage=P,$=function(){Q.postMessage(null)}}else $=function(){f(P,0)};function ne(F,W){R=f(function(){F(h.unstable_now())},W)}h.unstable_IdlePriority=5,h.unstable_ImmediatePriority=1,h.unstable_LowPriority=4,h.unstable_NormalPriority=3,h.unstable_Profiling=null,h.unstable_UserBlockingPriority=2,h.unstable_cancelCallback=function(F){F.callback=null},h.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<F?Math.floor(1e3/F):5},h.unstable_getCurrentPriorityLevel=function(){return _},h.unstable_next=function(F){switch(_){case 1:case 2:case 3:var W=3;break;default:W=_}var Y=_;_=W;try{return F()}finally{_=Y}},h.unstable_requestPaint=function(){d=!0},h.unstable_runWithPriority=function(F,W){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Y=_;_=F;try{return W()}finally{_=Y}},h.unstable_scheduleCallback=function(F,W,Y){var j=h.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?j+Y:j):Y=j,F){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=Y+B,F={id:v++,callback:W,priorityLevel:F,startTime:Y,expirationTime:B,sortIndex:-1},Y>j?(F.sortIndex=Y,b(m,F),M(p)===null&&F===M(m)&&(g?(r(R),R=-1):g=!0,ne(A,Y-j))):(F.sortIndex=B,b(p,F),w||C||(w=!0,E||(E=!0,$()))),F},h.unstable_shouldYield=I,h.unstable_wrapCallback=function(F){var W=_;return function(){var Y=_;_=W;try{return F.apply(this,arguments)}finally{_=Y}}}})(dc)),dc}var Rf;function W_(){return Rf||(Rf=1,hc.exports=P_()),hc.exports}var fc={exports:{}},Wt={};/**
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 Tf;function F_(){if(Tf)return Wt;Tf=1;var h=kc();function b(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function M(){}var x={d:{f:M,r:function(){throw Error(b(522))},D:M,C:M,L:M,m:M,X:M,S:M,M},p:0,findDOMNode:null},U=Symbol.for("react.portal");function K(p,m,v){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:l==null?null:""+l,children:p,containerInfo:m,implementation:v}}var H=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,Wt.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(b(299));return K(p,m,null,v)},Wt.flushSync=function(p){var m=H.T,v=x.p;try{if(H.T=null,x.p=2,p)return p()}finally{H.T=m,x.p=v,x.d.f()}},Wt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,x.d.C(p,m))},Wt.prefetchDNS=function(p){typeof p=="string"&&x.d.D(p)},Wt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,l=c(v,m.crossOrigin),_=typeof m.integrity=="string"?m.integrity:void 0,C=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?x.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:l,integrity:_,fetchPriority:C}):v==="script"&&x.d.X(p,{crossOrigin:l,integrity:_,fetchPriority:C,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Wt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=c(m.as,m.crossOrigin);x.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&x.d.M(p)},Wt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,l=c(v,m.crossOrigin);x.d.L(p,v,{crossOrigin:l,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Wt.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=c(m.as,m.crossOrigin);x.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else x.d.m(p)},Wt.requestFormReset=function(p){x.d.r(p)},Wt.unstable_batchedUpdates=function(p,m){return p(m)},Wt.useFormState=function(p,m,v){return H.H.useFormState(p,m,v)},Wt.useFormStatus=function(){return H.H.useHostTransitionStatus()},Wt.version="19.2.7",Wt}var Mf;function ap(){if(Mf)return fc.exports;Mf=1;function h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h)}catch(b){console.error(b)}}return h(),fc.exports=F_(),fc.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 jf;function Y_(){if(jf)return ka;jf=1;var h=W_(),b=kc(),M=ap();function x(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 U(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function K(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function H(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 c(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 p(e){if(K(e)!==e)throw Error(x(188))}function m(e){var t=e.alternate;if(!t){if(t=K(e),t===null)throw Error(x(188));return t!==e?null:e}for(var s=e,i=t;;){var n=s.return;if(n===null)break;var o=n.alternate;if(o===null){if(i=n.return,i!==null){s=i;continue}break}if(n.child===o.child){for(o=n.child;o;){if(o===s)return p(n),e;if(o===i)return p(n),t;o=o.sibling}throw Error(x(188))}if(s.return!==i.return)s=n,i=o;else{for(var k=!1,L=n.child;L;){if(L===s){k=!0,s=n,i=o;break}if(L===i){k=!0,i=n,s=o;break}L=L.sibling}if(!k){for(L=o.child;L;){if(L===s){k=!0,s=o,i=n;break}if(L===i){k=!0,i=o,s=n;break}L=L.sibling}if(!k)throw Error(x(189))}}if(s.alternate!==i)throw Error(x(190))}if(s.tag!==3)throw Error(x(188));return s.stateNode.current===s?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var l=Object.assign,_=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),u=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var z=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case f:return"Profiler";case d:return"StrictMode";case A:return"Suspense";case E:return"SuspenseList";case D:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case u:return e.displayName||"Context";case r:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case y:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var ne=Array.isArray,F=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=M.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},j=[],B=-1;function T(e){return{current:e}}function O(e){0>B||(e.current=j[B],j[B]=null,B--)}function Z(e,t){B++,j[B]=e.current,e.current=t}var ae=T(null),_e=T(null),ge=T(null),X=T(null);function N(e,t){switch(Z(ge,t),Z(_e,e),Z(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yd(t),e=Kd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(ae),Z(ae,e)}function ce(){O(ae),O(_e),O(ge)}function le(e){e.memoizedState!==null&&Z(X,e);var t=ae.current,s=Kd(t,e.type);t!==s&&(Z(_e,e),Z(ae,s))}function ye(e){_e.current===e&&(O(ae),O(_e)),X.current===e&&(O(X),ba._currentValue=Y)}var be,je;function Le(e){if(be===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",je=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+be+e+je}var Be=!1;function Ye(e,t){if(!e||Be)return"";Be=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(oe){var re=oe}Reflect.construct(e,[],me)}else{try{me.call()}catch(oe){re=oe}e.call(me.prototype)}}else{try{throw Error()}catch(oe){re=oe}(me=e())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(oe){if(oe&&re&&typeof oe.stack=="string")return[oe.stack,re.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),k=o[0],L=o[1];if(k&&L){var G=k.split(`
44
+ `),se=L.split(`
45
+ `);for(n=i=0;i<G.length&&!G[i].includes("DetermineComponentFrameRoot");)i++;for(;n<se.length&&!se[n].includes("DetermineComponentFrameRoot");)n++;if(i===G.length||n===se.length)for(i=G.length-1,n=se.length-1;1<=i&&0<=n&&G[i]!==se[n];)n--;for(;1<=i&&0<=n;i--,n--)if(G[i]!==se[n]){if(i!==1||n!==1)do if(i--,n--,0>n||G[i]!==se[n]){var he=`
46
+ `+G[i].replace(" at new "," at ");return e.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",e.displayName)),he}while(1<=i&&0<=n);break}}}finally{Be=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Le(s):""}function Ae(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 Ye(e.type,!1);case 11:return Ye(e.type.render,!1);case 1:return Ye(e.type,!0);case 31:return Le("Activity");default:return""}}function jt(e){try{var t="",s=null;do t+=Ae(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var ft=Object.prototype.hasOwnProperty,Lt=h.unstable_scheduleCallback,mt=h.unstable_cancelCallback,Ft=h.unstable_shouldYield,Ce=h.unstable_requestPaint,Ie=h.unstable_now,Ke=h.unstable_getCurrentPriorityLevel,rt=h.unstable_ImmediatePriority,Ze=h.unstable_UserBlockingPriority,ct=h.unstable_NormalPriority,Xt=h.unstable_LowPriority,xt=h.unstable_IdlePriority,Vt=h.log,Ge=h.unstable_setDisableYieldValue,Tt=null,yt=null;function st(e){if(typeof Vt=="function"&&Ge(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Tt,e)}catch{}}var vt=Math.clz32?Math.clz32:ee,ue=Math.log,we=Math.LN2;function ee(e){return e>>>=0,e===0?32:31-(ue(e)/we|0)|0}var ie=256,de=262144,ve=4194304;function Ee(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 Nt(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var n=0,o=e.suspendedLanes,k=e.pingedLanes;e=e.warmLanes;var L=i&134217727;return L!==0?(i=L&~o,i!==0?n=Ee(i):(k&=L,k!==0?n=Ee(k):s||(s=L&~e,s!==0&&(n=Ee(s))))):(L=i&~o,L!==0?n=Ee(L):k!==0?n=Ee(k):s||(s=i&~e,s!==0&&(n=Ee(s)))),n===0?0:t!==0&&t!==n&&(t&o)===0&&(o=n&-n,s=t&-t,o>=s||o===32&&(s&4194048)!==0)?t:n}function Yt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ot(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 Ot(){var e=ve;return ve<<=1,(ve&62914560)===0&&(ve=4194304),e}function ai(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function fs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Es(e,t,s,i,n,o){var k=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var L=e.entanglements,G=e.expirationTimes,se=e.hiddenUpdates;for(s=k&~s;0<s;){var he=31-vt(s),me=1<<he;L[he]=0,G[he]=-1;var re=se[he];if(re!==null)for(se[he]=null,he=0;he<re.length;he++){var oe=re[he];oe!==null&&(oe.lane&=-536870913)}s&=~me}i!==0&&Qe(e,i,0),o!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=o&~(k&~t))}function Qe(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-vt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function is(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-vt(s),n=1<<i;n&t|e[i]&t&&(e[i]|=t),s&=~n}}function ns(e,t){var s=t&-t;return s=(s&42)!==0?1:Hs(s),(s&(e.suspendedLanes|t))!==0?0:s}function Hs(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 ps(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Bn(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:vf(e.type))}function Ra(e,t){var s=W.p;try{return W.p=e,t()}finally{W.p=s}}var Ms=Math.random().toString(36).slice(2),_t="__reactFiber$"+Ms,Ut="__reactProps$"+Ms,pe="__reactContainer$"+Ms,Re="__reactEvents$"+Ms,He="__reactListeners$"+Ms,bt="__reactHandles$"+Ms,Ne="__reactResources$"+Ms,Bt="__reactMarker$"+Ms;function ks(e){delete e[_t],delete e[Ut],delete e[Re],delete e[He],delete e[bt]}function Kt(e){var t=e[_t];if(t)return t;for(var s=e.parentNode;s;){if(t=s[pe]||s[_t]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=ef(e);e!==null;){if(s=e[_t])return s;e=ef(e)}return t}e=s,s=e.parentNode}return null}function zs(e){if(e=e[_t]||e[pe]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function js(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(x(33))}function Ht(e){var t=e[Ne];return t||(t=e[Ne]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[Bt]=!0}var Ta=new Set,Hn={};function Mi(e,t){Vi(e,t),Vi(e+"Capture",t)}function Vi(e,t){for(Hn[e]=t,e=0;e<t.length;e++)Ta.add(t[e])}var Rp=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]*$"),Bc={},Hc={};function Tp(e){return ft.call(Hc,e)?!0:ft.call(Bc,e)?!1:Rp.test(e)?Hc[e]=!0:(Bc[e]=!0,!1)}function Ma(e,t,s){if(Tp(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function ja(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Us(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function ms(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Mp(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var n=i.get,o=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(k){s=""+k,o.call(this,k)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(k){s=""+k},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Jr(e){if(!e._valueTracker){var t=zc(e)?"checked":"value";e._valueTracker=Mp(e,t,""+e[t])}}function Uc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=zc(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function La(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 jp=/[\n"\\]/g;function _s(e){return e.replace(jp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function el(e,t,s,i,n,o,k,L){e.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.type=k:e.removeAttribute("type"),t!=null?k==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ms(t)):e.value!==""+ms(t)&&(e.value=""+ms(t)):k!=="submit"&&k!=="reset"||e.removeAttribute("value"),t!=null?tl(e,k,ms(t)):s!=null?tl(e,k,ms(s)):i!=null&&e.removeAttribute("value"),n==null&&o!=null&&(e.defaultChecked=!!o),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.name=""+ms(L):e.removeAttribute("name")}function Ic(e,t,s,i,n,o,k,L){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||s!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Jr(e);return}s=s!=null?""+ms(s):"",t=t!=null?""+ms(t):s,L||t===e.value||(e.value=t),e.defaultValue=t}i=i??n,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=L?e.checked:!!i,e.defaultChecked=!!i,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(e.name=k),Jr(e)}function tl(e,t,s){t==="number"&&La(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Zi(e,t,s,i){if(e=e.options,t){t={};for(var n=0;n<s.length;n++)t["$"+s[n]]=!0;for(s=0;s<e.length;s++)n=t.hasOwnProperty("$"+e[s].value),e[s].selected!==n&&(e[s].selected=n),n&&i&&(e[s].defaultSelected=!0)}else{for(s=""+ms(s),t=null,n=0;n<e.length;n++){if(e[n].value===s){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function qc(e,t,s){if(t!=null&&(t=""+ms(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+ms(s):""}function $c(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(x(92));if(ne(i)){if(1<i.length)throw Error(x(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=ms(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Jr(e)}function Qi(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Lp=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 Pc(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||Lp.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Wc(e,t,s){if(t!=null&&typeof t!="object")throw Error(x(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var n in t)i=t[n],t.hasOwnProperty(n)&&s[n]!==i&&Pc(e,n,i)}else for(var o in t)t.hasOwnProperty(o)&&Pc(e,o,t[o])}function sl(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 Np=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"]]),Op=/^[\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 Na(e){return Op.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Is(){}var il=null;function nl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ji=null,en=null;function Fc(e){var t=zs(e);if(t&&(e=t.stateNode)){var s=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(el(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+_s(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var n=i[Ut]||null;if(!n)throw Error(x(90));el(i,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&Uc(i)}break e;case"textarea":qc(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Zi(e,!!s.multiple,t,!1)}}}var al=!1;function Yc(e,t,s){if(al)return e(t,s);al=!0;try{var i=e(t);return i}finally{if(al=!1,(Ji!==null||en!==null)&&(br(),Ji&&(t=Ji,e=en,en=Ji=null,Fc(t),e)))for(t=0;t<e.length;t++)Fc(e[t])}}function zn(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Ut]||null;if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(x(231,t,typeof s));return s}var qs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rl=!1;if(qs)try{var Un={};Object.defineProperty(Un,"passive",{get:function(){rl=!0}}),window.addEventListener("test",Un,Un),window.removeEventListener("test",Un,Un)}catch{rl=!1}var ri=null,ll=null,Oa=null;function Kc(){if(Oa)return Oa;var e,t=ll,s=t.length,i,n="value"in ri?ri.value:ri.textContent,o=n.length;for(e=0;e<s&&t[e]===n[e];e++);var k=s-e;for(i=1;i<=k&&t[s-i]===n[o-i];i++);return Oa=n.slice(e,1<i?1-i:void 0)}function Ba(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 Ha(){return!0}function Gc(){return!1}function Zt(e){function t(s,i,n,o,k){this._reactName=s,this._targetInst=n,this.type=i,this.nativeEvent=o,this.target=k,this.currentTarget=null;for(var L in e)e.hasOwnProperty(L)&&(s=e[L],this[L]=s?s(o):o[L]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ha:Gc,this.isPropagationStopped=Gc,this}return l(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ha)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ha)},persist:function(){},isPersistent:Ha}),t}var ji={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},za=Zt(ji),In=l({},ji,{view:0,detail:0}),Bp=Zt(In),ol,cl,qn,Ua=l({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hl,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!==qn&&(qn&&e.type==="mousemove"?(ol=e.screenX-qn.screenX,cl=e.screenY-qn.screenY):cl=ol=0,qn=e),ol)},movementY:function(e){return"movementY"in e?e.movementY:cl}}),Xc=Zt(Ua),Hp=l({},Ua,{dataTransfer:0}),zp=Zt(Hp),Up=l({},In,{relatedTarget:0}),ul=Zt(Up),Ip=l({},ji,{animationName:0,elapsedTime:0,pseudoElement:0}),qp=Zt(Ip),$p=l({},ji,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pp=Zt($p),Wp=l({},ji,{data:0}),Vc=Zt(Wp),Fp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yp={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"},Kp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kp[e])?!!t[e]:!1}function hl(){return Gp}var Xp=l({},In,{key:function(e){if(e.key){var t=Fp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ba(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hl,charCode:function(e){return e.type==="keypress"?Ba(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ba(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Vp=Zt(Xp),Zp=l({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zc=Zt(Zp),Qp=l({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hl}),Jp=Zt(Qp),em=l({},ji,{propertyName:0,elapsedTime:0,pseudoElement:0}),tm=Zt(em),sm=l({},Ua,{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}),im=Zt(sm),nm=l({},ji,{newState:0,oldState:0}),am=Zt(nm),rm=[9,13,27,32],dl=qs&&"CompositionEvent"in window,$n=null;qs&&"documentMode"in document&&($n=document.documentMode);var lm=qs&&"TextEvent"in window&&!$n,Qc=qs&&(!dl||$n&&8<$n&&11>=$n),Jc=" ",eu=!1;function tu(e,t){switch(e){case"keyup":return rm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function su(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tn=!1;function om(e,t){switch(e){case"compositionend":return su(t);case"keypress":return t.which!==32?null:(eu=!0,Jc);case"textInput":return e=t.data,e===Jc&&eu?null:e;default:return null}}function cm(e,t){if(tn)return e==="compositionend"||!dl&&tu(e,t)?(e=Kc(),Oa=ll=ri=null,tn=!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 Qc&&t.locale!=="ko"?null:t.data;default:return null}}var um={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 iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!um[e.type]:t==="textarea"}function nu(e,t,s,i){Ji?en?en.push(i):en=[i]:Ji=i,t=Dr(t,"onChange"),0<t.length&&(s=new za("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Pn=null,Wn=null;function hm(e){Id(e,0)}function Ia(e){var t=js(e);if(Uc(t))return e}function au(e,t){if(e==="change")return t}var ru=!1;if(qs){var fl;if(qs){var pl="oninput"in document;if(!pl){var lu=document.createElement("div");lu.setAttribute("oninput","return;"),pl=typeof lu.oninput=="function"}fl=pl}else fl=!1;ru=fl&&(!document.documentMode||9<document.documentMode)}function ou(){Pn&&(Pn.detachEvent("onpropertychange",cu),Wn=Pn=null)}function cu(e){if(e.propertyName==="value"&&Ia(Wn)){var t=[];nu(t,Wn,e,nl(e)),Yc(hm,t)}}function dm(e,t,s){e==="focusin"?(ou(),Pn=t,Wn=s,Pn.attachEvent("onpropertychange",cu)):e==="focusout"&&ou()}function fm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ia(Wn)}function pm(e,t){if(e==="click")return Ia(t)}function mm(e,t){if(e==="input"||e==="change")return Ia(t)}function _m(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var as=typeof Object.is=="function"?Object.is:_m;function Fn(e,t){if(as(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var n=s[i];if(!ft.call(t,n)||!as(e[n],t[n]))return!1}return!0}function uu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hu(e,t){var s=uu(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=uu(s)}}function du(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?du(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=La(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=La(e.document)}return t}function ml(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 vm=qs&&"documentMode"in document&&11>=document.documentMode,sn=null,_l=null,Yn=null,vl=!1;function pu(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;vl||sn==null||sn!==La(i)||(i=sn,"selectionStart"in i&&ml(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Yn&&Fn(Yn,i)||(Yn=i,i=Dr(_l,"onSelect"),0<i.length&&(t=new za("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=sn)))}function Li(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var nn={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},gl={},mu={};qs&&(mu=document.createElement("div").style,"AnimationEvent"in window||(delete nn.animationend.animation,delete nn.animationiteration.animation,delete nn.animationstart.animation),"TransitionEvent"in window||delete nn.transitionend.transition);function Ni(e){if(gl[e])return gl[e];if(!nn[e])return e;var t=nn[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in mu)return gl[e]=t[s];return e}var _u=Ni("animationend"),vu=Ni("animationiteration"),gu=Ni("animationstart"),gm=Ni("transitionrun"),Sm=Ni("transitionstart"),ym=Ni("transitioncancel"),Su=Ni("transitionend"),yu=new Map,Sl="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(" ");Sl.push("scrollEnd");function As(e,t){yu.set(e,t),Mi(t,[e])}var qa=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)},vs=[],an=0,yl=0;function $a(){for(var e=an,t=yl=an=0;t<e;){var s=vs[t];vs[t++]=null;var i=vs[t];vs[t++]=null;var n=vs[t];vs[t++]=null;var o=vs[t];if(vs[t++]=null,i!==null&&n!==null){var k=i.pending;k===null?n.next=n:(n.next=k.next,k.next=n),i.pending=n}o!==0&&bu(s,n,o)}}function Pa(e,t,s,i){vs[an++]=e,vs[an++]=t,vs[an++]=s,vs[an++]=i,yl|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function bl(e,t,s,i){return Pa(e,t,s,i),Wa(e)}function Oi(e,t){return Pa(e,null,null,t),Wa(e)}function bu(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var n=!1,o=e.return;o!==null;)o.childLanes|=s,i=o.alternate,i!==null&&(i.childLanes|=s),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(n=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,n&&t!==null&&(n=31-vt(s),e=o.hiddenUpdates,i=e[n],i===null?e[n]=[t]:i.push(t),t.lane=s|536870912),o):null}function Wa(e){if(50<pa)throw pa=0,Mo=null,Error(x(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rn={};function bm(e,t,s,i){this.tag=e,this.key=s,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rs(e,t,s,i){return new bm(e,t,s,i)}function Cl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $s(e,t){var s=e.alternate;return s===null?(s=rs(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Cu(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fa(e,t,s,i,n,o){var k=0;if(i=e,typeof e=="function")Cl(e)&&(k=1);else if(typeof e=="string")k=k_(e,s,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case D:return e=rs(31,s,t,n),e.elementType=D,e.lanes=o,e;case g:return Bi(s.children,n,o,t);case d:k=8,n|=24;break;case f:return e=rs(12,s,t,n|2),e.elementType=f,e.lanes=o,e;case A:return e=rs(13,s,t,n),e.elementType=A,e.lanes=o,e;case E:return e=rs(19,s,t,n),e.elementType=E,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case u:k=10;break e;case r:k=9;break e;case S:k=11;break e;case R:k=14;break e;case y:k=16,i=null;break e}k=29,s=Error(x(130,e===null?"null":typeof e,"")),i=null}return t=rs(k,s,t,n),t.elementType=e,t.type=i,t.lanes=o,t}function Bi(e,t,s,i){return e=rs(7,e,i,t),e.lanes=s,e}function wl(e,t,s){return e=rs(6,e,null,t),e.lanes=s,e}function wu(e){var t=rs(18,null,null,0);return t.stateNode=e,t}function xl(e,t,s){return t=rs(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xu=new WeakMap;function gs(e,t){if(typeof e=="object"&&e!==null){var s=xu.get(e);return s!==void 0?s:(t={value:e,source:t,stack:jt(t)},xu.set(e,t),t)}return{value:e,source:t,stack:jt(t)}}var ln=[],on=0,Ya=null,Kn=0,Ss=[],ys=0,li=null,Ls=1,Ns="";function Ps(e,t){ln[on++]=Kn,ln[on++]=Ya,Ya=e,Kn=t}function Eu(e,t,s){Ss[ys++]=Ls,Ss[ys++]=Ns,Ss[ys++]=li,li=e;var i=Ls;e=Ns;var n=32-vt(i)-1;i&=~(1<<n),s+=1;var o=32-vt(t)+n;if(30<o){var k=n-n%5;o=(i&(1<<k)-1).toString(32),i>>=k,n-=k,Ls=1<<32-vt(t)+n|s<<n|i,Ns=o+e}else Ls=1<<o|s<<n|i,Ns=e}function El(e){e.return!==null&&(Ps(e,1),Eu(e,1,0))}function kl(e){for(;e===Ya;)Ya=ln[--on],ln[on]=null,Kn=ln[--on],ln[on]=null;for(;e===li;)li=Ss[--ys],Ss[ys]=null,Ns=Ss[--ys],Ss[ys]=null,Ls=Ss[--ys],Ss[ys]=null}function ku(e,t){Ss[ys++]=Ls,Ss[ys++]=Ns,Ss[ys++]=li,Ls=t.id,Ns=t.overflow,li=e}var It=null,ut=null,Fe=!1,oi=null,bs=!1,Al=Error(x(519));function ci(e){var t=Error(x(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gn(gs(t,e)),Al}function Au(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[_t]=e,t[Ut]=i,s){case"dialog":$e("cancel",t),$e("close",t);break;case"iframe":case"object":case"embed":$e("load",t);break;case"video":case"audio":for(s=0;s<_a.length;s++)$e(_a[s],t);break;case"source":$e("error",t);break;case"img":case"image":case"link":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"input":$e("invalid",t),Ic(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":$e("invalid",t);break;case"textarea":$e("invalid",t),$c(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||Wd(t.textContent,s)?(i.popover!=null&&($e("beforetoggle",t),$e("toggle",t)),i.onScroll!=null&&$e("scroll",t),i.onScrollEnd!=null&&$e("scrollend",t),i.onClick!=null&&(t.onclick=Is),t=!0):t=!1,t||ci(e,!0)}function Du(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:bs=!1;return;case 27:case 3:bs=!0;return;default:It=It.return}}function cn(e){if(e!==It)return!1;if(!Fe)return Du(e),Fe=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Yo(e.type,e.memoizedProps)),s=!s),s&&ut&&ci(e),Du(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));ut=Jd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));ut=Jd(e)}else t===27?(t=ut,wi(e.type)?(e=Zo,Zo=null,ut=e):ut=t):ut=It?ws(e.stateNode.nextSibling):null;return!0}function Hi(){ut=It=null,Fe=!1}function Dl(){var e=oi;return e!==null&&(ts===null?ts=e:ts.push.apply(ts,e),oi=null),e}function Gn(e){oi===null?oi=[e]:oi.push(e)}var Rl=T(null),zi=null,Ws=null;function ui(e,t,s){Z(Rl,t._currentValue),t._currentValue=s}function Fs(e){e._currentValue=Rl.current,O(Rl)}function Tl(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function Ml(e,t,s,i){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var o=n.dependencies;if(o!==null){var k=n.child;o=o.firstContext;e:for(;o!==null;){var L=o;o=n;for(var G=0;G<t.length;G++)if(L.context===t[G]){o.lanes|=s,L=o.alternate,L!==null&&(L.lanes|=s),Tl(o.return,s,e),i||(k=null);break e}o=L.next}}else if(n.tag===18){if(k=n.return,k===null)throw Error(x(341));k.lanes|=s,o=k.alternate,o!==null&&(o.lanes|=s),Tl(k,s,e),k=null}else k=n.child;if(k!==null)k.return=n;else for(k=n;k!==null;){if(k===e){k=null;break}if(n=k.sibling,n!==null){n.return=k.return,k=n;break}k=k.return}n=k}}function un(e,t,s,i){e=null;for(var n=t,o=!1;n!==null;){if(!o){if((n.flags&524288)!==0)o=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var k=n.alternate;if(k===null)throw Error(x(387));if(k=k.memoizedProps,k!==null){var L=n.type;as(n.pendingProps.value,k.value)||(e!==null?e.push(L):e=[L])}}else if(n===X.current){if(k=n.alternate,k===null)throw Error(x(387));k.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(ba):e=[ba])}n=n.return}e!==null&&Ml(t,e,s,i),t.flags|=262144}function Ka(e){for(e=e.firstContext;e!==null;){if(!as(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ui(e){zi=e,Ws=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return Ru(zi,e)}function Ga(e,t){return zi===null&&Ui(e),Ru(e,t)}function Ru(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ws===null){if(e===null)throw Error(x(308));Ws=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ws=Ws.next=t;return s}var Cm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},wm=h.unstable_scheduleCallback,xm=h.unstable_NormalPriority,kt={$$typeof:u,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jl(){return{controller:new Cm,data:new Map,refCount:0}}function Xn(e){e.refCount--,e.refCount===0&&wm(xm,function(){e.controller.abort()})}var Vn=null,Ll=0,hn=0,dn=null;function Em(e,t){if(Vn===null){var s=Vn=[];Ll=0,hn=Ho(),dn={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Ll++,t.then(Tu,Tu),t}function Tu(){if(--Ll===0&&Vn!==null){dn!==null&&(dn.status="fulfilled");var e=Vn;Vn=null,hn=0,dn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function km(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(n){s.push(n)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var n=0;n<s.length;n++)(0,s[n])(t)},function(n){for(i.status="rejected",i.reason=n,n=0;n<s.length;n++)(0,s[n])(void 0)}),i}var Mu=F.S;F.S=function(e,t){pd=Ie(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Em(e,t),Mu!==null&&Mu(e,t)};var Ii=T(null);function Nl(){var e=Ii.current;return e!==null?e:lt.pooledCache}function Xa(e,t){t===null?Z(Ii,Ii.current):Z(Ii,t.pool)}function ju(){var e=Nl();return e===null?null:{parent:kt._currentValue,pool:e}}var fn=Error(x(460)),Ol=Error(x(474)),Va=Error(x(542)),Za={then:function(){}};function Lu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nu(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Is,Is),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bu(e),e;default:if(typeof t.status=="string")t.then(Is,Is);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(x(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=i}},function(i){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bu(e),e}throw $i=t,fn}}function qi(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?($i=s,fn):s}}var $i=null;function Ou(){if($i===null)throw Error(x(459));var e=$i;return $i=null,e}function Bu(e){if(e===fn||e===Va)throw Error(x(483))}var pn=null,Zn=0;function Qa(e){var t=Zn;return Zn+=1,pn===null&&(pn=[]),Nu(pn,e,t)}function Qn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ja(e,t){throw t.$$typeof===_?Error(x(525)):(e=Object.prototype.toString.call(t),Error(x(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Hu(e){function t(J,V){if(e){var te=J.deletions;te===null?(J.deletions=[V],J.flags|=16):te.push(V)}}function s(J,V){if(!e)return null;for(;V!==null;)t(J,V),V=V.sibling;return null}function i(J){for(var V=new Map;J!==null;)J.key!==null?V.set(J.key,J):V.set(J.index,J),J=J.sibling;return V}function n(J,V){return J=$s(J,V),J.index=0,J.sibling=null,J}function o(J,V,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<V?(J.flags|=67108866,V):te):(J.flags|=67108866,V)):(J.flags|=1048576,V)}function k(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function L(J,V,te,fe){return V===null||V.tag!==6?(V=wl(te,J.mode,fe),V.return=J,V):(V=n(V,te),V.return=J,V)}function G(J,V,te,fe){var Te=te.type;return Te===g?he(J,V,te.props.children,fe,te.key):V!==null&&(V.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===y&&qi(Te)===V.type)?(V=n(V,te.props),Qn(V,te),V.return=J,V):(V=Fa(te.type,te.key,te.props,null,J.mode,fe),Qn(V,te),V.return=J,V)}function se(J,V,te,fe){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=xl(te,J.mode,fe),V.return=J,V):(V=n(V,te.children||[]),V.return=J,V)}function he(J,V,te,fe,Te){return V===null||V.tag!==7?(V=Bi(te,J.mode,fe,Te),V.return=J,V):(V=n(V,te),V.return=J,V)}function me(J,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=wl(""+V,J.mode,te),V.return=J,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case C:return te=Fa(V.type,V.key,V.props,null,J.mode,te),Qn(te,V),te.return=J,te;case w:return V=xl(V,J.mode,te),V.return=J,V;case y:return V=qi(V),me(J,V,te)}if(ne(V)||$(V))return V=Bi(V,J.mode,te,null),V.return=J,V;if(typeof V.then=="function")return me(J,Qa(V),te);if(V.$$typeof===u)return me(J,Ga(J,V),te);Ja(J,V)}return null}function re(J,V,te,fe){var Te=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Te!==null?null:L(J,V,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case C:return te.key===Te?G(J,V,te,fe):null;case w:return te.key===Te?se(J,V,te,fe):null;case y:return te=qi(te),re(J,V,te,fe)}if(ne(te)||$(te))return Te!==null?null:he(J,V,te,fe,null);if(typeof te.then=="function")return re(J,V,Qa(te),fe);if(te.$$typeof===u)return re(J,V,Ga(J,te),fe);Ja(J,te)}return null}function oe(J,V,te,fe,Te){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return J=J.get(te)||null,L(V,J,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case C:return J=J.get(fe.key===null?te:fe.key)||null,G(V,J,fe,Te);case w:return J=J.get(fe.key===null?te:fe.key)||null,se(V,J,fe,Te);case y:return fe=qi(fe),oe(J,V,te,fe,Te)}if(ne(fe)||$(fe))return J=J.get(te)||null,he(V,J,fe,Te,null);if(typeof fe.then=="function")return oe(J,V,te,Qa(fe),Te);if(fe.$$typeof===u)return oe(J,V,te,Ga(V,fe),Te);Ja(V,fe)}return null}function xe(J,V,te,fe){for(var Te=null,Xe=null,De=V,Ue=V=0,We=null;De!==null&&Ue<te.length;Ue++){De.index>Ue?(We=De,De=null):We=De.sibling;var Ve=re(J,De,te[Ue],fe);if(Ve===null){De===null&&(De=We);break}e&&De&&Ve.alternate===null&&t(J,De),V=o(Ve,V,Ue),Xe===null?Te=Ve:Xe.sibling=Ve,Xe=Ve,De=We}if(Ue===te.length)return s(J,De),Fe&&Ps(J,Ue),Te;if(De===null){for(;Ue<te.length;Ue++)De=me(J,te[Ue],fe),De!==null&&(V=o(De,V,Ue),Xe===null?Te=De:Xe.sibling=De,Xe=De);return Fe&&Ps(J,Ue),Te}for(De=i(De);Ue<te.length;Ue++)We=oe(De,J,Ue,te[Ue],fe),We!==null&&(e&&We.alternate!==null&&De.delete(We.key===null?Ue:We.key),V=o(We,V,Ue),Xe===null?Te=We:Xe.sibling=We,Xe=We);return e&&De.forEach(function(Di){return t(J,Di)}),Fe&&Ps(J,Ue),Te}function Me(J,V,te,fe){if(te==null)throw Error(x(151));for(var Te=null,Xe=null,De=V,Ue=V=0,We=null,Ve=te.next();De!==null&&!Ve.done;Ue++,Ve=te.next()){De.index>Ue?(We=De,De=null):We=De.sibling;var Di=re(J,De,Ve.value,fe);if(Di===null){De===null&&(De=We);break}e&&De&&Di.alternate===null&&t(J,De),V=o(Di,V,Ue),Xe===null?Te=Di:Xe.sibling=Di,Xe=Di,De=We}if(Ve.done)return s(J,De),Fe&&Ps(J,Ue),Te;if(De===null){for(;!Ve.done;Ue++,Ve=te.next())Ve=me(J,Ve.value,fe),Ve!==null&&(V=o(Ve,V,Ue),Xe===null?Te=Ve:Xe.sibling=Ve,Xe=Ve);return Fe&&Ps(J,Ue),Te}for(De=i(De);!Ve.done;Ue++,Ve=te.next())Ve=oe(De,J,Ue,Ve.value,fe),Ve!==null&&(e&&Ve.alternate!==null&&De.delete(Ve.key===null?Ue:Ve.key),V=o(Ve,V,Ue),Xe===null?Te=Ve:Xe.sibling=Ve,Xe=Ve);return e&&De.forEach(function(H_){return t(J,H_)}),Fe&&Ps(J,Ue),Te}function at(J,V,te,fe){if(typeof te=="object"&&te!==null&&te.type===g&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case C:e:{for(var Te=te.key;V!==null;){if(V.key===Te){if(Te=te.type,Te===g){if(V.tag===7){s(J,V.sibling),fe=n(V,te.props.children),fe.return=J,J=fe;break e}}else if(V.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===y&&qi(Te)===V.type){s(J,V.sibling),fe=n(V,te.props),Qn(fe,te),fe.return=J,J=fe;break e}s(J,V);break}else t(J,V);V=V.sibling}te.type===g?(fe=Bi(te.props.children,J.mode,fe,te.key),fe.return=J,J=fe):(fe=Fa(te.type,te.key,te.props,null,J.mode,fe),Qn(fe,te),fe.return=J,J=fe)}return k(J);case w:e:{for(Te=te.key;V!==null;){if(V.key===Te)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){s(J,V.sibling),fe=n(V,te.children||[]),fe.return=J,J=fe;break e}else{s(J,V);break}else t(J,V);V=V.sibling}fe=xl(te,J.mode,fe),fe.return=J,J=fe}return k(J);case y:return te=qi(te),at(J,V,te,fe)}if(ne(te))return xe(J,V,te,fe);if($(te)){if(Te=$(te),typeof Te!="function")throw Error(x(150));return te=Te.call(te),Me(J,V,te,fe)}if(typeof te.then=="function")return at(J,V,Qa(te),fe);if(te.$$typeof===u)return at(J,V,Ga(J,te),fe);Ja(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(s(J,V.sibling),fe=n(V,te),fe.return=J,J=fe):(s(J,V),fe=wl(te,J.mode,fe),fe.return=J,J=fe),k(J)):s(J,V)}return function(J,V,te,fe){try{Zn=0;var Te=at(J,V,te,fe);return pn=null,Te}catch(De){if(De===fn||De===Va)throw De;var Xe=rs(29,De,null,J.mode);return Xe.lanes=fe,Xe.return=J,Xe}finally{}}}var Pi=Hu(!0),zu=Hu(!1),hi=!1;function Bl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hl(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 di(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fi(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Je&2)!==0){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,t=Wa(e),bu(e,null,s),t}return Pa(e,i,t,s),Wa(e)}function Jn(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,is(e,s)}}function zl(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var n=null,o=null;if(s=s.firstBaseUpdate,s!==null){do{var k={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};o===null?n=o=k:o=o.next=k,s=s.next}while(s!==null);o===null?n=o=t:o=o.next=t}else n=o=t;s={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Ul=!1;function ea(){if(Ul){var e=dn;if(e!==null)throw e}}function ta(e,t,s,i){Ul=!1;var n=e.updateQueue;hi=!1;var o=n.firstBaseUpdate,k=n.lastBaseUpdate,L=n.shared.pending;if(L!==null){n.shared.pending=null;var G=L,se=G.next;G.next=null,k===null?o=se:k.next=se,k=G;var he=e.alternate;he!==null&&(he=he.updateQueue,L=he.lastBaseUpdate,L!==k&&(L===null?he.firstBaseUpdate=se:L.next=se,he.lastBaseUpdate=G))}if(o!==null){var me=n.baseState;k=0,he=se=G=null,L=o;do{var re=L.lane&-536870913,oe=re!==L.lane;if(oe?(Pe&re)===re:(i&re)===re){re!==0&&re===hn&&(Ul=!0),he!==null&&(he=he.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var xe=e,Me=L;re=t;var at=s;switch(Me.tag){case 1:if(xe=Me.payload,typeof xe=="function"){me=xe.call(at,me,re);break e}me=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Me.payload,re=typeof xe=="function"?xe.call(at,me,re):xe,re==null)break e;me=l({},me,re);break e;case 2:hi=!0}}re=L.callback,re!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=n.callbacks,oe===null?n.callbacks=[re]:oe.push(re))}else oe={lane:re,tag:L.tag,payload:L.payload,callback:L.callback,next:null},he===null?(se=he=oe,G=me):he=he.next=oe,k|=re;if(L=L.next,L===null){if(L=n.shared.pending,L===null)break;oe=L,L=oe.next,oe.next=null,n.lastBaseUpdate=oe,n.shared.pending=null}}while(!0);he===null&&(G=me),n.baseState=G,n.firstBaseUpdate=se,n.lastBaseUpdate=he,o===null&&(n.shared.lanes=0),gi|=k,e.lanes=k,e.memoizedState=me}}function Uu(e,t){if(typeof e!="function")throw Error(x(191,e));e.call(t)}function Iu(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Uu(s[e],t)}var mn=T(null),er=T(0);function qu(e,t){e=ei,Z(er,e),Z(mn,t),ei=e|t.baseLanes}function Il(){Z(er,ei),Z(mn,mn.current)}function ql(){ei=er.current,O(mn),O(er)}var ls=T(null),Cs=null;function pi(e){var t=e.alternate;Z(Ct,Ct.current&1),Z(ls,e),Cs===null&&(t===null||mn.current!==null||t.memoizedState!==null)&&(Cs=e)}function $l(e){Z(Ct,Ct.current),Z(ls,e),Cs===null&&(Cs=e)}function $u(e){e.tag===22?(Z(Ct,Ct.current),Z(ls,e),Cs===null&&(Cs=e)):mi()}function mi(){Z(Ct,Ct.current),Z(ls,ls.current)}function os(e){O(ls),Cs===e&&(Cs=null),O(Ct)}var Ct=T(0);function tr(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Xo(s)||Vo(s)))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 Ys=0,ze=null,it=null,At=null,sr=!1,_n=!1,Wi=!1,ir=0,sa=0,vn=null,Am=0;function gt(){throw Error(x(321))}function Pl(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!as(e[s],t[s]))return!1;return!0}function Wl(e,t,s,i,n,o){return Ys=o,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Eh:ao,Wi=!1,o=s(i,n),Wi=!1,_n&&(o=Wu(t,s,i,n)),Pu(e),o}function Pu(e){F.H=aa;var t=it!==null&&it.next!==null;if(Ys=0,At=it=ze=null,sr=!1,sa=0,vn=null,t)throw Error(x(300));e===null||Dt||(e=e.dependencies,e!==null&&Ka(e)&&(Dt=!0))}function Wu(e,t,s,i){ze=e;var n=0;do{if(_n&&(vn=null),sa=0,_n=!1,25<=n)throw Error(x(301));if(n+=1,At=it=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=kh,o=t(s,i)}while(_n);return o}function Dm(){var e=F.H,t=e.useState()[0];return t=typeof t.then=="function"?ia(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(ze.flags|=1024),t}function Fl(){var e=ir!==0;return ir=0,e}function Yl(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Kl(e){if(sr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}sr=!1}Ys=0,At=it=ze=null,_n=!1,sa=ir=0,vn=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?ze.memoizedState=At=e:At=At.next=e,At}function wt(){if(it===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=At===null?ze.memoizedState:At.next;if(t!==null)At=t,it=e;else{if(e===null)throw ze.alternate===null?Error(x(467)):Error(x(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},At===null?ze.memoizedState=At=e:At=At.next=e}return At}function nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ia(e){var t=sa;return sa+=1,vn===null&&(vn=[]),e=Nu(vn,e,t),t=ze,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Eh:ao),e}function ar(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ia(e);if(e.$$typeof===u)return qt(e)}throw Error(x(438,String(e)))}function Gl(e){var t=null,s=ze.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=nr(),ze.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=I;return t.index++,s}function Ks(e,t){return typeof t=="function"?t(e):t}function rr(e){var t=wt();return Xl(t,it,e)}function Xl(e,t,s){var i=e.queue;if(i===null)throw Error(x(311));i.lastRenderedReducer=s;var n=e.baseQueue,o=i.pending;if(o!==null){if(n!==null){var k=n.next;n.next=o.next,o.next=k}t.baseQueue=n=o,i.pending=null}if(o=e.baseState,n===null)e.memoizedState=o;else{t=n.next;var L=k=null,G=null,se=t,he=!1;do{var me=se.lane&-536870913;if(me!==se.lane?(Pe&me)===me:(Ys&me)===me){var re=se.revertLane;if(re===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),me===hn&&(he=!0);else if((Ys&re)===re){se=se.next,re===hn&&(he=!0);continue}else me={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(L=G=me,k=o):G=G.next=me,ze.lanes|=re,gi|=re;me=se.action,Wi&&s(o,me),o=se.hasEagerState?se.eagerState:s(o,me)}else re={lane:me,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},G===null?(L=G=re,k=o):G=G.next=re,ze.lanes|=me,gi|=me;se=se.next}while(se!==null&&se!==t);if(G===null?k=o:G.next=L,!as(o,e.memoizedState)&&(Dt=!0,he&&(s=dn,s!==null)))throw s;e.memoizedState=o,e.baseState=k,e.baseQueue=G,i.lastRenderedState=o}return n===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Vl(e){var t=wt(),s=t.queue;if(s===null)throw Error(x(311));s.lastRenderedReducer=e;var i=s.dispatch,n=s.pending,o=t.memoizedState;if(n!==null){s.pending=null;var k=n=n.next;do o=e(o,k.action),k=k.next;while(k!==n);as(o,t.memoizedState)||(Dt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),s.lastRenderedState=o}return[o,i]}function Fu(e,t,s){var i=ze,n=wt(),o=Fe;if(o){if(s===void 0)throw Error(x(407));s=s()}else s=t();var k=!as((it||n).memoizedState,s);if(k&&(n.memoizedState=s,Dt=!0),n=n.queue,Jl(Gu.bind(null,i,n,e),[e]),n.getSnapshot!==t||k||At!==null&&At.memoizedState.tag&1){if(i.flags|=2048,gn(9,{destroy:void 0},Ku.bind(null,i,n,s,t),null),lt===null)throw Error(x(349));o||(Ys&127)!==0||Yu(i,t,s)}return s}function Yu(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=ze.updateQueue,t===null?(t=nr(),ze.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Ku(e,t,s,i){t.value=s,t.getSnapshot=i,Xu(t)&&Vu(e)}function Gu(e,t,s){return s(function(){Xu(t)&&Vu(e)})}function Xu(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!as(e,s)}catch{return!0}}function Vu(e){var t=Oi(e,2);t!==null&&ss(t,e,2)}function Zl(e){var t=Gt();if(typeof e=="function"){var s=e;if(e=s(),Wi){st(!0);try{s()}finally{st(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:e},t}function Zu(e,t,s,i){return e.baseState=s,Xl(e,it,typeof i=="function"?i:Ks)}function Rm(e,t,s,i,n){if(cr(e))throw Error(x(485));if(e=t.action,e!==null){var o={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){o.listeners.push(k)}};F.T!==null?s(!0):o.isTransition=!1,i(o),s=t.pending,s===null?(o.next=t.pending=o,Qu(t,o)):(o.next=s.next,t.pending=s.next=o)}}function Qu(e,t){var s=t.action,i=t.payload,n=e.state;if(t.isTransition){var o=F.T,k={};F.T=k;try{var L=s(n,i),G=F.S;G!==null&&G(k,L),Ju(e,t,L)}catch(se){Ql(e,t,se)}finally{o!==null&&k.types!==null&&(o.types=k.types),F.T=o}}else try{o=s(n,i),Ju(e,t,o)}catch(se){Ql(e,t,se)}}function Ju(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){eh(e,t,i)},function(i){return Ql(e,t,i)}):eh(e,t,s)}function eh(e,t,s){t.status="fulfilled",t.value=s,th(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Qu(e,s)))}function Ql(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,th(t),t=t.next;while(t!==i)}e.action=null}function th(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sh(e,t){return t}function ih(e,t){if(Fe){var s=lt.formState;if(s!==null){e:{var i=ze;if(Fe){if(ut){t:{for(var n=ut,o=bs;n.nodeType!==8;){if(!o){n=null;break t}if(n=ws(n.nextSibling),n===null){n=null;break t}}o=n.data,n=o==="F!"||o==="F"?n:null}if(n){ut=ws(n.nextSibling),i=n.data==="F!";break e}}ci(i)}i=!1}i&&(t=s[0])}}return s=Gt(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sh,lastRenderedState:t},s.queue=i,s=Ch.bind(null,ze,i),i.dispatch=s,i=Zl(!1),o=no.bind(null,ze,!1,i.queue),i=Gt(),n={state:t,dispatch:null,action:e,pending:null},i.queue=n,s=Rm.bind(null,ze,n,o,s),n.dispatch=s,i.memoizedState=e,[t,s,!1]}function nh(e){var t=wt();return ah(t,it,e)}function ah(e,t,s){if(t=Xl(e,t,sh)[0],e=rr(Ks)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=ia(t)}catch(k){throw k===fn?Va:k}else i=t;t=wt();var n=t.queue,o=n.dispatch;return s!==t.memoizedState&&(ze.flags|=2048,gn(9,{destroy:void 0},Tm.bind(null,n,s),null)),[i,o,e]}function Tm(e,t){e.action=t}function rh(e){var t=wt(),s=it;if(s!==null)return ah(t,s,e);wt(),t=t.memoizedState,s=wt();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function gn(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=nr(),ze.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function lh(){return wt().memoizedState}function lr(e,t,s,i){var n=Gt();ze.flags|=e,n.memoizedState=gn(1|t,{destroy:void 0},s,i===void 0?null:i)}function or(e,t,s,i){var n=wt();i=i===void 0?null:i;var o=n.memoizedState.inst;it!==null&&i!==null&&Pl(i,it.memoizedState.deps)?n.memoizedState=gn(t,o,s,i):(ze.flags|=e,n.memoizedState=gn(1|t,o,s,i))}function oh(e,t){lr(8390656,8,e,t)}function Jl(e,t){or(2048,8,e,t)}function Mm(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=nr(),ze.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function ch(e){var t=wt().memoizedState;return Mm({ref:t,nextImpl:e}),function(){if((Je&2)!==0)throw Error(x(440));return t.impl.apply(void 0,arguments)}}function uh(e,t){return or(4,2,e,t)}function hh(e,t){return or(4,4,e,t)}function dh(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fh(e,t,s){s=s!=null?s.concat([e]):null,or(4,4,dh.bind(null,t,e),s)}function eo(){}function ph(e,t){var s=wt();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&Pl(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function mh(e,t){var s=wt();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&Pl(t,i[1]))return i[0];if(i=e(),Wi){st(!0);try{e()}finally{st(!1)}}return s.memoizedState=[i,t],i}function to(e,t,s){return s===void 0||(Ys&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=_d(),ze.lanes|=e,gi|=e,s)}function _h(e,t,s,i){return as(s,t)?s:mn.current!==null?(e=to(e,s,i),as(e,t)||(Dt=!0),e):(Ys&42)===0||(Ys&1073741824)!==0&&(Pe&261930)===0?(Dt=!0,e.memoizedState=s):(e=_d(),ze.lanes|=e,gi|=e,t)}function vh(e,t,s,i,n){var o=W.p;W.p=o!==0&&8>o?o:8;var k=F.T,L={};F.T=L,no(e,!1,t,s);try{var G=n(),se=F.S;if(se!==null&&se(L,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var he=km(G,i);na(e,t,he,hs(e))}else na(e,t,i,hs(e))}catch(me){na(e,t,{then:function(){},status:"rejected",reason:me},hs())}finally{W.p=o,k!==null&&L.types!==null&&(k.types=L.types),F.T=k}}function jm(){}function so(e,t,s,i){if(e.tag!==5)throw Error(x(476));var n=gh(e).queue;vh(e,n,t,Y,s===null?jm:function(){return Sh(e),s(i)})}function gh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:Y},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ks,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Sh(e){var t=gh(e);t.next===null&&(t=e.alternate.memoizedState),na(e,t.next.queue,{},hs())}function io(){return qt(ba)}function yh(){return wt().memoizedState}function bh(){return wt().memoizedState}function Lm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=hs();e=di(s);var i=fi(t,e,s);i!==null&&(ss(i,t,s),Jn(i,t,s)),t={cache:jl()},e.payload=t;return}t=t.return}}function Nm(e,t,s){var i=hs();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cr(e)?wh(t,s):(s=bl(e,t,s,i),s!==null&&(ss(s,e,i),xh(s,t,i)))}function Ch(e,t,s){var i=hs();na(e,t,s,i)}function na(e,t,s,i){var n={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(cr(e))wh(t,n);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var k=t.lastRenderedState,L=o(k,s);if(n.hasEagerState=!0,n.eagerState=L,as(L,k))return Pa(e,t,n,0),lt===null&&$a(),!1}catch{}finally{}if(s=bl(e,t,n,i),s!==null)return ss(s,e,i),xh(s,t,i),!0}return!1}function no(e,t,s,i){if(i={lane:2,revertLane:Ho(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cr(e)){if(t)throw Error(x(479))}else t=bl(e,s,i,2),t!==null&&ss(t,e,2)}function cr(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function wh(e,t){_n=sr=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function xh(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,is(e,s)}}var aa={readContext:qt,use:ar,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};aa.useEffectEvent=gt;var Eh={readContext:qt,use:ar,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:oh,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,lr(4194308,4,dh.bind(null,t,e),s)},useLayoutEffect:function(e,t){return lr(4194308,4,e,t)},useInsertionEffect:function(e,t){lr(4,2,e,t)},useMemo:function(e,t){var s=Gt();t=t===void 0?null:t;var i=e();if(Wi){st(!0);try{e()}finally{st(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=Gt();if(s!==void 0){var n=s(t);if(Wi){st(!0);try{s(t)}finally{st(!1)}}}else n=t;return i.memoizedState=i.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=Nm.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zl(e);var t=e.queue,s=Ch.bind(null,ze,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:eo,useDeferredValue:function(e,t){var s=Gt();return to(s,e,t)},useTransition:function(){var e=Zl(!1);return e=vh.bind(null,ze,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=ze,n=Gt();if(Fe){if(s===void 0)throw Error(x(407));s=s()}else{if(s=t(),lt===null)throw Error(x(349));(Pe&127)!==0||Yu(i,t,s)}n.memoizedState=s;var o={value:s,getSnapshot:t};return n.queue=o,oh(Gu.bind(null,i,o,e),[e]),i.flags|=2048,gn(9,{destroy:void 0},Ku.bind(null,i,o,s,t),null),s},useId:function(){var e=Gt(),t=lt.identifierPrefix;if(Fe){var s=Ns,i=Ls;s=(i&~(1<<32-vt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=ir++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Am++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:io,useFormState:ih,useActionState:ih,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=no.bind(null,ze,!0,s),s.dispatch=t,[e,t]},useMemoCache:Gl,useCacheRefresh:function(){return Gt().memoizedState=Lm.bind(null,ze)},useEffectEvent:function(e){var t=Gt(),s={impl:e};return t.memoizedState=s,function(){if((Je&2)!==0)throw Error(x(440));return s.impl.apply(void 0,arguments)}}},ao={readContext:qt,use:ar,useCallback:ph,useContext:qt,useEffect:Jl,useImperativeHandle:fh,useInsertionEffect:uh,useLayoutEffect:hh,useMemo:mh,useReducer:rr,useRef:lh,useState:function(){return rr(Ks)},useDebugValue:eo,useDeferredValue:function(e,t){var s=wt();return _h(s,it.memoizedState,e,t)},useTransition:function(){var e=rr(Ks)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:ia(e),t]},useSyncExternalStore:Fu,useId:yh,useHostTransitionStatus:io,useFormState:nh,useActionState:nh,useOptimistic:function(e,t){var s=wt();return Zu(s,it,e,t)},useMemoCache:Gl,useCacheRefresh:bh};ao.useEffectEvent=ch;var kh={readContext:qt,use:ar,useCallback:ph,useContext:qt,useEffect:Jl,useImperativeHandle:fh,useInsertionEffect:uh,useLayoutEffect:hh,useMemo:mh,useReducer:Vl,useRef:lh,useState:function(){return Vl(Ks)},useDebugValue:eo,useDeferredValue:function(e,t){var s=wt();return it===null?to(s,e,t):_h(s,it.memoizedState,e,t)},useTransition:function(){var e=Vl(Ks)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:ia(e),t]},useSyncExternalStore:Fu,useId:yh,useHostTransitionStatus:io,useFormState:rh,useActionState:rh,useOptimistic:function(e,t){var s=wt();return it!==null?Zu(s,it,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Gl,useCacheRefresh:bh};kh.useEffectEvent=ch;function ro(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:l({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var lo={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=hs(),n=di(i);n.payload=t,s!=null&&(n.callback=s),t=fi(e,n,i),t!==null&&(ss(t,e,i),Jn(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=hs(),n=di(i);n.tag=1,n.payload=t,s!=null&&(n.callback=s),t=fi(e,n,i),t!==null&&(ss(t,e,i),Jn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=hs(),i=di(s);i.tag=2,t!=null&&(i.callback=t),t=fi(e,i,s),t!==null&&(ss(t,e,s),Jn(t,e,s))}};function Ah(e,t,s,i,n,o,k){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,o,k):t.prototype&&t.prototype.isPureReactComponent?!Fn(s,i)||!Fn(n,o):!0}function Dh(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&lo.enqueueReplaceState(t,t.state,null)}function Fi(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=l({},s));for(var n in e)s[n]===void 0&&(s[n]=e[n])}return s}function Rh(e){qa(e)}function Th(e){console.error(e)}function Mh(e){qa(e)}function ur(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function jh(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function oo(e,t,s){return s=di(s),s.tag=3,s.payload={element:null},s.callback=function(){ur(e,t)},s}function Lh(e){return e=di(e),e.tag=3,e}function Nh(e,t,s,i){var n=s.type.getDerivedStateFromError;if(typeof n=="function"){var o=i.value;e.payload=function(){return n(o)},e.callback=function(){jh(t,s,i)}}var k=s.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(e.callback=function(){jh(t,s,i),typeof n!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var L=i.stack;this.componentDidCatch(i.value,{componentStack:L!==null?L:""})})}function Om(e,t,s,i,n){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&un(t,s,n,!0),s=ls.current,s!==null){switch(s.tag){case 31:case 13:return Cs===null?Cr():s.alternate===null&&St===0&&(St=3),s.flags&=-257,s.flags|=65536,s.lanes=n,i===Za?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),No(e,i,n)),!1;case 22:return s.flags|=65536,i===Za?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),No(e,i,n)),!1}throw Error(x(435,s.tag))}return No(e,i,n),Cr(),!1}if(Fe)return t=ls.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,i!==Al&&(e=Error(x(422),{cause:i}),Gn(gs(e,s)))):(i!==Al&&(t=Error(x(423),{cause:i}),Gn(gs(t,s))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,i=gs(i,s),n=oo(e.stateNode,i,n),zl(e,n),St!==4&&(St=2)),!1;var o=Error(x(520),{cause:i});if(o=gs(o,s),fa===null?fa=[o]:fa.push(o),St!==4&&(St=2),t===null)return!0;i=gs(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=n&-n,s.lanes|=e,e=oo(s.stateNode,i,e),zl(s,e),!1;case 1:if(t=s.type,o=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Si===null||!Si.has(o))))return s.flags|=65536,n&=-n,s.lanes|=n,n=Lh(n),Nh(n,e,s,i),zl(s,n),!1}s=s.return}while(s!==null);return!1}var co=Error(x(461)),Dt=!1;function $t(e,t,s,i){t.child=e===null?zu(t,null,s,i):Pi(t,e.child,s,i)}function Oh(e,t,s,i,n){s=s.render;var o=t.ref;if("ref"in i){var k={};for(var L in i)L!=="ref"&&(k[L]=i[L])}else k=i;return Ui(t),i=Wl(e,t,s,k,o,n),L=Fl(),e!==null&&!Dt?(Yl(e,t,n),Gs(e,t,n)):(Fe&&L&&El(t),t.flags|=1,$t(e,t,i,n),t.child)}function Bh(e,t,s,i,n){if(e===null){var o=s.type;return typeof o=="function"&&!Cl(o)&&o.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=o,Hh(e,t,o,i,n)):(e=Fa(s.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!go(e,n)){var k=o.memoizedProps;if(s=s.compare,s=s!==null?s:Fn,s(k,i)&&e.ref===t.ref)return Gs(e,t,n)}return t.flags|=1,e=$s(o,i),e.ref=t.ref,e.return=t,t.child=e}function Hh(e,t,s,i,n){if(e!==null){var o=e.memoizedProps;if(Fn(o,i)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=i=o,go(e,n))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Gs(e,t,n)}return uo(e,t,s,i,n)}function zh(e,t,s,i){var n=i.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|s:s,e!==null){for(i=t.child=e.child,n=0;i!==null;)n=n|i.lanes|i.childLanes,i=i.sibling;i=n&~o}else i=0,t.child=null;return Uh(e,t,o,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xa(t,o!==null?o.cachePool:null),o!==null?qu(t,o):Il(),$u(t);else return i=t.lanes=536870912,Uh(e,t,o!==null?o.baseLanes|s:s,s,i)}else o!==null?(Xa(t,o.cachePool),qu(t,o),mi(),t.memoizedState=null):(e!==null&&Xa(t,null),Il(),mi());return $t(e,t,n,s),t.child}function ra(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Uh(e,t,s,i,n){var o=Nl();return o=o===null?null:{parent:kt._currentValue,pool:o},t.memoizedState={baseLanes:s,cachePool:o},e!==null&&Xa(t,null),Il(),$u(t),e!==null&&un(e,t,i,!0),t.childLanes=n,null}function hr(e,t){return t=fr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ih(e,t,s){return Pi(t,e.child,null,s),e=hr(t,t.pendingProps),e.flags|=2,os(t),t.memoizedState=null,e}function Bm(e,t,s){var i=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Fe){if(i.mode==="hidden")return e=hr(t,i),t.lanes=536870912,ra(null,e);if($l(t),(e=ut)?(e=Qd(e,bs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:li!==null?{id:Ls,overflow:Ns}:null,retryLane:536870912,hydrationErrors:null},s=wu(e),s.return=t,t.child=s,It=t,ut=null)):e=null,e===null)throw ci(t);return t.lanes=536870912,null}return hr(t,i)}var o=e.memoizedState;if(o!==null){var k=o.dehydrated;if($l(t),n)if(t.flags&256)t.flags&=-257,t=Ih(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(x(558));else if(Dt||un(e,t,s,!1),n=(s&e.childLanes)!==0,Dt||n){if(i=lt,i!==null&&(k=ns(i,s),k!==0&&k!==o.retryLane))throw o.retryLane=k,Oi(e,k),ss(i,e,k),co;Cr(),t=Ih(e,t,s)}else e=o.treeContext,ut=ws(k.nextSibling),It=t,Fe=!0,oi=null,bs=!1,e!==null&&ku(t,e),t=hr(t,i),t.flags|=4096;return t}return e=$s(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dr(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(x(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function uo(e,t,s,i,n){return Ui(t),s=Wl(e,t,s,i,void 0,n),i=Fl(),e!==null&&!Dt?(Yl(e,t,n),Gs(e,t,n)):(Fe&&i&&El(t),t.flags|=1,$t(e,t,s,n),t.child)}function qh(e,t,s,i,n,o){return Ui(t),t.updateQueue=null,s=Wu(t,i,s,n),Pu(e),i=Fl(),e!==null&&!Dt?(Yl(e,t,o),Gs(e,t,o)):(Fe&&i&&El(t),t.flags|=1,$t(e,t,s,o),t.child)}function $h(e,t,s,i,n){if(Ui(t),t.stateNode===null){var o=rn,k=s.contextType;typeof k=="object"&&k!==null&&(o=qt(k)),o=new s(i,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=lo,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=i,o.state=t.memoizedState,o.refs={},Bl(t),k=s.contextType,o.context=typeof k=="object"&&k!==null?qt(k):rn,o.state=t.memoizedState,k=s.getDerivedStateFromProps,typeof k=="function"&&(ro(t,s,k,i),o.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(k=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),k!==o.state&&lo.enqueueReplaceState(o,o.state,null),ta(t,i,o,n),ea(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){o=t.stateNode;var L=t.memoizedProps,G=Fi(s,L);o.props=G;var se=o.context,he=s.contextType;k=rn,typeof he=="object"&&he!==null&&(k=qt(he));var me=s.getDerivedStateFromProps;he=typeof me=="function"||typeof o.getSnapshotBeforeUpdate=="function",L=t.pendingProps!==L,he||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(L||se!==k)&&Dh(t,o,i,k),hi=!1;var re=t.memoizedState;o.state=re,ta(t,i,o,n),ea(),se=t.memoizedState,L||re!==se||hi?(typeof me=="function"&&(ro(t,s,me,i),se=t.memoizedState),(G=hi||Ah(t,s,G,i,re,se,k))?(he||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=se),o.props=i,o.state=se,o.context=k,i=G):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,Hl(e,t),k=t.memoizedProps,he=Fi(s,k),o.props=he,me=t.pendingProps,re=o.context,se=s.contextType,G=rn,typeof se=="object"&&se!==null&&(G=qt(se)),L=s.getDerivedStateFromProps,(se=typeof L=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(k!==me||re!==G)&&Dh(t,o,i,G),hi=!1,re=t.memoizedState,o.state=re,ta(t,i,o,n),ea();var oe=t.memoizedState;k!==me||re!==oe||hi||e!==null&&e.dependencies!==null&&Ka(e.dependencies)?(typeof L=="function"&&(ro(t,s,L,i),oe=t.memoizedState),(he=hi||Ah(t,s,he,i,re,oe,G)||e!==null&&e.dependencies!==null&&Ka(e.dependencies))?(se||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,oe,G),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,oe,G)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=oe),o.props=i,o.state=oe,o.context=G,i=he):(typeof o.componentDidUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||k===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),i=!1)}return o=i,dr(e,t),i=(t.flags&128)!==0,o||i?(o=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&i?(t.child=Pi(t,e.child,null,n),t.child=Pi(t,null,s,n)):$t(e,t,s,n),t.memoizedState=o.state,e=t.child):e=Gs(e,t,n),e}function Ph(e,t,s,i){return Hi(),t.flags|=256,$t(e,t,s,i),t.child}var ho={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fo(e){return{baseLanes:e,cachePool:ju()}}function po(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=us),e}function Wh(e,t,s){var i=t.pendingProps,n=!1,o=(t.flags&128)!==0,k;if((k=o)||(k=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),k&&(n=!0,t.flags&=-129),k=(t.flags&32)!==0,t.flags&=-33,e===null){if(Fe){if(n?pi(t):mi(),(e=ut)?(e=Qd(e,bs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:li!==null?{id:Ls,overflow:Ns}:null,retryLane:536870912,hydrationErrors:null},s=wu(e),s.return=t,t.child=s,It=t,ut=null)):e=null,e===null)throw ci(t);return Vo(e)?t.lanes=32:t.lanes=536870912,null}var L=i.children;return i=i.fallback,n?(mi(),n=t.mode,L=fr({mode:"hidden",children:L},n),i=Bi(i,n,s,null),L.return=t,i.return=t,L.sibling=i,t.child=L,i=t.child,i.memoizedState=fo(s),i.childLanes=po(e,k,s),t.memoizedState=ho,ra(null,i)):(pi(t),mo(t,L))}var G=e.memoizedState;if(G!==null&&(L=G.dehydrated,L!==null)){if(o)t.flags&256?(pi(t),t.flags&=-257,t=_o(e,t,s)):t.memoizedState!==null?(mi(),t.child=e.child,t.flags|=128,t=null):(mi(),L=i.fallback,n=t.mode,i=fr({mode:"visible",children:i.children},n),L=Bi(L,n,s,null),L.flags|=2,i.return=t,L.return=t,i.sibling=L,t.child=i,Pi(t,e.child,null,s),i=t.child,i.memoizedState=fo(s),i.childLanes=po(e,k,s),t.memoizedState=ho,t=ra(null,i));else if(pi(t),Vo(L)){if(k=L.nextSibling&&L.nextSibling.dataset,k)var se=k.dgst;k=se,i=Error(x(419)),i.stack="",i.digest=k,Gn({value:i,source:null,stack:null}),t=_o(e,t,s)}else if(Dt||un(e,t,s,!1),k=(s&e.childLanes)!==0,Dt||k){if(k=lt,k!==null&&(i=ns(k,s),i!==0&&i!==G.retryLane))throw G.retryLane=i,Oi(e,i),ss(k,e,i),co;Xo(L)||Cr(),t=_o(e,t,s)}else Xo(L)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,ut=ws(L.nextSibling),It=t,Fe=!0,oi=null,bs=!1,e!==null&&ku(t,e),t=mo(t,i.children),t.flags|=4096);return t}return n?(mi(),L=i.fallback,n=t.mode,G=e.child,se=G.sibling,i=$s(G,{mode:"hidden",children:i.children}),i.subtreeFlags=G.subtreeFlags&65011712,se!==null?L=$s(se,L):(L=Bi(L,n,s,null),L.flags|=2),L.return=t,i.return=t,i.sibling=L,t.child=i,ra(null,i),i=t.child,L=e.child.memoizedState,L===null?L=fo(s):(n=L.cachePool,n!==null?(G=kt._currentValue,n=n.parent!==G?{parent:G,pool:G}:n):n=ju(),L={baseLanes:L.baseLanes|s,cachePool:n}),i.memoizedState=L,i.childLanes=po(e,k,s),t.memoizedState=ho,ra(e.child,i)):(pi(t),s=e.child,e=s.sibling,s=$s(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(k=t.deletions,k===null?(t.deletions=[e],t.flags|=16):k.push(e)),t.child=s,t.memoizedState=null,s)}function mo(e,t){return t=fr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function fr(e,t){return e=rs(22,e,null,t),e.lanes=0,e}function _o(e,t,s){return Pi(t,e.child,null,s),e=mo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fh(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Tl(e.return,t,s)}function vo(e,t,s,i,n,o){var k=e.memoizedState;k===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:n,treeForkCount:o}:(k.isBackwards=t,k.rendering=null,k.renderingStartTime=0,k.last=i,k.tail=s,k.tailMode=n,k.treeForkCount=o)}function Yh(e,t,s){var i=t.pendingProps,n=i.revealOrder,o=i.tail;i=i.children;var k=Ct.current,L=(k&2)!==0;if(L?(k=k&1|2,t.flags|=128):k&=1,Z(Ct,k),$t(e,t,i,s),i=Fe?Kn:0,!L&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fh(e,s,t);else if(e.tag===19)Fh(e,s,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(n){case"forwards":for(s=t.child,n=null;s!==null;)e=s.alternate,e!==null&&tr(e)===null&&(n=s),s=s.sibling;s=n,s===null?(n=t.child,t.child=null):(n=s.sibling,s.sibling=null),vo(t,!1,n,s,o,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&tr(e)===null){t.child=n;break}e=n.sibling,n.sibling=s,s=n,n=e}vo(t,!0,s,null,o,i);break;case"together":vo(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Gs(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),gi|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(un(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(x(153));if(t.child!==null){for(e=t.child,s=$s(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=$s(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function go(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ka(e)))}function Hm(e,t,s){switch(t.tag){case 3:N(t,t.stateNode.containerInfo),ui(t,kt,e.memoizedState.cache),Hi();break;case 27:case 5:le(t);break;case 4:N(t,t.stateNode.containerInfo);break;case 10:ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$l(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(pi(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Wh(e,t,s):(pi(t),e=Gs(e,t,s),e!==null?e.sibling:null);pi(t);break;case 19:var n=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(un(e,t,s,!1),i=(s&t.childLanes)!==0),n){if(i)return Yh(e,t,s);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Z(Ct,Ct.current),i)break;return null;case 22:return t.lanes=0,zh(e,t,s,t.pendingProps);case 24:ui(t,kt,e.memoizedState.cache)}return Gs(e,t,s)}function Kh(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!go(e,s)&&(t.flags&128)===0)return Dt=!1,Hm(e,t,s);Dt=(e.flags&131072)!==0}else Dt=!1,Fe&&(t.flags&1048576)!==0&&Eu(t,Kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=qi(t.elementType),t.type=e,typeof e=="function")Cl(e)?(i=Fi(e,i),t.tag=1,t=$h(null,t,e,i,s)):(t.tag=0,t=uo(null,t,e,i,s));else{if(e!=null){var n=e.$$typeof;if(n===S){t.tag=11,t=Oh(null,t,e,i,s);break e}else if(n===R){t.tag=14,t=Bh(null,t,e,i,s);break e}}throw t=Q(e)||e,Error(x(306,t,""))}}return t;case 0:return uo(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,n=Fi(i,t.pendingProps),$h(e,t,i,n,s);case 3:e:{if(N(t,t.stateNode.containerInfo),e===null)throw Error(x(387));i=t.pendingProps;var o=t.memoizedState;n=o.element,Hl(e,t),ta(t,i,null,s);var k=t.memoizedState;if(i=k.cache,ui(t,kt,i),i!==o.cache&&Ml(t,[kt],s,!0),ea(),i=k.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:k.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Ph(e,t,i,s);break e}else if(i!==n){n=gs(Error(x(424)),t),Gn(n),t=Ph(e,t,i,s);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(ut=ws(e.firstChild),It=t,Fe=!0,oi=null,bs=!0,s=zu(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Hi(),i===n){t=Gs(e,t,s);break e}$t(e,t,i,s)}t=t.child}return t;case 26:return dr(e,t),e===null?(s=af(t.type,null,t.pendingProps,null))?t.memoizedState=s:Fe||(s=t.type,e=t.pendingProps,i=Rr(ge.current).createElement(s),i[_t]=t,i[Ut]=e,Pt(i,s,e),Et(i),t.stateNode=i):t.memoizedState=af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Fe&&(i=t.stateNode=tf(t.type,t.pendingProps,ge.current),It=t,bs=!0,n=ut,wi(t.type)?(Zo=n,ut=ws(i.firstChild)):ut=n),$t(e,t,t.pendingProps.children,s),dr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fe&&((n=i=ut)&&(i=f_(i,t.type,t.pendingProps,bs),i!==null?(t.stateNode=i,It=t,ut=ws(i.firstChild),bs=!1,n=!0):n=!1),n||ci(t)),le(t),n=t.type,o=t.pendingProps,k=e!==null?e.memoizedProps:null,i=o.children,Yo(n,o)?i=null:k!==null&&Yo(n,k)&&(t.flags|=32),t.memoizedState!==null&&(n=Wl(e,t,Dm,null,null,s),ba._currentValue=n),dr(e,t),$t(e,t,i,s),t.child;case 6:return e===null&&Fe&&((e=s=ut)&&(s=p_(s,t.pendingProps,bs),s!==null?(t.stateNode=s,It=t,ut=null,e=!0):e=!1),e||ci(t)),null;case 13:return Wh(e,t,s);case 4:return N(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Pi(t,null,i,s):$t(e,t,i,s),t.child;case 11:return Oh(e,t,t.type,t.pendingProps,s);case 7:return $t(e,t,t.pendingProps,s),t.child;case 8:return $t(e,t,t.pendingProps.children,s),t.child;case 12:return $t(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,ui(t,t.type,i.value),$t(e,t,i.children,s),t.child;case 9:return n=t.type._context,i=t.pendingProps.children,Ui(t),n=qt(n),i=i(n),t.flags|=1,$t(e,t,i,s),t.child;case 14:return Bh(e,t,t.type,t.pendingProps,s);case 15:return Hh(e,t,t.type,t.pendingProps,s);case 19:return Yh(e,t,s);case 31:return Bm(e,t,s);case 22:return zh(e,t,s,t.pendingProps);case 24:return Ui(t),i=qt(kt),e===null?(n=Nl(),n===null&&(n=lt,o=jl(),n.pooledCache=o,o.refCount++,o!==null&&(n.pooledCacheLanes|=s),n=o),t.memoizedState={parent:i,cache:n},Bl(t),ui(t,kt,n)):((e.lanes&s)!==0&&(Hl(e,t),ta(t,null,null,s),ea()),n=e.memoizedState,o=t.memoizedState,n.parent!==i?(n={parent:i,cache:i},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),ui(t,kt,i)):(i=o.cache,ui(t,kt,i),i!==n.cache&&Ml(t,[kt],s,!0))),$t(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(x(156,t.tag))}function Xs(e){e.flags|=4}function So(e,t,s,i,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(yd())e.flags|=8192;else throw $i=Za,Ol}else e.flags&=-16777217}function Gh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!uf(t))if(yd())e.flags|=8192;else throw $i=Za,Ol}function pr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ot():536870912,e.lanes|=t,Cn|=t)}function la(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var n=e.child;n!==null;)s|=n.lanes|n.childLanes,i|=n.subtreeFlags&65011712,i|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)s|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function zm(e,t,s){var i=t.pendingProps;switch(kl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return ht(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Fs(kt),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(cn(t)?Xs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Dl())),ht(t),null;case 26:var n=t.type,o=t.memoizedState;return e===null?(Xs(t),o!==null?(ht(t),Gh(t,o)):(ht(t),So(t,n,null,i,s))):o?o!==e.memoizedState?(Xs(t),ht(t),Gh(t,o)):(ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Xs(t),ht(t),So(t,n,e,i,s)),null;case 27:if(ye(t),s=ge.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Xs(t);else{if(!i){if(t.stateNode===null)throw Error(x(166));return ht(t),null}e=ae.current,cn(t)?Au(t):(e=tf(n,i,s),t.stateNode=e,Xs(t))}return ht(t),null;case 5:if(ye(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Xs(t);else{if(!i){if(t.stateNode===null)throw Error(x(166));return ht(t),null}if(o=ae.current,cn(t))Au(t);else{var k=Rr(ge.current);switch(o){case 1:o=k.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:o=k.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":o=k.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":o=k.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":o=k.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?k.createElement("select",{is:i.is}):k.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?k.createElement(n,{is:i.is}):k.createElement(n)}}o[_t]=t,o[Ut]=i;e:for(k=t.child;k!==null;){if(k.tag===5||k.tag===6)o.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===t)break e;for(;k.sibling===null;){if(k.return===null||k.return===t)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}t.stateNode=o;e:switch(Pt(o,n,i),n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Xs(t)}}return ht(t),So(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Xs(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(x(166));if(e=ge.current,cn(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,n=It,n!==null)switch(n.tag){case 27:case 5:i=n.memoizedProps}e[_t]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||Wd(e.nodeValue,s)),e||ci(t,!0)}else e=Rr(e).createTextNode(i),e[_t]=t,t.stateNode=e}return ht(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=cn(t),s!==null){if(e===null){if(!i)throw Error(x(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(557));e[_t]=t}else Hi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),e=!1}else s=Dl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(os(t),t):(os(t),null);if((t.flags&128)!==0)throw Error(x(558))}return ht(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=cn(t),i!==null&&i.dehydrated!==null){if(e===null){if(!n)throw Error(x(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(x(317));n[_t]=t}else Hi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),n=!1}else n=Dl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(os(t),t):(os(t),null)}return os(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,n=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(n=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==n&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),pr(t,t.updateQueue),ht(t),null);case 4:return ce(),e===null&&qo(t.stateNode.containerInfo),ht(t),null;case 10:return Fs(t.type),ht(t),null;case 19:if(O(Ct),i=t.memoizedState,i===null)return ht(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)la(i,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=tr(e),o!==null){for(t.flags|=128,la(i,!1),e=o.updateQueue,t.updateQueue=e,pr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Cu(s,e),s=s.sibling;return Z(Ct,Ct.current&1|2),Fe&&Ps(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ie()>Sr&&(t.flags|=128,n=!0,la(i,!1),t.lanes=4194304)}else{if(!n)if(e=tr(o),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,pr(t,e),la(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Fe)return ht(t),null}else 2*Ie()-i.renderingStartTime>Sr&&s!==536870912&&(t.flags|=128,n=!0,la(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ie(),e.sibling=null,s=Ct.current,Z(Ct,n?s&1|2:s&1),Fe&&Ps(t,i.treeForkCount),e):(ht(t),null);case 22:case 23:return os(t),ql(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),s=t.updateQueue,s!==null&&pr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&O(Ii),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Fs(kt),ht(t),null;case 25:return null;case 30:return null}throw Error(x(156,t.tag))}function Um(e,t){switch(kl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fs(kt),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(os(t),t.alternate===null)throw Error(x(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(os(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(x(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(Ct),null;case 4:return ce(),null;case 10:return Fs(t.type),null;case 22:case 23:return os(t),ql(),e!==null&&O(Ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fs(kt),null;case 25:return null;default:return null}}function Xh(e,t){switch(kl(t),t.tag){case 3:Fs(kt),ce();break;case 26:case 27:case 5:ye(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&os(t);break;case 13:os(t);break;case 19:O(Ct);break;case 10:Fs(t.type);break;case 22:case 23:os(t),ql(),e!==null&&O(Ii);break;case 24:Fs(kt)}}function oa(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var n=i.next;s=n;do{if((s.tag&e)===e){i=void 0;var o=s.create,k=s.inst;i=o(),k.destroy=i}s=s.next}while(s!==n)}}catch(L){tt(t,t.return,L)}}function _i(e,t,s){try{var i=t.updateQueue,n=i!==null?i.lastEffect:null;if(n!==null){var o=n.next;i=o;do{if((i.tag&e)===e){var k=i.inst,L=k.destroy;if(L!==void 0){k.destroy=void 0,n=t;var G=s,se=L;try{se()}catch(he){tt(n,G,he)}}}i=i.next}while(i!==o)}}catch(he){tt(t,t.return,he)}}function Vh(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Iu(t,s)}catch(i){tt(e,e.return,i)}}}function Zh(e,t,s){s.props=Fi(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){tt(e,t,i)}}function ca(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(n){tt(e,t,n)}}function Os(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(n){tt(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(n){tt(e,t,n)}else s.current=null}function Qh(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(n){tt(e,e.return,n)}}function yo(e,t,s){try{var i=e.stateNode;l_(i,e.type,s,t),i[Ut]=t}catch(n){tt(e,e.return,n)}}function Jh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wi(e.type)||e.tag===4}function bo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jh(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&&wi(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 Co(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Is));else if(i!==4&&(i===27&&wi(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Co(e,t,s),e=e.sibling;e!==null;)Co(e,t,s),e=e.sibling}function mr(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&wi(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(mr(e,t,s),e=e.sibling;e!==null;)mr(e,t,s),e=e.sibling}function ed(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Pt(t,i,s),t[_t]=e,t[Ut]=s}catch(o){tt(e,e.return,o)}}var Vs=!1,Rt=!1,wo=!1,td=typeof WeakSet=="function"?WeakSet:Set,zt=null;function Im(e,t){if(e=e.containerInfo,Wo=Br,e=fu(e),ml(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var n=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{s.nodeType,o.nodeType}catch{s=null;break e}var k=0,L=-1,G=-1,se=0,he=0,me=e,re=null;t:for(;;){for(var oe;me!==s||n!==0&&me.nodeType!==3||(L=k+n),me!==o||i!==0&&me.nodeType!==3||(G=k+i),me.nodeType===3&&(k+=me.nodeValue.length),(oe=me.firstChild)!==null;)re=me,me=oe;for(;;){if(me===e)break t;if(re===s&&++se===n&&(L=k),re===o&&++he===i&&(G=k),(oe=me.nextSibling)!==null)break;me=re,re=me.parentNode}me=oe}s=L===-1||G===-1?null:{start:L,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(Fo={focusedElem:e,selectionRange:s},Br=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,o=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(s=0;s<e.length;s++)n=e[s],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,s=t,n=o.memoizedProps,o=o.memoizedState,i=s.stateNode;try{var xe=Fi(s.type,n);e=i.getSnapshotBeforeUpdate(xe,o),i.__reactInternalSnapshotBeforeUpdate=e}catch(Me){tt(s,s.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Go(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Go(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(x(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function sd(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:Qs(e,s),i&4&&oa(5,s);break;case 1:if(Qs(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(k){tt(s,s.return,k)}else{var n=Fi(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(k){tt(s,s.return,k)}}i&64&&Vh(s),i&512&&ca(s,s.return);break;case 3:if(Qs(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Iu(e,t)}catch(k){tt(s,s.return,k)}}break;case 27:t===null&&i&4&&ed(s);case 26:case 5:Qs(e,s),t===null&&i&4&&Qh(s),i&512&&ca(s,s.return);break;case 12:Qs(e,s);break;case 31:Qs(e,s),i&4&&ad(e,s);break;case 13:Qs(e,s),i&4&&rd(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Xm.bind(null,s),m_(e,s))));break;case 22:if(i=s.memoizedState!==null||Vs,!i){t=t!==null&&t.memoizedState!==null||Rt,n=Vs;var o=Rt;Vs=i,(Rt=t)&&!o?Js(e,s,(s.subtreeFlags&8772)!==0):Qs(e,s),Vs=n,Rt=o}break;case 30:break;default:Qs(e,s)}}function id(e){var t=e.alternate;t!==null&&(e.alternate=null,id(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ks(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 pt=null,Qt=!1;function Zs(e,t,s){for(s=s.child;s!==null;)nd(e,t,s),s=s.sibling}function nd(e,t,s){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Tt,s)}catch{}switch(s.tag){case 26:Rt||Os(s,t),Zs(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Rt||Os(s,t);var i=pt,n=Qt;wi(s.type)&&(pt=s.stateNode,Qt=!1),Zs(e,t,s),ga(s.stateNode),pt=i,Qt=n;break;case 5:Rt||Os(s,t);case 6:if(i=pt,n=Qt,pt=null,Zs(e,t,s),pt=i,Qt=n,pt!==null)if(Qt)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(s.stateNode)}catch(o){tt(s,t,o)}else try{pt.removeChild(s.stateNode)}catch(o){tt(s,t,o)}break;case 18:pt!==null&&(Qt?(e=pt,Vd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Tn(e)):Vd(pt,s.stateNode));break;case 4:i=pt,n=Qt,pt=s.stateNode.containerInfo,Qt=!0,Zs(e,t,s),pt=i,Qt=n;break;case 0:case 11:case 14:case 15:_i(2,s,t),Rt||_i(4,s,t),Zs(e,t,s);break;case 1:Rt||(Os(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Zh(s,t,i)),Zs(e,t,s);break;case 21:Zs(e,t,s);break;case 22:Rt=(i=Rt)||s.memoizedState!==null,Zs(e,t,s),Rt=i;break;default:Zs(e,t,s)}}function ad(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Tn(e)}catch(s){tt(t,t.return,s)}}}function rd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Tn(e)}catch(s){tt(t,t.return,s)}}function qm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new td),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new td),t;default:throw Error(x(435,e.tag))}}function _r(e,t){var s=qm(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var n=Vm.bind(null,e,i);i.then(n,n)}})}function Jt(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var n=s[i],o=e,k=t,L=k;e:for(;L!==null;){switch(L.tag){case 27:if(wi(L.type)){pt=L.stateNode,Qt=!1;break e}break;case 5:pt=L.stateNode,Qt=!1;break e;case 3:case 4:pt=L.stateNode.containerInfo,Qt=!0;break e}L=L.return}if(pt===null)throw Error(x(160));nd(o,k,n),pt=null,Qt=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ld(t,e),t=t.sibling}var Ds=null;function ld(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(t,e),es(e),i&4&&(_i(3,e,e.return),oa(3,e),_i(5,e,e.return));break;case 1:Jt(t,e),es(e),i&512&&(Rt||s===null||Os(s,s.return)),i&64&&Vs&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var n=Ds;if(Jt(t,e),es(e),i&512&&(Rt||s===null||Os(s,s.return)),i&4){var o=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,n=n.ownerDocument||n;t:switch(i){case"title":o=n.getElementsByTagName("title")[0],(!o||o[Bt]||o[_t]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=n.createElement(i),n.head.insertBefore(o,n.querySelector("head > title"))),Pt(o,i,s),o[_t]=e,Et(o),i=o;break e;case"link":var k=of("link","href",n).get(i+(s.href||""));if(k){for(var L=0;L<k.length;L++)if(o=k[L],o.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&o.getAttribute("rel")===(s.rel==null?null:s.rel)&&o.getAttribute("title")===(s.title==null?null:s.title)&&o.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){k.splice(L,1);break t}}o=n.createElement(i),Pt(o,i,s),n.head.appendChild(o);break;case"meta":if(k=of("meta","content",n).get(i+(s.content||""))){for(L=0;L<k.length;L++)if(o=k[L],o.getAttribute("content")===(s.content==null?null:""+s.content)&&o.getAttribute("name")===(s.name==null?null:s.name)&&o.getAttribute("property")===(s.property==null?null:s.property)&&o.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&o.getAttribute("charset")===(s.charSet==null?null:s.charSet)){k.splice(L,1);break t}}o=n.createElement(i),Pt(o,i,s),n.head.appendChild(o);break;default:throw Error(x(468,i))}o[_t]=e,Et(o),i=o}e.stateNode=i}else cf(n,e.type,e.stateNode);else e.stateNode=lf(n,i,e.memoizedProps);else o!==i?(o===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):o.count--,i===null?cf(n,e.type,e.stateNode):lf(n,i,e.memoizedProps)):i===null&&e.stateNode!==null&&yo(e,e.memoizedProps,s.memoizedProps)}break;case 27:Jt(t,e),es(e),i&512&&(Rt||s===null||Os(s,s.return)),s!==null&&i&4&&yo(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Jt(t,e),es(e),i&512&&(Rt||s===null||Os(s,s.return)),e.flags&32){n=e.stateNode;try{Qi(n,"")}catch(xe){tt(e,e.return,xe)}}i&4&&e.stateNode!=null&&(n=e.memoizedProps,yo(e,n,s!==null?s.memoizedProps:n)),i&1024&&(wo=!0);break;case 6:if(Jt(t,e),es(e),i&4){if(e.stateNode===null)throw Error(x(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(xe){tt(e,e.return,xe)}}break;case 3:if(jr=null,n=Ds,Ds=Tr(t.containerInfo),Jt(t,e),Ds=n,es(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Tn(t.containerInfo)}catch(xe){tt(e,e.return,xe)}wo&&(wo=!1,od(e));break;case 4:i=Ds,Ds=Tr(e.stateNode.containerInfo),Jt(t,e),es(e),Ds=i;break;case 12:Jt(t,e),es(e);break;case 31:Jt(t,e),es(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_r(e,i)));break;case 13:Jt(t,e),es(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(gr=Ie()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_r(e,i)));break;case 22:n=e.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,se=Vs,he=Rt;if(Vs=se||n,Rt=he||G,Jt(t,e),Rt=he,Vs=se,es(e),i&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(s===null||G||Vs||Rt||Yi(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){G=s=t;try{if(o=G.stateNode,n)k=o.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{L=G.stateNode;var me=G.memoizedProps.style,re=me!=null&&me.hasOwnProperty("display")?me.display:null;L.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(xe){tt(G,G.return,xe)}}}else if(t.tag===6){if(s===null){G=t;try{G.stateNode.nodeValue=n?"":G.memoizedProps}catch(xe){tt(G,G.return,xe)}}}else if(t.tag===18){if(s===null){G=t;try{var oe=G.stateNode;n?Zd(oe,!0):Zd(G.stateNode,!1)}catch(xe){tt(G,G.return,xe)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,_r(e,s))));break;case 19:Jt(t,e),es(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_r(e,i)));break;case 30:break;case 21:break;default:Jt(t,e),es(e)}}function es(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(Jh(i)){s=i;break}i=i.return}if(s==null)throw Error(x(160));switch(s.tag){case 27:var n=s.stateNode,o=bo(e);mr(e,o,n);break;case 5:var k=s.stateNode;s.flags&32&&(Qi(k,""),s.flags&=-33);var L=bo(e);mr(e,L,k);break;case 3:case 4:var G=s.stateNode.containerInfo,se=bo(e);Co(e,se,G);break;default:throw Error(x(161))}}catch(he){tt(e,e.return,he)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function od(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;od(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Qs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sd(e,t.alternate,t),t=t.sibling}function Yi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_i(4,t,t.return),Yi(t);break;case 1:Os(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Zh(t,t.return,s),Yi(t);break;case 27:ga(t.stateNode);case 26:case 5:Os(t,t.return),Yi(t);break;case 22:t.memoizedState===null&&Yi(t);break;case 30:Yi(t);break;default:Yi(t)}e=e.sibling}}function Js(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,n=e,o=t,k=o.flags;switch(o.tag){case 0:case 11:case 15:Js(n,o,s),oa(4,o);break;case 1:if(Js(n,o,s),i=o,n=i.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(se){tt(i,i.return,se)}if(i=o,n=i.updateQueue,n!==null){var L=i.stateNode;try{var G=n.shared.hiddenCallbacks;if(G!==null)for(n.shared.hiddenCallbacks=null,n=0;n<G.length;n++)Uu(G[n],L)}catch(se){tt(i,i.return,se)}}s&&k&64&&Vh(o),ca(o,o.return);break;case 27:ed(o);case 26:case 5:Js(n,o,s),s&&i===null&&k&4&&Qh(o),ca(o,o.return);break;case 12:Js(n,o,s);break;case 31:Js(n,o,s),s&&k&4&&ad(n,o);break;case 13:Js(n,o,s),s&&k&4&&rd(n,o);break;case 22:o.memoizedState===null&&Js(n,o,s),ca(o,o.return);break;case 30:break;default:Js(n,o,s)}t=t.sibling}}function xo(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Xn(s))}function Eo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xn(e))}function Rs(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cd(e,t,s,i),t=t.sibling}function cd(e,t,s,i){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Rs(e,t,s,i),n&2048&&oa(9,t);break;case 1:Rs(e,t,s,i);break;case 3:Rs(e,t,s,i),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xn(e)));break;case 12:if(n&2048){Rs(e,t,s,i),e=t.stateNode;try{var o=t.memoizedProps,k=o.id,L=o.onPostCommit;typeof L=="function"&&L(k,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){tt(t,t.return,G)}}else Rs(e,t,s,i);break;case 31:Rs(e,t,s,i);break;case 13:Rs(e,t,s,i);break;case 23:break;case 22:o=t.stateNode,k=t.alternate,t.memoizedState!==null?o._visibility&2?Rs(e,t,s,i):ua(e,t):o._visibility&2?Rs(e,t,s,i):(o._visibility|=2,Sn(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),n&2048&&xo(k,t);break;case 24:Rs(e,t,s,i),n&2048&&Eo(t.alternate,t);break;default:Rs(e,t,s,i)}}function Sn(e,t,s,i,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,k=t,L=s,G=i,se=k.flags;switch(k.tag){case 0:case 11:case 15:Sn(o,k,L,G,n),oa(8,k);break;case 23:break;case 22:var he=k.stateNode;k.memoizedState!==null?he._visibility&2?Sn(o,k,L,G,n):ua(o,k):(he._visibility|=2,Sn(o,k,L,G,n)),n&&se&2048&&xo(k.alternate,k);break;case 24:Sn(o,k,L,G,n),n&&se&2048&&Eo(k.alternate,k);break;default:Sn(o,k,L,G,n)}t=t.sibling}}function ua(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,n=i.flags;switch(i.tag){case 22:ua(s,i),n&2048&&xo(i.alternate,i);break;case 24:ua(s,i),n&2048&&Eo(i.alternate,i);break;default:ua(s,i)}t=t.sibling}}var ha=8192;function yn(e,t,s){if(e.subtreeFlags&ha)for(e=e.child;e!==null;)ud(e,t,s),e=e.sibling}function ud(e,t,s){switch(e.tag){case 26:yn(e,t,s),e.flags&ha&&e.memoizedState!==null&&A_(s,Ds,e.memoizedState,e.memoizedProps);break;case 5:yn(e,t,s);break;case 3:case 4:var i=Ds;Ds=Tr(e.stateNode.containerInfo),yn(e,t,s),Ds=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ha,ha=16777216,yn(e,t,s),ha=i):yn(e,t,s));break;default:yn(e,t,s)}}function hd(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 da(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];zt=i,fd(i,e)}hd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dd(e),e=e.sibling}function dd(e){switch(e.tag){case 0:case 11:case 15:da(e),e.flags&2048&&_i(9,e,e.return);break;case 3:da(e);break;case 12:da(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vr(e)):da(e);break;default:da(e)}}function vr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];zt=i,fd(i,e)}hd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_i(8,t,t.return),vr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,vr(t));break;default:vr(t)}e=e.sibling}}function fd(e,t){for(;zt!==null;){var s=zt;switch(s.tag){case 0:case 11:case 15:_i(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Xn(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,zt=i;else e:for(s=e;zt!==null;){i=zt;var n=i.sibling,o=i.return;if(id(i),i===s){zt=null;break e}if(n!==null){n.return=o,zt=n;break e}zt=o}}}var $m={getCacheForType:function(e){var t=qt(kt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return qt(kt).controller.signal}},Pm=typeof WeakMap=="function"?WeakMap:Map,Je=0,lt=null,qe=null,Pe=0,et=0,cs=null,vi=!1,bn=!1,ko=!1,ei=0,St=0,gi=0,Ki=0,Ao=0,us=0,Cn=0,fa=null,ts=null,Do=!1,gr=0,pd=0,Sr=1/0,yr=null,Si=null,Mt=0,yi=null,wn=null,ti=0,Ro=0,To=null,md=null,pa=0,Mo=null;function hs(){return(Je&2)!==0&&Pe!==0?Pe&-Pe:F.T!==null?Ho():Bn()}function _d(){if(us===0)if((Pe&536870912)===0||Fe){var e=de;de<<=1,(de&3932160)===0&&(de=262144),us=e}else us=536870912;return e=ls.current,e!==null&&(e.flags|=32),us}function ss(e,t,s){(e===lt&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(xn(e,0),bi(e,Pe,us,!1)),fs(e,s),((Je&2)===0||e!==lt)&&(e===lt&&((Je&2)===0&&(Ki|=s),St===4&&bi(e,Pe,us,!1)),Bs(e))}function vd(e,t,s){if((Je&6)!==0)throw Error(x(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Yt(e,t),n=i?Ym(e,t):Lo(e,t,!0),o=i;do{if(n===0){bn&&!i&&bi(e,t,0,!1);break}else{if(s=e.current.alternate,o&&!Wm(s)){n=Lo(e,t,!1),o=!1;continue}if(n===2){if(o=t,e.errorRecoveryDisabledLanes&o)var k=0;else k=e.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){t=k;e:{var L=e;n=fa;var G=L.current.memoizedState.isDehydrated;if(G&&(xn(L,k).flags|=256),k=Lo(L,k,!1),k!==2){if(ko&&!G){L.errorRecoveryDisabledLanes|=o,Ki|=o,n=4;break e}o=ts,ts=n,o!==null&&(ts===null?ts=o:ts.push.apply(ts,o))}n=k}if(o=!1,n!==2)continue}}if(n===1){xn(e,0),bi(e,t,0,!0);break}e:{switch(i=e,o=n,o){case 0:case 1:throw Error(x(345));case 4:if((t&4194048)!==t)break;case 6:bi(i,t,us,!vi);break e;case 2:ts=null;break;case 3:case 5:break;default:throw Error(x(329))}if((t&62914560)===t&&(n=gr+300-Ie(),10<n)){if(bi(i,t,us,!vi),Nt(i,0,!0)!==0)break e;ti=t,i.timeoutHandle=Gd(gd.bind(null,i,s,ts,yr,Do,t,us,Ki,Cn,vi,o,"Throttled",-0,0),n);break e}gd(i,s,ts,yr,Do,t,us,Ki,Cn,vi,o,null,-0,0)}}break}while(!0);Bs(e)}function gd(e,t,s,i,n,o,k,L,G,se,he,me,re,oe){if(e.timeoutHandle=-1,me=t.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Is},ud(t,o,me);var xe=(o&62914560)===o?gr-Ie():(o&4194048)===o?pd-Ie():0;if(xe=D_(me,xe),xe!==null){ti=o,e.cancelPendingCommit=xe(kd.bind(null,e,t,o,s,i,n,k,L,G,he,me,null,re,oe)),bi(e,o,k,!se);return}}kd(e,t,o,s,i,n,k,L,G)}function Wm(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var n=s[i],o=n.getSnapshot;n=n.value;try{if(!as(o(),n))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 bi(e,t,s,i){t&=~Ao,t&=~Ki,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var n=t;0<n;){var o=31-vt(n),k=1<<o;i[o]=-1,n&=~k}s!==0&&Qe(e,s,t)}function br(){return(Je&6)===0?(ma(0),!1):!0}function jo(){if(qe!==null){if(et===0)var e=qe.return;else e=qe,Ws=zi=null,Kl(e),pn=null,Zn=0,e=qe;for(;e!==null;)Xh(e.alternate,e),e=e.return;qe=null}}function xn(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,u_(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ti=0,jo(),lt=e,qe=s=$s(e.current,null),Pe=t,et=0,cs=null,vi=!1,bn=Yt(e,t),ko=!1,Cn=us=Ao=Ki=gi=St=0,ts=fa=null,Do=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var n=31-vt(i),o=1<<n;t|=e[n],i&=~o}return ei=t,$a(),s}function Sd(e,t){ze=null,F.H=aa,t===fn||t===Va?(t=Ou(),et=3):t===Ol?(t=Ou(),et=4):et=t===co?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cs=t,qe===null&&(St=1,ur(e,gs(t,e.current)))}function yd(){var e=ls.current;return e===null?!0:(Pe&4194048)===Pe?Cs===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===Cs:!1}function bd(){var e=F.H;return F.H=aa,e===null?aa:e}function Cd(){var e=F.A;return F.A=$m,e}function Cr(){St=4,vi||(Pe&4194048)!==Pe&&ls.current!==null||(bn=!0),(gi&134217727)===0&&(Ki&134217727)===0||lt===null||bi(lt,Pe,us,!1)}function Lo(e,t,s){var i=Je;Je|=2;var n=bd(),o=Cd();(lt!==e||Pe!==t)&&(yr=null,xn(e,t)),t=!1;var k=St;e:do try{if(et!==0&&qe!==null){var L=qe,G=cs;switch(et){case 8:jo(),k=6;break e;case 3:case 2:case 9:case 6:ls.current===null&&(t=!0);var se=et;if(et=0,cs=null,En(e,L,G,se),s&&bn){k=0;break e}break;default:se=et,et=0,cs=null,En(e,L,G,se)}}Fm(),k=St;break}catch(he){Sd(e,he)}while(!0);return t&&e.shellSuspendCounter++,Ws=zi=null,Je=i,F.H=n,F.A=o,qe===null&&(lt=null,Pe=0,$a()),k}function Fm(){for(;qe!==null;)wd(qe)}function Ym(e,t){var s=Je;Je|=2;var i=bd(),n=Cd();lt!==e||Pe!==t?(yr=null,Sr=Ie()+500,xn(e,t)):bn=Yt(e,t);e:do try{if(et!==0&&qe!==null){t=qe;var o=cs;t:switch(et){case 1:et=0,cs=null,En(e,t,o,1);break;case 2:case 9:if(Lu(o)){et=0,cs=null,xd(t);break}t=function(){et!==2&&et!==9||lt!==e||(et=7),Bs(e)},o.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Lu(o)?(et=0,cs=null,xd(t)):(et=0,cs=null,En(e,t,o,7));break;case 5:var k=null;switch(qe.tag){case 26:k=qe.memoizedState;case 5:case 27:var L=qe;if(k?uf(k):L.stateNode.complete){et=0,cs=null;var G=L.sibling;if(G!==null)qe=G;else{var se=L.return;se!==null?(qe=se,wr(se)):qe=null}break t}}et=0,cs=null,En(e,t,o,5);break;case 6:et=0,cs=null,En(e,t,o,6);break;case 8:jo(),St=6;break e;default:throw Error(x(462))}}Km();break}catch(he){Sd(e,he)}while(!0);return Ws=zi=null,F.H=i,F.A=n,Je=s,qe!==null?0:(lt=null,Pe=0,$a(),St)}function Km(){for(;qe!==null&&!Ft();)wd(qe)}function wd(e){var t=Kh(e.alternate,e,ei);e.memoizedProps=e.pendingProps,t===null?wr(e):qe=t}function xd(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=qh(s,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=qh(s,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:Kl(t);default:Xh(s,t),t=qe=Cu(t,ei),t=Kh(s,t,ei)}e.memoizedProps=e.pendingProps,t===null?wr(e):qe=t}function En(e,t,s,i){Ws=zi=null,Kl(t),pn=null,Zn=0;var n=t.return;try{if(Om(e,n,t,s,Pe)){St=1,ur(e,gs(s,e.current)),qe=null;return}}catch(o){if(n!==null)throw qe=n,o;St=1,ur(e,gs(s,e.current)),qe=null;return}t.flags&32768?(Fe||i===1?e=!0:bn||(Pe&536870912)!==0?e=!1:(vi=e=!0,(i===2||i===9||i===3||i===6)&&(i=ls.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ed(t,e)):wr(t)}function wr(e){var t=e;do{if((t.flags&32768)!==0){Ed(t,vi);return}e=t.return;var s=zm(t.alternate,t,ei);if(s!==null){qe=s;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);St===0&&(St=5)}function Ed(e,t){do{var s=Um(e.alternate,e);if(s!==null){s.flags&=32767,qe=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=s}while(e!==null);St=6,qe=null}function kd(e,t,s,i,n,o,k,L,G){e.cancelPendingCommit=null;do xr();while(Mt!==0);if((Je&6)!==0)throw Error(x(327));if(t!==null){if(t===e.current)throw Error(x(177));if(o=t.lanes|t.childLanes,o|=yl,Es(e,s,o,k,L,G),e===lt&&(qe=lt=null,Pe=0),wn=t,yi=e,ti=s,Ro=o,To=n,md=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Zm(ct,function(){return Md(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=F.T,F.T=null,n=W.p,W.p=2,k=Je,Je|=4;try{Im(e,t,s)}finally{Je=k,W.p=n,F.T=i}}Mt=1,Ad(),Dd(),Rd()}}function Ad(){if(Mt===1){Mt=0;var e=yi,t=wn,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=F.T,F.T=null;var i=W.p;W.p=2;var n=Je;Je|=4;try{ld(t,e);var o=Fo,k=fu(e.containerInfo),L=o.focusedElem,G=o.selectionRange;if(k!==L&&L&&L.ownerDocument&&du(L.ownerDocument.documentElement,L)){if(G!==null&&ml(L)){var se=G.start,he=G.end;if(he===void 0&&(he=se),"selectionStart"in L)L.selectionStart=se,L.selectionEnd=Math.min(he,L.value.length);else{var me=L.ownerDocument||document,re=me&&me.defaultView||window;if(re.getSelection){var oe=re.getSelection(),xe=L.textContent.length,Me=Math.min(G.start,xe),at=G.end===void 0?Me:Math.min(G.end,xe);!oe.extend&&Me>at&&(k=at,at=Me,Me=k);var J=hu(L,Me),V=hu(L,at);if(J&&V&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==V.node||oe.focusOffset!==V.offset)){var te=me.createRange();te.setStart(J.node,J.offset),oe.removeAllRanges(),Me>at?(oe.addRange(te),oe.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),oe.addRange(te))}}}}for(me=[],oe=L;oe=oe.parentNode;)oe.nodeType===1&&me.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<me.length;L++){var fe=me[L];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Br=!!Wo,Fo=Wo=null}finally{Je=n,W.p=i,F.T=s}}e.current=t,Mt=2}}function Dd(){if(Mt===2){Mt=0;var e=yi,t=wn,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=F.T,F.T=null;var i=W.p;W.p=2;var n=Je;Je|=4;try{sd(e,t.alternate,t)}finally{Je=n,W.p=i,F.T=s}}Mt=3}}function Rd(){if(Mt===4||Mt===3){Mt=0,Ce();var e=yi,t=wn,s=ti,i=md;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Mt=5:(Mt=0,wn=yi=null,Td(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Si=null),ps(s),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Tt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=F.T,n=W.p,W.p=2,F.T=null;try{for(var o=e.onRecoverableError,k=0;k<i.length;k++){var L=i[k];o(L.value,{componentStack:L.stack})}}finally{F.T=t,W.p=n}}(ti&3)!==0&&xr(),Bs(e),n=e.pendingLanes,(s&261930)!==0&&(n&42)!==0?e===Mo?pa++:(pa=0,Mo=e):pa=0,ma(0)}}function Td(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xn(t)))}function xr(){return Ad(),Dd(),Rd(),Md()}function Md(){if(Mt!==5)return!1;var e=yi,t=Ro;Ro=0;var s=ps(ti),i=F.T,n=W.p;try{W.p=32>s?32:s,F.T=null,s=To,To=null;var o=yi,k=ti;if(Mt=0,wn=yi=null,ti=0,(Je&6)!==0)throw Error(x(331));var L=Je;if(Je|=4,dd(o.current),cd(o,o.current,k,s),Je=L,ma(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Tt,o)}catch{}return!0}finally{W.p=n,F.T=i,Td(e,t)}}function jd(e,t,s){t=gs(s,t),t=oo(e.stateNode,t,2),e=fi(e,t,2),e!==null&&(fs(e,2),Bs(e))}function tt(e,t,s){if(e.tag===3)jd(e,e,s);else for(;t!==null;){if(t.tag===3){jd(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Si===null||!Si.has(i))){e=gs(s,e),s=Lh(2),i=fi(t,s,2),i!==null&&(Nh(s,i,t,e),fs(i,2),Bs(i));break}}t=t.return}}function No(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new Pm;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(s)||(ko=!0,n.add(s),e=Gm.bind(null,e,t,s),t.then(e,e))}function Gm(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,lt===e&&(Pe&s)===s&&(St===4||St===3&&(Pe&62914560)===Pe&&300>Ie()-gr?(Je&2)===0&&xn(e,0):Ao|=s,Cn===Pe&&(Cn=0)),Bs(e)}function Ld(e,t){t===0&&(t=Ot()),e=Oi(e,t),e!==null&&(fs(e,t),Bs(e))}function Xm(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Ld(e,s)}function Vm(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(s=n.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(x(314))}i!==null&&i.delete(t),Ld(e,s)}function Zm(e,t){return Lt(e,t)}var Er=null,kn=null,Oo=!1,kr=!1,Bo=!1,Ci=0;function Bs(e){e!==kn&&e.next===null&&(kn===null?Er=kn=e:kn=kn.next=e),kr=!0,Oo||(Oo=!0,Jm())}function ma(e,t){if(!Bo&&kr){Bo=!0;do for(var s=!1,i=Er;i!==null;){if(e!==0){var n=i.pendingLanes;if(n===0)var o=0;else{var k=i.suspendedLanes,L=i.pingedLanes;o=(1<<31-vt(42|e)+1)-1,o&=n&~(k&~L),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(s=!0,Hd(i,o))}else o=Pe,o=Nt(i,i===lt?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Yt(i,o)||(s=!0,Hd(i,o));i=i.next}while(s);Bo=!1}}function Qm(){Nd()}function Nd(){kr=Oo=!1;var e=0;Ci!==0&&c_()&&(e=Ci);for(var t=Ie(),s=null,i=Er;i!==null;){var n=i.next,o=Od(i,t);o===0?(i.next=null,s===null?Er=n:s.next=n,n===null&&(kn=s)):(s=i,(e!==0||(o&3)!==0)&&(kr=!0)),i=n}Mt!==0&&Mt!==5||ma(e),Ci!==0&&(Ci=0)}function Od(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var k=31-vt(o),L=1<<k,G=n[k];G===-1?((L&s)===0||(L&i)!==0)&&(n[k]=ot(L,t)):G<=t&&(e.expiredLanes|=L),o&=~L}if(t=lt,s=Pe,s=Nt(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&mt(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Yt(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&mt(i),ps(s)){case 2:case 8:s=Ze;break;case 32:s=ct;break;case 268435456:s=xt;break;default:s=ct}return i=Bd.bind(null,e),s=Lt(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&mt(i),e.callbackPriority=2,e.callbackNode=null,2}function Bd(e,t){if(Mt!==0&&Mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(xr()&&e.callbackNode!==s)return null;var i=Pe;return i=Nt(e,e===lt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(vd(e,i,t),Od(e,Ie()),e.callbackNode!=null&&e.callbackNode===s?Bd.bind(null,e):null)}function Hd(e,t){if(xr())return null;vd(e,t,!0)}function Jm(){h_(function(){(Je&6)!==0?Lt(rt,Qm):Nd()})}function Ho(){if(Ci===0){var e=hn;e===0&&(e=ie,ie<<=1,(ie&261888)===0&&(ie=256)),Ci=e}return Ci}function zd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Na(""+e)}function Ud(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function e_(e,t,s,i,n){if(t==="submit"&&s&&s.stateNode===n){var o=zd((n[Ut]||null).action),k=i.submitter;k&&(t=(t=k[Ut]||null)?zd(t.formAction):k.getAttribute("formAction"),t!==null&&(o=t,k=null));var L=new za("action","action",null,i,n);e.push({event:L,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Ci!==0){var G=k?Ud(n,k):new FormData(n);so(s,{pending:!0,data:G,method:n.method,action:o},null,G)}}else typeof o=="function"&&(L.preventDefault(),G=k?Ud(n,k):new FormData(n),so(s,{pending:!0,data:G,method:n.method,action:o},o,G))},currentTarget:n}]})}}for(var zo=0;zo<Sl.length;zo++){var Uo=Sl[zo],t_=Uo.toLowerCase(),s_=Uo[0].toUpperCase()+Uo.slice(1);As(t_,"on"+s_)}As(_u,"onAnimationEnd"),As(vu,"onAnimationIteration"),As(gu,"onAnimationStart"),As("dblclick","onDoubleClick"),As("focusin","onFocus"),As("focusout","onBlur"),As(gm,"onTransitionRun"),As(Sm,"onTransitionStart"),As(ym,"onTransitionCancel"),As(Su,"onTransitionEnd"),Vi("onMouseEnter",["mouseout","mouseover"]),Vi("onMouseLeave",["mouseout","mouseover"]),Vi("onPointerEnter",["pointerout","pointerover"]),Vi("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _a="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(" "),i_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_a));function Id(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],n=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var k=i.length-1;0<=k;k--){var L=i[k],G=L.instance,se=L.currentTarget;if(L=L.listener,G!==o&&n.isPropagationStopped())break e;o=L,n.currentTarget=se;try{o(n)}catch(he){qa(he)}n.currentTarget=null,o=G}else for(k=0;k<i.length;k++){if(L=i[k],G=L.instance,se=L.currentTarget,L=L.listener,G!==o&&n.isPropagationStopped())break e;o=L,n.currentTarget=se;try{o(n)}catch(he){qa(he)}n.currentTarget=null,o=G}}}}function $e(e,t){var s=t[Re];s===void 0&&(s=t[Re]=new Set);var i=e+"__bubble";s.has(i)||(qd(t,e,2,!1),s.add(i))}function Io(e,t,s){var i=0;t&&(i|=4),qd(s,e,i,t)}var Ar="_reactListening"+Math.random().toString(36).slice(2);function qo(e){if(!e[Ar]){e[Ar]=!0,Ta.forEach(function(s){s!=="selectionchange"&&(i_.has(s)||Io(s,!1,e),Io(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ar]||(t[Ar]=!0,Io("selectionchange",!1,t))}}function qd(e,t,s,i){switch(vf(t)){case 2:var n=M_;break;case 8:n=j_;break;default:n=sc}s=n.bind(null,t,s,e),n=void 0,!rl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),i?n!==void 0?e.addEventListener(t,s,{capture:!0,passive:n}):e.addEventListener(t,s,!0):n!==void 0?e.addEventListener(t,s,{passive:n}):e.addEventListener(t,s,!1)}function $o(e,t,s,i,n){var o=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var k=i.tag;if(k===3||k===4){var L=i.stateNode.containerInfo;if(L===n)break;if(k===4)for(k=i.return;k!==null;){var G=k.tag;if((G===3||G===4)&&k.stateNode.containerInfo===n)return;k=k.return}for(;L!==null;){if(k=Kt(L),k===null)return;if(G=k.tag,G===5||G===6||G===26||G===27){i=o=k;continue e}L=L.parentNode}}i=i.return}Yc(function(){var se=o,he=nl(s),me=[];e:{var re=yu.get(e);if(re!==void 0){var oe=za,xe=e;switch(e){case"keypress":if(Ba(s)===0)break e;case"keydown":case"keyup":oe=Vp;break;case"focusin":xe="focus",oe=ul;break;case"focusout":xe="blur",oe=ul;break;case"beforeblur":case"afterblur":oe=ul;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=Xc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=zp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Jp;break;case _u:case vu:case gu:oe=qp;break;case Su:oe=tm;break;case"scroll":case"scrollend":oe=Bp;break;case"wheel":oe=im;break;case"copy":case"cut":case"paste":oe=Pp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Zc;break;case"toggle":case"beforetoggle":oe=am}var Me=(t&4)!==0,at=!Me&&(e==="scroll"||e==="scrollend"),J=Me?re!==null?re+"Capture":null:re;Me=[];for(var V=se,te;V!==null;){var fe=V;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||J===null||(fe=zn(V,J),fe!=null&&Me.push(va(V,fe,te))),at)break;V=V.return}0<Me.length&&(re=new oe(re,xe,null,s,he),me.push({event:re,listeners:Me}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",re&&s!==il&&(xe=s.relatedTarget||s.fromElement)&&(Kt(xe)||xe[pe]))break e;if((oe||re)&&(re=he.window===he?he:(re=he.ownerDocument)?re.defaultView||re.parentWindow:window,oe?(xe=s.relatedTarget||s.toElement,oe=se,xe=xe?Kt(xe):null,xe!==null&&(at=K(xe),Me=xe.tag,xe!==at||Me!==5&&Me!==27&&Me!==6)&&(xe=null)):(oe=null,xe=se),oe!==xe)){if(Me=Xc,fe="onMouseLeave",J="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(Me=Zc,fe="onPointerLeave",J="onPointerEnter",V="pointer"),at=oe==null?re:js(oe),te=xe==null?re:js(xe),re=new Me(fe,V+"leave",oe,s,he),re.target=at,re.relatedTarget=te,fe=null,Kt(he)===se&&(Me=new Me(J,V+"enter",xe,s,he),Me.target=te,Me.relatedTarget=at,fe=Me),at=fe,oe&&xe)t:{for(Me=n_,J=oe,V=xe,te=0,fe=J;fe;fe=Me(fe))te++;fe=0;for(var Te=V;Te;Te=Me(Te))fe++;for(;0<te-fe;)J=Me(J),te--;for(;0<fe-te;)V=Me(V),fe--;for(;te--;){if(J===V||V!==null&&J===V.alternate){Me=J;break t}J=Me(J),V=Me(V)}Me=null}else Me=null;oe!==null&&$d(me,re,oe,Me,!1),xe!==null&&at!==null&&$d(me,at,xe,Me,!0)}}e:{if(re=se?js(se):window,oe=re.nodeName&&re.nodeName.toLowerCase(),oe==="select"||oe==="input"&&re.type==="file")var Xe=au;else if(iu(re))if(ru)Xe=mm;else{Xe=fm;var De=dm}else oe=re.nodeName,!oe||oe.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?se&&sl(se.elementType)&&(Xe=au):Xe=pm;if(Xe&&(Xe=Xe(e,se))){nu(me,Xe,s,he);break e}De&&De(e,re,se),e==="focusout"&&se&&re.type==="number"&&se.memoizedProps.value!=null&&tl(re,"number",re.value)}switch(De=se?js(se):window,e){case"focusin":(iu(De)||De.contentEditable==="true")&&(sn=De,_l=se,Yn=null);break;case"focusout":Yn=_l=sn=null;break;case"mousedown":vl=!0;break;case"contextmenu":case"mouseup":case"dragend":vl=!1,pu(me,s,he);break;case"selectionchange":if(vm)break;case"keydown":case"keyup":pu(me,s,he)}var Ue;if(dl)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else tn?tu(e,s)&&(We="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(We="onCompositionStart");We&&(Qc&&s.locale!=="ko"&&(tn||We!=="onCompositionStart"?We==="onCompositionEnd"&&tn&&(Ue=Kc()):(ri=he,ll="value"in ri?ri.value:ri.textContent,tn=!0)),De=Dr(se,We),0<De.length&&(We=new Vc(We,e,null,s,he),me.push({event:We,listeners:De}),Ue?We.data=Ue:(Ue=su(s),Ue!==null&&(We.data=Ue)))),(Ue=lm?om(e,s):cm(e,s))&&(We=Dr(se,"onBeforeInput"),0<We.length&&(De=new Vc("onBeforeInput","beforeinput",null,s,he),me.push({event:De,listeners:We}),De.data=Ue)),e_(me,e,se,s,he)}Id(me,t)})}function va(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Dr(e,t){for(var s=t+"Capture",i=[];e!==null;){var n=e,o=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||o===null||(n=zn(e,s),n!=null&&i.unshift(va(e,n,o)),n=zn(e,t),n!=null&&i.push(va(e,n,o))),e.tag===3)return i;e=e.return}return[]}function n_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $d(e,t,s,i,n){for(var o=t._reactName,k=[];s!==null&&s!==i;){var L=s,G=L.alternate,se=L.stateNode;if(L=L.tag,G!==null&&G===i)break;L!==5&&L!==26&&L!==27||se===null||(G=se,n?(se=zn(s,o),se!=null&&k.unshift(va(s,se,G))):n||(se=zn(s,o),se!=null&&k.push(va(s,se,G)))),s=s.return}k.length!==0&&e.push({event:t,listeners:k})}var a_=/\r\n?/g,r_=/\u0000|\uFFFD/g;function Pd(e){return(typeof e=="string"?e:""+e).replace(a_,`
49
+ `).replace(r_,"")}function Wd(e,t){return t=Pd(t),Pd(e)===t}function nt(e,t,s,i,n,o){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Qi(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Qi(e,""+i);break;case"className":ja(e,"class",i);break;case"tabIndex":ja(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":ja(e,s,i);break;case"style":Wc(e,i,o);break;case"data":if(t!=="object"){ja(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Na(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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 o=="function"&&(s==="formAction"?(t!=="input"&&nt(e,t,"name",n.name,n,null),nt(e,t,"formEncType",n.formEncType,n,null),nt(e,t,"formMethod",n.formMethod,n,null),nt(e,t,"formTarget",n.formTarget,n,null)):(nt(e,t,"encType",n.encType,n,null),nt(e,t,"method",n.method,n,null),nt(e,t,"target",n.target,n,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Na(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=Is);break;case"onScroll":i!=null&&$e("scroll",e);break;case"onScrollEnd":i!=null&&$e("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(x(61));if(s=i.__html,s!=null){if(n.children!=null)throw Error(x(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Na(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":$e("beforetoggle",e),$e("toggle",e),Ma(e,"popover",i);break;case"xlinkActuate":Us(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Us(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Us(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Us(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Us(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Us(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Us(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Us(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Us(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ma(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Np.get(s)||s,Ma(e,s,i))}}function Po(e,t,s,i,n,o){switch(s){case"style":Wc(e,i,o);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(x(61));if(s=i.__html,s!=null){if(n.children!=null)throw Error(x(60));e.innerHTML=s}}break;case"children":typeof i=="string"?Qi(e,i):(typeof i=="number"||typeof i=="bigint")&&Qi(e,""+i);break;case"onScroll":i!=null&&$e("scroll",e);break;case"onScrollEnd":i!=null&&$e("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hn.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(n=s.endsWith("Capture"),t=s.slice(2,n?s.length-7:void 0),o=e[Ut]||null,o=o!=null?o[s]:null,typeof o=="function"&&e.removeEventListener(t,o,n),typeof i=="function")){typeof o!="function"&&o!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,n);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):Ma(e,s,i)}}}function Pt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",e),$e("load",e);var i=!1,n=!1,o;for(o in s)if(s.hasOwnProperty(o)){var k=s[o];if(k!=null)switch(o){case"src":i=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(x(137,t));default:nt(e,t,o,k,s,null)}}n&&nt(e,t,"srcSet",s.srcSet,s,null),i&&nt(e,t,"src",s.src,s,null);return;case"input":$e("invalid",e);var L=o=k=n=null,G=null,se=null;for(i in s)if(s.hasOwnProperty(i)){var he=s[i];if(he!=null)switch(i){case"name":n=he;break;case"type":k=he;break;case"checked":G=he;break;case"defaultChecked":se=he;break;case"value":o=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(x(137,t));break;default:nt(e,t,i,he,s,null)}}Ic(e,o,L,G,se,k,n,!1);return;case"select":$e("invalid",e),i=k=o=null;for(n in s)if(s.hasOwnProperty(n)&&(L=s[n],L!=null))switch(n){case"value":o=L;break;case"defaultValue":k=L;break;case"multiple":i=L;default:nt(e,t,n,L,s,null)}t=o,s=k,e.multiple=!!i,t!=null?Zi(e,!!i,t,!1):s!=null&&Zi(e,!!i,s,!0);return;case"textarea":$e("invalid",e),o=n=i=null;for(k in s)if(s.hasOwnProperty(k)&&(L=s[k],L!=null))switch(k){case"value":i=L;break;case"defaultValue":n=L;break;case"children":o=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(x(91));break;default:nt(e,t,k,L,s,null)}$c(e,i,n,o);return;case"option":for(G in s)if(s.hasOwnProperty(G)&&(i=s[G],i!=null))switch(G){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:nt(e,t,G,i,s,null)}return;case"dialog":$e("beforetoggle",e),$e("toggle",e),$e("cancel",e),$e("close",e);break;case"iframe":case"object":$e("load",e);break;case"video":case"audio":for(i=0;i<_a.length;i++)$e(_a[i],e);break;case"image":$e("error",e),$e("load",e);break;case"details":$e("toggle",e);break;case"embed":case"source":case"link":$e("error",e),$e("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in s)if(s.hasOwnProperty(se)&&(i=s[se],i!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(x(137,t));default:nt(e,t,se,i,s,null)}return;default:if(sl(t)){for(he in s)s.hasOwnProperty(he)&&(i=s[he],i!==void 0&&Po(e,t,he,i,s,void 0));return}}for(L in s)s.hasOwnProperty(L)&&(i=s[L],i!=null&&nt(e,t,L,i,s,null))}function l_(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,o=null,k=null,L=null,G=null,se=null,he=null;for(oe in s){var me=s[oe];if(s.hasOwnProperty(oe)&&me!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":G=me;default:i.hasOwnProperty(oe)||nt(e,t,oe,null,i,me)}}for(var re in i){var oe=i[re];if(me=s[re],i.hasOwnProperty(re)&&(oe!=null||me!=null))switch(re){case"type":o=oe;break;case"name":n=oe;break;case"checked":se=oe;break;case"defaultChecked":he=oe;break;case"value":k=oe;break;case"defaultValue":L=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(x(137,t));break;default:oe!==me&&nt(e,t,re,oe,i,me)}}el(e,k,L,G,se,he,o,n);return;case"select":oe=k=L=re=null;for(o in s)if(G=s[o],s.hasOwnProperty(o)&&G!=null)switch(o){case"value":break;case"multiple":oe=G;default:i.hasOwnProperty(o)||nt(e,t,o,null,i,G)}for(n in i)if(o=i[n],G=s[n],i.hasOwnProperty(n)&&(o!=null||G!=null))switch(n){case"value":re=o;break;case"defaultValue":L=o;break;case"multiple":k=o;default:o!==G&&nt(e,t,n,o,i,G)}t=L,s=k,i=oe,re!=null?Zi(e,!!s,re,!1):!!i!=!!s&&(t!=null?Zi(e,!!s,t,!0):Zi(e,!!s,s?[]:"",!1));return;case"textarea":oe=re=null;for(L in s)if(n=s[L],s.hasOwnProperty(L)&&n!=null&&!i.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:nt(e,t,L,null,i,n)}for(k in i)if(n=i[k],o=s[k],i.hasOwnProperty(k)&&(n!=null||o!=null))switch(k){case"value":re=n;break;case"defaultValue":oe=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(x(91));break;default:n!==o&&nt(e,t,k,n,i,o)}qc(e,re,oe);return;case"option":for(var xe in s)if(re=s[xe],s.hasOwnProperty(xe)&&re!=null&&!i.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:nt(e,t,xe,null,i,re)}for(G in i)if(re=i[G],oe=s[G],i.hasOwnProperty(G)&&re!==oe&&(re!=null||oe!=null))switch(G){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:nt(e,t,G,re,i,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in s)re=s[Me],s.hasOwnProperty(Me)&&re!=null&&!i.hasOwnProperty(Me)&&nt(e,t,Me,null,i,re);for(se in i)if(re=i[se],oe=s[se],i.hasOwnProperty(se)&&re!==oe&&(re!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(x(137,t));break;default:nt(e,t,se,re,i,oe)}return;default:if(sl(t)){for(var at in s)re=s[at],s.hasOwnProperty(at)&&re!==void 0&&!i.hasOwnProperty(at)&&Po(e,t,at,void 0,i,re);for(he in i)re=i[he],oe=s[he],!i.hasOwnProperty(he)||re===oe||re===void 0&&oe===void 0||Po(e,t,he,re,i,oe);return}}for(var J in s)re=s[J],s.hasOwnProperty(J)&&re!=null&&!i.hasOwnProperty(J)&&nt(e,t,J,null,i,re);for(me in i)re=i[me],oe=s[me],!i.hasOwnProperty(me)||re===oe||re==null&&oe==null||nt(e,t,me,re,i,oe)}function Fd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var n=s[i],o=n.transferSize,k=n.initiatorType,L=n.duration;if(o&&L&&Fd(k)){for(k=0,L=n.responseEnd,i+=1;i<s.length;i++){var G=s[i],se=G.startTime;if(se>L)break;var he=G.transferSize,me=G.initiatorType;he&&Fd(me)&&(G=G.responseEnd,k+=he*(G<L?1:(L-se)/(G-se)))}if(--i,t+=8*(o+k)/(n.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 Wo=null,Fo=null;function Rr(e){return e.nodeType===9?e:e.ownerDocument}function Yd(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 Kd(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 Yo(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 Ko=null;function c_(){var e=window.event;return e&&e.type==="popstate"?e===Ko?!1:(Ko=e,!0):(Ko=null,!1)}var Gd=typeof setTimeout=="function"?setTimeout:void 0,u_=typeof clearTimeout=="function"?clearTimeout:void 0,Xd=typeof Promise=="function"?Promise:void 0,h_=typeof queueMicrotask=="function"?queueMicrotask:typeof Xd<"u"?function(e){return Xd.resolve(null).then(e).catch(d_)}:Gd;function d_(e){setTimeout(function(){throw e})}function wi(e){return e==="head"}function Vd(e,t){var s=t,i=0;do{var n=s.nextSibling;if(e.removeChild(s),n&&n.nodeType===8)if(s=n.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(n),Tn(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")ga(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,ga(s);for(var o=s.firstChild;o;){var k=o.nextSibling,L=o.nodeName;o[Bt]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&o.rel.toLowerCase()==="stylesheet"||s.removeChild(o),o=k}}else s==="body"&&ga(e.ownerDocument.body);s=n}while(s);Tn(t)}function Zd(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function Go(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Go(s),ks(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function f_(e,t,s,i){for(;e.nodeType===1;){var n=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Bt])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=ws(e.nextSibling),e===null)break}return null}function p_(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ws(e.nextSibling),e===null))return null;return e}function Qd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ws(e.nextSibling),e===null))return null;return e}function Xo(e){return e.data==="$?"||e.data==="$~"}function Vo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m_(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ws(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 Zo=null;function Jd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return ws(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function ef(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function tf(e,t,s){switch(t=Rr(s),e){case"html":if(e=t.documentElement,!e)throw Error(x(452));return e;case"head":if(e=t.head,!e)throw Error(x(453));return e;case"body":if(e=t.body,!e)throw Error(x(454));return e;default:throw Error(x(451))}}function ga(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ks(e)}var xs=new Map,sf=new Set;function Tr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var si=W.d;W.d={f:__,r:v_,D:g_,C:S_,L:y_,m:b_,X:w_,S:C_,M:x_};function __(){var e=si.f(),t=br();return e||t}function v_(e){var t=zs(e);t!==null&&t.tag===5&&t.type==="form"?Sh(t):si.r(e)}var An=typeof document>"u"?null:document;function nf(e,t,s){var i=An;if(i&&typeof t=="string"&&t){var n=_s(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof s=="string"&&(n+='[crossorigin="'+s+'"]'),sf.has(n)||(sf.add(n),e={rel:e,crossOrigin:s,href:t},i.querySelector(n)===null&&(t=i.createElement("link"),Pt(t,"link",e),Et(t),i.head.appendChild(t)))}}function g_(e){si.D(e),nf("dns-prefetch",e,null)}function S_(e,t){si.C(e,t),nf("preconnect",e,t)}function y_(e,t,s){si.L(e,t,s);var i=An;if(i&&e&&t){var n='link[rel="preload"][as="'+_s(t)+'"]';t==="image"&&s&&s.imageSrcSet?(n+='[imagesrcset="'+_s(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(n+='[imagesizes="'+_s(s.imageSizes)+'"]')):n+='[href="'+_s(e)+'"]';var o=n;switch(t){case"style":o=Dn(e);break;case"script":o=Rn(e)}xs.has(o)||(e=l({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),xs.set(o,e),i.querySelector(n)!==null||t==="style"&&i.querySelector(Sa(o))||t==="script"&&i.querySelector(ya(o))||(t=i.createElement("link"),Pt(t,"link",e),Et(t),i.head.appendChild(t)))}}function b_(e,t){si.m(e,t);var s=An;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+_s(i)+'"][href="'+_s(e)+'"]',o=n;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Rn(e)}if(!xs.has(o)&&(e=l({rel:"modulepreload",href:e},t),xs.set(o,e),s.querySelector(n)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ya(o)))return}i=s.createElement("link"),Pt(i,"link",e),Et(i),s.head.appendChild(i)}}}function C_(e,t,s){si.S(e,t,s);var i=An;if(i&&e){var n=Ht(i).hoistableStyles,o=Dn(e);t=t||"default";var k=n.get(o);if(!k){var L={loading:0,preload:null};if(k=i.querySelector(Sa(o)))L.loading=5;else{e=l({rel:"stylesheet",href:e,"data-precedence":t},s),(s=xs.get(o))&&Qo(e,s);var G=k=i.createElement("link");Et(G),Pt(G,"link",e),G._p=new Promise(function(se,he){G.onload=se,G.onerror=he}),G.addEventListener("load",function(){L.loading|=1}),G.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Mr(k,t,i)}k={type:"stylesheet",instance:k,count:1,state:L},n.set(o,k)}}}function w_(e,t){si.X(e,t);var s=An;if(s&&e){var i=Ht(s).hoistableScripts,n=Rn(e),o=i.get(n);o||(o=s.querySelector(ya(n)),o||(e=l({src:e,async:!0},t),(t=xs.get(n))&&Jo(e,t),o=s.createElement("script"),Et(o),Pt(o,"link",e),s.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(n,o))}}function x_(e,t){si.M(e,t);var s=An;if(s&&e){var i=Ht(s).hoistableScripts,n=Rn(e),o=i.get(n);o||(o=s.querySelector(ya(n)),o||(e=l({src:e,async:!0,type:"module"},t),(t=xs.get(n))&&Jo(e,t),o=s.createElement("script"),Et(o),Pt(o,"link",e),s.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(n,o))}}function af(e,t,s,i){var n=(n=ge.current)?Tr(n):null;if(!n)throw Error(x(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Dn(s.href),s=Ht(n).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Dn(s.href);var o=Ht(n).hoistableStyles,k=o.get(e);if(k||(n=n.ownerDocument||n,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,k),(o=n.querySelector(Sa(e)))&&!o._p&&(k.instance=o,k.state.loading=5),xs.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xs.set(e,s),o||E_(n,e,s,k.state))),t&&i===null)throw Error(x(528,""));return k}if(t&&i!==null)throw Error(x(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Rn(s),s=Ht(n).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(x(444,e))}}function Dn(e){return'href="'+_s(e)+'"'}function Sa(e){return'link[rel="stylesheet"]['+e+"]"}function rf(e){return l({},e,{"data-precedence":e.precedence,precedence:null})}function E_(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Pt(t,"link",s),Et(t),e.head.appendChild(t))}function Rn(e){return'[src="'+_s(e)+'"]'}function ya(e){return"script[async]"+e}function lf(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+_s(s.href)+'"]');if(i)return t.instance=i,Et(i),i;var n=l({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Et(i),Pt(i,"style",n),Mr(i,s.precedence,e),t.instance=i;case"stylesheet":n=Dn(s.href);var o=e.querySelector(Sa(n));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;i=rf(s),(n=xs.get(n))&&Qo(i,n),o=(e.ownerDocument||e).createElement("link"),Et(o);var k=o;return k._p=new Promise(function(L,G){k.onload=L,k.onerror=G}),Pt(o,"link",i),t.state.loading|=4,Mr(o,s.precedence,e),t.instance=o;case"script":return o=Rn(s.src),(n=e.querySelector(ya(o)))?(t.instance=n,Et(n),n):(i=s,(n=xs.get(o))&&(i=l({},s),Jo(i,n)),e=e.ownerDocument||e,n=e.createElement("script"),Et(n),Pt(n,"link",i),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(x(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Mr(i,s.precedence,e));return t.instance}function Mr(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=i.length?i[i.length-1]:null,o=n,k=0;k<i.length;k++){var L=i[k];if(L.dataset.precedence===t)o=L;else if(o!==n)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Qo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var jr=null;function of(e,t,s){if(jr===null){var i=new Map,n=jr=new Map;n.set(s,i)}else n=jr,i=n.get(s),i||(i=new Map,n.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),n=0;n<s.length;n++){var o=s[n];if(!(o[Bt]||o[_t]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var k=o.getAttribute(t)||"";k=e+k;var L=i.get(k);L?L.push(o):i.set(k,[o])}}return i}function cf(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function k_(e,t,s){if(s===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 uf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A_(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var n=Dn(i.href),o=t.querySelector(Sa(n));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=o,Et(o);return}o=t.ownerDocument||t,i=rf(i),(n=xs.get(n))&&Qo(i,n),o=o.createElement("link"),Et(o);var k=o;k._p=new Promise(function(L,G){k.onload=L,k.onerror=G}),Pt(o,"link",i),s.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Lr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var ec=0;function D_(e,t){return e.stylesheets&&e.count===0&&Or(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Or(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&ec===0&&(ec=62500*o_());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Or(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>ec?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(n)}}:null}function Lr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Or(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nr=null;function Or(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nr=new Map,t.forEach(R_,e),Nr=null,Lr.call(e))}function R_(e,t){if(!(t.state.loading&4)){var s=Nr.get(e);if(s)var i=s.get(null);else{s=new Map,Nr.set(e,s);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<n.length;o++){var k=n[o];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(s.set(k.dataset.precedence,k),i=k)}i&&s.set(null,i)}n=t.instance,k=n.getAttribute("data-precedence"),o=s.get(k)||i,o===i&&s.set(null,n),s.set(k,n),this.count++,i=Lr.bind(this),n.addEventListener("load",i),n.addEventListener("error",i),o?o.parentNode.insertBefore(n,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var ba={$$typeof:u,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function T_(e,t,s,i,n,o,k,L,G){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=ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ai(0),this.hiddenUpdates=ai(null),this.identifierPrefix=i,this.onUncaughtError=n,this.onCaughtError=o,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function hf(e,t,s,i,n,o,k,L,G,se,he,me){return e=new T_(e,t,s,k,G,se,he,me,L),t=1,o===!0&&(t|=24),o=rs(3,null,null,t),e.current=o,o.stateNode=e,t=jl(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:i,isDehydrated:s,cache:t},Bl(o),e}function df(e){return e?(e=rn,e):rn}function ff(e,t,s,i,n,o){n=df(n),i.context===null?i.context=n:i.pendingContext=n,i=di(t),i.payload={element:s},o=o===void 0?null:o,o!==null&&(i.callback=o),s=fi(e,i,t),s!==null&&(ss(s,e,t),Jn(s,e,t))}function pf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function tc(e,t){pf(e,t),(e=e.alternate)&&pf(e,t)}function mf(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&ss(t,e,67108864),tc(e,67108864)}}function _f(e){if(e.tag===13||e.tag===31){var t=hs();t=Hs(t);var s=Oi(e,t);s!==null&&ss(s,e,t),tc(e,t)}}var Br=!0;function M_(e,t,s,i){var n=F.T;F.T=null;var o=W.p;try{W.p=2,sc(e,t,s,i)}finally{W.p=o,F.T=n}}function j_(e,t,s,i){var n=F.T;F.T=null;var o=W.p;try{W.p=8,sc(e,t,s,i)}finally{W.p=o,F.T=n}}function sc(e,t,s,i){if(Br){var n=ic(i);if(n===null)$o(e,t,i,Hr,s),gf(e,i);else if(N_(n,e,t,s,i))i.stopPropagation();else if(gf(e,i),t&4&&-1<L_.indexOf(e)){for(;n!==null;){var o=zs(n);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var k=Ee(o.pendingLanes);if(k!==0){var L=o;for(L.pendingLanes|=2,L.entangledLanes|=2;k;){var G=1<<31-vt(k);L.entanglements[1]|=G,k&=~G}Bs(o),(Je&6)===0&&(Sr=Ie()+500,ma(0))}}break;case 31:case 13:L=Oi(o,2),L!==null&&ss(L,o,2),br(),tc(o,2)}if(o=ic(i),o===null&&$o(e,t,i,Hr,s),o===n)break;n=o}n!==null&&i.stopPropagation()}else $o(e,t,i,null,s)}}function ic(e){return e=nl(e),nc(e)}var Hr=null;function nc(e){if(Hr=null,e=Kt(e),e!==null){var t=K(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=H(t),e!==null)return e;e=null}else if(s===31){if(e=c(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Hr=e,null}function vf(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ke()){case rt:return 2;case Ze:return 8;case ct:case Xt:return 32;case xt:return 268435456;default:return 32}default:return 32}}var ac=!1,xi=null,Ei=null,ki=null,Ca=new Map,wa=new Map,Ai=[],L_="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 gf(e,t){switch(e){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":Ei=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":Ca.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wa.delete(t.pointerId)}}function xa(e,t,s,i,n,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:o,targetContainers:[n]},t!==null&&(t=zs(t),t!==null&&mf(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function N_(e,t,s,i,n){switch(t){case"focusin":return xi=xa(xi,e,t,s,i,n),!0;case"dragenter":return Ei=xa(Ei,e,t,s,i,n),!0;case"mouseover":return ki=xa(ki,e,t,s,i,n),!0;case"pointerover":var o=n.pointerId;return Ca.set(o,xa(Ca.get(o)||null,e,t,s,i,n)),!0;case"gotpointercapture":return o=n.pointerId,wa.set(o,xa(wa.get(o)||null,e,t,s,i,n)),!0}return!1}function Sf(e){var t=Kt(e.target);if(t!==null){var s=K(t);if(s!==null){if(t=s.tag,t===13){if(t=H(s),t!==null){e.blockedOn=t,Ra(e.priority,function(){_f(s)});return}}else if(t===31){if(t=c(s),t!==null){e.blockedOn=t,Ra(e.priority,function(){_f(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=ic(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);il=i,s.target.dispatchEvent(i),il=null}else return t=zs(s),t!==null&&mf(t),e.blockedOn=s,!1;t.shift()}return!0}function yf(e,t,s){zr(e)&&s.delete(t)}function O_(){ac=!1,xi!==null&&zr(xi)&&(xi=null),Ei!==null&&zr(Ei)&&(Ei=null),ki!==null&&zr(ki)&&(ki=null),Ca.forEach(yf),wa.forEach(yf)}function Ur(e,t){e.blockedOn===t&&(e.blockedOn=null,ac||(ac=!0,h.unstable_scheduleCallback(h.unstable_NormalPriority,O_)))}var Ir=null;function bf(e){Ir!==e&&(Ir=e,h.unstable_scheduleCallback(h.unstable_NormalPriority,function(){Ir===e&&(Ir=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],n=e[t+2];if(typeof i!="function"){if(nc(i||s)===null)continue;break}var o=zs(s);o!==null&&(e.splice(t,3),t-=3,so(o,{pending:!0,data:n,method:s.method,action:i},i,n))}}))}function Tn(e){function t(G){return Ur(G,e)}xi!==null&&Ur(xi,e),Ei!==null&&Ur(Ei,e),ki!==null&&Ur(ki,e),Ca.forEach(t),wa.forEach(t);for(var s=0;s<Ai.length;s++){var i=Ai[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ai.length&&(s=Ai[0],s.blockedOn===null);)Sf(s),s.blockedOn===null&&Ai.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var n=s[i],o=s[i+1],k=n[Ut]||null;if(typeof o=="function")k||bf(s);else if(k){var L=null;if(o&&o.hasAttribute("formAction")){if(n=o,k=o[Ut]||null)L=k.formAction;else if(nc(n)!==null)continue}else L=k.action;typeof L=="function"?s[i+1]=L:(s.splice(i,3),i-=3),bf(s)}}}function Cf(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(k){return n=k})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function rc(e){this._internalRoot=e}qr.prototype.render=rc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(x(409));var s=t.current,i=hs();ff(s,i,e,t,null,null)},qr.prototype.unmount=rc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ff(e.current,2,null,e,null,null),br(),t[pe]=null}};function qr(e){this._internalRoot=e}qr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bn();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ai.length&&t!==0&&t<Ai[s].priority;s++);Ai.splice(s,0,e),s===0&&Sf(e)}};var wf=b.version;if(wf!=="19.2.7")throw Error(x(527,wf,"19.2.7"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(x(188)):(e=Object.keys(e).join(","),Error(x(268,e)));return e=m(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var B_={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$r.isDisabled&&$r.supportsFiber)try{Tt=$r.inject(B_),yt=$r}catch{}}return ka.createRoot=function(e,t){if(!U(e))throw Error(x(299));var s=!1,i="",n=Rh,o=Th,k=Mh;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(k=t.onRecoverableError)),t=hf(e,1,!1,null,null,s,i,null,n,o,k,Cf),e[pe]=t.current,qo(e),new rc(t)},ka.hydrateRoot=function(e,t,s){if(!U(e))throw Error(x(299));var i=!1,n="",o=Rh,k=Th,L=Mh,G=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(n=s.identifierPrefix),s.onUncaughtError!==void 0&&(o=s.onUncaughtError),s.onCaughtError!==void 0&&(k=s.onCaughtError),s.onRecoverableError!==void 0&&(L=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),t=hf(e,1,!0,t,s??null,i,n,G,o,k,L,Cf),t.context=df(null),s=t.current,i=hs(),i=Hs(i),n=di(i),n.callback=null,fi(s,n,i),s=i,t.current.lanes=s,fs(t,s),Bs(t),e[pe]=t.current,qo(e),new qr(t)},ka.version="19.2.7",ka}var Lf;function K_(){if(Lf)return uc.exports;Lf=1;function h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h)}catch(b){console.error(b)}}return h(),uc.exports=Y_(),uc.exports}var G_=K_();const rp=Date.now(),ii=h=>new Date(rp-h*6e4).toISOString(),Kr=h=>new Date(rp-h*24*60*6e4).toISOString(),Nf="/Users/demo/acme-app";ii(1),ii(1),ii(42),ii(20),Kr(2),Kr(1),ii(0),ii(0),ii(3),ii(3);ii(1),Kr(1),Kr(1);function lp(){return!1}function Mn(h){return(h==null?void 0:h.boundWorkflowPath)??null}class ds extends Error{constructor(M,x,U){super(x);lc(this,"status");lc(this,"reason");this.name="ApiError",this.status=M,this.reason=U}}function jn(){const h=window.__HARNESS__;return h!=null&&h.token?h.token:new URLSearchParams(window.location.search).get("token")??""}class X_{startAuth(){return this.request("/api/auth/start",{method:"POST"})}disconnect(){return this.request("/api/auth/disconnect",{method:"POST"})}authStatus(){return this.request("/api/auth/status")}async request(b,M){const x=await fetch(b,{...M,headers:{"Content-Type":"application/json","X-Harness-Token":jn(),...M==null?void 0:M.headers}});if(!x.ok){const U=await x.text().catch(()=>"");let K;try{const H=U?JSON.parse(U):void 0;H&&typeof H=="object"&&typeof H.error=="string"&&(K=H.error)}catch{}throw new ds(x.status,`${(M==null?void 0:M.method)??"GET"} ${b} → ${x.status}${U?`: ${U}`:""}`,K)}if(x.status!==204)return await x.json()}getState(){return this.request("/api/state")}createSession(b){return this.request("/api/sessions",{method:"POST",body:JSON.stringify(b)})}listSessions(){return this.request("/api/sessions")}sessionHistory(b){return this.request(`/api/sessions/history?cwd=${encodeURIComponent(b)}`)}resumeSession(b){return this.request(`/api/sessions/${encodeURIComponent(b)}/resume`,{method:"POST"})}async killSession(b){await this.request(`/api/sessions/${encodeURIComponent(b)}`,{method:"DELETE"})}async injectInput(b,M){await this.request(`/api/sessions/${encodeURIComponent(b)}/input`,{method:"POST",body:JSON.stringify(M)})}attachImage(b,M){return this.request(`/api/sessions/${encodeURIComponent(b)}/image`,{method:"POST",body:JSON.stringify(M)})}listWorkflows(){return this.request("/api/workflows")}connectWorkflow(b){return this.request("/api/workflows/connect",{method:"POST",body:JSON.stringify({path:b})})}scanWorkflows(b){return this.request("/api/workflows/scan",{method:"POST",body:JSON.stringify({root:b})})}listHarnesses(){return this.request("/api/harnesses")}listMacros(){return this.request("/api/macros")}async runMacro(b,M){await this.request(`/api/macros/${encodeURIComponent(b)}/run`,{method:"POST",body:JSON.stringify(M)})}getSettings(){return this.request("/api/settings")}updateSettings(b){return this.request("/api/settings",{method:"PATCH",body:JSON.stringify(b)})}listDir(b){const M=b?`?path=${encodeURIComponent(b)}`:"";return this.request(`/api/fs/list${M}`)}bindWorkflow(b,M){const x={workflowPath:M};return this.request(`/api/sessions/${encodeURIComponent(b)}/workflow`,{method:"PATCH",body:JSON.stringify(x)})}seedSampleProject(){return this.request("/api/sample-project",{method:"POST"})}getRunState(b){return this.request(`/api/runs/${encodeURIComponent(b)}/state`)}async runLocal(b,M){const x=await fetch("/api/runs/local",{method:"POST",headers:{"Content-Type":"application/json","X-Harness-Token":jn()},body:JSON.stringify(b)});if(!x.ok||!x.body){const p=await x.text().catch(()=>"");throw new ds(x.status,`POST /api/runs/local → ${x.status}${p?`: ${p}`:""}`,void 0)}const U=x.body.getReader(),K=new TextDecoder;let H="";const c=(p,m)=>{H+=p;const{lines:v,rest:l}=Z_(H,m);H=l;for(const _ of v){const C=Q_(_);C&&M(C)}};for(;;){const{done:p,value:m}=await U.read();if(p)break;c(K.decode(m,{stream:!0}),!1)}c(K.decode(),!0)}async deploy(b,M){const x=await this.streamNdjson(`/api/workflows/${encodeURIComponent(b)}/deploy`,{method:"POST"},M);return J_(x)}async run(b){return this.request("/api/runs",{method:"POST",body:JSON.stringify(b)})}async streamNdjson(b,M,x){const U=await fetch(b,{...M,headers:{"Content-Type":"application/json","X-Harness-Token":jn(),...M.headers}});if(!U.ok||!U.body){const v=await U.text().catch(()=>"");let l;try{const _=v?JSON.parse(v):void 0;_&&typeof _=="object"&&typeof _.error=="string"&&(l=_.error)}catch{}throw new ds(U.status,`${M.method??"GET"} ${b} → ${U.status}${v?`: ${v}`:""}`,l)}const K=[],H=U.body.getReader(),c=new TextDecoder;let p="";const m=v=>{p+=v;let l=p.indexOf(`
50
+ `);for(;l!==-1;){const _=p.slice(0,l);p=p.slice(l+1);const C=V_(_);C!==void 0&&(K.push(C),x==null||x(C)),l=p.indexOf(`
51
+ `)}};for(;;){const{done:v,value:l}=await H.read();if(v)break;m(c.decode(l,{stream:!0}))}return m(c.decode()+`
52
+ `),K}}function V_(h){const b=h.trim();if(b==="")return;let M;try{M=JSON.parse(b)}catch{return}return M===null?void 0:M}function Z_(h,b){const M=h.split(`
53
+ `);if(b)return{lines:M.filter(U=>U.trim()!==""),rest:""};const x=M.pop()??"";return{lines:M.filter(U=>U.trim()!==""),rest:x}}function Q_(h){const b=h.trim();if(b==="")return null;let M;try{M=JSON.parse(b)}catch{return null}return typeof M!="object"||M===null||Array.isArray(M)?null:M}function J_(h){for(let b=h.length-1;b>=0;b--){const M=h[b];if(M.phase==="ready"||M.phase==="error")return M}return{phase:"error",code:"NO_OUTPUT",message:"deploy produced no terminal status"}}function ev(){return new X_}function tv(h){return h.find(b=>b.id==="visualize")}function op(h,b,M){if(h.requiresWorkflow){if(!b)return"Select a workflow first";if(h.action.kind==="open-url"&&h.action.url.includes("{{workflow.definitionId}}")&&b.definitionId==null)return"Not deployed yet"}return h.action.kind!=="open-url"&&!M?"Start a session first":null}function sv(h,b){return h.replace("{{workflow.definitionId}}",String((b==null?void 0:b.definitionId)??""))}const cp="sapiom-harness-theme",bc=new Set;function iv(){const h=typeof window<"u"?window.localStorage.getItem(cp):null;return h==="light"||h==="dark"?h:"dark"}let Ac=iv();function Dc(){return Ac}function nv(h){Ac=h,document.documentElement.dataset.theme=h,window.localStorage.setItem(cp,h),bc.forEach(b=>b(h))}function av(){nv(Ac==="dark"?"light":"dark")}function Rc(h){return bc.add(h),()=>bc.delete(h)}function Nn(h,b,M){const x={event:h,...b?{data:b}:{}};fetch("/api/track",{method:"POST",headers:{"Content-Type":"application/json","X-Harness-Token":jn()},body:JSON.stringify(x),keepalive:!0}).catch(()=>{})}function Aa(h){var x,U;const b=(x=h.inputSchema)==null?void 0:x.properties;if(!b)return[];const M=new Set(((U=h.inputSchema)==null?void 0:U.required)??[]);return Object.entries(b).map(([K,H])=>({name:K,type:(H==null?void 0:H.type)??"unknown",required:M.has(K)})).sort((K,H)=>Number(H.required)-Number(K.required))}function Gi(h){return h<1e3?`${h}ms`:`${Math.round(h/100)/10}s`}function rv(h,b){const M=[],x=Aa(h).length;x>0&&M.push(x===1?"1 input":`${x} inputs`);const U=b.filter(K=>K.from===h.id&&K.kind==="branching").length;return U>1&&M.push(`${U} branches`),h.timeoutMs&&h.timeoutMs>0&&M.push(`${Gi(h.timeoutMs)} limit`),M}function lv(h){const b=h.nodes.filter(M=>M.kind==="terminal-success"||M.kind==="terminal-warn").length;return{steps:h.nodes.length-b,exits:b}}function ov(h){const{steps:b,exits:M}=lv(h),x=[`${b} ${b===1?"step":"steps"}`];return M>0&&x.push(`${M} ${M===1?"exit":"exits"}`),x.join(" · ")}function up(h){switch(h){case"entry":return"Entry step";case"pause":return"Pause";case"terminal-success":return"Terminal · success";case"terminal-warn":return"Terminal · needs attention";case"launched-workflow":return"Launched workflow";default:return"Step"}}function cv(h){if(!h||typeof h!="object")return null;const b=h;if(!b.properties||typeof b.properties!="object")return null;const M={};for(const[x,U]of Object.entries(b.properties)){const K=U&&typeof U=="object"?U.type:void 0;M[x]=typeof K=="string"?{type:K}:{}}return Object.keys(M).length===0?null:{properties:M,required:Array.isArray(b.required)?b.required.filter(x=>typeof x=="string"):[]}}function uv(h){if(!h||typeof h!="object")return null;const b=h;if(!Array.isArray(b.nodes)||!Array.isArray(b.edges))return null;const M=x=>typeof x=="string"?x:"";return{name:M(b.name),entry:M(b.entry),nodes:b.nodes.map(x=>({id:M(x.id),kind:M(x.kind),label:M(x.label),role:M(x.role),description:M(x.description),timeoutMs:typeof x.timeoutMs=="number"&&x.timeoutMs>0?x.timeoutMs:null,inputSchema:cv(x.inputSchema),capabilities:Array.isArray(x.capabilities)?x.capabilities.filter(U=>typeof U=="string"):[]})),edges:b.edges.map(x=>({from:M(x.from),to:M(x.to),kind:M(x.kind),label:M(x.label)})),groups:Array.isArray(b.groups)?b.groups.map(x=>({label:M(x.label),nodeIds:Array.isArray(x.nodeIds)?x.nodeIds.filter(U=>typeof U=="string"):[]})):[],warnings:Array.isArray(b.warnings)?b.warnings.filter(x=>typeof x=="string"):[]}}const hp="sapiom-harness-ui-prefs";function Ti(){if(typeof window>"u")return{};try{const h=window.localStorage.getItem(hp);return h?JSON.parse(h):{}}catch{return{}}}function Ln(h){if(!(typeof window>"u"))try{window.localStorage.setItem(hp,JSON.stringify({...Ti(),...h}))}catch{}}function Gr(h,b){return!h||h.stubbed!==!0?!1:h.steps.some(M=>M.name===b)}function hv(h){if(!h)return null;const b={};return h.unusedStubs&&h.unusedStubs.length>0&&(b.unusedStubs=h.unusedStubs),h.stubWarnings&&h.stubWarnings.length>0&&(b.stubWarnings=h.stubWarnings),b.unusedStubs||b.stubWarnings?b:null}function Da(h){if(typeof h=="string")return h;try{return JSON.stringify(h,null,2)??String(h)}catch{return String(h)}}const Of=3e3,Bf=2e3;function dv(h){return h<1e3?`${h}ms`:`${(h/1e3).toFixed(1)}s`}function Hf(h){let b;if(typeof h=="string")b=h;else try{b=JSON.stringify(h,null,2)??String(h)}catch{b=String(h)}return b.length>Bf?`${b.slice(0,Bf)}
54
+ … (truncated, ${b.length} chars total)`:b}function fv(h,b,M){const x=[];x.push(`Step: ${h.name}`),x.push(`Status: ${h.status}`),h.latencyMs!=null&&x.push(`Latency: ${dv(h.latencyMs)}`),h.status==="failed"&&h.error&&x.push(`Error: ${h.error}`),(b==null?void 0:b.input)!==void 0&&x.push(`
55
+ Input:
56
+ ${Hf(b.input)}`),(b==null?void 0:b.output)!==void 0&&x.push(`
57
+ Output:
58
+ ${Hf(b.output)}`);const U=b==null?void 0:b.calls;if(U!==void 0)if(U.length>0){x.push(`
59
+ Capabilities called:`);for(const K of U){const H=K.stubUsed?" (stubbed)":"";x.push(` - ${K.capability}${H}`)}}else x.push(`
60
+ Capabilities called: none (the step made zero capability calls).`);else if(M!=null&&M.capabilities&&M.capabilities.length>0){x.push(`
61
+ Capabilities declared (no call trace):`);for(const K of M.capabilities)x.push(` - ${K}`)}if(b!=null&&b.unusedStubs&&b.unusedStubs.length>0){x.push(`
62
+ Unused stubs (supplied but matched no call):`);for(const K of b.unusedStubs)x.push(` - ${K}`)}if(b!=null&&b.stubWarnings&&b.stubWarnings.length>0){x.push(`
63
+ Stub warnings:`);for(const K of b.stubWarnings)x.push(` - ${K}`)}if(h.logSlice){const K=h.logSlice.trimEnd(),H=K.length>Of?K.slice(K.length-Of):K;x.push(`
64
+ Logs:
65
+ ${H}`)}return x.join(`
66
+ `)}const pv=/\.(png|jpg|jpeg|webp|gif|svg)($|\?)/i,mv=/https?:\/\/[^\s"'<>`\])\]]+/gi,_v=/[.,;:)\]}\s]+$/;function zf(h){if(typeof h=="string")return h;try{return JSON.stringify(h)??String(h)}catch{return String(h)}}function vv(h){const b=new Set,M=[],x=U=>{const K=U.matchAll(mv);for(const[H]of K){const c=H.replace(_v,"");if(!c||b.has(c))continue;b.add(c);const p=pv.test(c)?"image":"other";M.push({url:c,kind:p})}};if(h.output!==void 0&&x(zf(h.output)),h.logSlice&&x(h.logSlice),h.calls)for(const U of h.calls)U.result!==void 0&&x(zf(U.result));return M}/**
67
+ * @license lucide-react v1.23.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const dp=(...h)=>h.filter((b,M,x)=>!!b&&b.trim()!==""&&x.indexOf(b)===M).join(" ").trim();/**
72
+ * @license lucide-react v1.23.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const gv=h=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
77
+ * @license lucide-react v1.23.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Sv=h=>h.replace(/^([A-Z])|[\s-_]+(\w)/g,(b,M,x)=>x?x.toUpperCase():M.toLowerCase());/**
82
+ * @license lucide-react v1.23.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Uf=h=>{const b=Sv(h);return b.charAt(0).toUpperCase()+b.slice(1)};/**
87
+ * @license lucide-react v1.23.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */var pc={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"};/**
92
+ * @license lucide-react v1.23.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const yv=h=>{for(const b in h)if(b.startsWith("aria-")||b==="role"||b==="title")return!0;return!1},bv=q.createContext({}),Cv=()=>q.useContext(bv),wv=q.forwardRef(({color:h,size:b,strokeWidth:M,absoluteStrokeWidth:x,className:U="",children:K,iconNode:H,...c},p)=>{const{size:m=24,strokeWidth:v=2,absoluteStrokeWidth:l=!1,color:_="currentColor",className:C=""}=Cv()??{},w=x??l?Number(M??v)*24/Number(b??m):M??v;return q.createElement("svg",{ref:p,...pc,width:b??m??pc.width,height:b??m??pc.height,stroke:h??_,strokeWidth:w,className:dp("lucide",C,U),...!K&&!yv(c)&&{"aria-hidden":"true"},...c},[...H.map(([g,d])=>q.createElement(g,d)),...Array.isArray(K)?K:[K]])});/**
97
+ * @license lucide-react v1.23.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const ke=(h,b)=>{const M=q.forwardRef(({className:x,...U},K)=>q.createElement(wv,{ref:K,iconNode:b,className:dp(`lucide-${gv(Uf(h))}`,`lucide-${h}`,x),...U}));return M.displayName=Uf(h),M};/**
102
+ * @license lucide-react v1.23.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const xv=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ev=ke("arrow-down",xv);/**
107
+ * @license lucide-react v1.23.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const kv=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Av=ke("arrow-left",kv);/**
112
+ * @license lucide-react v1.23.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Dv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Rv=ke("arrow-right",Dv);/**
117
+ * @license lucide-react v1.23.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const Tv=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Mv=ke("arrow-up",Tv);/**
122
+ * @license lucide-react v1.23.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const jv=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Lv=ke("book-open",jv);/**
127
+ * @license lucide-react v1.23.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Nv=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Ov=ke("brain",Nv);/**
132
+ * @license lucide-react v1.23.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Bv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Hv=ke("check",Bv);/**
137
+ * @license lucide-react v1.23.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const zv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uv=ke("chevron-down",zv);/**
142
+ * @license lucide-react v1.23.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Iv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qv=ke("chevron-right",Iv);/**
147
+ * @license lucide-react v1.23.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const $v=[["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"}]],Pv=ke("circle-question-mark",$v);/**
152
+ * @license lucide-react v1.23.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Wv=[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Fv=ke("cloud-off",Wv);/**
157
+ * @license lucide-react v1.23.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Yv=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Kv=ke("cloud-upload",Yv);/**
162
+ * @license lucide-react v1.23.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Gv=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Xv=ke("cloud",Gv);/**
167
+ * @license lucide-react v1.23.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const Vv=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Zv=ke("code",Vv);/**
172
+ * @license lucide-react v1.23.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const Qv=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Jv=ke("copy",Qv);/**
177
+ * @license lucide-react v1.23.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const eg=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],tg=ke("corner-down-right",eg);/**
182
+ * @license lucide-react v1.23.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const sg=[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]],ig=ke("corner-left-up",sg);/**
187
+ * @license lucide-react v1.23.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const ng=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ag=ke("ellipsis",ng);/**
192
+ * @license lucide-react v1.23.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const rg=[["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"}]],lg=ke("external-link",rg);/**
197
+ * @license lucide-react v1.23.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const og=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],cg=ke("flask-conical",og);/**
202
+ * @license lucide-react v1.23.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const ug=[["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"}]],hg=ke("folder",ug);/**
207
+ * @license lucide-react v1.23.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const dg=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],fg=ke("frame",dg);/**
212
+ * @license lucide-react v1.23.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const pg=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],mg=ke("hammer",pg);/**
217
+ * @license lucide-react v1.23.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const _g=[["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"}]],vg=ke("history",_g);/**
222
+ * @license lucide-react v1.23.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const gg=[["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"}]],Sg=ke("image-up",gg);/**
227
+ * @license lucide-react v1.23.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const yg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],bg=ke("info",yg);/**
232
+ * @license lucide-react v1.23.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const Cg=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],wg=ke("layout-template",Cg);/**
237
+ * @license lucide-react v1.23.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const xg=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Eg=ke("list-checks",xg);/**
242
+ * @license lucide-react v1.23.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const kg=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Ag=ke("list",kg);/**
247
+ * @license lucide-react v1.23.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const Dg=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Rg=ke("loader",Dg);/**
252
+ * @license lucide-react v1.23.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Tg=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Mg=ke("log-out",Tg);/**
257
+ * @license lucide-react v1.23.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const jg=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Lg=ke("maximize-2",jg);/**
262
+ * @license lucide-react v1.23.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const Ng=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Og=ke("menu",Ng);/**
267
+ * @license lucide-react v1.23.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const Bg=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Hg=ke("message-square",Bg);/**
272
+ * @license lucide-react v1.23.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const zg=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Ug=ke("minimize-2",zg);/**
277
+ * @license lucide-react v1.23.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Ig=[["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"}]],qg=ke("moon",Ig);/**
282
+ * @license lucide-react v1.23.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const $g=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Pg=ke("panel-left-close",$g);/**
287
+ * @license lucide-react v1.23.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const Wg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Fg=ke("panel-left-open",Wg);/**
292
+ * @license lucide-react v1.23.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const Yg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],Kg=ke("panel-right-close",Yg);/**
297
+ * @license lucide-react v1.23.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const Gg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Xg=ke("panel-right-open",Gg);/**
302
+ * @license lucide-react v1.23.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const Vg=[["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"}]],Zg=ke("paperclip",Vg);/**
307
+ * @license lucide-react v1.23.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const Qg=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Jg=ke("pencil",Qg);/**
312
+ * @license lucide-react v1.23.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const e0=[["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"}]],t0=ke("play",e0);/**
317
+ * @license lucide-react v1.23.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const s0=[["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"}]],i0=ke("plug",s0);/**
322
+ * @license lucide-react v1.23.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const n0=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],a0=ke("plus",n0);/**
327
+ * @license lucide-react v1.23.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const r0=[["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"}]],l0=ke("radio",r0);/**
332
+ * @license lucide-react v1.23.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const o0=[["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"}]],c0=ke("refresh-cw",o0);/**
337
+ * @license lucide-react v1.23.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const u0=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],h0=ke("search",u0);/**
342
+ * @license lucide-react v1.23.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const d0=[["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"}]],f0=ke("settings",d0);/**
347
+ * @license lucide-react v1.23.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const p0=[["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"}]],m0=ke("sparkles",p0);/**
352
+ * @license lucide-react v1.23.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const _0=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],v0=ke("square-terminal",_0);/**
357
+ * @license lucide-react v1.23.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const g0=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],S0=ke("square",g0);/**
362
+ * @license lucide-react v1.23.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const y0=[["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"}]],b0=ke("sun",y0);/**
367
+ * @license lucide-react v1.23.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const C0=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],w0=ke("tags",C0);/**
372
+ * @license lucide-react v1.23.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const x0=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],E0=ke("trash-2",x0);/**
377
+ * @license lucide-react v1.23.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const k0=[["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"}]],A0=ke("triangle-alert",k0);/**
382
+ * @license lucide-react v1.23.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const D0=[["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"}]],R0=ke("wand-sparkles",D0);/**
387
+ * @license lucide-react v1.23.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const T0=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],M0=ke("workflow",T0);/**
392
+ * @license lucide-react v1.23.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const j0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],L0=ke("x",j0);/**
397
+ * @license lucide-react v1.23.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const N0=[["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"}]],O0=ke("zap",N0);/**
402
+ * @license lucide-react v1.23.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const B0=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],H0=ke("zoom-in",B0);/**
407
+ * @license lucide-react v1.23.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const z0=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],U0=ke("zoom-out",z0),I0={ArrowDown:Ev,ArrowLeft:Av,ArrowRight:Rv,ArrowUp:Mv,BookOpen:Lv,Brain:Ov,Check:Hv,ChevronDown:Uv,ChevronRight:qv,Cloud:Xv,CloudOff:Fv,CloudUpload:Kv,Code:Zv,Copy:Jv,CornerDownRight:tg,CornerLeftUp:ig,ExternalLink:lg,FlaskConical:cg,Folder:hg,Frame:fg,Hammer:mg,History:vg,ImageUp:Sg,Info:bg,LayoutTemplate:wg,List:Ag,ListChecks:Eg,Loader:Rg,LogOut:Mg,Maximize2:Lg,Menu:Og,MessageSquare:Hg,Minimize2:Ug,MoreHorizontal:ag,Moon:qg,PanelLeftClose:Pg,PanelLeftOpen:Fg,PanelRightClose:Kg,PanelRightOpen:Xg,Paperclip:Zg,Pencil:Jg,Play:t0,Plug:i0,Plus:a0,Radio:l0,RefreshCw:c0,Search:h0,Settings:f0,Sparkles:m0,Square:S0,SquareTerminal:v0,Sun:b0,Tags:w0,Trash2:E0,TriangleAlert:A0,Wand2:R0,Workflow:M0,X:L0,Zap:O0,ZoomIn:H0,ZoomOut:U0};function Se({name:h,size:b=16}){const M=I0[h]??Pv;return a.jsx(M,{size:b,strokeWidth:1.75,"aria-hidden":"true"})}function Xr(){return a.jsx("span",{className:"canvas-run-stub-chip","data-testid":"canvas-run-stub-chip","data-tooltip":"Capability calls in this step were served by stubs (offline run) — not real calls",children:"stubbed"})}function fp({step:h}){const b=vv(h);return b.length===0?null:a.jsxs("section",{className:"canvas-detail-section","data-testid":"canvas-detail-links",children:[a.jsx("h4",{children:"Links"}),a.jsx("div",{className:"canvas-links-list",children:b.map(({url:M,kind:x})=>x==="image"?a.jsx("a",{href:M,target:"_blank",rel:"noreferrer",className:"canvas-link-thumb-wrap","data-testid":"canvas-link-image",children:a.jsx("img",{src:M,alt:"",className:"canvas-link-thumb",loading:"lazy"})},M):a.jsxs("a",{href:M,target:"_blank",rel:"noreferrer",className:"canvas-link-item","data-testid":"canvas-link-other",children:[a.jsx(Se,{name:"ExternalLink",size:12}),a.jsx("span",{className:"canvas-link-url",children:"Open"})]},M))})]})}function pp({step:h}){return!h.calls||h.calls.length===0?null:a.jsxs("section",{className:"canvas-detail-section","data-testid":"canvas-detail-capability-calls",children:[a.jsx("h4",{children:"Capability calls"}),a.jsx("div",{className:"canvas-capability-calls",children:h.calls.map((b,M)=>a.jsxs("div",{className:"canvas-capability-call",children:[a.jsxs("div",{className:"canvas-capability-call-head",children:[a.jsx("code",{className:"canvas-input-field",children:b.capability}),b.stubUsed&&a.jsx("span",{className:"canvas-run-stub-chip","data-testid":`canvas-call-stub-chip-${b.capability}`,children:"stubbed"})]}),b.result!==void 0&&a.jsxs("details",{className:"canvas-run-logs canvas-capability-call-result","data-testid":`canvas-call-result-${b.capability}`,children:[a.jsx("summary",{children:"Result"}),a.jsx("pre",{children:Da(b.result)})]})]},`${b.capability}-${M}`))})]})}function Tc({run:h}){const b=hv(h);return b?a.jsxs("section",{className:"canvas-detail-section","data-testid":"canvas-detail-stub-notice",children:[a.jsx("h4",{children:"Stub notices"}),b.unusedStubs&&a.jsxs("div",{className:"canvas-stub-notice","data-testid":"canvas-stub-unused",children:[a.jsx("span",{className:"canvas-input-label",children:"Unused stubs"}),a.jsx("p",{className:"canvas-stub-notice-hint",children:"Supplied but matched no capability call — likely a typo or wrong path."}),a.jsx("ul",{className:"canvas-detail-warnings",children:b.unusedStubs.map(M=>a.jsxs("li",{children:[a.jsx("code",{className:"canvas-input-field",children:M.key})," in ",M.step]},`${M.step} ${M.key}`))})]}),b.stubWarnings&&a.jsxs("div",{className:"canvas-stub-notice","data-testid":"canvas-stub-warnings",children:[a.jsx("span",{className:"canvas-input-label",children:"Stub warnings"}),a.jsx("p",{className:"canvas-stub-notice-hint",children:"Matched a call but had the wrong shape."}),a.jsx("ul",{className:"canvas-detail-warnings",children:b.stubWarnings.map(M=>a.jsx("li",{children:M},M))})]})]}):null}function Mc(h,b){return(h==null?void 0:h.steps.find(M=>M.name===b))??null}function mp(h){return h?`${h} run`:"run"}function Vr({status:h}){return h==="passed"?a.jsx("span",{className:"canvas-run-status is-passed","data-status":"passed","aria-label":"passed",children:a.jsx(Se,{name:"Check",size:11})}):h==="failed"?a.jsx("span",{className:"canvas-run-status is-failed","data-status":"failed","aria-label":"failed",children:a.jsx(Se,{name:"X",size:11})}):h==="running"?a.jsx("span",{className:"canvas-run-status is-running","data-status":"running","aria-label":"running"}):a.jsx("span",{className:"canvas-run-status is-pending","data-status":"pending","aria-label":"pending"})}function Pr(h){return h.kind==="branching"?"branch":h.kind==="cross"?"pause resume":h.kind==="launch"?"launch":null}function _p({node:h}){const b=Aa(h);return b.length===0?null:a.jsxs("div",{className:"canvas-input-card","data-testid":`canvas-step-input-${h.id}`,children:[a.jsx("span",{className:"canvas-input-label",children:"Input"}),a.jsx("span",{className:"canvas-input-fields",children:b.map(M=>a.jsxs("code",{className:"canvas-input-field"+(M.required?" is-required":""),"aria-label":`${M.name}, ${M.type}${M.required?", required":""}`,children:[M.name,M.required&&a.jsx("span",{"aria-hidden":"true",children:"*"}),a.jsx("span",{className:"canvas-input-type",children:M.type})]},M.name))})]})}function vp({node:h}){return h.capabilities.length===0?null:a.jsxs("div",{className:"canvas-input-card","data-testid":`canvas-step-capabilities-${h.id}`,children:[a.jsx("span",{className:"canvas-input-label",children:"Capabilities"}),a.jsx("span",{className:"canvas-input-fields",children:h.capabilities.map(b=>a.jsx("code",{className:"canvas-input-field","data-tooltip":"Sapiom capability this step calls",children:b},b))})]})}function gp({graph:h,node:b,onSelectStep:M}){const x=h.edges.filter(c=>c.from===b.id),U=h.edges.filter(c=>c.to===b.id);if(x.length===0&&U.length===0)return null;const K=c=>{var p;return((p=h.nodes.find(m=>m.id===c))==null?void 0:p.label)??c},H=(c,p,m)=>{const v=a.jsxs(a.Fragment,{children:[a.jsx(Se,{name:m,size:12}),a.jsx("span",{className:"canvas-step-transition-target",children:K(p)}),c.label&&a.jsx("span",{className:"canvas-step-transition-cond",children:c.label})]}),l=`${m}${c.from}->${c.to}`;return M?a.jsx("button",{className:"canvas-step-transition is-link","data-tooltip":`Inspect ${K(p)}`,onClick:()=>M(p),children:v},l):a.jsx("div",{className:"canvas-step-transition",children:v},l)};return a.jsxs(a.Fragment,{children:[x.map(c=>H(c,c.to,"CornerDownRight")),U.map(c=>H(c,c.from,"CornerLeftUp"))]})}function q0(h,b){return h.kind!=="launched-workflow"?null:b.find(M=>M.path===h.label)??b.find(M=>M.name===h.label)??b.find(M=>M.path.endsWith(`/${h.label}`))??null}function jc({node:h,workflows:b,onOpenWorkflow:M}){const x=q0(h,b);return x?a.jsxs("button",{className:"canvas-step-open","data-testid":`canvas-open-workflow-${h.id}`,"data-tooltip":`Switch to ${x.name}`,onClick:()=>M(x.path),children:["Open workflow ",a.jsx(Se,{name:"ArrowRight",size:12})]}):null}function If({run:h,target:b}){return a.jsxs("div",{className:"canvas-steps-list","data-testid":"canvas-run-fallback",children:[a.jsxs("div",{className:"canvas-steps-label",children:["Run steps",a.jsx("span",{className:"canvas-steps-run-note","data-testid":"canvas-steps-run-note",children:mp(b)})]}),h.steps.map((M,x)=>{const U=[M.latencyMs!==void 0?Gi(M.latencyMs):null].filter(K=>K!==null);return a.jsxs("div",{className:"canvas-step-item",children:[a.jsxs("div",{className:"canvas-step-row is-static","data-testid":`canvas-run-step-${M.name}`,children:[a.jsx("span",{className:"canvas-step-index",children:String(x+1).padStart(2,"0")}),a.jsx(Vr,{status:M.status}),a.jsxs("span",{className:"canvas-step-copy",children:[a.jsx("span",{className:"canvas-step-name",children:M.name}),a.jsx("span",{className:"canvas-step-role",children:M.status})]}),Gr(h,M.name)&&a.jsx(Xr,{}),a.jsx("span",{className:"canvas-step-meta",children:U.join(" · ")}),a.jsx("span",{"aria-hidden":"true"})]}),(M.error||M.logSlice)&&a.jsxs("div",{className:"canvas-step-expand",children:[M.error&&a.jsx("pre",{className:"canvas-run-error",children:M.error}),M.logSlice&&a.jsxs("details",{className:"canvas-run-logs",children:[a.jsx("summary",{children:"Logs"}),a.jsx("pre",{children:M.logSlice})]})]})]},M.id)}),a.jsx(Tc,{run:h}),a.jsx("p",{className:"canvas-empty-hint",children:"Run data only. Visualize on the Canvas tab to map transitions and contracts."})]})}function $0({graph:h,run:b,runTarget:M,workflows:x,onOpenWorkflow:U,expandedId:K,onToggle:H,onOpenDetail:c}){const p=new Set(h.nodes.map(_=>_.id)),m=h.groups.filter(_=>_.nodeIds.length>0&&_.nodeIds.every(C=>p.has(C))),v=_=>{var C;return((C=m.find(w=>w.nodeIds.includes(_)))==null?void 0:C.label)??null},l=[];return h.nodes.forEach((_,C)=>{const w=v(_.id),g=l[l.length-1];g&&g.group===w?g.nodes.push({node:_,index:C}):l.push({group:w,nodes:[{node:_,index:C}]})}),a.jsxs("div",{className:"canvas-steps-list","data-testid":"canvas-steps-list",children:[a.jsxs("div",{className:"canvas-steps-label",children:["Steps",b&&a.jsx("span",{className:"canvas-steps-run-note","data-testid":"canvas-steps-run-note",children:mp(M)})]}),l.map((_,C)=>a.jsxs("div",{className:_.group?"canvas-step-band":void 0,children:[_.group&&a.jsx("div",{className:"canvas-step-group",children:_.group}),_.nodes.map(({node:w,index:g})=>{const d=K===w.id,f=rv(w,h.edges),r=Mc(b,w.id),u=r?[r.latencyMs!==void 0?Gi(r.latencyMs):null].filter(S=>S!==null):[];return a.jsxs("div",{className:"canvas-step-item"+(d?" is-open":""),children:[a.jsxs("button",{className:"canvas-step-row","data-testid":`canvas-step-row-${w.id}`,"aria-expanded":d,onClick:()=>H(w.id),children:[a.jsx("span",{className:"canvas-step-index",children:String(g+1).padStart(2,"0")}),r?a.jsx(Vr,{status:r.status}):a.jsx("span",{className:"canvas-step-dot dot--"+w.kind,"aria-hidden":"true"}),a.jsxs("span",{className:"canvas-step-copy",children:[a.jsx("span",{className:"canvas-step-name",children:w.label}),a.jsx("span",{className:"canvas-step-role",children:w.role})]}),r&&Gr(b,w.id)&&a.jsx(Xr,{}),a.jsx("span",{className:"canvas-step-meta",children:(u.length>0?u:f).join(" · ")}),a.jsx("span",{className:"canvas-step-caret"+(d?" is-open":""),"aria-hidden":"true",children:a.jsx(Se,{name:"ChevronDown",size:13})})]}),d&&a.jsxs("div",{className:"canvas-step-expand","data-testid":`canvas-step-expand-${w.id}`,children:[w.description&&a.jsx("p",{className:"canvas-step-desc",children:w.description}),a.jsx(_p,{node:w}),a.jsx(vp,{node:w}),a.jsx(gp,{graph:h,node:w}),a.jsx(jc,{node:w,workflows:x,onOpenWorkflow:U}),a.jsxs("button",{className:"canvas-step-open","data-testid":`canvas-step-open-${w.id}`,onClick:()=>c(w.id),children:["Full details ",a.jsx(Se,{name:"ArrowRight",size:12})]})]})]},w.id)})]},`${_.group??"ungrouped"}-${C}`))]})}function P0({graph:h,node:b,run:M,onSelectStep:x,workflows:U,onOpenWorkflow:K}){const H=Mc(M,b.id),c=h.edges.filter(l=>l.from===b.id),p=h.edges.filter(l=>l.to===b.id),m=l=>{var _;return((_=h.nodes.find(C=>C.id===l))==null?void 0:_.label)??l},v=h.groups.filter(l=>l.nodeIds.includes(b.id));return a.jsx("div",{className:"canvas-detail","data-testid":"canvas-step-detail",children:a.jsxs("div",{className:"canvas-detail-body",children:[b.role&&a.jsx("p",{className:"canvas-detail-role",children:b.role}),b.description&&a.jsx("p",{className:"canvas-detail-desc",children:b.description}),v.length>0&&a.jsxs("p",{className:"canvas-detail-groups",children:["Part of ",v.map(l=>l.label).join(", ")]}),a.jsx(jc,{node:b,workflows:U,onOpenWorkflow:K}),H&&a.jsxs("section",{className:"canvas-detail-section","data-testid":"canvas-detail-run",children:[a.jsx("h4",{children:"Last run"}),a.jsxs("div",{className:"canvas-detail-contract",children:[a.jsx("span",{className:"canvas-input-label",children:"Status"}),a.jsxs("span",{className:"canvas-run-text is-"+H.status,children:[a.jsx(Vr,{status:H.status}),H.status,Gr(M,b.id)&&a.jsx(Xr,{})]})]}),H.latencyMs!==void 0&&a.jsxs("div",{className:"canvas-detail-contract",children:[a.jsx("span",{className:"canvas-input-label",children:"Duration"}),a.jsx("span",{className:"canvas-detail-timeout",children:Gi(H.latencyMs)})]}),H.input!==void 0&&a.jsxs("details",{className:"canvas-run-logs","data-testid":`canvas-detail-run-input-${b.id}`,children:[a.jsx("summary",{children:"Input"}),a.jsx("pre",{children:Da(H.input)})]}),H.output!==void 0&&a.jsxs("details",{className:"canvas-run-logs","data-testid":`canvas-detail-run-output-${b.id}`,children:[a.jsx("summary",{children:"Output"}),a.jsx("pre",{children:Da(H.output)})]}),H.error&&a.jsx("pre",{className:"canvas-run-error",children:H.error}),H.logSlice&&a.jsxs("details",{className:"canvas-run-logs",children:[a.jsx("summary",{children:"Logs"}),a.jsx("pre",{children:H.logSlice})]})]}),H&&a.jsx(pp,{step:H}),H&&a.jsx(fp,{step:H}),a.jsx(Tc,{run:M}),(Aa(b).length>0||b.timeoutMs!==null||b.capabilities.length>0)&&a.jsxs("section",{className:"canvas-detail-section",children:[a.jsx("h4",{children:"Contract"}),b.capabilities.length>0&&a.jsxs("div",{className:"canvas-detail-contract","data-testid":"canvas-detail-capabilities",children:[a.jsx("span",{className:"canvas-input-label",children:"Capabilities"}),a.jsx("span",{className:"canvas-input-fields",children:b.capabilities.map(l=>a.jsx("code",{className:"canvas-input-field","data-tooltip":"Sapiom capability this step calls",children:l},l))})]}),Aa(b).length>0&&a.jsxs("div",{className:"canvas-detail-contract","data-testid":"canvas-detail-input",children:[a.jsx("span",{className:"canvas-input-label",children:"Input"}),a.jsx("span",{className:"canvas-input-fields",children:Aa(b).map(l=>a.jsxs("code",{className:"canvas-input-field"+(l.required?" is-required":""),"aria-label":`${l.name}, ${l.type}${l.required?", required":""}`,"data-tooltip":l.required?"Required field":"Optional field",children:[l.name,l.required&&a.jsx("span",{"aria-hidden":"true",children:"*"}),a.jsx("span",{className:"canvas-input-type",children:l.type})]},l.name))})]}),b.timeoutMs!==null&&a.jsxs("div",{className:"canvas-detail-contract",children:[a.jsx("span",{className:"canvas-input-label",children:"Timeout"}),a.jsx("span",{className:"canvas-detail-timeout",children:Gi(b.timeoutMs)})]})]}),a.jsxs("section",{className:"canvas-detail-section",children:[a.jsxs("h4",{children:["Leads to ",a.jsx("span",{className:"canvas-detail-count",children:c.length})]}),c.length===0?a.jsx("p",{className:"canvas-detail-empty",children:"Terminal step: nothing follows."}):a.jsx("ul",{className:"canvas-detail-edges",children:c.map(l=>a.jsx("li",{children:a.jsxs("button",{className:"canvas-detail-edge","data-tooltip":`Open ${m(l.to)}`,onClick:()=>x(l.to),children:[a.jsx(Se,{name:"CornerDownRight",size:13}),a.jsx("span",{className:"canvas-detail-edge-target",children:m(l.to)}),Pr(l)&&a.jsx("span",{className:"canvas-detail-edge-kind",children:Pr(l)}),l.label&&a.jsx("span",{className:"canvas-detail-edge-cond",children:l.label})]})},`${l.from}->${l.to}`))})]}),a.jsxs("section",{className:"canvas-detail-section",children:[a.jsxs("h4",{children:["Reached from ",a.jsx("span",{className:"canvas-detail-count",children:p.length})]}),p.length===0?a.jsx("p",{className:"canvas-detail-empty",children:b.kind==="entry"?"Entry point: the workflow starts here.":"No step routes here."}):a.jsx("ul",{className:"canvas-detail-edges",children:p.map(l=>a.jsx("li",{children:a.jsxs("button",{className:"canvas-detail-edge","data-tooltip":`Open ${m(l.from)}`,onClick:()=>x(l.from),children:[a.jsx(Se,{name:"CornerLeftUp",size:13}),a.jsx("span",{className:"canvas-detail-edge-target",children:m(l.from)}),Pr(l)&&a.jsx("span",{className:"canvas-detail-edge-kind",children:Pr(l)}),l.label&&a.jsx("span",{className:"canvas-detail-edge-cond",children:l.label})]})},`${l.from}->${l.to}`))})]}),h.warnings.length>0&&a.jsxs("section",{className:"canvas-detail-section",children:[a.jsxs("h4",{children:["Graph warnings ",a.jsx("span",{className:"canvas-detail-count",children:h.warnings.length})]}),a.jsx("ul",{className:"canvas-detail-warnings",children:h.warnings.map(l=>a.jsx("li",{children:l},l))})]})]})})}function W0({graph:h,node:b,run:M,onSelectStep:x,workflows:U,onOpenWorkflow:K,onInjectPrompt:H}){const c=Mc(M,b.id),[p,m]=q.useState("");function v(_){var d;if(!H)return;const C=c?{input:c.input,output:c.output,calls:c.calls,unusedStubs:(d=M==null?void 0:M.unusedStubs)==null?void 0:d.map(f=>f.key),stubWarnings:M==null?void 0:M.stubWarnings}:void 0,w=b.capabilities.length>0?{capabilities:b.capabilities}:void 0,g=fv(c??{id:b.id,name:b.id,status:"pending"},C,w);H(`${g}
412
+
413
+ ${_}`)}function l(){const _=p.trim();_&&(v(_),m(""))}return a.jsxs("div",{className:"canvas-inspector","data-testid":"canvas-step-inspector",children:[b.role&&a.jsx("p",{className:"canvas-detail-role",children:b.role}),b.description&&a.jsx("p",{className:"canvas-step-desc",children:b.description}),a.jsx(_p,{node:b}),a.jsx(vp,{node:b}),b.timeoutMs!==null&&a.jsxs("div",{className:"canvas-input-card","data-testid":`canvas-inspector-timeout-${b.id}`,children:[a.jsx("span",{className:"canvas-input-label",children:"Timeout"}),a.jsx("span",{className:"canvas-detail-timeout",children:Gi(b.timeoutMs)})]}),a.jsx(gp,{graph:h,node:b,onSelectStep:x}),a.jsx(jc,{node:b,workflows:U,onOpenWorkflow:K}),c&&a.jsxs("div",{className:"canvas-inspector-run","data-testid":"canvas-inspector-run",children:[a.jsx("span",{className:"canvas-input-label",children:"Last run"}),a.jsxs("span",{className:"canvas-run-text is-"+c.status,children:[a.jsx(Vr,{status:c.status}),c.status,Gr(M,b.id)&&a.jsx(Xr,{})]}),c.latencyMs!==void 0&&a.jsx("span",{className:"canvas-inspector-run-meta",children:Gi(c.latencyMs)})]}),(c==null?void 0:c.input)!==void 0&&a.jsxs("details",{className:"canvas-run-logs","data-testid":`canvas-inspector-run-input-${b.id}`,children:[a.jsx("summary",{children:"Input"}),a.jsx("pre",{children:Da(c.input)})]}),(c==null?void 0:c.output)!==void 0&&a.jsxs("details",{className:"canvas-run-logs","data-testid":`canvas-inspector-run-output-${b.id}`,children:[a.jsx("summary",{children:"Output"}),a.jsx("pre",{children:Da(c.output)})]}),(c==null?void 0:c.error)&&a.jsx("pre",{className:"canvas-run-error",children:c.error}),(c==null?void 0:c.logSlice)&&a.jsxs("details",{className:"canvas-run-logs","data-testid":`canvas-inspector-run-logs-${b.id}`,children:[a.jsx("summary",{children:"Logs"}),a.jsx("pre",{children:c.logSlice})]}),c&&a.jsx(pp,{step:c}),c&&a.jsx(fp,{step:c}),a.jsx(Tc,{run:M}),H&&a.jsxs("div",{className:"canvas-inspector-macros","data-testid":"canvas-inspector-macros",children:[a.jsx("button",{className:"canvas-inspector-macro-btn btn-ghost","data-testid":"canvas-macro-slow",onClick:()=>v("Why is this step slow / stuck?"),children:"Why is this step slow / stuck?"}),a.jsx("button",{className:"canvas-inspector-macro-btn "+((c==null?void 0:c.status)==="failed"?"btn-primary":"btn-ghost"),"data-testid":"canvas-macro-debug",onClick:()=>v("Debug this step"),children:"Debug this step"}),a.jsx("button",{className:"canvas-inspector-macro-btn btn-ghost","data-testid":"canvas-macro-explain",onClick:()=>v("Explain this step"),children:"Explain this step"}),a.jsxs("div",{className:"canvas-inspector-freeform",children:[a.jsx("textarea",{className:"canvas-inspector-freeform-input","data-testid":"canvas-freeform-input",placeholder:"Ask about this step…",rows:2,value:p,onChange:_=>m(_.target.value),onKeyDown:_=>{_.key==="Enter"&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),l())}}),a.jsx("button",{className:"btn-primary canvas-inspector-freeform-ask","data-testid":"canvas-freeform-ask",disabled:!p.trim(),onClick:l,children:"Ask"})]})]})]})}const qf=24;function F0({overview:h,selectedNode:b,graph:M,run:x,workflows:U,onOpenWorkflow:K,onSelectStep:H,onOpenSteps:c,onDeselect:p,onCollapse:m,onInjectPrompt:v}){const l=q.useRef(null),_=q.useRef(null),C=q.useRef(null),w=q.useRef(null),g=q.useRef(Ti().canvasInspectorHeight??null),[d,f]=q.useState(null),[r,u]=q.useState(!1),S=()=>{var z;const $=(z=l.current)==null?void 0:z.parentElement;return $?Math.round($.getBoundingClientRect().height*.5):Number.MAX_SAFE_INTEGER},A=()=>{var $;return((($=_.current)==null?void 0:$.offsetHeight)??40)+1},E=q.useCallback(()=>{const $=_.current,z=C.current,Q=w.current;if(!$||!z||!Q)return;const ne=S(),F=g.current,W=window.getComputedStyle(z),Y=(parseFloat(W.paddingTop)||0)+(parseFloat(W.paddingBottom)||0),j=$.offsetHeight+Q.offsetHeight+Y+1,B=F!=null?Math.min(Math.max(F,A()),ne):Math.min(j,ne);f(B)},[]);q.useLayoutEffect(E),q.useEffect(()=>{var Q;if(typeof ResizeObserver>"u")return;const $=new ResizeObserver(E),z=(Q=l.current)==null?void 0:Q.parentElement;return z&&$.observe(z),w.current&&$.observe(w.current),()=>$.disconnect()},[E]);const R=$=>{g.current=Math.round(Math.min(Math.max($,A()),S())),E()},y=()=>{Ln({canvasInspectorHeight:g.current})},D=()=>{g.current=null,Ln({canvasInspectorHeight:null}),E()},I=$=>{if($.button!==0)return;const z=$.currentTarget,Q=l.current;if(!Q)return;try{z.setPointerCapture($.pointerId)}catch{}u(!0);const ne=$.clientY,F=Q.getBoundingClientRect().height,W=j=>{R(F+(ne-j.clientY))},Y=()=>{u(!1),y(),window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",Y),window.removeEventListener("pointercancel",Y)};window.addEventListener("pointermove",W),window.addEventListener("pointerup",Y),window.addEventListener("pointercancel",Y)},P=$=>{var Q;const z=((Q=l.current)==null?void 0:Q.getBoundingClientRect().height)??0;$.key==="ArrowUp"?($.preventDefault(),R(z+qf),y()):$.key==="ArrowDown"?($.preventDefault(),R(z-qf),y()):$.key==="Home"&&($.preventDefault(),D())};return a.jsxs("div",{ref:l,className:"canvas-overview"+(r?" is-resizing":"")+(b?" is-inspecting":""),"data-testid":"canvas-overview",style:d!=null?{height:d}:void 0,children:[a.jsx("div",{className:"canvas-overview-resize","data-testid":"canvas-overview-resize",role:"separator","aria-orientation":"horizontal","aria-label":"Resize the overview panel",tabIndex:0,onPointerDown:I,onDoubleClick:D,onKeyDown:P}),a.jsx("div",{ref:_,className:"canvas-overview-head",children:b?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"canvas-step-dot dot--"+b.kind,"aria-hidden":"true"}),a.jsx("span",{className:"canvas-overview-title","data-testid":"canvas-inspector-title",children:b.label}),a.jsx("span",{className:"canvas-detail-kind node--"+b.kind,children:up(b.kind)}),a.jsxs("button",{className:"status-tag status-tag-action canvas-inspector-open-steps","data-testid":"canvas-inspector-open-steps","data-tooltip":"Full details in the Steps tab",onClick:c,children:["Open in Steps ",a.jsx(Se,{name:"ArrowRight",size:12})]}),a.jsx("button",{className:"theme-toggle canvas-overview-close","data-testid":"canvas-inspector-close","aria-label":"Back to the workflow overview","data-tooltip":"Back to the workflow overview (Esc)",onClick:p,children:a.jsx(Se,{name:"X",size:13})})]}):a.jsxs(a.Fragment,{children:[a.jsx(Se,{name:"Radio",size:13}),"Overview",a.jsx("span",{className:"canvas-overview-stats",children:((h==null?void 0:h.stats)??"").split("·").map($=>{const z=$.trim();if(!z)return null;const Q=z.indexOf(" "),ne=Q===-1?z:z.slice(0,Q),F=Q===-1?"":z.slice(Q+1);return a.jsxs("span",{className:"canvas-overview-stat",children:[a.jsx("strong",{children:ne})," ",F]},z)})}),a.jsx("button",{className:"theme-toggle canvas-overview-close","data-testid":"canvas-overview-toggle","aria-label":"Collapse workflow overview","data-tooltip":"Collapse workflow overview",onClick:m,children:a.jsx(Se,{name:"X",size:13})})]})}),a.jsx("div",{ref:C,className:"canvas-overview-body",children:a.jsx("div",{ref:w,className:"canvas-overview-content",children:b&&M?a.jsx(W0,{graph:M,node:b,run:x,onSelectStep:H,workflows:U,onOpenWorkflow:K,onInjectPrompt:v}):h&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"canvas-overview-desc",children:h.description}),h.notes.length>0&&a.jsx("ul",{className:"canvas-overview-notes",children:h.notes.map($=>a.jsx("li",{children:$},$))}),a.jsxs("div",{className:"canvas-legend-row","aria-hidden":"true",children:[a.jsxs("span",{children:[a.jsx("span",{className:"dot dot--entry"}),"entry / active step"]}),a.jsxs("span",{children:[a.jsx("span",{className:"dot dot--step"}),"step"]}),a.jsxs("span",{children:[a.jsx("span",{className:"dot dot--terminal"}),"terminal"]})]})]})})})]})}function Ts({eyebrow:h,icon:b,title:M,body:x,cta:U,className:K,testId:H,children:c}){return a.jsxs("div",{className:"empty-state"+(K?` ${K}`:""),"data-empty-state":!0,"data-testid":H,children:[b&&a.jsx("span",{className:"empty-state-icon","aria-hidden":"true",children:a.jsx(Se,{name:b,size:18})}),h&&a.jsx("span",{className:"empty-state-eyebrow",children:h}),a.jsx("span",{className:"empty-state-title",children:M}),x&&a.jsx("span",{className:"empty-state-body",children:x}),U&&a.jsx("span",{className:"empty-state-cta",children:U}),c]})}function Y0(h,b=Date.now()){const M=Math.max(0,Math.round((b-h)/1e3));if(M<45)return"just now";const x=Math.round(M/60);if(x<60)return`${x}m ago`;const U=Math.round(x/60);return U<24?`${U}h ago`:`${Math.round(U/24)}d ago`}var K0=ap();function Zr(h,{onDismiss:b,containerRef:M,triggerRef:x}){q.useEffect(()=>{if(!h)return;const U=H=>{var p;const c=M.current;!c||!(H.target instanceof Node)||c.contains(H.target)||(p=x==null?void 0:x.current)!=null&&p.contains(H.target)||b()},K=H=>{var c;H.key==="Escape"&&(b(),(c=x==null?void 0:x.current)==null||c.focus())};return document.addEventListener("mousedown",U),document.addEventListener("keydown",K),()=>{document.removeEventListener("mousedown",U),document.removeEventListener("keydown",K)}},[h,b,M,x])}const Wr=4,ni=8;function G0(h,b,M){const x=h.getBoundingClientRect(),U={position:"fixed",top:"auto",right:"auto",bottom:"auto",left:"auto",overflowY:"auto"};return M&&(U.width=x.width),U.maxWidth=window.innerWidth-2*ni,b.startsWith("down")?(U.top=x.bottom+Wr,U.maxHeight=window.innerHeight-x.bottom-Wr-ni):(U.bottom=window.innerHeight-x.top+Wr,U.maxHeight=x.top-Wr-ni),b.endsWith("start")?U.left=Math.max(ni,x.left):U.right=Math.max(ni,window.innerWidth-x.right),U}function Xi({open:h,anchorRef:b,onDismiss:M,placement:x,matchWidth:U=!1,className:K,role:H,testid:c,children:p}){const m=q.useRef(null),[v,l]=q.useState(null);Zr(h,{onDismiss:M,containerRef:m,triggerRef:b});const _=q.useCallback(()=>{const C=b.current;C&&l(G0(C,x,U))},[b,x,U]);return q.useLayoutEffect(()=>{h?_():l(null)},[h,_]),q.useLayoutEffect(()=>{if(!h||v==null)return;const C=m.current;if(!C)return;const w=C.getBoundingClientRect();let g=0;w.left<ni?g=ni-w.left:w.right>window.innerWidth-ni&&(g=window.innerWidth-ni-w.right),!(Math.abs(g)<.5)&&l(d=>d==null?d:{...d,left:typeof d.left=="number"?d.left+g:d.left,right:typeof d.right=="number"?d.right-g:d.right})},[h,v]),q.useEffect(()=>{if(h)return window.addEventListener("resize",_),window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("resize",_),window.removeEventListener("scroll",_,!0)}},[h,_]),!h||v==null?null:K0.createPortal(a.jsx("div",{ref:m,className:K,role:H,"data-testid":c,style:v,children:p}),document.body)}function X0(h,b){return`${b?`${b} run`:"run"} ${h.status}`}function V0({workflow:h,onReVisualize:b,reVisualizeDisabledReason:M,refreshing:x,expanded:U,onToggleExpanded:K,canExpand:H,detailStep:c,onBack:p,onAskAgent:m,surface:v,stepsSummary:l,run:_,runTarget:C,runs:w,onSelectRun:g}){const[d,f]=q.useState(!1),r=q.useRef(null),u=q.useCallback(()=>f(!1),[]),[S,A]=q.useState(!1),E=q.useRef(null),R=q.useCallback(()=>A(!1),[]);if(c)return a.jsxs("div",{className:"workflow-actions-header","data-testid":"workflow-actions-header",children:[a.jsx("button",{className:"theme-toggle","data-testid":"canvas-detail-back",onClick:p,"aria-label":"Back to the steps list","data-tooltip":"Back to the steps list",children:a.jsx(Se,{name:"ArrowLeft",size:14})}),a.jsx("span",{className:"workflow-actions-name","data-testid":"canvas-detail-title",children:c.label}),a.jsx("span",{className:"canvas-detail-kind node--"+c.kind,children:up(c.kind)}),a.jsxs("button",{className:"btn-ghost canvas-detail-ask","data-testid":"canvas-detail-ask","aria-label":"Ask agent","data-tooltip":"Sends the request to the agent in the terminal",onClick:()=>m(`Walk me through the "${c.label}" step of this workflow: what it does, its inputs and outputs, and its transitions.`),children:[a.jsx(Se,{name:"MessageSquare",size:13}),a.jsx("span",{className:"canvas-detail-ask-label",children:"Ask agent"})]}),a.jsxs("div",{className:"canvas-detail-menu-wrap",children:[a.jsx("button",{ref:r,className:"theme-toggle","data-testid":"canvas-detail-menu","aria-label":`More actions for ${c.label}`,"data-tooltip":"More actions","aria-haspopup":"menu","aria-expanded":d,onClick:()=>f(y=>!y),children:a.jsx(Se,{name:"MoreHorizontal",size:14})}),a.jsxs(Xi,{open:d,anchorRef:r,onDismiss:u,placement:"down-end",className:"canvas-detail-menu",role:"menu",testid:"canvas-detail-menu-popover",children:[a.jsxs("button",{role:"menuitem",className:"profile-menu-item",onClick:()=>{m(`Modify the "${c.label}" step of this workflow. Show me the step's code first, then propose the change.`),u()},children:[a.jsx(Se,{name:"Wand2",size:13}),"Ask agent to modify"]}),a.jsxs("button",{role:"menuitem",className:"profile-menu-item",onClick:()=>{var y;(y=navigator.clipboard)==null||y.writeText(c.label).catch(()=>{}),u()},children:[a.jsx(Se,{name:"Copy",size:13}),"Copy step name"]})]})]})]});if(v==="steps"){const y=_&&a.jsxs(a.Fragment,{children:[_.status==="running"&&a.jsx("span",{className:"canvas-run-status is-running","aria-hidden":"true"}),X0(_,C)]});return a.jsxs("div",{className:"workflow-actions-header"+(_?" has-run":""),"data-testid":"workflow-actions-header",children:[a.jsx("span",{className:"workflow-actions-name",children:h.name}),a.jsx("span",{className:"workflow-actions-count","data-testid":"canvas-steps-count",children:l??"no steps"}),_&&w.length<=1&&a.jsx("span",{className:"status-tag canvas-run-chip is-"+_.status,"data-testid":"canvas-run-chip",children:y}),_&&w.length>1&&a.jsxs("div",{className:"canvas-run-picker-wrap",children:[a.jsxs("button",{ref:E,className:"status-tag status-tag-action canvas-run-chip canvas-run-chip--picker is-"+_.status,"data-testid":"canvas-run-chip","aria-haspopup":"menu","aria-expanded":S,"aria-label":`Pick a run to inspect (${w.length} observed)`,"data-tooltip":"Pick a run to inspect",onClick:()=>A(D=>!D),children:[y,a.jsx(Se,{name:"ChevronDown",size:12})]}),a.jsx(Xi,{open:S,anchorRef:E,onDismiss:R,placement:"down-end",className:"canvas-run-menu",role:"menu",testid:"canvas-run-menu",children:[...w].reverse().map((D,I)=>{const P=w.length-I,$=D.run.executionId===_.executionId,z=Y0(D.observedAt);return a.jsxs("button",{role:"menuitemradio","aria-checked":$,className:"profile-menu-item"+($?" is-selected":""),"data-testid":`canvas-run-option-${D.run.executionId}`,title:D.run.executionId,onClick:()=>{g(D.run.executionId),R()},children:[a.jsx(Se,{name:$?"Check":"Play",size:13}),a.jsx("span",{children:`run ${P} · ${D.run.status} · ${D.target}`}),a.jsx("span",{className:"canvas-run-option-meta",children:z})]},D.run.executionId)})})]})]})}return a.jsxs("div",{className:"workflow-actions-header","data-testid":"workflow-actions-header",children:[a.jsx("span",{className:"workflow-actions-name",children:h.name}),h.definitionId!=null&&a.jsxs("span",{className:"status-tag workflow-deployed-tag","data-testid":"workflow-deployed-tag","data-tooltip":"Deployed to production",children:[a.jsx("span",{className:"workflow-dot workflow-dot-pinned","aria-hidden":"true"}),"Deployed"]}),h.definitionId!=null&&a.jsxs("a",{className:"status-tag status-tag-action workflow-dashboard-link","data-testid":"workflow-dashboard-link",href:`https://app.sapiom.ai/workflows/${h.definitionId}`,target:"_blank",rel:"noreferrer","aria-label":"Go to dashboard","data-tooltip":"Open this workflow in the Sapiom dashboard",children:[a.jsx(Se,{name:"ExternalLink",size:12}),a.jsx("span",{className:"workflow-dashboard-link-label",children:"Go to dashboard"})]}),a.jsx("button",{className:"macro-icon-btn canvas-refresh-btn"+(x?" is-refreshing":""),"aria-label":"Re-visualize","data-testid":"canvas-revisualize","data-tooltip":M??(x?"Rendering…":"Re-visualize"),disabled:!!M,onClick:b,children:a.jsx(Se,{name:"RefreshCw",size:14})}),H&&a.jsx("button",{className:"macro-icon-btn","data-testid":"canvas-expand","aria-label":U?"Exit expanded canvas":"Expand canvas","data-tooltip":U?"Exit expanded canvas":"Expand canvas",onClick:K,children:a.jsx(Se,{name:U?"Minimize2":"Maximize2",size:14})})]})}function Z0({sessionId:h,lastMessage:b,boundWorkflow:M,noSessionAgent:x=null,activeSessionId:U,overviewActive:K,sessionExited:H,macros:c,tasks:p,onRunMacro:m,onInjectPrompt:v,surface:l,onOpenSteps:_,run:C,runTarget:w,runs:g,onSelectRun:d,workflows:f,onOpenWorkflow:r}){const[u,S]=q.useState(!1),[A,E]=q.useState(0),[R,y]=q.useState(Dc()),[D,I]=q.useState(!1),[P,$]=q.useState(!0),[z,Q]=q.useState(!1),ne=q.useRef(null),F=q.useRef(null),W=q.useRef(0),Y=()=>{$(!1),Q(!0),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>Q(!1),360)},j=()=>{const pe=W.current-Date.now();F.current&&clearTimeout(F.current),pe>0?F.current=setTimeout(Y,pe):Y()};q.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current),F.current&&clearTimeout(F.current)},[]);const[B,T]=q.useState(1),[O,Z]=q.useState({x:0,y:0}),[ae,_e]=q.useState(!1),ge=q.useRef(null),X=q.useRef(null),N=pe=>Math.min(3,Math.max(.25,Math.round(pe*100)/100)),[ce,le]=q.useState(null),ye=q.useRef(!1),[be,je]=q.useState({zoom:1,x:0,y:0}),Le=q.useCallback(()=>{const pe=ge.current;if(!ce||!pe)return null;const Re=pe.getBoundingClientRect();if(Re.width<80||Re.height<80)return null;const He=Re.width-ce.insetX*2,bt=Re.height-ce.insetTop-ce.insetBottom;if(He<=0||bt<=0)return null;const Ne=Math.min(1,He/ce.width,bt/ce.height);return{zoom:Math.max(.5,Math.round(Ne*100)/100),x:0,y:0}},[ce]),Be=q.useCallback(()=>{const pe=Le()??{zoom:1,x:0,y:0};ye.current=!1,T(pe.zoom),Z({x:pe.x,y:pe.y}),je(pe)},[Le]);q.useEffect(()=>{!ce||ye.current||Be()},[ce,Be]),q.useEffect(()=>{const pe=ge.current;if(!pe||typeof ResizeObserver>"u")return;const Re=new ResizeObserver(()=>{ye.current||Be()});return Re.observe(pe),()=>Re.disconnect()},[Be]),q.useEffect(()=>{var He,bt,Ne;(bt=(He=X.current)==null?void 0:He.contentWindow)==null||bt.postMessage({type:"sapiom-canvas:view",zoom:B,x:O.x,y:O.y},"*");const pe=mt.current,Re=X.current;if(pe&&Re){const Bt=Re.getBoundingClientRect();(Ne=Re.contentWindow)==null||Ne.postMessage({type:"sapiom-canvas:hover",x:pe.x-Bt.left,y:pe.y-Bt.top},"*")}},[B,O]),q.useEffect(()=>{const pe=ge.current;if(!pe)return;const Re=He=>{He.preventDefault(),ye.current=!0,T(bt=>N(bt*(He.deltaY<0?1.1:1/1.1)))};return pe.addEventListener("wheel",Re,{passive:!1}),()=>pe.removeEventListener("wheel",Re)});const Ye=pe=>{var bt,Ne;const Re=X.current;if(!Re)return;const He=Re.getBoundingClientRect();if(typeof pe.clientX=="number"&&typeof pe.clientY=="number"){const{clientX:Bt,clientY:ks,...Kt}=pe;(bt=Re.contentWindow)==null||bt.postMessage({...Kt,x:Bt-He.left,y:ks-He.top},"*");return}(Ne=Re.contentWindow)==null||Ne.postMessage(pe,"*")},[Ae,jt]=q.useState(!1),ft=q.useRef(!1),Lt=q.useRef(0),mt=q.useRef(null),Ft=pe=>{if(mt.current={x:pe.clientX,y:pe.clientY},ae)return;const{clientX:Re,clientY:He}=pe;cancelAnimationFrame(Lt.current),Lt.current=requestAnimationFrame(()=>{Ye({type:"sapiom-canvas:hover",clientX:Re,clientY:He})})},Ce=()=>{cancelAnimationFrame(Lt.current),mt.current=null,jt(!1),ft.current=!1,Ye({type:"sapiom-canvas:hover",x:-1,y:-1})},Ie=pe=>{if(pe.button!==0)return;const Re=pe.currentTarget;try{Re.setPointerCapture(pe.pointerId)}catch{}_e(!0),Ye({type:"sapiom-canvas:press",clientX:pe.clientX,clientY:pe.clientY,down:!0});let He=!0;const bt=()=>{He&&(He=!1,Ye({type:"sapiom-canvas:press",down:!1}))};let Ne=pe.clientX,Bt=pe.clientY;const ks=pe.clientX,Kt=pe.clientY,zs=Ht=>{const Et=Ht.clientX-Ne,Ta=Ht.clientY-Bt;Ne=Ht.clientX,Bt=Ht.clientY,(Math.abs(Ht.clientX-ks)>=4||Math.abs(Ht.clientY-Kt)>=4)&&(bt(),ye.current=!0),Z(Hn=>({x:Hn.x+Et,y:Hn.y+Ta}))},js=Ht=>{_e(!1),bt(),Re.removeEventListener("pointermove",zs),Re.removeEventListener("pointerup",js),Re.removeEventListener("pointercancel",js),Math.abs(Ht.clientX-ks)<4&&Math.abs(Ht.clientY-Kt)<4&&(Ye({type:"sapiom-canvas:pick",clientX:Ht.clientX,clientY:Ht.clientY}),ft.current||ct(null))};Re.addEventListener("pointermove",zs),Re.addEventListener("pointerup",js),Re.addEventListener("pointercancel",js)},[Ke,rt]=q.useState(!1),[Ze,ct]=q.useState(null);q.useEffect(()=>{if(!Ke&&Ze==null)return;const pe=Re=>{Re.key==="Escape"&&(Ze!=null?ct(null):rt(!1))};return window.addEventListener("keydown",pe),()=>window.removeEventListener("keydown",pe)},[Ke,Ze]);const[Xt,xt]=q.useState(!0),[Vt,Ge]=q.useState(null),[Tt,yt]=q.useState(null),[st,vt]=q.useState(null),[ue,we]=q.useState(null),[ee,ie]=q.useState(null);q.useEffect(()=>{const pe=Re=>{var bt;const He=Re.data;if(!(!He||Re.source!==((bt=X.current)==null?void 0:bt.contentWindow))){if(He.type==="sapiom-canvas:overview")Ge({description:typeof He.description=="string"?He.description:"",stats:typeof He.stats=="string"?He.stats:"",notes:Array.isArray(He.notes)?He.notes.filter(Ne=>typeof Ne=="string"):[]});else if(He.type==="sapiom-canvas:graph")vt(uv(He.graph));else if(He.type==="sapiom-canvas:node"){const Ne=He.id;typeof Ne=="string"&&ct(Ne)}else if(He.type==="sapiom:node-click"){const Ne=He.stepName;typeof Ne=="string"&&vt(Bt=>{if(Bt){const ks=Bt.nodes.find(Kt=>Kt.label===Ne)??Bt.nodes.find(Kt=>Kt.id===Ne)??null;ks&&ct(ks.id)}return Bt})}else if(He.type==="sapiom-canvas:hit"){const Ne=typeof He.id=="string";jt(Ne),ft.current=Ne}else if(He.type==="sapiom-canvas:size"){const Ne=He;typeof Ne.width=="number"&&Ne.width>0&&typeof Ne.height=="number"&&Ne.height>0&&le({width:Ne.width,height:Ne.height,insetTop:typeof Ne.insetTop=="number"&&Ne.insetTop>=0?Ne.insetTop:0,insetBottom:typeof Ne.insetBottom=="number"&&Ne.insetBottom>=0?Ne.insetBottom:0,insetX:typeof Ne.insetX=="number"&&Ne.insetX>=0?Ne.insetX:0})}else if(He.type==="sapiom-canvas:error"){const Ne=He;yt({title:typeof Ne.title=="string"?Ne.title:"",reason:typeof Ne.reason=="string"?Ne.reason:""})}}};return window.addEventListener("message",pe),()=>window.removeEventListener("message",pe)},[]),q.useEffect(()=>{Ge(null),yt(null),vt(null),we(null),ct(null),ie(null),xt(!0),jt(!1),ft.current=!1,le(null),je({zoom:1,x:0,y:0}),ye.current=!1},[h,A]);const de=st&&ue?st.nodes.find(pe=>pe.id===ue)??null:null,ve=q.useRef(null);de&&(ve.current=de),st||(ve.current=null);const Ee=de??ve.current,Nt=st&&Ze?st.nodes.find(pe=>pe.id===Ze)??null:null;q.useEffect(()=>{var pe,Re;(Re=(pe=X.current)==null?void 0:pe.contentWindow)==null||Re.postMessage({type:"sapiom-canvas:select",id:ue??Ze},"*")},[ue,Ze]);const Yt=q.useCallback(()=>{var pe,Re;!C||!w||!h||lp()||P||(Re=(pe=X.current)==null?void 0:pe.contentWindow)==null||Re.postMessage({type:"sapiom:run-state",steps:C.steps,status:C.status,target:w},"*")},[C,w,h,P]);q.useEffect(()=>{Yt()},[Yt]);const ot=Vt??void 0,[Ot,ai]=q.useState(new Set);q.useEffect(()=>Rc(y),[]),q.useEffect(()=>{if($(!0),!h){S(!1);return}S(!1);let pe=!1;return I(!0),fetch(`/canvas/${h}/`,{method:"HEAD"}).then(Re=>!pe&&S(Re.ok)).catch(()=>{}).finally(()=>!pe&&I(!1)),()=>{pe=!0}},[h]),q.useEffect(()=>{!b||!h||b.type==="canvas.reload"&&b.harnessSessionId===h&&(S(!0),$(!0),E(pe=>pe+1))},[b,h]);const fs=(M==null?void 0:M.path)??null;q.useEffect(()=>{$(!0),E(pe=>pe+1),T(1),Z({x:0,y:0}),je({zoom:1,x:0,y:0}),ye.current=!1},[fs]);const Es=tv(c),Qe=Es?op(Es,M,U):null,is=p.filter(pe=>pe.harnessSessionId===h&&(pe.workflowPath==null||pe.workflowPath===fs)),ns=is.find(pe=>pe.status==="running")??null,Hs=is.filter(pe=>pe.status!=="running").sort((pe,Re)=>(Re.endedAt??"").localeCompare(pe.endedAt??""))[0],ps=!ns&&(Hs==null?void 0:Hs.status)==="failed"&&!Ot.has(Hs.id)?Hs:null,Bn=ps?c.find(pe=>pe.id===ps.macroId)??null:null,Ra=()=>{Es&&(u&&(W.current=Date.now()+900,$(!0),E(pe=>pe+1)),m(Es),Nn("visualize.triggered"))},Ms=h!=null&&!0,_t=u&&Ms,Ut=!!h&&!ps&&_t&&!D;return a.jsxs("aside",{className:"canvas-pane",children:[M&&!K&&a.jsx(V0,{workflow:M,onReVisualize:Ra,reVisualizeDisabledReason:Qe,refreshing:!!ns||Ut&&P,expanded:Ke,onToggleExpanded:()=>rt(pe=>!pe),canExpand:Ut,detailStep:de,onBack:()=>we(null),onAskAgent:v,surface:l,stepsSummary:st&&st.nodes.length>0?ov(st):null,run:C,runTarget:w,runs:g,onSelectRun:d}),x?a.jsx(Ts,{className:"canvas-empty",testId:"canvas-empty-no-session",icon:"Radio",title:`No running session for ${x}`,body:l==="steps"?"Start a session to map this agent's steps here.":"Start a session to map, run, and inspect this agent."}):K||!h?l==="steps"?a.jsx(Ts,{className:"canvas-empty",icon:"Radio",title:"No session",body:"Start a session to see its workflow steps here."}):a.jsx(Ts,{className:"canvas-empty",icon:"Radio",title:"No session",body:"Start a session to see its canvas here."}):ps?a.jsxs("div",{className:"canvas-task-failed","data-testid":"canvas-task-failed",children:[a.jsxs("p",{className:"canvas-task-title",children:[a.jsx(Se,{name:"TriangleAlert",size:14})," ",ps.label," failed."]}),ps.errorTail&&a.jsx("pre",{className:"canvas-task-error",children:ps.errorTail}),a.jsxs("div",{className:"canvas-task-actions",children:[Bn&&a.jsx("button",{className:"btn-primary","data-testid":"canvas-task-retry",onClick:()=>m(Bn),children:"Retry"}),a.jsx("button",{className:"btn-ghost","data-testid":"canvas-task-dismiss",onClick:()=>ai(pe=>{const Re=new Set(pe);return Re.add(ps.id),Re}),children:"Dismiss"})]})]}):ns&&!_t?a.jsxs("div",{className:"canvas-task-activity","data-testid":"canvas-task-activity",children:[a.jsx("span",{className:"canvas-task-icon","aria-hidden":"true",children:a.jsx(Se,{name:"Workflow",size:20})}),a.jsx("div",{className:"canvas-task-title",children:a.jsxs("span",{children:[ns.label," is running…"]})}),ns.statusLines.length>0&&a.jsx("ul",{className:"canvas-task-lines","data-testid":"canvas-task-lines",children:ns.statusLines.slice(-8).map((pe,Re)=>a.jsx("li",{children:pe},`${Re}-${pe}`))}),a.jsx("p",{className:"canvas-empty-hint",children:"Running as a background task, so your session stays free. The canvas reloads here when it finishes."})]}):D?a.jsxs("div",{className:"canvas-loading","data-testid":"canvas-loading",children:[a.jsx("span",{className:"canvas-task-spinner","aria-hidden":"true"}),a.jsx("p",{className:"canvas-empty-hint",children:l==="steps"?"Loading steps…":"Loading canvas…"})]}):!_t&&l==="steps"&&C?a.jsx("div",{className:"canvas-steps-surface","data-testid":"canvas-steps-surface",children:a.jsx(If,{run:C,target:w})}):!_t&&H?a.jsx(Ts,{className:"canvas-empty",testId:"canvas-empty-exited",icon:"History",title:"Session ended",body:`Resume the session to visualize its ${l==="steps"?"workflow steps":"workflow"} here.`}):_t?a.jsx("div",{className:"canvas-frame-wrap"+(Ke?" is-expanded":""),"data-view":l==="board"?"board":de?"detail":"steps",children:a.jsxs("div",{className:"canvas-slide-track",children:[a.jsxs("div",{className:"canvas-slide-pane",children:[a.jsxs("div",{className:"canvas-visual"+(l==="steps"?" is-offstage":""),children:[a.jsxs("div",{className:"canvas-view-controls","data-testid":"canvas-view-controls",children:[a.jsx("button",{className:"theme-toggle","data-testid":"canvas-zoom-out","aria-label":"Zoom out",title:"Zoom out",disabled:B<=.5,onClick:()=>{ye.current=!0,T(pe=>Math.max(.5,Math.round((pe-.25)*100)/100))},children:a.jsx(Se,{name:"ZoomOut",size:14})}),a.jsxs("button",{className:"theme-toggle canvas-zoom-reset","data-testid":"canvas-zoom-reset","aria-label":"Reset zoom",title:"Reset zoom",disabled:B===1,onClick:()=>{ye.current=!0,T(1)},children:[Math.round(B*100),"%"]}),a.jsx("button",{className:"theme-toggle","data-testid":"canvas-zoom-in","aria-label":"Zoom in",title:"Zoom in",disabled:B>=2,onClick:()=>{ye.current=!0,T(pe=>Math.min(2,Math.round((pe+.25)*100)/100))},children:a.jsx(Se,{name:"ZoomIn",size:14})}),a.jsx("button",{className:"theme-toggle","data-testid":"canvas-fit","aria-label":"Fit to view",title:"Fit to view",disabled:B===be.zoom&&O.x===be.x&&O.y===be.y,onClick:Be,children:a.jsx(Se,{name:"Frame",size:14})})]}),Ke&&a.jsx("button",{className:"macro-icon-btn canvas-expand-exit","data-testid":"canvas-expand-exit","aria-label":"Exit expanded canvas",title:"Exit expanded canvas (Esc)",onClick:()=>rt(!1),children:a.jsx(Se,{name:"Minimize2",size:14})}),(P||z)&&a.jsxs("div",{className:"canvas-skeleton canvas-loading--overlay"+(P?"":" is-fading"),"data-testid":"canvas-loading",role:"status","aria-label":"Rendering diagram",children:[a.jsx("div",{className:"canvas-skeleton-block canvas-skeleton-title"}),a.jsxs("div",{className:"canvas-skeleton-row",children:[a.jsx("div",{className:"canvas-skeleton-block"}),a.jsx("div",{className:"canvas-skeleton-block"})]}),a.jsxs("div",{className:"canvas-skeleton-row",children:[a.jsx("div",{className:"canvas-skeleton-block"}),a.jsx("div",{className:"canvas-skeleton-block"}),a.jsx("div",{className:"canvas-skeleton-block"})]}),a.jsx("div",{className:"canvas-skeleton-block canvas-skeleton-wide"})]}),Tt&&a.jsxs("div",{className:"canvas-render-error","data-testid":"canvas-render-error",children:[a.jsx("span",{className:"canvas-error-icon","aria-hidden":"true",children:a.jsx(Se,{name:"TriangleAlert",size:20})}),a.jsx("div",{className:"canvas-task-title",children:"Render failed"}),a.jsx("p",{className:"canvas-error-summary",children:(()=>{const pe=Tt.reason.trim();return pe.length<4?"The workflow graph could not be extracted. Open the terminal for details.":pe.includes(": ")?pe.slice(pe.indexOf(": ")+2).split(". ")[0]:pe})()}),a.jsxs("div",{className:"canvas-error-actions",children:[a.jsx("button",{className:"btn-primary","data-testid":"canvas-error-fix",onClick:()=>v(`The canvas render for ${Tt.title||"this workflow"} failed: ${Tt.reason} Fix the project so the workflow graph extracts cleanly.`),children:"Ask agent to fix"}),a.jsx("button",{className:"btn-ghost","data-testid":"canvas-error-retry",onClick:()=>{W.current=Date.now()+900,$(!0),E(pe=>pe+1)},children:"Retry"})]}),a.jsxs("details",{className:"canvas-error-details",children:[a.jsx("summary",{children:"Details"}),a.jsx("pre",{children:Tt.reason.trim().length>=4?Tt.reason:"The rendered document reported a failure without details. Re-run Visualize or check the terminal."})]})]}),ns&&a.jsxs("div",{className:"canvas-task-activity canvas-task-activity--overlay","data-testid":"canvas-task-activity",children:[a.jsx("span",{className:"canvas-task-icon","aria-hidden":"true",children:a.jsx(Se,{name:"Workflow",size:20})}),a.jsx("div",{className:"canvas-task-title",children:a.jsxs("span",{children:[ns.label," is running…"]})}),ns.statusLines.length>0&&a.jsx("ul",{className:"canvas-task-lines","data-testid":"canvas-task-lines",children:ns.statusLines.slice(-8).map((pe,Re)=>a.jsx("li",{children:pe},`${Re}-${pe}`))}),a.jsx("p",{className:"canvas-empty-hint",children:"Running as a background task, so your session stays free. The canvas reloads here when it finishes."})]}),ot&&!Xt&&!Nt&&a.jsx("button",{className:"theme-toggle canvas-overview-open","data-testid":"canvas-overview-toggle","aria-label":"Show workflow overview","data-tooltip":"Show workflow overview",onClick:()=>xt(!0),children:"i"}),a.jsx("iframe",{ref:X,className:"canvas-iframe",src:`/canvas/${h}/?theme=${R}`,sandbox:"allow-scripts",onLoad:()=>{var pe,Re,He,bt;j(),(Re=(pe=X.current)==null?void 0:pe.contentWindow)==null||Re.postMessage({type:"sapiom-canvas:view",zoom:B,x:O.x,y:O.y},"*"),C&&w&&h&&((bt=(He=X.current)==null?void 0:He.contentWindow)==null||bt.postMessage({type:"sapiom:run-state",steps:C.steps,status:C.status,target:w},"*"))}},`${h}:${A}`),a.jsx("div",{ref:ge,className:"canvas-pan-layer"+(ae?" is-panning":""),"data-testid":"canvas-pan-layer","data-over-node":Ae&&!ae?"true":void 0,onPointerDown:Ie,onPointerMove:Ft,onPointerLeave:Ce,onDoubleClick:Be})]}),l==="steps"&&a.jsx("div",{className:"canvas-steps-surface","data-testid":"canvas-steps-surface",children:st&&st.nodes.length>0?a.jsx($0,{graph:st,run:C,runTarget:w,workflows:f,onOpenWorkflow:r,expandedId:ee,onToggle:pe=>ie(Re=>Re===pe?null:pe),onOpenDetail:we}):C?a.jsx(If,{run:C,target:w}):a.jsx(Ts,{className:"canvas-empty",icon:"Sparkles",title:"No steps yet",body:"This canvas has not posted a step graph. Re-run Visualize on the Canvas tab to map them."})}),l==="board"&&(ot&&Xt||Nt)&&a.jsx(F0,{overview:ot??null,selectedNode:Nt,graph:st,run:C,workflows:f,onOpenWorkflow:r,onSelectStep:ct,onOpenSteps:()=>{Ze&&we(Ze),_()},onDeselect:()=>ct(null),onCollapse:()=>xt(!1),onInjectPrompt:v})]}),a.jsx("div",{className:"canvas-slide-pane","aria-hidden":de?void 0:!0,children:Ee&&st&&a.jsx(P0,{graph:st,node:Ee,run:C,onSelectStep:we,workflows:f,onOpenWorkflow:r})})]})}):a.jsx(Ts,{className:"canvas-empty",icon:"Sparkles",title:l==="steps"?"No steps yet":"Nothing generated yet",body:l==="steps"?"Steps are read from the visualized workflow. Visualize on the Canvas tab to map them.":"Visualize the bound workflow; the canvas updates as the agent works.",cta:Es&&a.jsxs("button",{className:"btn-primary canvas-visualize-cta","data-testid":"canvas-visualize-cta","data-tooltip":Qe??Es.label,disabled:!!Qe,onClick:()=>{m(Es),Nn("visualize.triggered")},children:[a.jsx(Se,{name:"Sparkles",size:14})," Visualize"]})})]})}const Q0="https://tools.sapiom.ai",J0="x-sapiom-api-key",e1="YOUR_SAPIOM_API_KEY";function t1(h){return h==null?"{ /* your input */ }":JSON.stringify(h,null,2).replace(/\n/g,`
414
+ `)}function s1(h){return h==null?"{}":JSON.stringify(h)}function i1(h){return h.replace(/'/g,"'\\''")}function n1(h,b){return`import { agents } from "@sapiom/tools";
415
+
416
+ const result = await agents.run({
417
+ definition: ${JSON.stringify(h)},
418
+ input: ${t1(b)},
419
+ });
420
+
421
+ if (result.status === "completed") {
422
+ console.log(result.output);
423
+ }
424
+ `}function a1(h,b,M){const x=i1(`{ "input": ${s1(b)} }`);return`curl -X POST ${M}/agents/v1/definitions/${h}/executions \\
425
+ -H "${J0}: ${e1}" \\
426
+ -H "Content-Type: application/json" \\
427
+ -d '${x}'
428
+ `}function r1(h){const{definition:b,inputSample:M,baseUrl:x=Q0}=h;return{typescript:n1(b,M),curl:a1(b,M,x)}}const l1="https://app.sapiom.ai/settings?tab=api-keys";function o1({boundWorkflow:h,agentsBaseUrl:b}){return h.definitionId==null?null:a.jsx(c1,{boundWorkflow:h,agentsBaseUrl:b})}function c1({boundWorkflow:h,agentsBaseUrl:b}){const[M,x]=q.useState("typescript"),[U,K]=q.useState(!1),H=h.definitionSlug==null,c=h.definitionSlug??h.name,{typescript:p,curl:m}=r1({definition:c,baseUrl:b}),v=M==="typescript"?p:m,l=()=>{navigator.clipboard.writeText(v).then(()=>{K(!0),window.setTimeout(()=>K(!1),2e3)}).catch(()=>{})};return a.jsxs("div",{className:"snippet-panel","data-testid":"snippet-panel",children:[a.jsx("div",{className:"snippet-panel-header",children:a.jsx("span",{className:"snippet-panel-title",children:"Trigger from your code"})}),a.jsxs("div",{className:"snippet-slug-row",children:[a.jsx("span",{className:"snippet-slug-label",children:"Agent"}),a.jsx("code",{className:"snippet-slug","data-testid":"snippet-slug",children:c})]}),H&&a.jsx("p",{className:"snippet-slug-inferred","data-testid":"snippet-slug-inferred",children:"Inferred from the project name. Confirm it matches your deployed agent."}),a.jsxs("div",{className:"snippet-tabs",role:"tablist","aria-label":"Snippet language",children:[a.jsx("button",{role:"tab","aria-selected":M==="typescript","aria-controls":"snippet-code-panel",className:"snippet-tab"+(M==="typescript"?" is-active":""),"data-testid":"snippet-tab-ts",onClick:()=>x("typescript"),children:"TypeScript (SDK)"}),a.jsx("button",{role:"tab","aria-selected":M==="curl","aria-controls":"snippet-code-panel",className:"snippet-tab"+(M==="curl"?" is-active":""),"data-testid":"snippet-tab-curl",onClick:()=>x("curl"),children:"cURL (HTTP)"})]}),a.jsxs("div",{className:"snippet-code-wrap",role:"tabpanel",id:"snippet-code-panel",children:[a.jsx("pre",{className:"snippet-code","data-testid":"snippet-code",children:a.jsx("code",{children:v})}),a.jsx("button",{className:"snippet-copy"+(U?" is-copied":""),"data-testid":"snippet-copy","aria-label":U?"Copied":"Copy snippet",onClick:l,children:U?"Copied":"Copy"})]}),a.jsxs("p",{className:"snippet-hint",children:["Replace ",a.jsx("code",{children:"YOUR_SAPIOM_API_KEY"})," with a key from your"," ",a.jsx("a",{className:"snippet-link","data-testid":"snippet-api-key-link",href:l1,target:"_blank",rel:"noreferrer",children:"Sapiom dashboard"}),". Add ",a.jsx("code",{children:"idempotencyKey"})," to the body to deduplicate retries."]})]})}function u1({boundWorkflow:h,noSessionAgent:b=null,agentsBaseUrl:M}){if(!h)return a.jsx(Ts,{className:"code-panel-empty",icon:"Code",title:b?`No running session for ${b}`:"No agent bound",body:b?"Start a session to trigger this agent from your code.":"Open an agent to see how to trigger it from your code."});const x=h.definitionId!=null;return a.jsxs("div",{className:"code-panel",children:[a.jsxs("div",{className:"workflow-actions-header code-panel-header","data-testid":"code-panel-header",children:[a.jsx("span",{className:"workflow-actions-name",children:h.name}),x?a.jsxs("span",{className:"status-tag workflow-deployed-tag","data-testid":"code-panel-status","data-tooltip":"Deployed to production",children:[a.jsx("span",{className:"workflow-dot workflow-dot-pinned","aria-hidden":"true"}),"Deployed"]}):a.jsxs("span",{className:"status-tag code-panel-draft-tag","data-testid":"code-panel-status","data-tooltip":"Exists locally only. Deploy it to call it from your code.",children:[a.jsx(Se,{name:"CloudOff",size:13}),"Draft"]})]}),x?a.jsx("div",{className:"code-panel-body","data-testid":"code-panel-body",children:a.jsx(o1,{boundWorkflow:h,agentsBaseUrl:M},h.path)}):a.jsx(Ts,{className:"code-panel-empty",icon:"Code",title:"Deploy to trigger from code",body:`${h.name} is a draft. Once it deploys, copy-paste TypeScript SDK and cURL calls for it appear here.`})]})}function $f(h,b){if(!h)return{score:0,indices:[]};const M=h.toLowerCase(),x=b.toLowerCase();let U=0,K=0,H=0;const c=[];for(let p=0;p<M.length;p++){const m=M[p],v=x.indexOf(m,K);if(v===-1)return null;H=v===K?H+1:0,U+=10-Math.min(v-K,8),U+=H*3,v===0&&(U+=5),c.push(v),K=v+1}return{score:U,indices:c}}const h1={command:"LayoutTemplate",session:"Radio",past:"History",workflow:"Workflow",recent:"Folder",path:"Folder"},mc={command:"Actions",session:"Sessions",past:"Past sessions",workflow:"Workflows",recent:"Folders",path:"Folders"},d1=6;function Pf(h,b){if(!b||b.length===0)return h;const M=new Set(b),x=[];let U="",K=M.has(0);const H=c=>{U&&(x.push(K?a.jsx("b",{className:"palette-match",children:U},c):U),U="")};for(let c=0;c<h.length;c++){const p=M.has(c);p!==K&&(H(c),K=p),U+=h[c]}return H(h.length),x}function f1(h,b){const M=$f(h,b.label);if(M)return{item:{...b,labelIndices:M.indices},score:1e3+M.score};const x=$f(h,b.meta);return x?{item:{...b,metaIndices:x.indices},score:x.score}:null}function p1({sessions:h,workflows:b,recentDirs:M,history:x,listDir:U,onSelectSession:K,onReviewSummary:H,onOpenPath:c,onBrowseTemplates:p,onClose:m}){const[v,l]=q.useState(""),[_,C]=q.useState([]),[w,g]=q.useState(!1),[d,f]=q.useState(!1),[r,u]=q.useState(0),S=q.useRef(null);q.useEffect(()=>{var D;(D=S.current)==null||D.focus()},[]);const A=v.startsWith("/")||v.startsWith("~");q.useEffect(()=>{if(!A){C([]),f(!1);return}let D=!1;g(!0),f(!1);const I=setTimeout(()=>{U(v).then(P=>{D||C(P.dirs)}).catch(()=>{D||(C([]),f(!0))}).finally(()=>!D&&g(!1))},150);return()=>{D=!0,clearTimeout(I)}},[v,A,U]);const E=q.useMemo(()=>{if(A){const W=v.trim(),Y=W?[{id:`confirm:${W}`,kind:"path",label:W,meta:"Open this path",path:W}]:[],j=_.map(B=>({id:`dir:${B.path}`,kind:"path",label:B.name,meta:B.path,path:B.path}));return[...Y,...j]}const D=h.filter(W=>W.status!=="exited").map(W=>({id:`session:${W.id}`,kind:"session",label:W.title,meta:W.cwd,sessionId:W.id})),I=new Set(h.map(W=>W.id)),P=new Set(h.map(W=>W.agentSessionId).filter(W=>W!=null)),$=[...h.filter(W=>W.status==="exited").map(W=>({id:`past:${W.id}`,kind:"past",label:W.title,meta:W.cwd,sessionId:W.id})),...x.filter(W=>!(W.harnessSessionId!=null&&I.has(W.harnessSessionId))&&!P.has(W.agentSessionId)).map(W=>({id:`summary:${W.agentSessionId}`,kind:"past",label:W.title,meta:W.cwd,summary:W}))],z=b.map(W=>({id:`workflow:${W.path}`,kind:"workflow",label:W.name,meta:W.path,path:W.path})),Q=[{id:"command:browse-templates",kind:"command",label:"Browse templates",meta:"Gallery and starters"}],ne=new Set(b.map(W=>W.path)),F=M.filter(W=>!ne.has(W)).map(W=>({id:`recent:${W}`,kind:"recent",label:W.split("/").filter(Boolean).pop()??W,meta:W,path:W}));return v?[D,$,z,F,Q].flatMap(W=>W.map(Y=>f1(v,Y)).filter(Y=>Y!==null).sort((Y,j)=>j.score-Y.score).map(Y=>Y.item)).slice(0,20):[...D,...$.slice(0,d1),...z,...F].slice(0,20-Q.length).concat(Q)},[v,A,_,h,b,M,x]);q.useEffect(()=>u(0),[E.length,v]);const R=D=>{D.kind==="command"?p():(D.kind==="session"||D.kind==="past")&&D.sessionId?K(D.sessionId):D.kind==="past"&&D.summary?H(D.summary):D.path&&c(D.path),m()},y=D=>{if(D.key==="ArrowDown")D.preventDefault(),u(I=>Math.min(I+1,E.length-1));else if(D.key==="ArrowUp")D.preventDefault(),u(I=>Math.max(I-1,0));else if(D.key==="Enter"){D.preventDefault();const I=E[r];I&&R(I)}else D.key==="Escape"&&m()};return a.jsx("div",{className:"modal-backdrop",onClick:m,children:a.jsxs("div",{className:"modal command-palette",onClick:D=>D.stopPropagation(),children:[a.jsx("input",{ref:S,className:"command-palette-input","data-testid":"command-palette-input",placeholder:"Jump to a session, workflow, or path…",value:v,onChange:D=>l(D.target.value),onKeyDown:y}),a.jsxs("div",{className:"command-palette-list","data-testid":"command-palette-list",children:[A&&w&&a.jsx("div",{className:"command-palette-empty",children:"Loading…"}),A&&d&&!w&&a.jsx("div",{className:"command-palette-error","data-testid":"command-palette-error",role:"alert",children:"Couldn't read that path."}),E.length===0&&!w&&!d&&a.jsx("div",{className:"command-palette-empty",children:"No matches"}),E.map((D,I)=>a.jsxs("div",{className:"command-palette-row",children:[!A&&(I===0||mc[D.kind]!==mc[E[I-1].kind])&&a.jsx("div",{className:"command-palette-section","data-testid":"command-palette-section",children:mc[D.kind]}),a.jsxs("button",{type:"button",className:"command-palette-item"+(I===r?" is-selected":""),"data-testid":`command-palette-item-${I}`,onMouseEnter:()=>u(I),onClick:()=>R(D),children:[a.jsx(Se,{name:h1[D.kind],size:14}),a.jsx("span",{className:"command-palette-item-label",children:Pf(D.label,D.labelIndices)}),a.jsx("span",{className:"command-palette-item-meta",children:Pf(D.meta,D.metaIndices)})]})]},D.id))]})]})})}const m1={offline:{icon:"CloudOff",title:"You're offline",body:"Sapiom Studio can't reach the network. Check your connection — the moment you're back, retry to pick up right where you left off."},auth:{icon:"Plug",title:"Session needs a refresh",body:"Your credential was rejected — it may have rotated or expired. Retry to reconnect with the current key; you won't lose your place."},error:{icon:"TriangleAlert",title:"Couldn't reach Sapiom Studio",body:"The server didn't respond as expected. This is usually temporary — retry in a moment."}};function _1({status:h,onRetry:b,retrying:M=!1,detail:x,onStartAuth:U}){const K=m1[h],[H,c]=q.useState({status:"idle"}),p=async()=>{if(U){c({status:"pending"});try{await U(),c({status:"idle"})}catch(m){const v=m instanceof Error?m.message:"Could not start sign-in. Try again.";c({status:"error",message:v})}}};return a.jsx("div",{className:"app-status connectivity-screen","data-testid":"connectivity-screen","data-status":h,role:"alert",children:a.jsxs("div",{className:"connectivity-screen-inner",children:[a.jsx("span",{className:"connectivity-screen-icon","aria-hidden":"true",children:a.jsx(Se,{name:K.icon,size:22})}),a.jsx("span",{className:"connectivity-screen-title",children:K.title}),a.jsx("span",{className:"connectivity-screen-body",children:K.body}),h==="error"&&x&&a.jsx("span",{className:"connectivity-screen-detail","data-testid":"connectivity-screen-detail",children:x}),a.jsx("button",{className:"btn-primary connectivity-screen-retry","data-testid":"connectivity-retry",onClick:b,disabled:M||H.status==="pending",children:M?"Reconnecting…":"Retry"}),h==="auth"&&U&&a.jsxs("div",{className:"connectivity-screen-auth-section",children:[H.status==="pending"?a.jsxs("span",{className:"connectivity-auth-pending","data-testid":"connectivity-auth-pending",children:[a.jsx(Se,{name:"Loader",size:14}),"Opening browser… waiting for sign-in"]}):a.jsxs("button",{className:"btn-secondary connectivity-connect-btn","data-testid":"connectivity-connect-btn",onClick:()=>void p(),children:[a.jsx(Se,{name:"Plug",size:14}),"Connect account"]}),H.status==="error"&&a.jsx("span",{className:"connectivity-auth-error","data-testid":"connectivity-auth-error",children:H.message})]})]})})}function v1({onDismiss:h}){return a.jsxs("div",{className:"connectivity-banner",role:"status","data-testid":"connectivity-banner",children:[a.jsx("span",{className:"connectivity-banner-icon","aria-hidden":"true",children:a.jsx(Se,{name:"CloudOff",size:14})}),a.jsx("span",{className:"connectivity-banner-text",children:"You're offline. The Studio stays usable, but live actions (runs, deploys, the terminal) pause until your connection returns."}),h&&a.jsx("button",{className:"connectivity-banner-dismiss","aria-label":"Dismiss offline notice","data-testid":"connectivity-banner-dismiss",onClick:h,children:"×"})]})}const Qr={"claude-code":"Claude Code",codex:"Codex"};function Sp(h,b=Date.now()){const M=b-new Date(h).getTime(),x=Math.floor(M/6e4);if(x<1)return"just now";if(x<60)return`${x}m ago`;const U=Math.floor(x/60);if(U<24)return`${U}h ago`;const K=Math.floor(U/24);return K<7?`${K}d ago`:new Date(h).toLocaleDateString([],{month:"short",day:"numeric"})}function g1(h,b){const M=new Date(b).getTime()-new Date(h).getTime();if(!Number.isFinite(M)||M<0)return null;const x=Math.floor(M/6e4);if(x<1)return"under a minute";if(x<60)return`${x}m`;const U=Math.floor(x/60);return U<24?`${U}h ${x%60}m`:`${Math.floor(U/24)}d ${U%24}h`}function Cc(h){const b=[Qr[h.harness]];return h.gitBranch&&b.push(h.gitBranch),h.messageCount!=null&&h.messageCount>0&&b.push(`${h.messageCount} ${h.messageCount===1?"turn":"turns"}`),b.push(Sp(h.lastActiveAt)),b.join(" · ")}function S1({session:h,onResume:b,onClose:M}){const x=h.agentSessionId!=null,U=g1(h.createdAt,h.lastActiveAt);return a.jsxs("div",{className:"dead-session-pane","data-testid":"dead-session-pane",children:[a.jsx("span",{className:"empty-state-icon","aria-hidden":"true",children:a.jsx(Se,{name:"SquareTerminal",size:18})}),a.jsx("div",{className:"dead-session-title",children:"Session exited"}),a.jsxs("div",{className:"dead-session-meta",children:[h.cwd,h.exitCode!=null&&` · exit code ${h.exitCode}`]}),a.jsxs("dl",{className:"dead-session-detail","data-testid":"dead-session-detail",children:[h.title&&a.jsxs("div",{className:"dead-session-detail-row",children:[a.jsx("dt",{children:"Session"}),a.jsx("dd",{children:h.title})]}),a.jsxs("div",{className:"dead-session-detail-row",children:[a.jsx("dt",{children:"Agent"}),a.jsx("dd",{children:Qr[h.harness]})]}),U&&a.jsxs("div",{className:"dead-session-detail-row",children:[a.jsx("dt",{children:"Ran for"}),a.jsx("dd",{children:U})]}),a.jsxs("div",{className:"dead-session-detail-row",children:[a.jsx("dt",{children:"Ended"}),a.jsx("dd",{children:Sp(h.lastActiveAt)})]})]}),a.jsxs("div",{className:"dead-session-actions",children:[a.jsx("button",{className:"btn-primary","data-testid":"dead-session-resume",onClick:b,disabled:!x,title:x?void 0:"This session can't be resumed. It exited before establishing a session id.",children:"Resume"}),a.jsx("button",{className:"btn-ghost","data-testid":"dead-session-close",onClick:M,children:"Close"})]}),!x&&a.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."})]})}function y1({summary:h,resumable:b,onStart:M,onClose:x}){return a.jsxs("div",{className:"dead-session-pane","data-testid":"past-session-pane",children:[a.jsx("div",{className:"dead-session-title",children:h.title}),a.jsxs("div",{className:"dead-session-meta",children:[Cc(h)," · ",h.cwd]}),a.jsxs("div",{className:"dead-session-actions",children:[a.jsx("button",{className:"btn-primary","data-testid":"past-session-start",onClick:M,children:b?"Resume":"New session here"}),a.jsx("button",{className:"btn-ghost","data-testid":"past-session-close",onClick:x,children:"Close"})]}),!b&&a.jsx("div",{className:"dead-session-resume-reason","data-testid":"past-session-reason",children:"This entry comes from the agent's own transcript history; the Studio can't reattach to its process. Starting opens a fresh session in the same directory."})]})}const b1="~/.sapiom/harness",C1={events:`${b1}/events.ndjson`},w1=["image/png","image/jpeg","image/gif","image/webp"],Wf=10*1024*1024,yp=["claude-code","codex"],x1=q.createContext(null),_c=h=>h<1024?`${h} B`:h<1024*1024?`${Math.round(h/1024)} KB`:`${(h/(1024*1024)).toFixed(1)} MB`,E1=h=>new Promise((b,M)=>{const x=new FileReader;x.onload=()=>b(String(x.result)),x.onerror=()=>M(x.error??new Error("could not read file")),x.readAsDataURL(h)}),k1=({sessionId:h,harness:b,api:M,showToast:x,children:U})=>{const[K,H]=q.useState(null),[c,p]=q.useState([]),[m,v]=q.useState(!1),[l,_]=q.useState(!1),C=q.useRef(null),w=q.useRef(0);q.useEffect(()=>{let y=!1;return M.listHarnesses().then(D=>{y||H(D)}).catch(()=>{}),()=>{y=!0}},[M]);const g=q.useMemo(()=>{var y;return K?((y=K.find(D=>D.id===b))==null?void 0:y.imageInput)??!1:!0},[K,b]);q.useEffect(()=>{p([]),w.current=0,v(!1)},[h]);const d=q.useCallback(async y=>{const D=y.filter(P=>P.type.startsWith("image/"));if(D.length===0)return;const I=[];for(const P of D){if(!w1.includes(P.type)){x(`${P.name||"image"}: ${P.type} isn't a supported image type.`);continue}if(P.size>Wf){x(`${P.name||"image"} is ${_c(P.size)}, over the ${_c(Wf)} limit.`);continue}try{const $=await E1(P);I.push({id:crypto.randomUUID(),dataUrl:$,filename:P.name||"pasted-image",mediaType:P.type,bytes:P.size})}catch{x(`Could not read ${P.name||"image"}.`)}}I.length>0&&p(P=>[...P,...I])},[x]);q.useEffect(()=>{if(!g)return;const y=D=>{var $;const I=($=D.clipboardData)==null?void 0:$.items;if(!I)return;const P=[];for(let z=0;z<I.length;z+=1){const Q=I[z];if(Q.kind==="file"&&Q.type.startsWith("image/")){const ne=Q.getAsFile();ne&&P.push(ne)}}P.length!==0&&(D.preventDefault(),d(P))};return window.addEventListener("paste",y),()=>window.removeEventListener("paste",y)},[g,d]);const f=q.useCallback(y=>{p(D=>D.filter(I=>I.id!==y))},[]),r=q.useCallback(async()=>{if(c.length===0||l)return;_(!0);let y=null;for(const D of c)try{await M.attachImage(h,{dataUrl:D.dataUrl,filename:D.filename}),p(I=>I.filter(P=>P.id!==D.id))}catch(I){y=I instanceof ds&&I.reason?I.reason:I.message;break}_(!1),y&&x(y)},[c,l,M,h,x]),u=q.useCallback(y=>{Array.from(y.dataTransfer.types).includes("Files")&&(w.current+=1,v(!0))},[]),S=q.useCallback(y=>{Array.from(y.dataTransfer.types).includes("Files")&&y.preventDefault()},[]),A=q.useCallback(()=>{w.current=Math.max(0,w.current-1),w.current===0&&v(!1)},[]),E=q.useCallback(y=>{Array.from(y.dataTransfer.types).includes("Files")&&(y.preventDefault(),w.current=0,v(!1),d(Array.from(y.dataTransfer.files)))},[d]),R=q.useCallback(()=>{var y;(y=C.current)==null||y.click()},[]);return g?a.jsxs("div",{className:"image-composer","data-testid":"image-composer",onDragEnter:u,onDragOver:S,onDragLeave:A,onDrop:E,children:[a.jsx(x1.Provider,{value:R,children:a.jsx("div",{className:"image-composer-pane",children:U})}),m&&a.jsxs("div",{className:"image-composer-dropzone","data-testid":"image-composer-dropzone",children:[a.jsx(Se,{name:"ImageUp",size:28}),a.jsx("span",{children:"Drop an image to attach it"})]}),c.length>0&&a.jsxs("div",{className:"image-composer-bar",children:[a.jsx("ul",{className:"image-composer-thumbs","data-testid":"image-composer-thumbs",children:c.map(y=>a.jsxs("li",{className:"image-composer-thumb",title:`${y.filename} · ${_c(y.bytes)}`,children:[a.jsx("img",{src:y.dataUrl,alt:y.filename}),a.jsx("button",{type:"button",className:"image-composer-thumb-remove",onClick:()=>f(y.id),disabled:l,"aria-label":`Remove ${y.filename}`,"data-tooltip":`Remove ${y.filename}`,"data-testid":"image-composer-thumb-remove",children:a.jsx(Se,{name:"X",size:11})})]},y.id))}),a.jsx("button",{type:"button",className:"image-composer-send btn-primary",onClick:()=>void r(),disabled:l,"data-testid":"image-composer-send",children:l?"Sending…":`Send ${c.length} to agent`})]}),a.jsx("input",{ref:C,type:"file",accept:"image/*",multiple:!0,hidden:!0,"data-testid":"image-composer-file-input",onChange:y=>{const D=y.target.files?Array.from(y.target.files):[];d(D),y.target.value=""}})]}):a.jsx(a.Fragment,{children:U})};function bp({onCancel:h,onConfirm:b,triggerRef:M}){const x=q.useRef(null);return Zr(!0,{onDismiss:h,containerRef:x,triggerRef:M}),a.jsx("div",{className:"modal-backdrop",onClick:h,children:a.jsxs("div",{ref:x,className:"modal modal-confirm",role:"alertdialog","aria-label":"End session","data-testid":"end-session-confirm",onClick:U=>U.stopPropagation(),children:[a.jsxs("div",{className:"modal-header",children:["End session?",a.jsx("button",{className:"theme-toggle modal-close","aria-label":"Close",title:"Close",onClick:h,children:a.jsx(Se,{name:"X",size:14})})]}),a.jsx("div",{className:"modal-body",children:a.jsx("p",{className:"modal-copy",children:"This kills the live terminal; anything the agent is doing right now stops. The session stays resumable from history once it has an agent session id."})}),a.jsxs("div",{className:"modal-actions",children:[a.jsx("button",{className:"btn-ghost",autoFocus:!0,onClick:h,children:"Keep session"}),a.jsx("button",{className:"btn-danger","data-testid":"end-session-confirm-btn",onClick:b,children:"End session"})]})]})})}const A1="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",D1="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",R1={"claude-code":A1,codex:D1},T1=["M105.267 60.7219L98.8902 71.7648L92.1353 83.4669L83.3114 98.7521L70.18 121.491H0L13.1249 98.7521H57.042L72.6274 71.7648L79.0038 60.7219L72.2619 49.0459H98.5247L105.267 60.7219Z","M114.072 0L100.954 22.7189H57.0694L57.0498 22.6928L57.0368 22.7189L41.8365 49.047L35.0945 60.723L41.471 71.7659H15.2016L8.8252 60.723L15.5671 49.047L21.9631 37.978L30.774 22.7189L43.8923 0H114.072Z"];function On({kind:h,size:b=16}){if(h==="sapiom")return a.jsx("svg",{viewBox:"0 0 115 122",width:b,height:b,fill:"currentColor","aria-hidden":"true",focusable:"false",children:T1.map(x=>a.jsx("path",{d:x},x.slice(0,16)))});const M=R1[h];return M?a.jsx("svg",{viewBox:"0 0 24 24",width:b,height:b,fill:"currentColor","aria-hidden":"true",focusable:"false",children:a.jsx("path",{d:M})}):a.jsx(Se,{name:"SquareTerminal",size:b})}function M1(h,b){return h.status==="exited"?"exited":b?"busy":h.status==="running"?"live":h.status}function j1(h){return h.split("/").filter(Boolean).pop()??h}function L1({overviewMode:h=!1,openedAgentName:b=null,reviewTitle:M=null,activeSession:x,sessionName:U,onRenameSession:K,boundWorkflowName:H,busy:c,onExpandRail:p,onExpandRight:m,onCloseSession:v,onOpenInEditor:l,onToast:_}){const[C,w]=q.useState(!1),[g,d]=q.useState(!1),[f,r]=q.useState(!1),[u,S]=q.useState(""),A=q.useRef(null),E=()=>d(!1),R=()=>{x&&K(x.id,u),r(!1)};return a.jsxs("div",{className:"session-bar",children:[p&&a.jsx("button",{className:"gear-btn","data-testid":"rail-expand","aria-label":"Expand workspace panel",title:"Expand workspace panel",onClick:p,children:a.jsx(Se,{name:"Menu",size:15})}),a.jsx("div",{className:"session-context","data-testid":"session-context","data-session-id":(x==null?void 0:x.id)??"",children:h?a.jsxs(a.Fragment,{children:[a.jsx(Se,{name:"Radio",size:13}),a.jsx("span",{className:"session-context-title","data-testid":"session-context-title",children:"Overview"})]}):b?a.jsxs(a.Fragment,{children:[a.jsx(Se,{name:"Zap",size:13}),a.jsx("span",{className:"session-context-title","data-testid":"session-context-title",children:b}),a.jsx("span",{className:"status-tag session-status-tag session-context-status","data-testid":"session-status-tag","data-status":"none","data-tooltip":"No running session for this agent. Start one to work on it.",children:"no session"})]}):M?a.jsxs(a.Fragment,{children:[a.jsx(Se,{name:"History",size:13}),a.jsx("span",{className:"session-context-title","data-testid":"session-context-title",children:M}),a.jsxs("span",{className:"status-tag session-status-tag session-context-status","data-testid":"session-status-tag","data-status":"exited","data-tooltip":"A past session under review. Resume it from the pane below.",children:[a.jsx("span",{className:"session-dot","data-status":"exited"}),"past"]})]}):x?a.jsxs(a.Fragment,{children:[a.jsx(On,{kind:x.harness,size:13}),f?a.jsx("input",{className:"group-name-input session-rename-input session-context-rename","data-testid":"session-rename-input",value:u,autoFocus:!0,onFocus:y=>y.currentTarget.select(),onChange:y=>S(y.target.value),onKeyDown:y=>{y.key==="Enter"&&R(),y.key==="Escape"&&r(!1)},onBlur:R}):a.jsx("span",{className:"session-context-title","data-testid":"session-context-title","data-tooltip":`${Qr[x.harness]} · ${j1(x.cwd)} · ${x.cwd}`,children:U??x.title}),H&&a.jsxs("span",{className:"session-workflow-chip","data-testid":"session-workflow-chip","data-tooltip":`Bound to ${H}; shown in Canvas`,children:["· ",H]}),a.jsxs("span",{className:"status-tag session-status-tag session-context-status","data-testid":"session-status-tag","data-status":x.status,"data-tooltip":c?"The agent produced output in the last few seconds":x.status==="running"?"Session is live; the terminal is connected":x.status==="exited"?"Session ended; resume it from the dead-session pane or history":"Session is starting",children:[c?a.jsx("span",{className:"session-busy","data-testid":"session-busy","aria-hidden":"true"}):a.jsx("span",{className:"session-dot","data-status":x.status}),M1(x,c)]})]}):a.jsx("span",{className:"session-context-none",children:"No active session"})}),!h&&!M&&!b&&x&&a.jsxs("div",{className:"session-menu-wrap",children:[a.jsx("button",{ref:A,className:"theme-toggle","data-testid":"session-menu","aria-label":"Session options","data-tooltip":"Session options","aria-haspopup":"menu","aria-expanded":g,onClick:()=>d(y=>!y),children:a.jsx(Se,{name:"MoreHorizontal",size:14})}),a.jsxs(Xi,{open:g,anchorRef:A,onDismiss:E,placement:"down-end",className:"session-menu",role:"menu",testid:"session-menu-popover",children:[a.jsxs("button",{role:"menuitem",className:"profile-menu-item",onClick:()=>{var y;(y=navigator.clipboard)==null||y.writeText(x.cwd).then(()=>_("Path copied.")).catch(()=>_("Couldn't copy the path.")),E()},children:[a.jsx(Se,{name:"Copy",size:13}),"Copy path"]}),a.jsxs("button",{role:"menuitem",className:"profile-menu-item","data-testid":"session-rename",onClick:()=>{S(U??x.title),r(!0),E()},children:[a.jsx(Se,{name:"Pencil",size:13}),"Rename session"]}),a.jsxs("button",{role:"menuitem",className:"profile-menu-item","data-testid":"session-open-editor",onClick:()=>{l(x.cwd),E()},children:[a.jsx(Se,{name:"Code",size:13}),"Open in editor"]}),x.status!=="exited"&&a.jsxs("button",{role:"menuitem",className:"profile-menu-item session-menu-danger","data-testid":"session-end-btn",onClick:()=>{E(),w(!0)},children:[a.jsx(Se,{name:"X",size:13}),"End session…"]})]})]}),m&&a.jsx("button",{className:"gear-btn","data-testid":"right-expand","aria-label":"Expand canvas panel",title:"Expand canvas panel",onClick:m,children:a.jsx(Se,{name:"List",size:15})}),C&&x&&a.jsx(bp,{triggerRef:A,onCancel:()=>w(!1),onConfirm:()=>{w(!1),v(x.id)}})]})}function N1({workflow:h,activeSessionId:b,sessionReady:M,macros:x,onRunMacro:U,preview:K,lastDeployError:H,authenticated:c,directActionSettleSeq:p}){const m=w=>x.find(g=>g.id===w),v=h.definitionId!=null,[l,_]=q.useState(null);q.useEffect(()=>{_(null)},[h.path,v,H,p]);const C=[{id:"local",label:"Local Run",icon:"FlaskConical",macro:m("run_local"),testId:"session-step-local",hint:"Test: run locally with every capability stubbed - no real calls."},{id:"run",label:"Prod Run",icon:"Play",macro:m("prod_run"),testId:"session-step-run",hint:"Ship: start a real cloud execution on Sapiom.",needsDeploy:!0,needsAuth:!0},{id:"deploy",label:"Deploy",icon:"CloudUpload",macro:m("deploy"),testId:"session-step-deploy",hint:"Ship: push and build on Sapiom.",primary:!0,needsAuth:!0}].filter(w=>w.macro);return a.jsxs("div",{className:"session-steps","data-testid":"session-steps","aria-label":"Agent actions",children:[a.jsxs("span",{className:"status-tag session-lifecycle-chip","data-testid":"session-lifecycle-chip","data-deployed":v,"data-deploy-error":H!=null&&!v?"":void 0,"data-tooltip":v?`Deployed to Sapiom (definition ${h.definitionId}). Run starts real cloud executions.`:H!=null?"Last deploy failed. Retry Deploy to push to Sapiom.":"Draft: exists locally only. Building here uses your Claude Code account; Deploy publishes to Sapiom.",children:[a.jsx(Se,{name:v?"Cloud":"CloudOff",size:13}),a.jsx("span",{className:"session-lifecycle-label",children:v?"Deployed":H!=null?"Deploy failed":"Draft"})]}),K&&a.jsxs("a",{className:"status-tag status-tag-action session-preview-chip","data-testid":"session-preview-chip",href:K.url,target:"_blank",rel:"noreferrer","aria-label":`Preview :${K.port}`,"data-tooltip":`The agent is serving an app on port ${K.port}. Opens ${K.url}`,children:[a.jsx(Se,{name:"ExternalLink",size:12}),a.jsx("span",{className:"session-preview-label",children:"Preview "}),":",K.port]}),a.jsx("div",{className:"session-actions",children:C.map(w=>{const g=w.needsAuth&&!c?"Connect your account first":null,d=w.needsDeploy&&!v?H!=null?"Last deploy failed — retry Deploy":"Not deployed yet":null,f=!M&&w.macro&&w.macro.action.kind!=="open-url"?"Session is starting":null,r=g??d??f??(w.macro?op(w.macro,h,b):null),u=w.label;return a.jsxs("button",{className:"session-step"+(w.primary?" session-action-primary":""),"data-testid":w.testId,"data-pending":l===w.id||void 0,disabled:!!r,"data-tooltip":r?`${u}: ${r}`:w.hint,"aria-label":r?`${u}: ${r}`:u,onClick:()=>{w.macro&&(U(w.macro),_(w.id),Nn("macro.invoked",{macroId:w.macro.id}))},children:[a.jsx(Se,{name:w.icon,size:14}),a.jsx("span",{className:"session-step-label",children:w.label})]},w.id)})})]})}function O1({sessions:h,activeSessionId:b,busySessionIds:M,labelOf:x,agentName:U,onSelect:K,onClose:H,onNew:c}){const[p,m]=q.useState(null),v=q.useRef(null);return a.jsxs("div",{className:"session-tabs",role:"tablist","aria-label":"Sessions","data-testid":"session-tabs",children:[h.map(l=>{const _=l.id===b,C=M.has(l.id),w=x(l);return a.jsxs("div",{className:"session-tab"+(_?" is-active":""),"data-testid":`session-tab-${l.id}`,children:[a.jsxs("button",{type:"button",role:"tab","aria-selected":_,className:"session-tab-main","data-testid":`session-tab-main-${l.id}`,title:`${w} · ${Qr[l.harness]}`,onClick:()=>K(l.id),children:[a.jsx(On,{kind:l.harness,size:13}),a.jsx("span",{className:"session-tab-label",children:w}),C?a.jsx("span",{className:"session-tab-busy","data-testid":`session-tab-busy-${l.id}`,"aria-hidden":"true"}):a.jsx("span",{className:"session-tab-dot","data-status":l.status,"aria-hidden":"true"})]}),a.jsx("button",{type:"button",className:"session-tab-close","data-testid":`session-tab-close-${l.id}`,"aria-label":`Close ${w}`,"data-tooltip":"End session",onClick:g=>{v.current=g.currentTarget,m(l.id)},children:a.jsx(Se,{name:"X",size:12})})]},l.id)}),a.jsx("button",{type:"button",className:"session-tab-new","data-testid":"session-tab-new","aria-label":`New session on ${U}`,"data-tooltip":"New session on this agent",onClick:c,children:a.jsx(Se,{name:"Plus",size:14})}),p&&a.jsx(bp,{triggerRef:v,onCancel:()=>m(null),onConfirm:()=>{const l=p;m(null),H(l)}})]})}function B1({onDismiss:h,onOpenSettings:b}){return a.jsxs("div",{className:"telemetry-notice",role:"status","data-testid":"telemetry-notice",children:[a.jsx("div",{className:"telemetry-notice-body",children:a.jsxs("p",{className:"telemetry-notice-text",children:["Analytics are ",a.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"," ",a.jsx("button",{className:"telemetry-notice-settings-link",onClick:()=>{b(),h()},children:"Settings"}),", or use the indicator in the top bar."]})}),a.jsx("button",{className:"telemetry-notice-dismiss","aria-label":"Dismiss analytics notice","data-testid":"telemetry-notice-dismiss",onClick:h,children:"×"})]})}const vc=[{kind:"gallery",id:"web-research-digest",name:"Web Research Digest",description:"Search the web for a topic and return a concise, sourced digest.",tags:["research","search"],sourcePath:"examples/web-research-digest",capabilities:["web.search"],whatItDoes:'Takes a topic, runs a web search through the Sapiom search capability, then condenses the top results into a short digest with source links. A legible "it did a thing" flagship: one metered capability, an obvious output.',steps:[{name:"search",description:"Query the web for the topic.",capability:"web.search",next:["summarize"]},{name:"summarize",description:"Condense the results into a sourced digest.",terminal:!0}],author:{name:"Sapiom",url:"https://sapiom.ai/"},useCases:["Get a quick, sourced briefing on an unfamiliar topic before a meeting.","Turn a research question into a shareable markdown digest with citations.","Learn how to wire a single capability into an agent you can extend."],notes:"`run_local` stubs the `web.search` capability, so you can trace the full graph offline before deploying. A real `deploy` + `run` performs a live web search.\n\nTo extend it, add a step after `summarize`, e.g. store the digest with `ctx.sapiom.memory.*`, or fan out one search per subtopic. `AGENTS.md` in this directory has the authoring loop.",examples:[{title:"Research an unfamiliar term",input:{topic:"what is an LLM agent?"},output:{topic:"what is an LLM agent?",digest:`# Research digest: what is an LLM agent?
429
+
430
+ An LLM agent is a system that uses a large language model to decide and take actions...
431
+
432
+ ## Sources
433
+ 1. [What are LLM agents?](https://example.com/llm-agents)
434
+ 2. [Agents overview](https://example.com/agents-overview)`,sources:[{title:"What are LLM agents?",url:"https://example.com/llm-agents"},{title:"Agents overview",url:"https://example.com/agents-overview"}]}}]},{kind:"gallery",id:"hello-agent",name:"Hello Agent",description:"The minimal single-step agent: a smoke test for the build, deploy, run path.",tags:["starter","minimal"],sourcePath:"examples/hello-agent",capabilities:[],whatItDoes:"Validates an input name and returns a greeting. The smallest valid definition: use it to confirm your MCP install and deploy path work end to end before reaching for a capability.",steps:[{name:"greet",description:"Validate the input and return a greeting.",terminal:!0}],author:{name:"Sapiom",url:"https://sapiom.ai/"},useCases:["Confirm your MCP install and deploy path work before building something real.","Start from the smallest valid definition and grow it one step at a time."],notes:"No capabilities, so `run_local` and a real `run` behave identically and cost nothing. Once this deploys and runs cleanly, fork a capability-backed template (e.g. Web Research Digest) for the real thing. See `AGENTS.md` for the authoring loop.",examples:[{title:"Greet a name",input:{name:"Ada"},output:{greeting:"Hello, Ada!"}},{title:"Default greeting",input:{},output:{greeting:"Hello, world!"}}]}],H1=[{kind:"starter",id:"default",name:"Default starter",description:"A minimal two-step starter."},{kind:"starter",id:"coding-pause",name:"Coding pause",description:"The launch + pauseUntilSignal + resume pattern for a non-blocking coding-agent run."}];function z1(h,b){const M="When the project is ready, offer a free local test run (sapiom_dev_agents_run_local) as the next step.";return h.kind==="gallery"?`Clone the Sapiom gallery template "${h.id}" into this directory: call the sapiom_dev_agents_clone tool with dir "${b}" and templateId "${h.id}". If it reports you are not authenticated, run sapiom_authenticate first and retry. After the clone, read the project's AGENTS.md and run npm install. `+M:`Scaffold the "${h.id}" starter in this directory: run \`sapiom agents init . -t ${h.id}\`, then run npm install and read AGENTS.md. Use the sapiom-agent-authoring skill to adapt the workflow. `+M}function U1(h){var x;const b=h.steps.map((U,K)=>({id:U.name,kind:U.terminal?"terminal-success":K===0?"entry":"step",label:U.name,role:U.terminal?"terminal":K===0?"entry":"step",description:U.description,timeoutMs:null,inputSchema:null,capabilities:U.capability?[U.capability]:[]})),M=[];return h.steps.forEach((U,K)=>{const H=U.next??(h.steps[K+1]&&!U.terminal?[h.steps[K+1].name]:[]);for(const c of H)M.push({from:U.name,to:c,kind:H.length>1?"branching":"sequential",label:""})}),{name:h.name,entry:((x=h.steps[0])==null?void 0:x.name)??"",nodes:b,edges:M,groups:[],warnings:[]}}function Ff(h,b){const M=h.kind==="starter"&&h.id==="default"?"sapiom-agent":h.id;return b?`${b}/${M}`:""}function I1({text:h}){const b=h.split(`
435
+ `),M=[];let x=0,U=0;function K(){return U++}function H(c){const p=[],m=/(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*)/g;let v=0,l;for(;(l=m.exec(c))!==null;){l.index>v&&p.push(c.slice(v,l.index));const _=l[0];_.startsWith("`")&&_.endsWith("`")?p.push(a.jsx("code",{className:"chat-inline-code",children:_.slice(1,-1)},K())):_.startsWith("**")&&_.endsWith("**")?p.push(a.jsx("strong",{children:_.slice(2,-2)},K())):_.startsWith("*")&&_.endsWith("*")?p.push(a.jsx("em",{children:_.slice(1,-1)},K())):p.push(_),v=l.index+_.length}return v<c.length&&p.push(c.slice(v)),p}for(;x<b.length;){const c=b[x];if(c.startsWith("```")){const l=c.slice(3).trim(),_=[];for(x++;x<b.length&&!b[x].startsWith("```");)_.push(b[x]),x++;x++,M.push(a.jsx("pre",{className:"chat-code-block","data-lang":l||void 0,children:a.jsx("code",{className:l?`language-${l}`:void 0,children:_.join(`
436
+ `)})},K()));continue}const p=c.match(/^(#{1,3})\s+(.+)/);if(p){const _=`h${p[1].length}`;M.push(a.jsx(_,{className:"chat-heading",children:H(p[2])},K())),x++;continue}if(c.startsWith("> ")){M.push(a.jsx("blockquote",{className:"chat-blockquote",children:H(c.slice(2))},K())),x++;continue}if(/^- \[[ x]\]/.test(c)){const l=[];for(;x<b.length&&/^- \[[ x]\]/.test(b[x]);){const _=b[x][3]==="x";l.push({text:b[x].replace(/^- \[[ x]\]\s?/,""),checked:_}),x++}M.push(a.jsx("ul",{className:"chat-list chat-checklist",children:l.map((_,C)=>a.jsx("li",{children:H(_.text)},C))},K()));continue}if(/^[-*+]\s+/.test(c)){const l=[];for(;x<b.length&&/^[-*+]\s+/.test(b[x]);){const _=b[x].replace(/^[-*+]\s+/,"");l.push(a.jsx("li",{children:H(_)},K())),x++}M.push(a.jsx("ul",{className:"chat-list",children:l},K()));continue}if(!c.trim()){x++;continue}const m=l=>l.startsWith("```")||/^#{1,3}\s+/.test(l)||l.startsWith("> ")||/^[-*+]\s+/.test(l),v=[c];for(x++;x<b.length&&b[x].trim()&&!m(b[x]);)v.push(b[x]),x++;M.push(a.jsx("p",{className:"chat-paragraph",children:H(v.join(" "))},K()))}return a.jsx(a.Fragment,{children:M})}function q1({template:h}){const b=U1(h);return a.jsx("div",{className:"template-graph","data-testid":"template-graph",children:b.nodes.map(M=>{const x=b.edges.filter(U=>U.from===M.id);return a.jsxs("div",{className:"template-graph-item","data-testid":`template-graph-node-${M.id}`,children:[a.jsxs("div",{className:"template-graph-node",children:[a.jsx("span",{className:"canvas-step-dot dot--"+M.kind,"aria-hidden":"true"}),a.jsx("span",{className:"template-graph-name",children:M.label}),M.kind==="terminal-success"&&a.jsx("span",{className:"template-step-exit",children:"exit"}),M.capabilities.map(U=>a.jsx("code",{className:"template-cap",children:U},U))]}),x.map(U=>a.jsxs("div",{className:"canvas-step-transition template-graph-edge",children:[a.jsx(Se,{name:"CornerDownRight",size:12}),a.jsx("span",{className:"canvas-step-transition-target",children:U.to})]},`${U.from}->${U.to}`))]},M.id)})})}function $1({example:h}){return a.jsxs("details",{className:"template-example",children:[a.jsx("summary",{className:"template-example-summary",children:h.title}),a.jsxs("div",{className:"template-example-body",children:[a.jsx("span",{className:"template-example-label",children:"Input"}),a.jsx("pre",{className:"template-example-json",children:JSON.stringify(h.input,null,2)}),a.jsx("span",{className:"template-example-label",children:"Output"}),a.jsx("pre",{className:"template-example-json",children:JSON.stringify(h.output,null,2)})]})]})}function P1({template:h}){return a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"template-lead",children:h.whatItDoes}),a.jsxs("section",{className:"template-section",children:[a.jsx("h4",{className:"template-section-title",children:"Steps"}),a.jsx(q1,{template:h}),a.jsx("ol",{className:"template-steps",children:h.steps.map((b,M)=>a.jsxs("li",{className:"template-step",children:[a.jsx("span",{className:"template-step-index","aria-hidden":"true",children:M+1}),a.jsxs("span",{className:"template-step-copy",children:[a.jsxs("span",{className:"template-step-name",children:[b.name,b.terminal&&a.jsx("span",{className:"template-step-exit",children:"exit"})]}),a.jsx("span",{className:"template-step-desc",children:b.description})]}),b.capability&&a.jsx("code",{className:"template-cap",children:b.capability})]},b.name))}),a.jsx("p",{className:"template-note",children:"Steps run in listed order; the first is the entry."})]}),a.jsxs("section",{className:"template-section",children:[a.jsx("h4",{className:"template-section-title",children:"Capabilities and cost"}),h.capabilities.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"template-caps",children:h.capabilities.map(b=>a.jsx("code",{className:"template-cap",children:b},b))}),a.jsx("p",{className:"template-note","data-testid":"template-cost-note",children:"Metered capabilities set the per-run price. Sapiom estimates it from this list; the estimate is not surfaced here yet. Local test runs stub every capability and are free."})]}):a.jsx("p",{className:"template-note","data-testid":"template-cost-note",children:"No metered capabilities, so runs record no capability cost."})]}),a.jsxs("section",{className:"template-section",children:[a.jsx("h4",{className:"template-section-title",children:"Use cases"}),a.jsx("ul",{className:"template-usecases",children:h.useCases.map(b=>a.jsx("li",{children:b},b))})]}),a.jsxs("section",{className:"template-section",children:[a.jsx("h4",{className:"template-section-title",children:"Examples"}),h.examples.map(b=>a.jsx($1,{example:b},b.title))]}),a.jsxs("section",{className:"template-section",children:[a.jsx("h4",{className:"template-section-title",children:"Notes"}),a.jsx("div",{className:"template-notes",children:a.jsx(I1,{text:h.notes})})]})]})}function W1({template:h}){return a.jsxs("div",{className:"template-detail","data-testid":"template-detail",children:[a.jsxs("div",{className:"template-detail-head",children:[a.jsx("h3",{className:"template-detail-name",children:h.name}),a.jsx("div",{className:"template-tags",children:(h.kind==="gallery"?h.tags:["bundled"]).map(b=>a.jsx("span",{className:"template-tag",children:b},b))})]}),h.kind==="gallery"?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"template-byline",children:["By"," ",a.jsx("a",{href:h.author.url,target:"_blank",rel:"noopener noreferrer",children:h.author.name})]}),a.jsx(P1,{template:h})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"template-lead",children:h.description}),a.jsx("p",{className:"template-note",children:"Scaffolds an npm-install-ready TypeScript project with a starter agent in index.ts."})]}),a.jsx("p",{className:"template-handoff","data-testid":"template-handoff",children:h.kind==="gallery"?"Using it forks the template into a repo you own, then clones it here. Needs a signed-in Sapiom account; the agent asks you to sign in if it is missing.":"Scaffolds offline from the template bundled with the CLI. No account, no network."})]})}function Yf({template:h,isSelected:b,onSelect:M}){return a.jsxs("button",{type:"button",role:"option","aria-selected":b,className:"template-row"+(b?" is-selected":""),"data-testid":`template-row-${h.id}`,onClick:()=>M(h),children:[a.jsx("span",{className:"template-row-name",children:h.name}),a.jsx("span",{className:"template-row-desc",children:h.description})]})}function Lc({launchDir:h,onClose:b,onUse:M,triggerRef:x}){const[U,K]=q.useState(vc[0]),[H,c]=q.useState(()=>Ff(vc[0],h)),[p,m]=q.useState(!1),[v,l]=q.useState(!1),[_,C]=q.useState(null),w=q.useRef(null);Zr(!0,{onDismiss:b,containerRef:w,triggerRef:x});const g=f=>{K(f),C(null),p||c(Ff(f,h))},d=async()=>{const f=H.trim();if(!(!f||v)){l(!0),C(null);try{await M(f,U),b()}catch(r){C(r.message),l(!1)}}};return a.jsx("div",{className:"modal-backdrop",children:a.jsxs("div",{className:"modal modal-templates",role:"dialog","aria-label":"Start from a template","data-testid":"templates-dialog",ref:w,children:[a.jsxs("div",{className:"modal-header",children:["Start from a template",a.jsx("button",{className:"theme-toggle modal-close","aria-label":"Close",title:"Close",onClick:b,disabled:v,children:a.jsx(Se,{name:"X",size:14})})]}),a.jsxs("div",{className:"templates-layout",children:[a.jsxs("div",{className:"templates-list",role:"listbox","aria-label":"Templates",children:[a.jsx("div",{className:"templates-list-section",children:"Gallery"}),vc.map(f=>a.jsx(Yf,{template:f,isSelected:f.id===U.id,onSelect:g},f.id)),a.jsx("div",{className:"templates-list-section",children:"Starters"}),H1.map(f=>a.jsx(Yf,{template:f,isSelected:f.id===U.id,onSelect:g},f.id))]}),a.jsx(W1,{template:U})]}),a.jsxs("div",{className:"modal-actions templates-actions",children:[a.jsxs("div",{className:"templates-dest",children:[a.jsx("input",{className:"modal-input",value:H,placeholder:"/path/to/new-folder","aria-label":"Destination folder","data-testid":"template-dest-input",disabled:v,onChange:f=>{c(f.target.value),m(!0)},onKeyDown:f=>{f.key==="Enter"&&d()}}),_?a.jsx("span",{className:"modal-error templates-dest-error",children:_}):a.jsx("span",{className:"templates-dest-hint",children:"A session starts here and sets it up."})]}),a.jsx("button",{className:"btn-ghost",onClick:b,disabled:v,children:"Cancel"}),a.jsx("button",{className:"btn-primary modal-primary-cta","data-testid":"template-use-btn",disabled:v||!H.trim(),onClick:()=>void d(),children:v?"Starting…":"Use template"})]})]})})}var gc={exports:{}},Kf;function F1(){return Kf||(Kf=1,(function(h,b){(function(M,x){h.exports=x()})(globalThis,(()=>(()=>{var M={4567:function(H,c,p){var m=this&&this.__decorate||function(r,u,S,A){var E,R=arguments.length,y=R<3?u:A===null?A=Object.getOwnPropertyDescriptor(u,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(r,u,S,A);else for(var D=r.length-1;D>=0;D--)(E=r[D])&&(y=(R<3?E(y):R>3?E(u,S,y):E(u,S))||y);return R>3&&y&&Object.defineProperty(u,S,y),y},v=this&&this.__param||function(r,u){return function(S,A){u(S,A,r)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const l=p(9042),_=p(9924),C=p(844),w=p(4725),g=p(2585),d=p(3656);let f=c.AccessibilityManager=class extends C.Disposable{constructor(r,u,S,A){super(),this._terminal=r,this._coreBrowserService=S,this._renderService=A,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 E=0;E<this._terminal.rows;E++)this._rowElements[E]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[E]);if(this._topBoundaryFocusListener=E=>this._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 _.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
437
+ `)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,d.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(r){for(let u=0;u<r;u++)this._handleChar(" ")}_handleChar(r){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
438
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(r){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(r)||this._charsToConsume.push(r)}_refreshRows(r,u){this._liveRegionDebouncer.refresh(r,u,this._terminal.rows)}_renderRows(r,u){const S=this._terminal.buffer,A=S.lines.length.toString();for(let E=r;E<=u;E++){const R=S.lines.get(S.ydisp+E),y=[],D=(R==null?void 0:R.translateToString(!0,void 0,void 0,y))||"",I=(S.ydisp+E+1).toString(),P=this._rowElements[E];P&&(D.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=D,this._rowColumns.set(P,y)),P.setAttribute("aria-posinset",I),P.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(r,u){const S=r.target,A=this._rowElements[u===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(u===0?"1":`${this._terminal.buffer.lines.length}`)||r.relatedTarget!==A)return;let E,R;if(u===0?(E=S,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(E=this._rowElements.shift(),R=S,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),u===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(u===0?-1:1),this._rowElements[u===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const r=document.getSelection();if(!r)return;if(r.isCollapsed)return void(this._rowContainer.contains(r.anchorNode)&&this._terminal.clearSelection());if(!r.anchorNode||!r.focusNode)return void console.error("anchorNode and/or focusNode are null");let u={node:r.anchorNode,offset:r.anchorOffset},S={node:r.focusNode,offset:r.focusOffset};if((u.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||u.node===S.node&&u.offset>S.offset)&&([u,S]=[S,u]),u.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(u={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(u.node))return;const A=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(A)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:A,offset:((D=A.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(S.node))return;const E=({node:I,offset:P})=>{const $=I instanceof Text?I.parentNode:I;let z=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(z))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get($);if(!Q)return console.warn("columns is null. Race condition?"),null;let ne=P<Q.length?Q[P]:Q.slice(-1)[0]+1;return ne>=this._terminal.cols&&(++z,ne=0),{row:z,column:ne}},R=E(u),y=E(S);if(R&&y){if(R.row>y.row||R.row===y.row&&R.column>=y.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(y.row-R.row)*this._terminal.cols-R.column+y.column)}}_handleResize(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let u=this._rowContainer.children.length;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const r=this._coreBrowserService.mainDocument.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r}_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 r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}}_refreshRowDimensions(r){r.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=f=m([v(1,g.IInstantiationService),v(2,w.ICoreBrowserService),v(3,w.IRenderService)],f)},3614:(H,c)=>{function p(_){return _.replace(/\r?\n/g,"\r")}function m(_,C){return C?"\x1B[200~"+_+"\x1B[201~":_}function v(_,C,w,g){_=m(_=p(_),w.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),C.value=""}function l(_,C,w){const g=w.getBoundingClientRect(),d=_.clientX-g.left-10,f=_.clientY-g.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${d}px`,C.style.top=`${f}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=p,c.bracketTextForPaste=m,c.copyHandler=function(_,C){_.clipboardData&&_.clipboardData.setData("text/plain",C.selectionText),_.preventDefault()},c.handlePasteEvent=function(_,C,w,g){_.stopPropagation(),_.clipboardData&&v(_.clipboardData.getData("text/plain"),C,w,g)},c.paste=v,c.moveTextAreaUnderMouseCursor=l,c.rightClickHandler=function(_,C,w,g,d){l(_,C,w),d&&g.rightClickSelect(_),C.value=g.selectionText,C.select()}},7239:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const m=p(1505);c.ColorContrastCache=class{constructor(){this._color=new m.TwoKeyMap,this._css=new m.TwoKeyMap}setCss(v,l,_){this._css.set(v,l,_)}getCss(v,l){return this._css.get(v,l)}setColor(v,l,_){this._color.set(v,l,_)}getColor(v,l){return this._color.get(v,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(p,m,v,l){p.addEventListener(m,v,l);let _=!1;return{dispose:()=>{_||(_=!0,p.removeEventListener(m,v,l))}}}},3551:function(H,c,p){var m=this&&this.__decorate||function(f,r,u,S){var A,E=arguments.length,R=E<3?r:S===null?S=Object.getOwnPropertyDescriptor(r,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,r,u,S);else for(var y=f.length-1;y>=0;y--)(A=f[y])&&(R=(E<3?A(R):E>3?A(r,u,R):A(r,u))||R);return E>3&&R&&Object.defineProperty(r,u,R),R},v=this&&this.__param||function(f,r){return function(u,S){r(u,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const l=p(3656),_=p(8460),C=p(844),w=p(2585),g=p(4725);let d=c.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(f,r,u,S,A){super(),this._element=f,this._mouseService=r,this._renderService=u,this._bufferService=S,this._linkProviderService=A,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){this._lastMouseEvent=f;const r=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!r)return;this._isMouseOut=!1;const u=f.composedPath();for(let S=0;S<u.length;S++){const A=u[S];if(A.classList.contains("xterm"))break;if(A.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._handleHover(r),this._lastBufferCell=r)}_handleHover(f){if(this._activeLine!==f.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(f,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,f)||(this._clearCurrentLink(),this._askForLink(f,!0))}_askForLink(f,r){var S,A;this._activeProviderReplies&&r||((S=this._activeProviderReplies)==null||S.forEach((E=>{E==null||E.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=f.y);let u=!1;for(const[E,R]of this._linkProviderService.linkProviders.entries())r?(A=this._activeProviderReplies)!=null&&A.get(E)&&(u=this._checkLinkProviderResult(E,f,u)):R.provideLinks(f.y,(y=>{var I,P;if(this._isMouseOut)return;const D=y==null?void 0:y.map(($=>({link:$})));(I=this._activeProviderReplies)==null||I.set(E,D),u=this._checkLinkProviderResult(E,f,u),((P=this._activeProviderReplies)==null?void 0:P.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)}))}_removeIntersectingLinks(f,r){const u=new Set;for(let S=0;S<r.size;S++){const A=r.get(S);if(A)for(let E=0;E<A.length;E++){const R=A[E],y=R.link.range.start.y<f?0:R.link.range.start.x,D=R.link.range.end.y>f?this._bufferService.cols:R.link.range.end.x;for(let I=y;I<=D;I++){if(u.has(I)){A.splice(E--,1);break}u.add(I)}}}}_checkLinkProviderResult(f,r,u){var E;if(!this._activeProviderReplies)return u;const S=this._activeProviderReplies.get(f);let A=!1;for(let R=0;R<f;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(A=!0);if(!A&&S){const R=S.find((y=>this._linkAtPosition(y.link,r)));R&&(u=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!u)for(let R=0;R<this._activeProviderReplies.size;R++){const y=(E=this._activeProviderReplies.get(R))==null?void 0:E.find((D=>this._linkAtPosition(D.link,r)));if(y){u=!0,this._handleNewLink(y);break}}return u}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._currentLink)return;const r=this._positionFromMouseEvent(f,this._element,this._mouseService);r&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,r){this._currentLink&&this._lastMouseEvent&&(!f||!r||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._lastMouseEvent)return;const r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(f.link,r)&&(this._currentLink=f,this._currentLink.state={decorations:{underline:f.link.decorations===void 0||f.link.decorations.underline,pointerCursor:f.link.decorations===void 0||f.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,f.link,this._lastMouseEvent),f.link.decorations={},Object.defineProperties(f.link.decorations,{pointerCursor:{get:()=>{var u,S;return(S=(u=this._currentLink)==null?void 0:u.state)==null?void 0:S.decorations.pointerCursor},set:u=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==u&&(this._currentLink.state.decorations.pointerCursor=u,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",u))}},underline:{get:()=>{var u,S;return(S=(u=this._currentLink)==null?void 0:u.state)==null?void 0:S.decorations.underline},set:u=>{var S,A,E;(S=this._currentLink)!=null&&S.state&&((E=(A=this._currentLink)==null?void 0:A.state)==null?void 0:E.decorations.underline)!==u&&(this._currentLink.state.decorations.underline=u,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,u))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((u=>{if(!this._currentLink)return;const S=u.start===0?0:u.start+1+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.ydisp+1+u.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=A&&(this._clearCurrentLink(S,A),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(f,r,u){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(u,r.text)}_fireUnderlineEvent(f,r){const u=f.range,S=this._bufferService.buffer.ydisp,A=this._createLinkUnderlineEvent(u.start.x-1,u.start.y-S-1,u.end.x,u.end.y-S-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(A)}_linkLeave(f,r,u){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(u,r.text)}_linkAtPosition(f,r){const u=f.range.start.y*this._bufferService.cols+f.range.start.x,S=f.range.end.y*this._bufferService.cols+f.range.end.x,A=r.y*this._bufferService.cols+r.x;return u<=A&&A<=S}_positionFromMouseEvent(f,r,u){const S=u.getCoords(f,r,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,r,u,S,A){return{x1:f,y1:r,x2:u,y2:S,cols:this._bufferService.cols,fg:A}}};c.Linkifier=d=m([v(1,g.IMouseService),v(2,g.IRenderService),v(3,w.IBufferService),v(4,g.ILinkProviderService)],d)},9042:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(H,c,p){var m=this&&this.__decorate||function(g,d,f,r){var u,S=arguments.length,A=S<3?d:r===null?r=Object.getOwnPropertyDescriptor(d,f):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,d,f,r);else for(var E=g.length-1;E>=0;E--)(u=g[E])&&(A=(S<3?u(A):S>3?u(d,f,A):u(d,f))||A);return S>3&&A&&Object.defineProperty(d,f,A),A},v=this&&this.__param||function(g,d){return function(f,r){d(f,r,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const l=p(511),_=p(2585);let C=c.OscLinkProvider=class{constructor(g,d,f){this._bufferService=g,this._optionsService=d,this._oscLinkService=f}provideLinks(g,d){var D;const f=this._bufferService.buffer.lines.get(g-1);if(!f)return void d(void 0);const r=[],u=this._optionsService.rawOptions.linkHandler,S=new l.CellData,A=f.getTrimmedLength();let E=-1,R=-1,y=!1;for(let I=0;I<A;I++)if(R!==-1||f.hasContent(I)){if(f.loadCell(I,S),S.hasExtendedAttrs()&&S.extended.urlId){if(R===-1){R=I,E=S.extended.urlId;continue}y=S.extended.urlId!==E}else R!==-1&&(y=!0);if(y||R!==-1&&I===A-1){const P=(D=this._oscLinkService.getLinkData(E))==null?void 0:D.uri;if(P){const $={start:{x:R+1,y:g},end:{x:I+(y||I!==A-1?0:1),y:g}};let z=!1;if(!(u!=null&&u.allowNonHttpProtocols))try{const Q=new URL(P);["http:","https:"].includes(Q.protocol)||(z=!0)}catch{z=!0}z||r.push({text:P,range:$,activate:(Q,ne)=>u?u.activate(Q,ne,$):w(0,ne),hover:(Q,ne)=>{var F;return(F=u==null?void 0:u.hover)==null?void 0:F.call(u,Q,ne,$)},leave:(Q,ne)=>{var F;return(F=u==null?void 0:u.leave)==null?void 0:F.call(u,Q,ne,$)}})}y=!1,S.hasExtendedAttrs()&&S.extended.urlId?(R=I,E=S.extended.urlId):(R=-1,E=-1)}}d(r)}};function w(g,d){if(confirm(`Do you want to navigate to ${d}?
439
+
440
+ WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=C=m([v(0,_.IBufferService),v(1,_.IOptionsService),v(2,_.IOscLinkService)],C)},6193:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(p,m){this._renderCallback=p,this._coreBrowserService=m,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(p){return this._refreshCallbacks.push(p),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(p,m,v){this._rowCount=v,p=p!==void 0?p:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,p):p,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m,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 p=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(p,m),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const p of this._refreshCallbacks)p(0);this._refreshCallbacks=[]}}},3236:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const m=p(3614),v=p(3656),l=p(3551),_=p(9042),C=p(3730),w=p(1680),g=p(3107),d=p(5744),f=p(2950),r=p(1296),u=p(428),S=p(4269),A=p(5114),E=p(8934),R=p(3230),y=p(9312),D=p(4725),I=p(6731),P=p(8055),$=p(8969),z=p(8460),Q=p(844),ne=p(6114),F=p(8437),W=p(2584),Y=p(7399),j=p(5941),B=p(9074),T=p(2585),O=p(5435),Z=p(4567),ae=p(779);class _e extends $.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(X={}){super(X),this.browser=ne,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new z.EventEmitter),this._onBlur=this.register(new z.EventEmitter),this._onA11yCharEmitter=this.register(new z.EventEmitter),this._onA11yTabEmitter=this.register(new z.EventEmitter),this._onWillOpen=this.register(new z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,ce)=>this.refresh(N,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this.register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this.register((0,z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,Q.toDisposable)((()=>{var N,ce;this._customKeyEventHandler=void 0,(ce=(N=this.element)==null?void 0:N.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(X){if(this._themeService)for(const N of X){let ce,le="";switch(N.index){case 256:ce="foreground",le="10";break;case 257:ce="background",le="11";break;case 258:ce="cursor",le="12";break;default:ce="ansi",le="4;"+N.index}switch(N.type){case 0:const ye=P.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${le};${(0,j.toRgbString)(ye)}${W.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((be=>be.ansi[N.index]=P.channels.toColor(...N.color)));else{const be=ce;this._themeService.modifyColors((je=>je[be]=P.channels.toColor(...N.color)))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(X){X?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(X){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var X;return(X=this.textarea)==null?void 0:X.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const X=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(X);if(!N)return;const ce=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,ye=N.getWidth(ce),be=this._renderService.dimensions.css.cell.width*ye,je=this.buffer.y*this._renderService.dimensions.css.cell.height,Le=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Le+"px",this.textarea.style.top=je+"px",this.textarea.style.width=be+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,m.copyHandler)(N,this._selectionService)})));const X=N=>(0,m.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",X)),this.register((0,v.addDisposableDomListener)(this.element,"paste",X)),ne.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,m.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,m.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ne.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,m.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(X=>this._keyUp(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(X=>this._keyDown(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(X=>this._keyPress(X)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(X=>this._compositionHelper.compositionupdate(X)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(X=>this._inputEvent(X)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(X){var ce;if(!X)throw new Error("Terminal requires a parent element.");if(X.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=X.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),X.appendChild(this.element);const N=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.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,v.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),ne.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(A.CoreBrowserService,this.textarea,X.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(d.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(r.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const X=this,N=this.element;function ce(be){const je=X._mouseService.getMouseReportCoords(be,X.screenElement);if(!je)return!1;let Le,Be;switch(be.overrideType||be.type){case"mousemove":Be=32,be.buttons===void 0?(Le=3,be.button!==void 0&&(Le=be.button<3?be.button:3)):Le=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":Be=0,Le=be.button<3?be.button:3;break;case"mousedown":Be=1,Le=be.button<3?be.button:3;break;case"wheel":if(X._customWheelEventHandler&&X._customWheelEventHandler(be)===!1||X.viewport.getLinesScrolled(be)===0)return!1;Be=be.deltaY<0?0:1,Le=4;break;default:return!1}return!(Be===void 0||Le===void 0||Le>4)&&X.coreMouseService.triggerMouseEvent({col:je.col,row:je.row,x:je.x,y:je.y,button:Le,action:Be,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ye={mouseup:be=>(ce(be),be.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(be)),wheel:be=>(ce(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&ce(be)},mousemove:be=>{be.buttons||ce(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),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&be?le.mousemove||(N.addEventListener("mousemove",ye.mousemove),le.mousemove=ye.mousemove):(N.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&be?le.wheel||(N.addEventListener("wheel",ye.wheel,{passive:!1}),le.wheel=ye.wheel):(N.removeEventListener("wheel",le.wheel),le.wheel=null),2&be?le.mouseup||(le.mouseup=ye.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&be?le.mousedrag||(le.mousedrag=ye.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(N,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return ce(be),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(be)}))),this.register((0,v.addDisposableDomListener)(N,"wheel",(be=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const je=this.viewport.getLinesScrolled(be);if(je===0)return;const Le=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Be="";for(let Ye=0;Ye<Math.abs(je);Ye++)Be+=Le;return this.coreService.triggerDataEvent(Be,!0),this.cancel(be,!0)}return this.viewport.handleWheel(be)?this.cancel(be):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(N,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(N,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(X,N){var ce;(ce=this._renderService)==null||ce.refreshRows(X,N)}updateCursorStyle(X){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(X)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(X,N,ce=0){var le;ce===1?(super.scrollLines(X,N,ce),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(X)}paste(X){(0,m.paste)(X,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(X){this._customKeyEventHandler=X}attachCustomWheelEventHandler(X){this._customWheelEventHandler=X}registerLinkProvider(X){return this._linkProviderService.registerLinkProvider(X)}registerCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(X);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(X){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(X)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(X){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+X)}registerDecoration(X){return this._decorationService.registerDecoration(X)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(X,N,ce){this._selectionService.setSelection(X,N,ce)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var X;(X=this._selectionService)==null||X.clearSelection()}selectAll(){var X;(X=this._selectionService)==null||X.selectAll()}selectLines(X,N){var ce;(ce=this._selectionService)==null||ce.selectLines(X,N)}_keyDown(X){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&X.altKey;if(!N&&!this._compositionHelper.keydown(X))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||X.key!=="Dead"&&X.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,Y.evaluateKeyboardEvent)(X,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(X),ce.type===3||ce.type===2){const le=this.rows-1;return this.scrollLines(ce.type===2?-le:le),this.cancel(X,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,X)||(ce.cancel&&this.cancel(X,!0),!ce.key||!!(X.key&&!X.ctrlKey&&!X.altKey&&!X.metaKey&&X.key.length===1&&X.key.charCodeAt(0)>=65&&X.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==W.C0.ETX&&ce.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||X.altKey||X.ctrlKey?this.cancel(X,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(X,N){const ce=X.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||X.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||X.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?ce:ce&&(!N.keyCode||N.keyCode>47)}_keyUp(X){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1||((function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18})(X)||this.focus(),this.updateCursorStyle(X),this._keyPressHandled=!1)}_keyPress(X){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(X)===!1)return!1;if(this.cancel(X),X.charCode)N=X.charCode;else if(X.which===null||X.which===void 0)N=X.keyCode;else{if(X.which===0||X.charCode===0)return!1;N=X.which}return!(!N||(X.altKey||X.ctrlKey||X.metaKey)&&!this._isThirdLevelShift(this.browser,X)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:X}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(X){if(X.data&&X.inputType==="insertText"&&(!X.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=X.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(X),!0}return!1}resize(X,N){X!==this.cols||N!==this.rows?super.resize(X,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(X,N){var ce,le;(ce=this._charSizeService)==null||ce.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var X;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(X=this.viewport)==null||X.reset(),this.refresh(0,this.rows-1)}}reset(){var N,ce;this.options.rows=this.rows,this.options.cols=this.cols;const X=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=X,this.refresh(0,this.rows-1)}clearTextureAtlas(){var X;(X=this._renderService)==null||X.clearTextureAtlas()}_reportFocus(){var X;(X=this.element)!=null&&X.classList.contains("focus")?this.coreService.triggerDataEvent(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(X){if(this._renderService)switch(X){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${ce};${N}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),ye=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${ye};${le}t`)}}cancel(X,N){if(this.options.cancelEvents||N)return X.preventDefault(),X.stopPropagation(),!1}}c.Terminal=_e},9924:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(p,m=1e3){this._renderCallback=p,this._debounceThresholdMS=m,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(p,m,v){this._rowCount=v,p=p!==void 0?p:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,p):p,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=l-this._lastRefreshMs,C=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const p=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(p,m)}}},1680:function(H,c,p){var m=this&&this.__decorate||function(f,r,u,S){var A,E=arguments.length,R=E<3?r:S===null?S=Object.getOwnPropertyDescriptor(r,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,r,u,S);else for(var y=f.length-1;y>=0;y--)(A=f[y])&&(R=(E<3?A(R):E>3?A(r,u,R):A(r,u))||R);return E>3&&R&&Object.defineProperty(r,u,R),R},v=this&&this.__param||function(f,r){return function(u,S){r(u,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const l=p(3656),_=p(4725),C=p(8460),w=p(844),g=p(2585);let d=c.Viewport=class extends w.Disposable{constructor(f,r,u,S,A,E,R,y){super(),this._viewportElement=f,this._scrollArea=r,this._bufferService=u,this._optionsService=S,this._charSizeService=A,this._renderService=E,this._coreBrowserService=R,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(f){this._viewportElement.style.backgroundColor=f.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(f){if(f)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:r,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(f,r){const u=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&u<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const r=this._getPixelsScrolled(f);return r!==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+r:this._smoothScrollState.target+=r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=r,this._bubbleScroll(f,r))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const r=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let r=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r}getBufferElements(f,r){var y;let u,S="";const A=[],E=r??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let D=f;D<E;D++){const I=R.get(D);if(!I)continue;const P=(y=R.get(D+1))==null?void 0:y.isWrapped;if(S+=I.translateToString(!P),!P||D===R.length-1){const $=document.createElement("div");$.textContent=S,A.push($),S.length>0&&(u=$),S=""}}return{bufferElements:A,cursorElement:u}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let r=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(f,r){const u=this._optionsService.rawOptions.fastScrollModifier;return u==="alt"&&r.altKey||u==="ctrl"&&r.ctrlKey||u==="shift"&&r.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const r=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(f,r))}};c.Viewport=d=m([v(2,g.IBufferService),v(3,g.IOptionsService),v(4,_.ICharSizeService),v(5,_.IRenderService),v(6,_.ICoreBrowserService),v(7,_.IThemeService)],d)},3107:function(H,c,p){var m=this&&this.__decorate||function(g,d,f,r){var u,S=arguments.length,A=S<3?d:r===null?r=Object.getOwnPropertyDescriptor(d,f):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,d,f,r);else for(var E=g.length-1;E>=0;E--)(u=g[E])&&(A=(S<3?u(A):S>3?u(d,f,A):u(d,f))||A);return S>3&&A&&Object.defineProperty(d,f,A),A},v=this&&this.__param||function(g,d){return function(f,r){d(f,r,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const l=p(4725),_=p(844),C=p(2585);let w=c.BufferDecorationRenderer=class extends _.Disposable{constructor(g,d,f,r,u){super(),this._screenElement=g,this._bufferService=d,this._coreBrowserService=f,this._decorationService=r,this._renderService=u,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((S=>this._removeDecoration(S)))),this.register((0,_.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 g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){var r;const d=this._coreBrowserService.mainDocument.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",((r=g==null?void 0:g.options)==null?void 0:r.layer)==="top"),d.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=g.options.x??0;return f&&f>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(g,d),d}_refreshStyle(g){const d=g.marker.line-this._bufferService.buffers.active.ydisp;if(d<0||d>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let f=this._decorationElements.get(g);f||(f=this._createElement(g),g.element=f,this._decorationElements.set(g,f),this._container.appendChild(f),g.onDispose((()=>{this._decorationElements.delete(g),f.remove()}))),f.style.top=d*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(f)}}_refreshXPosition(g,d=g.element){if(!d)return;const f=g.options.x??0;(g.options.anchor||"left")==="right"?d.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":d.style.left=f?f*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){var d;(d=this._decorationElements.get(g))==null||d.remove(),this._decorationElements.delete(g),g.dispose()}};c.BufferDecorationRenderer=w=m([v(1,C.IBufferService),v(2,l.ICoreBrowserService),v(3,C.IDecorationService),v(4,l.IRenderService)],w)},5871:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.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(p){if(p.options.overviewRulerOptions){for(const m of this._zones)if(m.color===p.options.overviewRulerOptions.color&&m.position===p.options.overviewRulerOptions.position){if(this._lineIntersectsZone(m,p.marker.line))return;if(this._lineAdjacentToZone(m,p.marker.line,p.options.overviewRulerOptions.position))return void this._addLineToZone(m,p.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=p.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=p.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=p.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=p.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:p.options.overviewRulerOptions.color,position:p.options.overviewRulerOptions.position,startBufferLine:p.marker.line,endBufferLine:p.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(p){this._linePadding=p}_lineIntersectsZone(p,m){return m>=p.startBufferLine&&m<=p.endBufferLine}_lineAdjacentToZone(p,m,v){return m>=p.startBufferLine-this._linePadding[v||"full"]&&m<=p.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(p,m){p.startBufferLine=Math.min(p.startBufferLine,m),p.endBufferLine=Math.max(p.endBufferLine,m)}}},5744:function(H,c,p){var m=this&&this.__decorate||function(u,S,A,E){var R,y=arguments.length,D=y<3?S:E===null?E=Object.getOwnPropertyDescriptor(S,A):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,S,A,E);else for(var I=u.length-1;I>=0;I--)(R=u[I])&&(D=(y<3?R(D):y>3?R(S,A,D):R(S,A))||D);return y>3&&D&&Object.defineProperty(S,A,D),D},v=this&&this.__param||function(u,S){return function(A,E){S(A,E,u)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const l=p(5871),_=p(4725),C=p(844),w=p(2585),g={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let r=c.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(u,S,A,E,R,y,D){var P;super(),this._viewportElement=u,this._screenElement=S,this._bufferService=A,this._decorationService=E,this._renderService=R,this._optionsService=y,this._coreBrowserService=D,this._colorZoneStore=new l.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(),(P=this._viewportElement.parentElement)==null||P.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var $;($=this._canvas)==null||$.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 u=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=u,d.center=S,d.right=u,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=d.left,f.right=d.left+d.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);const u=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(u,12),6)*this._coreBrowserService.dpr);g.left=S,g.center=S,g.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const u=this._colorZoneStore.zones;for(const S of u)S.position!=="full"&&this._renderColorZone(S);for(const S of u)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(u){this._ctx.fillStyle=u.color,this._ctx.fillRect(f[u.position||"full"],Math.round((this._canvas.height-1)*(u.startBufferLine/this._bufferService.buffers.active.lines.length)-g[u.position||"full"]/2),d[u.position||"full"],Math.round((this._canvas.height-1)*((u.endBufferLine-u.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[u.position||"full"]))}_queueRefresh(u,S){this._shouldUpdateDimensions=u||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=r=m([v(2,w.IBufferService),v(3,w.IDecorationService),v(4,_.IRenderService),v(5,w.IOptionsService),v(6,_.ICoreBrowserService)],r)},2950:function(H,c,p){var m=this&&this.__decorate||function(g,d,f,r){var u,S=arguments.length,A=S<3?d:r===null?r=Object.getOwnPropertyDescriptor(d,f):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,d,f,r);else for(var E=g.length-1;E>=0;E--)(u=g[E])&&(A=(S<3?u(A):S>3?u(d,f,A):u(d,f))||A);return S>3&&A&&Object.defineProperty(d,f,A),A},v=this&&this.__param||function(g,d){return function(f,r){d(f,r,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const l=p(4725),_=p(2585),C=p(2584);let w=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,d,f,r,u,S){this._textarea=g,this._compositionView=d,this._bufferService=f,this._optionsService=r,this._coreService=u,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){const d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,d.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(d.start,d.end):this._textarea.value.substring(d.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}}),0)}else{this._isSendingComposition=!1;const d=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(d,!0)}}_handleAnyTextareaChanges(){const g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const d=this._textarea.value,f=d.replace(g,"");this._dataAlreadySent=f,d.length>g.length?this._coreService.triggerDataEvent(f,!0):d.length<g.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):d.length===g.length&&d!==g&&this._coreService.triggerDataEvent(d,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,u=d*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=u+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=u+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=w=m([v(2,_.IBufferService),v(3,_.IOptionsService),v(4,_.ICoreService),v(5,l.IRenderService)],w)},9806:(H,c)=>{function p(m,v,l){const _=l.getBoundingClientRect(),C=m.getComputedStyle(l),w=parseInt(C.getPropertyValue("padding-left")),g=parseInt(C.getPropertyValue("padding-top"));return[v.clientX-_.left-w,v.clientY-_.top-g]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=p,c.getCoords=function(m,v,l,_,C,w,g,d,f){if(!w)return;const r=p(m,v,l);return r?(r[0]=Math.ceil((r[0]+(f?g/2:0))/g),r[1]=Math.ceil(r[1]/d),r[0]=Math.min(Math.max(r[0],1),_+(f?1:0)),r[1]=Math.min(Math.max(r[1],1),C),r):void 0}},9504:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const m=p(2584);function v(d,f,r,u){const S=d-l(d,r),A=f-l(f,r),E=Math.abs(S-A)-(function(R,y,D){let I=0;const P=R-l(R,D),$=y-l(y,D);for(let z=0;z<Math.abs(P-$);z++){const Q=_(R,y)==="A"?-1:1,ne=D.buffer.lines.get(P+Q*z);ne!=null&&ne.isWrapped&&I++}return I})(d,f,r);return g(E,w(_(d,f),u))}function l(d,f){let r=0,u=f.buffer.lines.get(d),S=u==null?void 0:u.isWrapped;for(;S&&d>=0&&d<f.rows;)r++,u=f.buffer.lines.get(--d),S=u==null?void 0:u.isWrapped;return r}function _(d,f){return d>f?"A":"B"}function C(d,f,r,u,S,A){let E=d,R=f,y="";for(;E!==r||R!==u;)E+=S?1:-1,S&&E>A.cols-1?(y+=A.buffer.translateBufferLineToString(R,!1,d,E),E=0,d=0,R++):!S&&E<0&&(y+=A.buffer.translateBufferLineToString(R,!1,0,d+1),E=A.cols-1,d=E,R--);return y+A.buffer.translateBufferLineToString(R,!1,d,E)}function w(d,f){const r=f?"O":"[";return m.C0.ESC+r+d}function g(d,f){d=Math.floor(d);let r="";for(let u=0;u<d;u++)r+=f;return r}c.moveToCellSequence=function(d,f,r,u){const S=r.buffer.x,A=r.buffer.y;if(!r.buffer.hasScrollback)return(function(y,D,I,P,$,z){return v(D,P,$,z).length===0?"":g(C(y,D,y,D-l(D,$),!1,$).length,w("D",z))})(S,A,0,f,r,u)+v(A,f,r,u)+(function(y,D,I,P,$,z){let Q;Q=v(D,P,$,z).length>0?P-l(P,$):D;const ne=P,F=(function(W,Y,j,B,T,O){let Z;return Z=v(j,B,T,O).length>0?B-l(B,T):Y,W<j&&Z<=B||W>=j&&Z<B?"C":"D"})(y,D,I,P,$,z);return g(C(y,Q,I,ne,F==="C",$).length,w(F,z))})(S,A,d,f,r,u);let E;if(A===f)return E=S>d?"D":"C",g(Math.abs(S-d),w(E,u));E=A>f?"D":"C";const R=Math.abs(A-f);return g((function(y,D){return D.cols-y})(A>f?d:S,r)+(R-1)*r.cols+1+((A>f?S:d)-1),w(E,u))}},1296:function(H,c,p){var m=this&&this.__decorate||function(z,Q,ne,F){var W,Y=arguments.length,j=Y<3?Q:F===null?F=Object.getOwnPropertyDescriptor(Q,ne):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(z,Q,ne,F);else for(var B=z.length-1;B>=0;B--)(W=z[B])&&(j=(Y<3?W(j):Y>3?W(Q,ne,j):W(Q,ne))||j);return Y>3&&j&&Object.defineProperty(Q,ne,j),j},v=this&&this.__param||function(z,Q){return function(ne,F){Q(ne,F,z)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const l=p(3787),_=p(2550),C=p(2223),w=p(6171),g=p(6052),d=p(4725),f=p(8055),r=p(8460),u=p(844),S=p(2585),A="xterm-dom-renderer-owner-",E="xterm-rows",R="xterm-fg-",y="xterm-bg-",D="xterm-focus",I="xterm-selection";let P=1,$=c.DomRenderer=class extends u.Disposable{constructor(z,Q,ne,F,W,Y,j,B,T,O,Z,ae,_e){super(),this._terminal=z,this._document=Q,this._element=ne,this._screenElement=F,this._viewportElement=W,this._helperContainer=Y,this._linkifier2=j,this._charSizeService=T,this._optionsService=O,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=_e,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new r.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ge=>this._injectCss(ge)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ge=>this._handleLinkHover(ge)))),this.register(this._linkifier2.onHideLinkUnderline((ge=>this._handleLinkLeave(ge)))),this.register((0,u.toDisposable)((()=>{this._element.classList.remove(A+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.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 z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*z),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/z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/z),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 ne of this._rowElements)ne.style.width=`${this.dimensions.css.canvas.width}px`,ne.style.height=`${this.dimensions.css.cell.height}px`,ne.style.lineHeight=`${this.dimensions.css.cell.height}px`,ne.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${E} { color: ${z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${E} .xterm-dim { color: ${f.color.multiplyOpacity(z.foreground,.5).css};}`,Q+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const ne=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${ne} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${F} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${W} { 0% { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css}; } 50% { background-color: inherit; color: ${z.cursor.css}; }}`,Q+=`${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ne} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${E}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${z.cursor.css}; color: ${z.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${z.cursor.css} !important; color: ${z.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${z.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${z.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,j]of z.ansi.entries())Q+=`${this._terminalSelector} .${R}${Y} { color: ${j.css}; }${this._terminalSelector} .${R}${Y}.xterm-dim { color: ${f.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${y}${Y} { background-color: ${j.css}; }`;Q+=`${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(z.background).css}; }${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(z.background),.5).css}; }${this._terminalSelector} .${y}${C.INVERTED_DEFAULT_COLOR} { background-color: ${z.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${z}px`,this._rowFactory.defaultSpacing=z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(z,Q){for(let ne=this._rowElements.length;ne<=Q;ne++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(z,Q){this._refreshRowElements(z,Q),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(z,Q,ne){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(z,Q,ne),this.renderRows(0,this._bufferService.rows-1),!z||!Q)return;this._selectionRenderModel.update(this._terminal,z,Q,ne);const F=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||j<0)return;const B=this._document.createDocumentFragment();if(ne){const T=z[0]>Q[0];B.appendChild(this._createSelectionElement(Y,T?Q[0]:z[0],T?z[0]:Q[0],j-Y+1))}else{const T=F===Y?z[0]:0,O=Y===W?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(Y,T,O));const Z=j-Y-1;if(B.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Z)),Y!==j){const ae=W===j?Q[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(j,0,ae))}}this._selectionContainer.appendChild(B)}_createSelectionElement(z,Q,ne,F=1){const W=this._document.createElement("div"),Y=Q*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(ne-Q);return Y+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-Y),W.style.height=F*this.dimensions.css.cell.height+"px",W.style.top=z*this.dimensions.css.cell.height+"px",W.style.left=`${Y}px`,W.style.width=`${j}px`,W}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 z of this._rowElements)z.replaceChildren()}renderRows(z,Q){const ne=this._bufferService.buffer,F=ne.ybase+ne.y,W=Math.min(ne.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=z;T<=Q;T++){const O=T+ne.ydisp,Z=this._rowElements[T],ae=ne.lines.get(O);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,O,O===F,j,B,W,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${this._terminalClass}`}_handleLinkHover(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!0)}_handleLinkLeave(z){this._setCellUnderline(z.x1,z.x2,z.y1,z.y2,z.cols,!1)}_setCellUnderline(z,Q,ne,F,W,Y){ne<0&&(z=0),F<0&&(Q=0);const j=this._bufferService.rows-1;ne=Math.max(Math.min(ne,j),0),F=Math.max(Math.min(F,j),0),W=Math.min(W,this._bufferService.cols);const B=this._bufferService.buffer,T=B.ybase+B.y,O=Math.min(B.x,W-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=ne;ge<=F;++ge){const X=ge+B.ydisp,N=this._rowElements[ge],ce=B.lines.get(X);if(!N||!ce)break;N.replaceChildren(...this._rowFactory.createRow(ce,X,X===T,ae,_e,O,Z,this.dimensions.css.cell.width,this._widthCache,Y?ge===ne?z:0:-1,Y?(ge===F?Q:W)-1:-1))}}};c.DomRenderer=$=m([v(7,S.IInstantiationService),v(8,d.ICharSizeService),v(9,S.IOptionsService),v(10,S.IBufferService),v(11,d.ICoreBrowserService),v(12,d.IThemeService)],$)},3787:function(H,c,p){var m=this&&this.__decorate||function(E,R,y,D){var I,P=arguments.length,$=P<3?R:D===null?D=Object.getOwnPropertyDescriptor(R,y):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(E,R,y,D);else for(var z=E.length-1;z>=0;z--)(I=E[z])&&($=(P<3?I($):P>3?I(R,y,$):I(R,y))||$);return P>3&&$&&Object.defineProperty(R,y,$),$},v=this&&this.__param||function(E,R){return function(y,D){R(y,D,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const l=p(2223),_=p(643),C=p(511),w=p(2585),g=p(8055),d=p(4725),f=p(4269),r=p(6171),u=p(3734);let S=c.DomRendererRowFactory=class{constructor(E,R,y,D,I,P,$){this._document=E,this._characterJoinerService=R,this._optionsService=y,this._coreBrowserService=D,this._coreService=I,this._decorationService=P,this._themeService=$,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,R,y){this._selectionStart=E,this._selectionEnd=R,this._columnSelectMode=y}createRow(E,R,y,D,I,P,$,z,Q,ne,F){const W=[],Y=this._characterJoinerService.getJoinedCharacters(R),j=this._themeService.colors;let B,T=E.getNoBgTrimmedLength();y&&T<P+1&&(T=P+1);let O=0,Z="",ae=0,_e=0,ge=0,X=!1,N=0,ce=!1,le=0;const ye=[],be=ne!==-1&&F!==-1;for(let je=0;je<T;je++){E.loadCell(je,this._workCell);let Le=this._workCell.getWidth();if(Le===0)continue;let Be=!1,Ye=je,Ae=this._workCell;if(Y.length>0&&je===Y[0][0]){Be=!0;const Ge=Y.shift();Ae=new f.JoinedCellData(this._workCell,E.translateToString(!0,Ge[0],Ge[1]),Ge[1]-Ge[0]),Ye=Ge[1]-1,Le=Ae.getWidth()}const jt=this._isCellInSelection(je,R),ft=y&&je===P,Lt=be&&je>=ne&&je<=F;let mt=!1;this._decorationService.forEachDecorationAtCell(je,R,void 0,(Ge=>{mt=!0}));let Ft=Ae.getChars()||_.WHITESPACE_CELL_CHAR;if(Ft===" "&&(Ae.isUnderline()||Ae.isOverline())&&(Ft=" "),le=Le*z-Q.get(Ft,Ae.isBold(),Ae.isItalic()),B){if(O&&(jt&&ce||!jt&&!ce&&Ae.bg===ae)&&(jt&&ce&&j.selectionForeground||Ae.fg===_e)&&Ae.extended.ext===ge&&Lt===X&&le===N&&!ft&&!Be&&!mt){Ae.isInvisible()?Z+=_.WHITESPACE_CELL_CHAR:Z+=Ft,O++;continue}O&&(B.textContent=Z),B=this._document.createElement("span"),O=0,Z=""}else B=this._document.createElement("span");if(ae=Ae.bg,_e=Ae.fg,ge=Ae.extended.ext,X=Lt,N=le,ce=jt,Be&&P>=je&&P<=Ye&&(P=je),!this._coreService.isCursorHidden&&ft&&this._coreService.isCursorInitialized){if(ye.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&ye.push("xterm-cursor-blink"),ye.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":ye.push("xterm-cursor-outline");break;case"block":ye.push("xterm-cursor-block");break;case"bar":ye.push("xterm-cursor-bar");break;case"underline":ye.push("xterm-cursor-underline")}}if(Ae.isBold()&&ye.push("xterm-bold"),Ae.isItalic()&&ye.push("xterm-italic"),Ae.isDim()&&ye.push("xterm-dim"),Z=Ae.isInvisible()?_.WHITESPACE_CELL_CHAR:Ae.getChars()||_.WHITESPACE_CELL_CHAR,Ae.isUnderline()&&(ye.push(`xterm-underline-${Ae.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ae.isUnderlineColorDefault()))if(Ae.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(Ae.getUnderlineColor()).join(",")})`;else{let Ge=Ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ae.isBold()&&Ge<8&&(Ge+=8),B.style.textDecorationColor=j.ansi[Ge].css}Ae.isOverline()&&(ye.push("xterm-overline"),Z===" "&&(Z=" ")),Ae.isStrikethrough()&&ye.push("xterm-strikethrough"),Lt&&(B.style.textDecoration="underline");let Ce=Ae.getFgColor(),Ie=Ae.getFgColorMode(),Ke=Ae.getBgColor(),rt=Ae.getBgColorMode();const Ze=!!Ae.isInverse();if(Ze){const Ge=Ce;Ce=Ke,Ke=Ge;const Tt=Ie;Ie=rt,rt=Tt}let ct,Xt,xt,Vt=!1;switch(this._decorationService.forEachDecorationAtCell(je,R,void 0,(Ge=>{Ge.options.layer!=="top"&&Vt||(Ge.backgroundColorRGB&&(rt=50331648,Ke=Ge.backgroundColorRGB.rgba>>8&16777215,ct=Ge.backgroundColorRGB),Ge.foregroundColorRGB&&(Ie=50331648,Ce=Ge.foregroundColorRGB.rgba>>8&16777215,Xt=Ge.foregroundColorRGB),Vt=Ge.options.layer==="top")})),!Vt&&jt&&(ct=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Ke=ct.rgba>>8&16777215,rt=50331648,Vt=!0,j.selectionForeground&&(Ie=50331648,Ce=j.selectionForeground.rgba>>8&16777215,Xt=j.selectionForeground)),Vt&&ye.push("xterm-decoration-top"),rt){case 16777216:case 33554432:xt=j.ansi[Ke],ye.push(`xterm-bg-${Ke}`);break;case 50331648:xt=g.channels.toColor(Ke>>16,Ke>>8&255,255&Ke),this._addStyle(B,`background-color:#${A((Ke>>>0).toString(16),"0",6)}`);break;default:Ze?(xt=j.foreground,ye.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):xt=j.background}switch(ct||Ae.isDim()&&(ct=g.color.multiplyOpacity(xt,.5)),Ie){case 16777216:case 33554432:Ae.isBold()&&Ce<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ce+=8),this._applyMinimumContrast(B,xt,j.ansi[Ce],Ae,ct,void 0)||ye.push(`xterm-fg-${Ce}`);break;case 50331648:const Ge=g.channels.toColor(Ce>>16&255,Ce>>8&255,255&Ce);this._applyMinimumContrast(B,xt,Ge,Ae,ct,Xt)||this._addStyle(B,`color:#${A(Ce.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,xt,j.foreground,Ae,ct,Xt)||Ze&&ye.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}ye.length&&(B.className=ye.join(" "),ye.length=0),ft||Be||mt?B.textContent=Z:O++,le!==this.defaultSpacing&&(B.style.letterSpacing=`${le}px`),W.push(B),je=Ye}return B&&O&&(B.textContent=Z),W}_applyMinimumContrast(E,R,y,D,I,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,r.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const $=this._getContrastCache(D);let z;if(I||P||(z=$.getColor(R.rgba,y.rgba)),z===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);z=g.color.ensureContrastRatio(I||R,P||y,Q),$.setColor((I||R).rgba,(P||y).rgba,z??null)}return!!z&&(this._addStyle(E,`color:${z.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,R){E.setAttribute("style",`${E.getAttribute("style")||""}${R};`)}_isCellInSelection(E,R){const y=this._selectionStart,D=this._selectionEnd;return!(!y||!D)&&(this._columnSelectMode?y[0]<=D[0]?E>=y[0]&&R>=y[1]&&E<D[0]&&R<=D[1]:E<y[0]&&R>=y[1]&&E>=D[0]&&R<=D[1]:R>y[1]&&R<D[1]||y[1]===D[1]&&R===y[1]&&E>=y[0]&&E<D[0]||y[1]<D[1]&&R===D[1]&&E<D[0]||y[1]<D[1]&&R===y[1]&&E>=y[0])}};function A(E,R,y){for(;E.length<y;)E=R+E;return E}c.DomRendererRowFactory=S=m([v(1,d.ICharacterJoinerService),v(2,w.IOptionsService),v(3,d.ICoreBrowserService),v(4,w.ICoreService),v(5,w.IDecorationService),v(6,d.IThemeService)],S)},2550:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(p,m){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=p.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 v=p.createElement("span");v.classList.add("xterm-char-measure-element");const l=p.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const _=p.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const C=p.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[v,l,_,C],this._container.appendChild(v),this._container.appendChild(l),this._container.appendChild(_),this._container.appendChild(C),m.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(p,m,v,l){p===this._font&&m===this._fontSize&&v===this._weight&&l===this._weightBold||(this._font=p,this._fontSize=m,this._weight=v,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(p,m,v){let l=0;if(!m&&!v&&p.length===1&&(l=p.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const w=this._measure(p,0);return w>0&&(this._flat[l]=w),w}let _=p;m&&(_+="B"),v&&(_+="I");let C=this._holey.get(_);if(C===void 0){let w=0;m&&(w|=1),v&&(w|=2),C=this._measure(p,w),C>0&&this._holey.set(_,C)}return C}_measure(p,m){const v=this._measureElements[m];return v.textContent=p.repeat(32),v.offsetWidth/32}}},2223:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const m=p(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},6171:(H,c)=>{function p(v){return 57508<=v&&v<=57558}function m(v){return v>=128512&&v<=128591||v>=127744&&v<=128511||v>=128640&&v<=128767||v>=9728&&v<=9983||v>=9984&&v<=10175||v>=65024&&v<=65039||v>=129280&&v<=129535||v>=127462&&v<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v},c.isPowerlineGlyph=p,c.isRestrictedPowerlineGlyph=function(v){return 57520<=v&&v<=57527},c.isEmoji=m,c.allowRescaling=function(v,l,_,C){return l===1&&_>Math.ceil(1.5*C)&&v!==void 0&&v>255&&!m(v)&&!p(v)&&!(function(w){return 57344<=w&&w<=63743})(v)},c.treatGlyphAsBackgroundColor=function(v){return p(v)||(function(l){return 9472<=l&&l<=9631})(v)},c.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}}}},c.computeNextVariantOffset=function(v,l,_=0){return(v-(2*Math.round(l)-_))%(2*Math.round(l))}},6052:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class p{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(v,l,_,C=!1){if(this.selectionStart=l,this.selectionEnd=_,!l||!_||l[0]===_[0]&&l[1]===_[1])return void this.clear();const w=v.buffers.active.ydisp,g=l[1]-w,d=_[1]-w,f=Math.max(g,0),r=Math.min(d,v.rows-1);f>=v.rows||r<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=g,this.viewportEndRow=d,this.viewportCappedStartRow=f,this.viewportCappedEndRow=r,this.startCol=l[0],this.endCol=_[0])}isCellSelected(v,l,_){return!!this.hasSelection&&(_-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&_>=this.viewportCappedStartRow&&l<this.endCol&&_<=this.viewportCappedEndRow:l<this.startCol&&_>=this.viewportCappedStartRow&&l>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&l>=this.startCol)}}c.createSelectionRenderModel=function(){return new p}},456:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(p){this._bufferService=p,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 p=this.selectionStart[0]+this.selectionStartLength;return p>this._bufferService.cols?p%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(p/this._bufferService.cols)-1]:[p%this._bufferService.cols,this.selectionStart[1]+Math.floor(p/this._bufferService.cols)]:[p,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const p=this.selectionStart[0]+this.selectionStartLength;return p>this._bufferService.cols?[p%this._bufferService.cols,this.selectionStart[1]+Math.floor(p/this._bufferService.cols)]:[Math.max(p,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const p=this.selectionStart,m=this.selectionEnd;return!(!p||!m)&&(p[1]>m[1]||p[1]===m[1]&&p[0]>m[0])}handleTrim(p){return this.selectionStart&&(this.selectionStart[1]-=p),this.selectionEnd&&(this.selectionEnd[1]-=p),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(H,c,p){var m=this&&this.__decorate||function(r,u,S,A){var E,R=arguments.length,y=R<3?u:A===null?A=Object.getOwnPropertyDescriptor(u,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(r,u,S,A);else for(var D=r.length-1;D>=0;D--)(E=r[D])&&(y=(R<3?E(y):R>3?E(u,S,y):E(u,S))||y);return R>3&&y&&Object.defineProperty(u,S,y),y},v=this&&this.__param||function(r,u){return function(S,A){u(S,A,r)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const l=p(2585),_=p(8460),C=p(844);let w=c.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(r,u,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new f(this._optionsService))}catch{this._measureStrategy=this.register(new d(r,u,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const r=this._measureStrategy.measure();r.width===this.width&&r.height===this.height||(this.width=r.width,this.height=r.height,this._onCharSizeChange.fire())}};c.CharSizeService=w=m([v(2,l.IOptionsService)],w);class g extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(u,S){u!==void 0&&u>0&&S!==void 0&&S>0&&(this._result.width=u,this._result.height=S)}}class d extends g{constructor(u,S,A){super(),this._document=u,this._parentElement=S,this._optionsService=A,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 f extends g{constructor(u){super(),this._optionsService=u,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const u=this._ctx.measureText("W");return this._validateAndSet(u.width,u.fontBoundingBoxAscent+u.fontBoundingBoxDescent),this._result}}},4269:function(H,c,p){var m=this&&this.__decorate||function(f,r,u,S){var A,E=arguments.length,R=E<3?r:S===null?S=Object.getOwnPropertyDescriptor(r,u):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,r,u,S);else for(var y=f.length-1;y>=0;y--)(A=f[y])&&(R=(E<3?A(R):E>3?A(r,u,R):A(r,u))||R);return E>3&&R&&Object.defineProperty(r,u,R),R},v=this&&this.__param||function(f,r){return function(u,S){r(u,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const l=p(3734),_=p(643),C=p(511),w=p(2585);class g extends l.AttributeData{constructor(r,u,S){super(),this.content=0,this.combinedData="",this.fg=r.fg,this.bg=r.bg,this.combinedData=u,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(r){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=g;let d=c.CharacterJoinerService=class Cp{constructor(r){this._bufferService=r,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(r){const u={id:this._nextCharacterJoinerId++,handler:r};return this._characterJoiners.push(u),u.id}deregister(r){for(let u=0;u<this._characterJoiners.length;u++)if(this._characterJoiners[u].id===r)return this._characterJoiners.splice(u,1),!0;return!1}getJoinedCharacters(r){if(this._characterJoiners.length===0)return[];const u=this._bufferService.buffer.lines.get(r);if(!u||u.length===0)return[];const S=[],A=u.translateToString(!0);let E=0,R=0,y=0,D=u.getFg(0),I=u.getBg(0);for(let P=0;P<u.getTrimmedLength();P++)if(u.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==D||this._workCell.bg!==I){if(P-E>1){const $=this._getJoinedRanges(A,y,R,u,E);for(let z=0;z<$.length;z++)S.push($[z])}E=P,y=R,D=this._workCell.fg,I=this._workCell.bg}R+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-E>1){const P=this._getJoinedRanges(A,y,R,u,E);for(let $=0;$<P.length;$++)S.push(P[$])}return S}_getJoinedRanges(r,u,S,A,E){const R=r.substring(u,S);let y=[];try{y=this._characterJoiners[0].handler(R)}catch(D){console.error(D)}for(let D=1;D<this._characterJoiners.length;D++)try{const I=this._characterJoiners[D].handler(R);for(let P=0;P<I.length;P++)Cp._mergeRanges(y,I[P])}catch(I){console.error(I)}return this._stringRangesToCellRanges(y,A,E),y}_stringRangesToCellRanges(r,u,S){let A=0,E=!1,R=0,y=r[A];if(y){for(let D=S;D<this._bufferService.cols;D++){const I=u.getWidth(D),P=u.getString(D).length||_.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!E&&y[0]<=R&&(y[0]=D,E=!0),y[1]<=R){if(y[1]=D,y=r[++A],!y)break;y[0]<=R?(y[0]=D,E=!0):E=!1}R+=P}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(r,u){let S=!1;for(let A=0;A<r.length;A++){const E=r[A];if(S){if(u[1]<=E[0])return r[A-1][1]=u[1],r;if(u[1]<=E[1])return r[A-1][1]=Math.max(u[1],E[1]),r.splice(A,1),r;r.splice(A,1),A--}else{if(u[1]<=E[0])return r.splice(A,0,u),r;if(u[1]<=E[1])return E[0]=Math.min(u[0],E[0]),r;u[0]<E[1]&&(E[0]=Math.min(u[0],E[0]),S=!0)}}return S?r[r.length-1][1]=u[1]:r.push(u),r}};c.CharacterJoinerService=d=m([v(0,w.IBufferService)],d)},5114:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const m=p(844),v=p(8460),l=p(3656);class _ extends m.Disposable{constructor(g,d,f){super(),this._textarea=g,this._window=d,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((r=>this._screenDprMonitor.setWindow(r)))),this.register((0,v.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(g){this._window!==g&&(this._window=g,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}}c.CoreBrowserService=_;class C extends m.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new m.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,m.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)==null||g.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const m=p(844);class v extends m.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,m.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const C=this.linkProviders.indexOf(_);C!==-1&&this.linkProviders.splice(C,1)}}}}c.LinkProviderService=v},8934:function(H,c,p){var m=this&&this.__decorate||function(w,g,d,f){var r,u=arguments.length,S=u<3?g:f===null?f=Object.getOwnPropertyDescriptor(g,d):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,g,d,f);else for(var A=w.length-1;A>=0;A--)(r=w[A])&&(S=(u<3?r(S):u>3?r(g,d,S):r(g,d))||S);return u>3&&S&&Object.defineProperty(g,d,S),S},v=this&&this.__param||function(w,g){return function(d,f){g(d,f,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const l=p(4725),_=p(9806);let C=c.MouseService=class{constructor(w,g){this._renderService=w,this._charSizeService=g}getCoords(w,g,d,f,r){return(0,_.getCoords)(window,w,g,d,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(w,g){const d=(0,_.getCoordsRelativeToElement)(window,w,g);if(this._charSizeService.hasValidSize)return d[0]=Math.min(Math.max(d[0],0),this._renderService.dimensions.css.canvas.width-1),d[1]=Math.min(Math.max(d[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(d[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(d[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(d[0]),y:Math.floor(d[1])}}};c.MouseService=C=m([v(0,l.IRenderService),v(1,l.ICharSizeService)],C)},3230:function(H,c,p){var m=this&&this.__decorate||function(r,u,S,A){var E,R=arguments.length,y=R<3?u:A===null?A=Object.getOwnPropertyDescriptor(u,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(r,u,S,A);else for(var D=r.length-1;D>=0;D--)(E=r[D])&&(y=(R<3?E(y):R>3?E(u,S,y):E(u,S))||y);return R>3&&y&&Object.defineProperty(u,S,y),y},v=this&&this.__param||function(r,u){return function(S,A){u(S,A,r)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const l=p(6193),_=p(4725),C=p(8460),w=p(844),g=p(7226),d=p(2585);let f=c.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(r,u,S,A,E,R,y,D){super(),this._rowCount=r,this._charSizeService=A,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((I,P)=>this._renderRows(I,P)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,u),this.register(y.onWindowChange((I=>this._registerIntersectionObserver(I,u))))}_registerIntersectionObserver(r,u){if("IntersectionObserver"in r){const S=new r.IntersectionObserver((A=>this._handleIntersectionChange(A[A.length-1])),{threshold:0});S.observe(u),this._observerDisposable.value=(0,w.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(r){this._isPaused=r.isIntersecting===void 0?r.intersectionRatio===0:!r.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(r,u,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(r,u,this._rowCount))}_renderRows(r,u){this._renderer.value&&(r=Math.min(r,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(r,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:r,end:u}),this._onRender.fire({start:r,end:u}),this._isNextRenderRedrawOnly=!0)}resize(r,u){this._rowCount=u,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(r){this._renderer.value=r,this._renderer.value&&(this._renderer.value.onRequestRedraw((u=>this.refreshRows(u.start,u.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(r){return this._renderDebouncer.addRefreshCallback(r)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var r,u;this._renderer.value&&((u=(r=this._renderer.value).clearTextureAtlas)==null||u.call(r),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(r,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(r,u)})):this._renderer.value.handleResize(r,u),this._fullRefresh())}handleCharSizeChanged(){var r;(r=this._renderer.value)==null||r.handleCharSizeChanged()}handleBlur(){var r;(r=this._renderer.value)==null||r.handleBlur()}handleFocus(){var r;(r=this._renderer.value)==null||r.handleFocus()}handleSelectionChanged(r,u,S){var A;this._selectionState.start=r,this._selectionState.end=u,this._selectionState.columnSelectMode=S,(A=this._renderer.value)==null||A.handleSelectionChanged(r,u,S)}handleCursorMove(){var r;(r=this._renderer.value)==null||r.handleCursorMove()}clear(){var r;(r=this._renderer.value)==null||r.clear()}};c.RenderService=f=m([v(2,d.IOptionsService),v(3,_.ICharSizeService),v(4,d.IDecorationService),v(5,d.IBufferService),v(6,_.ICoreBrowserService),v(7,_.IThemeService)],f)},9312:function(H,c,p){var m=this&&this.__decorate||function(y,D,I,P){var $,z=arguments.length,Q=z<3?D:P===null?P=Object.getOwnPropertyDescriptor(D,I):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(y,D,I,P);else for(var ne=y.length-1;ne>=0;ne--)($=y[ne])&&(Q=(z<3?$(Q):z>3?$(D,I,Q):$(D,I))||Q);return z>3&&Q&&Object.defineProperty(D,I,Q),Q},v=this&&this.__param||function(y,D){return function(I,P){D(I,P,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const l=p(9806),_=p(9504),C=p(456),w=p(4725),g=p(8460),d=p(844),f=p(6114),r=p(4841),u=p(511),S=p(2585),A=" ",E=new RegExp(A,"g");let R=c.SelectionService=class extends d.Disposable{constructor(y,D,I,P,$,z,Q,ne,F){super(),this._element=y,this._screenElement=D,this._linkifier=I,this._bufferService=P,this._coreService=$,this._mouseService=z,this._optionsService=Q,this._renderService=ne,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,d.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const y=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!y||!D||y[0]===D[0]&&y[1]===D[1])}get selectionText(){const y=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!y||!D)return"";const I=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(y[0]===D[0])return"";const $=y[0]<D[0]?y[0]:D[0],z=y[0]<D[0]?D[0]:y[0];for(let Q=y[1];Q<=D[1];Q++){const ne=I.translateBufferLineToString(Q,!0,$,z);P.push(ne)}}else{const $=y[1]===D[1]?D[0]:void 0;P.push(I.translateBufferLineToString(y[1],!0,y[0],$));for(let z=y[1]+1;z<=D[1]-1;z++){const Q=I.lines.get(z),ne=I.translateBufferLineToString(z,!0);Q!=null&&Q.isWrapped?P[P.length-1]+=ne:P.push(ne)}if(y[1]!==D[1]){const z=I.lines.get(D[1]),Q=I.translateBufferLineToString(D[1],!0,0,D[0]);z&&z.isWrapped?P[P.length-1]+=Q:P.push(Q)}}return P.map(($=>$.replace(E," "))).join(f.isWindows?`\r
441
+ `:`
442
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),f.isLinux&&y&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(y){const D=this._getMouseBufferCoords(y),I=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(I&&P&&D)&&this._areCoordsInSelection(D,I,P)}isCellInSelection(y,D){const I=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!I||!P)&&this._areCoordsInSelection([y,D],I,P)}_areCoordsInSelection(y,D,I){return y[1]>D[1]&&y[1]<I[1]||D[1]===I[1]&&y[1]===D[1]&&y[0]>=D[0]&&y[0]<I[0]||D[1]<I[1]&&y[1]===I[1]&&y[0]<I[0]||D[1]<I[1]&&y[1]===D[1]&&y[0]>=D[0]}_selectWordAtCursor(y,D){var $,z;const I=(z=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:z.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,r.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(y);return!!P&&(this._selectWordAt(P,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,D){this._model.clearSelection(),y=Math.max(y,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const D=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(y){let D=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=I?0:(D>I&&(D-=I),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(y){return f.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const D=this._getMouseBufferCoords(y);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(y){return y.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const P=I.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}D&&D[0]===this._model.selectionEnd[0]&&D[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const D=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const P=(0,_.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,I=!(!y||!D||y[0]===D[0]&&y[1]===D[1]);I?y&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,D,I)):this._oldHasSelection&&this._fireOnSelectionChange(y,D,I)}_fireOnSelectionChange(y,D,I){this._oldSelectionStart=y,this._oldSelectionEnd=D,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(y,D){let I=D;for(let P=0;D>=P;P++){const $=y.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:$>1&&D!==P&&(I+=$-1)}return I}setSelection(y,D,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,D],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,D,I=!0,P=!0){if(y[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,z=$.lines.get(y[1]);if(!z)return;const Q=$.translateBufferLineToString(y[1],!1);let ne=this._convertViewportColToCharacterIndex(z,y[0]),F=ne;const W=y[0]-ne;let Y=0,j=0,B=0,T=0;if(Q.charAt(ne)===" "){for(;ne>0&&Q.charAt(ne-1)===" ";)ne--;for(;F<Q.length&&Q.charAt(F+1)===" ";)F++}else{let ae=y[0],_e=y[0];z.getWidth(ae)===0&&(Y++,ae--),z.getWidth(_e)===2&&(j++,_e++);const ge=z.getString(_e).length;for(ge>1&&(T+=ge-1,F+=ge-1);ae>0&&ne>0&&!this._isCharWordSeparator(z.loadCell(ae-1,this._workCell));){z.loadCell(ae-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ae--):X>1&&(B+=X-1,ne-=X-1),ne--,ae--}for(;_e<z.length&&F+1<Q.length&&!this._isCharWordSeparator(z.loadCell(_e+1,this._workCell));){z.loadCell(_e+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,_e++):X>1&&(T+=X-1,F+=X-1),F++,_e++}}F++;let O=ne+W-Y+B,Z=Math.min(this._bufferService.cols,F-ne+Y+j-B-T);if(D||Q.slice(ne,F).trim()!==""){if(I&&O===0&&z.getCodePoint(0)!==32){const ae=$.lines.get(y[1]-1);if(ae&&z.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const _e=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(_e){const ge=this._bufferService.cols-_e.start;O-=ge,Z+=ge}}}if(P&&O+Z===this._bufferService.cols&&z.getCodePoint(this._bufferService.cols-1)!==32){const ae=$.lines.get(y[1]+1);if(ae!=null&&ae.isWrapped&&ae.getCodePoint(0)!==32){const _e=this._getWordAt([0,y[1]+1],!1,!1,!0);_e&&(Z+=_e.length)}}return{start:O,length:Z}}}_selectWordAt(y,D){const I=this._getWordAt(y,D);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[I.start,y[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(y){const D=this._getWordAt(y,!0);if(D){let I=y[1];for(;D.start<0;)D.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,I]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const D=this._bufferService.buffer.getWrappedRangeForLine(y),I={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,r.getRangeLength)(I,this._bufferService.cols)}};c.SelectionService=R=m([v(3,S.IBufferService),v(4,S.ICoreService),v(5,w.IMouseService),v(6,S.IOptionsService),v(7,w.IRenderService),v(8,w.ICoreBrowserService)],R)},4725:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const m=p(8343);c.ICharSizeService=(0,m.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),c.IMouseService=(0,m.createDecorator)("MouseService"),c.IRenderService=(0,m.createDecorator)("RenderService"),c.ISelectionService=(0,m.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,m.createDecorator)("ThemeService"),c.ILinkProviderService=(0,m.createDecorator)("LinkProviderService")},6731:function(H,c,p){var m=this&&this.__decorate||function(R,y,D,I){var P,$=arguments.length,z=$<3?y:I===null?I=Object.getOwnPropertyDescriptor(y,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(R,y,D,I);else for(var Q=R.length-1;Q>=0;Q--)(P=R[Q])&&(z=($<3?P(z):$>3?P(y,D,z):P(y,D))||z);return $>3&&z&&Object.defineProperty(y,D,z),z},v=this&&this.__param||function(R,y){return function(D,I){y(D,I,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const l=p(7239),_=p(8055),C=p(8460),w=p(844),g=p(2585),d=_.css.toColor("#ffffff"),f=_.css.toColor("#000000"),r=_.css.toColor("#ffffff"),u=_.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let D=0;D<216;D++){const I=y[D/36%6|0],P=y[D/6%6|0],$=y[D%6];R.push({css:_.channels.toCss(I,P,$),rgba:_.channels.toRgba(I,P,$)})}for(let D=0;D<24;D++){const I=8+10*D;R.push({css:_.channels.toCss(I,I,I),rgba:_.channels.toRgba(I,I,I)})}return R})());let A=c.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:d,background:f,cursor:r,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:_.color.blend(f,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:_.color.blend(f,S),ansi:c.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(R={}){const y=this._colors;if(y.foreground=E(R.foreground,d),y.background=E(R.background,f),y.cursor=E(R.cursor,r),y.cursorAccent=E(R.cursorAccent,u),y.selectionBackgroundTransparent=E(R.selectionBackground,S),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=E(R.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=R.selectionForeground?E(R.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=c.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=E(R.black,c.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=E(R.red,c.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=E(R.green,c.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=E(R.yellow,c.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=E(R.blue,c.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=E(R.magenta,c.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=E(R.cyan,c.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=E(R.white,c.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=E(R.brightBlack,c.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=E(R.brightRed,c.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=E(R.brightGreen,c.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=E(R.brightYellow,c.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=E(R.brightBlue,c.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=E(R.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=E(R.brightCyan,c.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=E(R.brightWhite,c.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const D=Math.min(y.ansi.length-16,R.extendedAnsi.length);for(let I=0;I<D;I++)y.ansi[I+16]=E(R.extendedAnsi[I],c.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(R){R(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function E(R,y){if(R!==void 0)try{return _.css.toColor(R)}catch{}return y}c.ThemeService=A=m([v(0,g.IOptionsService)],A)},6349:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const m=p(8460),v=p(844);class l extends v.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new m.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new m.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new m.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(C){if(this._maxLength===C)return;const w=new Array(C);for(let g=0;g<Math.min(C,this.length);g++)w[g]=this._array[this._getCyclicIndex(g)];this._array=w,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let w=this._length;w<C;w++)this._array[w]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,w){this._array[this._getCyclicIndex(C)]=w}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,w,...g){if(w){for(let d=C;d<this._length-w;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+w)];this._length-=w,this.onDeleteEmitter.fire({index:C,amount:w})}for(let d=this._length-1;d>=C;d--)this._array[this._getCyclicIndex(d+g.length)]=this._array[this._getCyclicIndex(d)];for(let d=0;d<g.length;d++)this._array[this._getCyclicIndex(C+d)]=g[d];if(g.length&&this.onInsertEmitter.fire({index:C,amount:g.length}),this._length+g.length>this._maxLength){const d=this._length+g.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=g.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,w,g){if(!(w<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let f=w-1;f>=0;f--)this.set(C+f+g,this.get(C+f));const d=C+w+g-this._length;if(d>0)for(this._length+=d;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let d=0;d<w;d++)this.set(C+d+g,this.get(C+d))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}c.CircularList=l},1439:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function p(m,v=5){if(typeof m!="object")return m;const l=Array.isArray(m)?[]:{};for(const _ in m)l[_]=v<=1?m[_]:m[_]&&p(m[_],v-1);return l}},8055:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let p=0,m=0,v=0,l=0;var _,C,w,g,d;function f(u){const S=u.toString(16);return S.length<2?"0"+S:S}function r(u,S){return u<S?(S+.05)/(u+.05):(u+.05)/(S+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(u){u.toCss=function(S,A,E,R){return R!==void 0?`#${f(S)}${f(A)}${f(E)}${f(R)}`:`#${f(S)}${f(A)}${f(E)}`},u.toRgba=function(S,A,E,R=255){return(S<<24|A<<16|E<<8|R)>>>0},u.toColor=function(S,A,E,R){return{css:u.toCss(S,A,E,R),rgba:u.toRgba(S,A,E,R)}}})(_||(c.channels=_={})),(function(u){function S(A,E){return l=Math.round(255*E),[p,m,v]=d.toChannels(A.rgba),{css:_.toCss(p,m,v,l),rgba:_.toRgba(p,m,v,l)}}u.blend=function(A,E){if(l=(255&E.rgba)/255,l===1)return{css:E.css,rgba:E.rgba};const R=E.rgba>>24&255,y=E.rgba>>16&255,D=E.rgba>>8&255,I=A.rgba>>24&255,P=A.rgba>>16&255,$=A.rgba>>8&255;return p=I+Math.round((R-I)*l),m=P+Math.round((y-P)*l),v=$+Math.round((D-$)*l),{css:_.toCss(p,m,v),rgba:_.toRgba(p,m,v)}},u.isOpaque=function(A){return(255&A.rgba)==255},u.ensureContrastRatio=function(A,E,R){const y=d.ensureContrastRatio(A.rgba,E.rgba,R);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(A){const E=(255|A.rgba)>>>0;return[p,m,v]=d.toChannels(E),{css:_.toCss(p,m,v),rgba:E}},u.opacity=S,u.multiplyOpacity=function(A,E){return l=255&A.rgba,S(A,l*E/255)},u.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(C||(c.color=C={})),(function(u){let S,A;try{const E=document.createElement("canvas");E.width=1,E.height=1;const R=E.getContext("2d",{willReadFrequently:!0});R&&(S=R,S.globalCompositeOperation="copy",A=S.createLinearGradient(0,0,1,1))}catch{}u.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return p=parseInt(E.slice(1,2).repeat(2),16),m=parseInt(E.slice(2,3).repeat(2),16),v=parseInt(E.slice(3,4).repeat(2),16),_.toColor(p,m,v);case 5:return p=parseInt(E.slice(1,2).repeat(2),16),m=parseInt(E.slice(2,3).repeat(2),16),v=parseInt(E.slice(3,4).repeat(2),16),l=parseInt(E.slice(4,5).repeat(2),16),_.toColor(p,m,v,l);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const R=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return p=parseInt(R[1]),m=parseInt(R[2]),v=parseInt(R[3]),l=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),_.toColor(p,m,v,l);if(!S||!A)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=A,S.fillStyle=E,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[p,m,v,l]=S.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(p,m,v,l),css:E}}})(w||(c.css=w={})),(function(u){function S(A,E,R){const y=A/255,D=E/255,I=R/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}u.relativeLuminance=function(A){return S(A>>16&255,A>>8&255,255&A)},u.relativeLuminance2=S})(g||(c.rgb=g={})),(function(u){function S(E,R,y){const D=E>>24&255,I=E>>16&255,P=E>>8&255;let $=R>>24&255,z=R>>16&255,Q=R>>8&255,ne=r(g.relativeLuminance2($,z,Q),g.relativeLuminance2(D,I,P));for(;ne<y&&($>0||z>0||Q>0);)$-=Math.max(0,Math.ceil(.1*$)),z-=Math.max(0,Math.ceil(.1*z)),Q-=Math.max(0,Math.ceil(.1*Q)),ne=r(g.relativeLuminance2($,z,Q),g.relativeLuminance2(D,I,P));return($<<24|z<<16|Q<<8|255)>>>0}function A(E,R,y){const D=E>>24&255,I=E>>16&255,P=E>>8&255;let $=R>>24&255,z=R>>16&255,Q=R>>8&255,ne=r(g.relativeLuminance2($,z,Q),g.relativeLuminance2(D,I,P));for(;ne<y&&($<255||z<255||Q<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),ne=r(g.relativeLuminance2($,z,Q),g.relativeLuminance2(D,I,P));return($<<24|z<<16|Q<<8|255)>>>0}u.blend=function(E,R){if(l=(255&R)/255,l===1)return R;const y=R>>24&255,D=R>>16&255,I=R>>8&255,P=E>>24&255,$=E>>16&255,z=E>>8&255;return p=P+Math.round((y-P)*l),m=$+Math.round((D-$)*l),v=z+Math.round((I-z)*l),_.toRgba(p,m,v)},u.ensureContrastRatio=function(E,R,y){const D=g.relativeLuminance(E>>8),I=g.relativeLuminance(R>>8);if(r(D,I)<y){if(I<D){const z=S(E,R,y),Q=r(D,g.relativeLuminance(z>>8));if(Q<y){const ne=A(E,R,y);return Q>r(D,g.relativeLuminance(ne>>8))?z:ne}return z}const P=A(E,R,y),$=r(D,g.relativeLuminance(P>>8));if($<y){const z=S(E,R,y);return $>r(D,g.relativeLuminance(z>>8))?P:z}return P}},u.reduceLuminance=S,u.increaseLuminance=A,u.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(d||(c.rgba=d={})),c.toPaddedHex=f,c.contrastRatio=r},8969:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const m=p(844),v=p(2585),l=p(4348),_=p(7866),C=p(744),w=p(7302),g=p(6975),d=p(8460),f=p(1753),r=p(1480),u=p(7994),S=p(9282),A=p(5435),E=p(5981),R=p(2660);let y=!1;class D extends m.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new d.EventEmitter),this._onScroll.event((P=>{var $;($=this._onScrollApi)==null||$.fire(P.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(P){for(const $ in P)this.optionsService.options[$]=P[$]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new m.MutableDisposable),this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new d.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new w.OptionsService(P)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(r.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,d.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,d.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,d.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,d.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(($=>{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(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new E.WriteBuffer((($,z)=>this._inputHandler.parse($,z)))),this.register((0,d.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,$){this._writeBuffer.write(P,$)}writeSync(P,$){this._logService.logLevel<=v.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(P,$)}input(P,$=!0){this.coreService.triggerDataEvent(P,$)}resize(P,$){isNaN(P)||isNaN($)||(P=Math.max(P,C.MINIMUM_COLS),$=Math.max($,C.MINIMUM_ROWS),this._bufferService.resize(P,$))}scroll(P,$=!1){this._bufferService.scroll(P,$)}scrollLines(P,$,z){this._bufferService.scrollLines(P,$,z)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const $=P-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(P,$){return this._inputHandler.registerEscHandler(P,$)}registerDcsHandler(P,$){return this._inputHandler.registerDcsHandler(P,$)}registerCsiHandler(P,$){return this._inputHandler.registerCsiHandler(P,$)}registerOscHandler(P,$){return this._inputHandler.registerOscHandler(P,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?P=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,m.toDisposable)((()=>{for(const $ of P)$.dispose()}))}}}c.CoreTerminal=D},8460:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=p=>(this._listeners.push(p),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===p)return void this._listeners.splice(m,1)}}})),this._event}fire(p,m){const v=[];for(let l=0;l<this._listeners.length;l++)v.push(this._listeners[l]);for(let l=0;l<v.length;l++)v[l].call(void 0,p,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(p,m){return p((v=>m.fire(v)))},c.runAndSubscribe=function(p,m){return m(void 0),p((v=>m(v)))}},5435:function(H,c,p){var m=this&&this.__decorate||function(Y,j,B,T){var O,Z=arguments.length,ae=Z<3?j:T===null?T=Object.getOwnPropertyDescriptor(j,B):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(Y,j,B,T);else for(var _e=Y.length-1;_e>=0;_e--)(O=Y[_e])&&(ae=(Z<3?O(ae):Z>3?O(j,B,ae):O(j,B))||ae);return Z>3&&ae&&Object.defineProperty(j,B,ae),ae},v=this&&this.__param||function(Y,j){return function(B,T){j(B,T,Y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const l=p(2584),_=p(7116),C=p(2015),w=p(844),g=p(482),d=p(8437),f=p(8460),r=p(643),u=p(511),S=p(3734),A=p(2585),E=p(1480),R=p(6242),y=p(6351),D=p(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function $(Y,j){if(Y>24)return j.setWinLines||!1;switch(Y){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var z;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(z||(c.WindowsOptionsReportType=z={}));let Q=0;class ne extends w.Disposable{getAttrData(){return this._curAttrData}constructor(j,B,T,O,Z,ae,_e,ge,X=new C.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=B,this._coreService=T,this._logService=O,this._optionsService=Z,this._oscLinkService=ae,this._coreMouseService=_e,this._unicodeService=ge,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._parser.setCsiHandlerFallback(((N,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:ce.toArray()})})),this._parser.setEscHandlerFallback((N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})})),this._parser.setExecuteHandlerFallback((N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})})),this._parser.setOscHandlerFallback(((N,ce,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:ce,data:le})})),this._parser.setDcsHandlerFallback(((N,ce,le)=>{ce==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:ce,payload:le})})),this._parser.setPrintHandler(((N,ce,le)=>this.print(N,ce,le))),this._parser.registerCsiHandler({final:"@"},(N=>this.insertChars(N))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(N=>this.scrollLeft(N))),this._parser.registerCsiHandler({final:"A"},(N=>this.cursorUp(N))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(N=>this.scrollRight(N))),this._parser.registerCsiHandler({final:"B"},(N=>this.cursorDown(N))),this._parser.registerCsiHandler({final:"C"},(N=>this.cursorForward(N))),this._parser.registerCsiHandler({final:"D"},(N=>this.cursorBackward(N))),this._parser.registerCsiHandler({final:"E"},(N=>this.cursorNextLine(N))),this._parser.registerCsiHandler({final:"F"},(N=>this.cursorPrecedingLine(N))),this._parser.registerCsiHandler({final:"G"},(N=>this.cursorCharAbsolute(N))),this._parser.registerCsiHandler({final:"H"},(N=>this.cursorPosition(N))),this._parser.registerCsiHandler({final:"I"},(N=>this.cursorForwardTab(N))),this._parser.registerCsiHandler({final:"J"},(N=>this.eraseInDisplay(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(N=>this.eraseInDisplay(N,!0))),this._parser.registerCsiHandler({final:"K"},(N=>this.eraseInLine(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(N=>this.eraseInLine(N,!0))),this._parser.registerCsiHandler({final:"L"},(N=>this.insertLines(N))),this._parser.registerCsiHandler({final:"M"},(N=>this.deleteLines(N))),this._parser.registerCsiHandler({final:"P"},(N=>this.deleteChars(N))),this._parser.registerCsiHandler({final:"S"},(N=>this.scrollUp(N))),this._parser.registerCsiHandler({final:"T"},(N=>this.scrollDown(N))),this._parser.registerCsiHandler({final:"X"},(N=>this.eraseChars(N))),this._parser.registerCsiHandler({final:"Z"},(N=>this.cursorBackwardTab(N))),this._parser.registerCsiHandler({final:"`"},(N=>this.charPosAbsolute(N))),this._parser.registerCsiHandler({final:"a"},(N=>this.hPositionRelative(N))),this._parser.registerCsiHandler({final:"b"},(N=>this.repeatPrecedingCharacter(N))),this._parser.registerCsiHandler({final:"c"},(N=>this.sendDeviceAttributesPrimary(N))),this._parser.registerCsiHandler({prefix:">",final:"c"},(N=>this.sendDeviceAttributesSecondary(N))),this._parser.registerCsiHandler({final:"d"},(N=>this.linePosAbsolute(N))),this._parser.registerCsiHandler({final:"e"},(N=>this.vPositionRelative(N))),this._parser.registerCsiHandler({final:"f"},(N=>this.hVPosition(N))),this._parser.registerCsiHandler({final:"g"},(N=>this.tabClear(N))),this._parser.registerCsiHandler({final:"h"},(N=>this.setMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(N=>this.setModePrivate(N))),this._parser.registerCsiHandler({final:"l"},(N=>this.resetMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(N=>this.resetModePrivate(N))),this._parser.registerCsiHandler({final:"m"},(N=>this.charAttributes(N))),this._parser.registerCsiHandler({final:"n"},(N=>this.deviceStatus(N))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(N=>this.deviceStatusPrivate(N))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(N=>this.softReset(N))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(N=>this.setCursorStyle(N))),this._parser.registerCsiHandler({final:"r"},(N=>this.setScrollRegion(N))),this._parser.registerCsiHandler({final:"s"},(N=>this.saveCursor(N))),this._parser.registerCsiHandler({final:"t"},(N=>this.windowOptions(N))),this._parser.registerCsiHandler({final:"u"},(N=>this.restoreCursor(N))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(N=>this.insertColumns(N))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(N=>this.deleteColumns(N))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(N=>this.selectProtected(N))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(N=>this.requestMode(N,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(N=>this.requestMode(N,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new R.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new R.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new R.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new R.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new R.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new R.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new R.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new R.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new R.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new R.OscHandler((N=>this.restoreCursorColor(N)))),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 N in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},(()=>this.selectCharset("("+N))),this._parser.registerEscHandler({intermediates:")",final:N},(()=>this.selectCharset(")"+N))),this._parser.registerEscHandler({intermediates:"*",final:N},(()=>this.selectCharset("*"+N))),this._parser.registerEscHandler({intermediates:"+",final:N},(()=>this.selectCharset("+"+N))),this._parser.registerEscHandler({intermediates:"-",final:N},(()=>this.selectCharset("-"+N))),this._parser.registerEscHandler({intermediates:".",final:N},(()=>this.selectCharset("."+N))),this._parser.registerEscHandler({intermediates:"/",final:N},(()=>this.selectCharset("/"+N)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((N=>(this._logService.error("Parsing error: ",N),N))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((N,ce)=>this.requestStatusString(N,ce))))}_preserveStack(j,B,T,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=T,this._parseStack.position=O}_logSlowResolvingAsync(j){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([j,new Promise(((B,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,B){let T,O=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const _e=this._parseStack.paused;if(_e){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(T),T;O=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>P&&(ae=this._parseStack.position+P)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(N=>String.fromCharCode(N))).join("")}"`),typeof j=="string"?j.split("").map((N=>N.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(j.length,P))),_e||this._dirtyRowTracker.clearRange(),j.length>P)for(let N=ae;N<j.length;N+=P){const ce=N+P<j.length?N+P:j.length,le=typeof j=="string"?this._stringDecoder.decode(j.substring(N,ce),this._parseBuffer):this._utf8Decoder.decode(j.subarray(N,ce),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,le))return this._preserveStack(O,Z,le,N),this._logSlowResolvingAsync(T),T}else if(!_e){const N=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,N))return this._preserveStack(O,Z,N,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===O&&this._activeBuffer.y===Z||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(j,B,T){let O,Z;const ae=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,ce=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-B>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let ye=this._parser.precedingJoinState;for(let be=B;be<T;++be){if(O=j[be],O<127&&ae){const Ye=ae[String.fromCharCode(O)];Ye&&(O=Ye.charCodeAt(0))}const je=this._unicodeService.charProperties(O,ye);Z=E.UnicodeService.extractWidth(je);const Le=E.UnicodeService.extractShouldJoin(je),Be=Le?E.UnicodeService.extractWidth(ye):0;if(ye=je,_e&&this._onA11yChar.fire((0,g.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Be>ge){if(X){const Ye=le;let Ae=this._activeBuffer.x-Be;for(this._activeBuffer.x=Be,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),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Be>0&&le instanceof d.BufferLine&&le.copyCellsFrom(Ye,Ae,0,Be,!1);Ae<ge;)Ye.setCellFromCodepoint(Ae++,0,1,ce)}else if(this._activeBuffer.x=ge-1,Z===2)continue}if(Le&&this._activeBuffer.x){const Ye=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-Ye,O,Z);for(let Ae=Z-Be;--Ae>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(N&&(le.insertCells(this._activeBuffer.x,Z-Be,this._activeBuffer.getNullCell(ce)),le.getWidth(ge-1)===2&&le.setCellFromCodepoint(ge-1,r.NULL_CELL_CODE,r.NULL_CELL_WIDTH,ce)),le.setCellFromCodepoint(this._activeBuffer.x++,O,Z,ce),Z>0)for(;--Z;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=ye,this._activeBuffer.x<ge&&T-B>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,B){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,B):this._parser.registerCsiHandler(j,(T=>!$(T.params[0],this._optionsService.rawOptions.windowOptions)||B(T)))}registerDcsHandler(j,B){return this._parser.registerDcsHandler(j,new y.DcsHandler(B))}registerEscHandler(j,B){return this._parser.registerEscHandler(j,B)}registerOscHandler(j,B){return this._parser.registerOscHandler(j,new R.OscHandler(B))}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 j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=j,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+B)}cursorUp(j){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const B=j.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=j.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=j.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const B=j.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,B,T,O=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);ae.replaceCells(B,T,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),O&&(ae.isWrapped=!1)}_resetBufferLine(j,B=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),T.isWrapped=!1)}eraseInDisplay(j,B=!1){let T;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);T<this._bufferService.rows;T++)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,B);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(j,B=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let B=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;B--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let B=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=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;B--;)this._activeBuffer.lines.splice(T,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(j){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let B=j.params[0]||1;for(;B--;)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(j){let B=j.params[0]||1;for(;B--;)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(d.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=j.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);O.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=j.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);O.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=j.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);O.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=j.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);O.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const B=this._parser.precedingJoinState;if(!B)return!0;const T=j.params[0]||1,O=E.UnicodeService.extractWidth(B),Z=this._activeBuffer.x-O,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),_e=new Uint32Array(ae.length*T);let ge=0;for(let N=0;N<ae.length;){const ce=ae.codePointAt(N)||0;_e[ge++]=ce,N+=ce>65535?2:1}let X=ge;for(let N=1;N<T;++N)_e.copyWithin(X,0,ge),X+=ge;return this.print(_e,0,X),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let B=0;B<j.length;B++)switch(j.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let B=0;B<j.length;B++)switch(j.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(j){for(let B=0;B<j.length;B++)switch(j.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let B=0;B<j.length;B++)switch(j.params[B]){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(),j.params[B]===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(j,B){const T=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:_e,cols:ge}=this._bufferService,{active:X,alt:N}=_e,ce=this._optionsService.rawOptions,le=Le=>Le?1:2,ye=j.params[0];return be=ye,je=B?ye===2?4:ye===4?le(ae.modes.insertMode):ye===12?3:ye===20?le(ce.convertEol):0:ye===1?le(T.applicationCursorKeys):ye===3?ce.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:ye===6?le(T.origin):ye===7?le(T.wraparound):ye===8?3:ye===9?le(O==="X10"):ye===12?le(ce.cursorBlink):ye===25?le(!ae.isCursorHidden):ye===45?le(T.reverseWraparound):ye===66?le(T.applicationKeypad):ye===67?4:ye===1e3?le(O==="VT200"):ye===1002?le(O==="DRAG"):ye===1003?le(O==="ANY"):ye===1004?le(T.sendFocus):ye===1005?4:ye===1006?le(Z==="SGR"):ye===1015?4:ye===1016?le(Z==="SGR_PIXELS"):ye===1048?1:ye===47||ye===1047||ye===1049?le(X===N):ye===2004?le(T.bracketedPasteMode):0,ae.triggerDataEvent(`${l.C0.ESC}[${B?"":"?"}${be};${je}$y`),!0;var be,je}_updateAttrColor(j,B,T,O,Z){return B===2?(j|=50331648,j&=-16777216,j|=S.AttributeData.fromColorRGB([T,O,Z])):B===5&&(j&=-50331904,j|=33554432|255&T),j}_extractColor(j,B,T){const O=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(O[ae+Z]=j.params[B+ae],j.hasSubParams(B+ae)){const _e=j.getSubParams(B+ae);let ge=0;do O[1]===5&&(Z=1),O[ae+ge+1+Z]=_e[ge];while(++ge<_e.length&&ge+ae+1+Z<O.length);break}if(O[1]===5&&ae+Z>=2||O[1]===2&&ae+Z>=5)break;O[1]&&(Z=1)}while(++ae+B<j.length&&ae+Z<O.length);for(let _e=2;_e<O.length;++_e)O[_e]===-1&&(O[_e]=0);switch(O[0]){case 38:T.fg=this._updateAttrColor(T.fg,O[1],O[3],O[4],O[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,O[1],O[3],O[4],O[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,O[1],O[3],O[4],O[5])}return ae}_processUnderline(j,B){B.extended=B.extended.clone(),(!~j||j>5)&&(j=1),B.extended.underlineStyle=j,B.fg|=268435456,j===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(j){j.fg=d.DEFAULT_ATTR_DATA.fg,j.bg=d.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=j.length;let T;const O=this._curAttrData;for(let Z=0;Z<B;Z++)T=j.params[Z],T>=30&&T<=37?(O.fg&=-50331904,O.fg|=16777216|T-30):T>=40&&T<=47?(O.bg&=-50331904,O.bg|=16777216|T-40):T>=90&&T<=97?(O.fg&=-50331904,O.fg|=16777224|T-90):T>=100&&T<=107?(O.bg&=-50331904,O.bg|=16777224|T-100):T===0?this._processSGR0(O):T===1?O.fg|=134217728:T===3?O.bg|=67108864:T===4?(O.fg|=268435456,this._processUnderline(j.hasSubParams(Z)?j.getSubParams(Z)[0]:1,O)):T===5?O.fg|=536870912:T===7?O.fg|=67108864:T===8?O.fg|=1073741824:T===9?O.fg|=2147483648:T===2?O.bg|=134217728:T===21?this._processUnderline(2,O):T===22?(O.fg&=-134217729,O.bg&=-134217729):T===23?O.bg&=-67108865:T===24?(O.fg&=-268435457,this._processUnderline(0,O)):T===25?O.fg&=-536870913:T===27?O.fg&=-67108865:T===28?O.fg&=-1073741825:T===29?O.fg&=2147483647:T===39?(O.fg&=-67108864,O.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):T===49?(O.bg&=-67108864,O.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?Z+=this._extractColor(j,Z,O):T===53?O.bg|=1073741824:T===55?O.bg&=-1073741825:T===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):T===100?(O.fg&=-67108864,O.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${B};${T}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${B};${T}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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(j){const B=j.params[0]||1;switch(B){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 T=B%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(j){const B=j.params[0]||1;let T;return(j.length<2||(T=j.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(j){if(!$(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const B=[],T=j.split(";");for(;T.length>1;){const O=T.shift(),Z=T.shift();if(/^\d+$/.exec(O)){const ae=parseInt(O);if(W(ae))if(Z==="?")B.push({type:0,index:ae});else{const _e=(0,D.parseColor)(Z);_e&&B.push({type:1,index:ae,color:_e})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(j){const B=j.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(j,B){this._getCurrentLinkId()&&this._finishHyperlink();const T=j.split(":");let O;const Z=T.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(O=T[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,B){const T=j.split(";");for(let O=0;O<T.length&&!(B>=this._specialColors.length);++O,++B)if(T[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Z=(0,D.parseColor)(T[O]);Z&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Z}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const B=[],T=j.split(";");for(let O=0;O<T.length;++O)if(/^\d+$/.exec(T[O])){const Z=parseInt(T[O]);W(Z)&&B.push({type:2,index:Z})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,_.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(I[j[0]],_.CHARSETS[j[1]]||_.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new u.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const T=this._activeBuffer.ybase+this._activeBuffer.y+B,O=this._activeBuffer.lines.get(T);O&&(O.fill(j),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,B){const T=this._bufferService.buffer,O=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${Z}${l.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,B){this._dirtyRowTracker.markRangeDirty(j,B)}}c.InputHandler=ne;let F=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,j){Y>j&&(Q=Y,Y=j,j=Q),Y<this.start&&(this.start=Y),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Y){return 0<=Y&&Y<256}F=m([v(0,A.IBufferService)],F)},844:(H,c)=>{function p(m){for(const v of m)v.dispose();m.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const v=this._disposables.indexOf(m);v!==-1&&this._disposables.splice(v,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){var v;this._isDisposed||m===this._value||((v=this._value)==null||v.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){var m;this._isDisposed=!0,(m=this._value)==null||m.dispose(),this._value=void 0}},c.toDisposable=function(m){return{dispose:m}},c.disposeArray=p,c.getDisposeArrayDisposable=function(m){return{dispose:()=>p(m)}}},1505:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class p{constructor(){this._data={}}set(v,l,_){this._data[v]||(this._data[v]={}),this._data[v][l]=_}get(v,l){return this._data[v]?this._data[v][l]:void 0}clear(){this._data={}}}c.TwoKeyMap=p,c.FourKeyMap=class{constructor(){this._data=new p}set(m,v,l,_,C){this._data.get(m,v)||this._data.set(m,v,new p),this._data.get(m,v).set(l,_,C)}get(m,v,l,_){var C;return(C=this._data.get(m,v))==null?void 0:C.get(l,_)}clear(){this._data.clear()}}},6114:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const p=c.isNode?"node":navigator.userAgent,m=c.isNode?"node":navigator.platform;c.isFirefox=p.includes("Firefox"),c.isLegacyEdge=p.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(p),c.getSafariVersion=function(){if(!c.isSafari)return 0;const v=p.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),c.isIpad=m==="iPad",c.isIphone=m==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),c.isLinux=m.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(p)},6106:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let p=0;c.SortedList=class{constructor(m){this._getKey=m,this._array=[]}clear(){this._array.length=0}insert(m){this._array.length!==0?(p=this._search(this._getKey(m)),this._array.splice(p,0,m)):this._array.push(m)}delete(m){if(this._array.length===0)return!1;const v=this._getKey(m);if(v===void 0||(p=this._search(v),p===-1)||this._getKey(this._array[p])!==v)return!1;do if(this._array[p]===m)return this._array.splice(p,1),!0;while(++p<this._array.length&&this._getKey(this._array[p])===v);return!1}*getKeyIterator(m){if(this._array.length!==0&&(p=this._search(m),!(p<0||p>=this._array.length)&&this._getKey(this._array[p])===m))do yield this._array[p];while(++p<this._array.length&&this._getKey(this._array[p])===m)}forEachByKey(m,v){if(this._array.length!==0&&(p=this._search(m),!(p<0||p>=this._array.length)&&this._getKey(this._array[p])===m))do v(this._array[p]);while(++p<this._array.length&&this._getKey(this._array[p])===m)}values(){return[...this._array].values()}_search(m){let v=0,l=this._array.length-1;for(;l>=v;){let _=v+l>>1;const C=this._getKey(this._array[_]);if(C>m)l=_-1;else{if(!(C<m)){for(;_>0&&this._getKey(this._array[_-1])===m;)_--;return _}v=_+1}}return v}}},7226:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const m=p(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let w=0,g=0,d=C.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),g=Math.max(w,g),f=C.timeRemaining(),1.5*g>f)return d-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(d-w))}ms`),void this._start();d=f}this.clear()}}class l extends v{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}c.PriorityTaskQueue=l,c.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:l,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const m=p(643);c.updateWindowsModeWrappedState=function(v){const l=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),_=l==null?void 0:l.get(v.cols-1),C=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);C&&_&&(C.isWrapped=_[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&_[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class p{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new p;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}}c.AttributeData=p;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,_=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=_}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=m},9092:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const m=p(6349),v=p(7226),l=p(3734),_=p(8437),C=p(4634),w=p(511),g=p(643),d=p(4863),f=p(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(r,u,S){this._hasScrollback=r,this._optionsService=u,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(r){return r?(this._nullCell.fg=r.fg,this._nullCell.bg=r.bg,this._nullCell.extended=r.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(r){return r?(this._whitespaceCell.fg=r.fg,this._whitespaceCell.bg=r.bg,this._whitespaceCell.extended=r.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(r,u){return new _.BufferLine(this._bufferService.cols,this.getNullCell(r),u)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const r=this.ybase+this.y-this.ydisp;return r>=0&&r<this._rows}_getCorrectBufferLength(r){if(!this._hasScrollback)return r;const u=r+this._optionsService.rawOptions.scrollback;return u>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:u}fillViewportRows(r){if(this.lines.length===0){r===void 0&&(r=_.DEFAULT_ATTR_DATA);let u=this._rows;for(;u--;)this.lines.push(this.getBlankLine(r))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(r,u){const S=this.getNullCell(_.DEFAULT_ATTR_DATA);let A=0;const E=this._getCorrectBufferLength(u);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols<r)for(let y=0;y<this.lines.length;y++)A+=+this.lines.get(y).resize(r,S);let R=0;if(this._rows<u)for(let y=this._rows;y<u;y++)this.lines.length<u+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(r,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(r,S)));else for(let y=this._rows;y>u;y--)this.lines.length>u+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E<this.lines.maxLength){const y=this.lines.length-E;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=E}this.x=Math.min(this.x,r-1),this.y=Math.min(this.y,u-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,r-1),this.scrollTop=0}if(this.scrollBottom=u-1,this._isReflowEnabled&&(this._reflow(r,u),this._cols>r))for(let R=0;R<this.lines.length;R++)A+=+this.lines.get(R).resize(r,S);this._cols=r,this._rows=u,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let r=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,r=!1);let u=0;for(;this._memoryCleanupPosition<this.lines.length;)if(u+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),u>100)return!0;return r}get _isReflowEnabled(){const r=this._optionsService.rawOptions.windowsPty;return r&&r.buildNumber?this._hasScrollback&&r.backend==="conpty"&&r.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(r,u){this._cols!==r&&(r>this._cols?this._reflowLarger(r,u):this._reflowSmaller(r,u))}_reflowLarger(r,u){const S=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,r,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(S.length>0){const A=(0,C.reflowLargerCreateNewLayout)(this.lines,S);(0,C.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(r,u,A.countRemoved)}}_reflowLargerAdjustViewport(r,u,S){const A=this.getNullCell(_.DEFAULT_ATTR_DATA);let E=S;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<u&&this.lines.push(new _.BufferLine(r,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(r,u){const S=this.getNullCell(_.DEFAULT_ATTR_DATA),A=[];let E=0;for(let R=this.lines.length-1;R>=0;R--){let y=this.lines.get(R);if(!y||!y.isWrapped&&y.getTrimmedLength()<=r)continue;const D=[y];for(;y.isWrapped&&R>0;)y=this.lines.get(--R),D.unshift(y);const I=this.ybase+this.y;if(I>=R&&I<R+D.length)continue;const P=D[D.length-1].getTrimmedLength(),$=(0,C.reflowSmallerGetNewLineLengths)(D,this._cols,r),z=$.length-D.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+z):Math.max(0,this.lines.length-this.lines.maxLength+z);const ne=[];for(let T=0;T<z;T++){const O=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);ne.push(O)}ne.length>0&&(A.push({start:R+D.length+E,newLines:ne}),E+=ne.length),D.push(...ne);let F=$.length-1,W=$[F];W===0&&(F--,W=$[F]);let Y=D.length-z-1,j=P;for(;Y>=0;){const T=Math.min(j,W);if(D[F]===void 0)break;if(D[F].copyCellsFrom(D[Y],j-T,W-T,T,!0),W-=T,W===0&&(F--,W=$[F]),j-=T,j===0){Y--;const O=Math.max(Y,0);j=(0,C.getWrappedLineTrimmedLength)(D,O,this._cols)}}for(let T=0;T<D.length;T++)$[T]<r&&D[T].setCell($[T],S);let B=z-Q;for(;B-- >0;)this.ybase===0?this.y<u-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+E)-u&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+z,this.ybase+u-1)}if(A.length>0){const R=[],y=[];for(let F=0;F<this.lines.length;F++)y.push(this.lines.get(F));const D=this.lines.length;let I=D-1,P=0,$=A[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+E);let z=0;for(let F=Math.min(this.lines.maxLength-1,D+E-1);F>=0;F--)if($&&$.start>I+z){for(let W=$.newLines.length-1;W>=0;W--)this.lines.set(F--,$.newLines[W]);F++,R.push({index:I+1,amount:$.newLines.length}),z+=$.newLines.length,$=A[++P]}else this.lines.set(F,y[I--]);let Q=0;for(let F=R.length-1;F>=0;F--)R[F].index+=Q,this.lines.onInsertEmitter.fire(R[F]),Q+=R[F].amount;const ne=Math.max(0,D+E-this.lines.maxLength);ne>0&&this.lines.onTrimEmitter.fire(ne)}}translateBufferLineToString(r,u,S=0,A){const E=this.lines.get(r);return E?E.translateToString(u,S,A):""}getWrappedRangeForLine(r){let u=r,S=r;for(;u>0&&this.lines.get(u).isWrapped;)u--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:u,last:S}}setupTabStops(r){for(r!=null?this.tabs[r]||(r=this.prevStop(r)):(this.tabs={},r=0);r<this._cols;r+=this._optionsService.rawOptions.tabStopWidth)this.tabs[r]=!0}prevStop(r){for(r==null&&(r=this.x);!this.tabs[--r]&&r>0;);return r>=this._cols?this._cols-1:r<0?0:r}nextStop(r){for(r==null&&(r=this.x);!this.tabs[++r]&&r<this._cols;);return r>=this._cols?this._cols-1:r<0?0:r}clearMarkers(r){this._isClearing=!0;for(let u=0;u<this.markers.length;u++)this.markers[u].line===r&&(this.markers[u].dispose(),this.markers.splice(u--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let r=0;r<this.markers.length;r++)this.markers[r].dispose(),this.markers.splice(r--,1);this._isClearing=!1}addMarker(r){const u=new d.Marker(r);return this.markers.push(u),u.register(this.lines.onTrim((S=>{u.line-=S,u.line<0&&u.dispose()}))),u.register(this.lines.onInsert((S=>{u.line>=S.index&&(u.line+=S.amount)}))),u.register(this.lines.onDelete((S=>{u.line>=S.index&&u.line<S.index+S.amount&&u.dispose(),u.line>S.index&&(u.line-=S.amount)}))),u.register(u.onDispose((()=>this._removeMarker(u)))),u}_removeMarker(r){this._isClearing||this.markers.splice(this.markers.indexOf(r),1)}}},8437:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const m=p(3734),v=p(511),l=p(643),_=p(482);c.DEFAULT_ATTR_DATA=Object.freeze(new m.AttributeData);let C=0;class w{constructor(d,f,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*d);const u=f||v.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let S=0;S<d;++S)this.setCell(S,u);this.length=d}get(d){const f=this._data[3*d+0],r=2097151&f;return[this._data[3*d+1],2097152&f?this._combined[d]:r?(0,_.stringFromCodePoint)(r):"",f>>22,2097152&f?this._combined[d].charCodeAt(this._combined[d].length-1):r]}set(d,f){this._data[3*d+1]=f[l.CHAR_DATA_ATTR_INDEX],f[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[d]=f[1],this._data[3*d+0]=2097152|d|f[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d+0]=f[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(d){return this._data[3*d+0]>>22}hasWidth(d){return 12582912&this._data[3*d+0]}getFg(d){return this._data[3*d+1]}getBg(d){return this._data[3*d+2]}hasContent(d){return 4194303&this._data[3*d+0]}getCodePoint(d){const f=this._data[3*d+0];return 2097152&f?this._combined[d].charCodeAt(this._combined[d].length-1):2097151&f}isCombined(d){return 2097152&this._data[3*d+0]}getString(d){const f=this._data[3*d+0];return 2097152&f?this._combined[d]:2097151&f?(0,_.stringFromCodePoint)(2097151&f):""}isProtected(d){return 536870912&this._data[3*d+2]}loadCell(d,f){return C=3*d,f.content=this._data[C+0],f.fg=this._data[C+1],f.bg=this._data[C+2],2097152&f.content&&(f.combinedData=this._combined[d]),268435456&f.bg&&(f.extended=this._extendedAttrs[d]),f}setCell(d,f){2097152&f.content&&(this._combined[d]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[d]=f.extended),this._data[3*d+0]=f.content,this._data[3*d+1]=f.fg,this._data[3*d+2]=f.bg}setCellFromCodepoint(d,f,r,u){268435456&u.bg&&(this._extendedAttrs[d]=u.extended),this._data[3*d+0]=f|r<<22,this._data[3*d+1]=u.fg,this._data[3*d+2]=u.bg}addCodepointToCell(d,f,r){let u=this._data[3*d+0];2097152&u?this._combined[d]+=(0,_.stringFromCodePoint)(f):2097151&u?(this._combined[d]=(0,_.stringFromCodePoint)(2097151&u)+(0,_.stringFromCodePoint)(f),u&=-2097152,u|=2097152):u=f|4194304,r&&(u&=-12582913,u|=r<<22),this._data[3*d+0]=u}insertCells(d,f,r){if((d%=this.length)&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,r),f<this.length-d){const u=new v.CellData;for(let S=this.length-d-f-1;S>=0;--S)this.setCell(d+f+S,this.loadCell(d+S,u));for(let S=0;S<f;++S)this.setCell(d+S,r)}else for(let u=d;u<this.length;++u)this.setCell(u,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(d,f,r){if(d%=this.length,f<this.length-d){const u=new v.CellData;for(let S=0;S<this.length-d-f;++S)this.setCell(d+S,this.loadCell(d+f+S,u));for(let S=this.length-f;S<this.length;++S)this.setCell(S,r)}else for(let u=d;u<this.length;++u)this.setCell(u,r);d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,r),this.getWidth(d)!==0||this.hasContent(d)||this.setCellFromCodepoint(d,0,1,r)}replaceCells(d,f,r,u=!1){if(u)for(d&&this.getWidth(d-1)===2&&!this.isProtected(d-1)&&this.setCellFromCodepoint(d-1,0,1,r),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,r);d<f&&d<this.length;)this.isProtected(d)||this.setCell(d,r),d++;else for(d&&this.getWidth(d-1)===2&&this.setCellFromCodepoint(d-1,0,1,r),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,r);d<f&&d<this.length;)this.setCell(d++,r)}resize(d,f){if(d===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const r=3*d;if(d>this.length){if(this._data.buffer.byteLength>=4*r)this._data=new Uint32Array(this._data.buffer,0,r);else{const u=new Uint32Array(r);u.set(this._data),this._data=u}for(let u=this.length;u<d;++u)this.setCell(u,f)}else{this._data=this._data.subarray(0,r);const u=Object.keys(this._combined);for(let A=0;A<u.length;A++){const E=parseInt(u[A],10);E>=d&&delete this._combined[E]}const S=Object.keys(this._extendedAttrs);for(let A=0;A<S.length;A++){const E=parseInt(S[A],10);E>=d&&delete this._extendedAttrs[E]}}return this.length=d,4*r*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const d=new Uint32Array(this._data.length);return d.set(this._data),this._data=d,1}return 0}fill(d,f=!1){if(f)for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,d);else{this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,d)}}copyFrom(d){this.length!==d.length?this._data=new Uint32Array(d._data):this._data.set(d._data),this.length=d.length,this._combined={};for(const f in d._combined)this._combined[f]=d._combined[f];this._extendedAttrs={};for(const f in d._extendedAttrs)this._extendedAttrs[f]=d._extendedAttrs[f];this.isWrapped=d.isWrapped}clone(){const d=new w(0);d._data=new Uint32Array(this._data),d.length=this.length;for(const f in this._combined)d._combined[f]=this._combined[f];for(const f in this._extendedAttrs)d._extendedAttrs[f]=this._extendedAttrs[f];return d.isWrapped=this.isWrapped,d}getTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0])return d+(this._data[3*d+0]>>22);return 0}getNoBgTrimmedLength(){for(let d=this.length-1;d>=0;--d)if(4194303&this._data[3*d+0]||50331648&this._data[3*d+2])return d+(this._data[3*d+0]>>22);return 0}copyCellsFrom(d,f,r,u,S){const A=d._data;if(S)for(let R=u-1;R>=0;R--){for(let y=0;y<3;y++)this._data[3*(r+R)+y]=A[3*(f+R)+y];268435456&A[3*(f+R)+2]&&(this._extendedAttrs[r+R]=d._extendedAttrs[f+R])}else for(let R=0;R<u;R++){for(let y=0;y<3;y++)this._data[3*(r+R)+y]=A[3*(f+R)+y];268435456&A[3*(f+R)+2]&&(this._extendedAttrs[r+R]=d._extendedAttrs[f+R])}const E=Object.keys(d._combined);for(let R=0;R<E.length;R++){const y=parseInt(E[R],10);y>=f&&(this._combined[y-f+r]=d._combined[y])}}translateToString(d,f,r,u){f=f??0,r=r??this.length,d&&(r=Math.min(r,this.getTrimmedLength())),u&&(u.length=0);let S="";for(;f<r;){const A=this._data[3*f+0],E=2097151&A,R=2097152&A?this._combined[f]:E?(0,_.stringFromCodePoint)(E):l.WHITESPACE_CELL_CHAR;if(S+=R,u)for(let y=0;y<R.length;++y)u.push(f);f+=A>>22||1}return u&&u.push(f),S}}c.BufferLine=w},4841:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(p,m){if(p.start.y>p.end.y)throw new Error(`Buffer range end (${p.end.x}, ${p.end.y}) cannot be before start (${p.start.x}, ${p.start.y})`);return m*(p.end.y-p.start.y)+(p.end.x-p.start.x+1)}},4634:(H,c)=>{function p(m,v,l){if(v===m.length-1)return m[v].getTrimmedLength();const _=!m[v].hasContent(l-1)&&m[v].getWidth(l-1)===1,C=m[v+1].getWidth(0)===2;return _&&C?l-1:l}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(m,v,l,_,C){const w=[];for(let g=0;g<m.length-1;g++){let d=g,f=m.get(++d);if(!f.isWrapped)continue;const r=[m.get(g)];for(;d<m.length&&f.isWrapped;)r.push(f),f=m.get(++d);if(_>=g&&_<d){g+=r.length-1;continue}let u=0,S=p(r,u,v),A=1,E=0;for(;A<r.length;){const y=p(r,A,v),D=y-E,I=l-S,P=Math.min(D,I);r[u].copyCellsFrom(r[A],E,S,P,!1),S+=P,S===l&&(u++,S=0),E+=P,E===y&&(A++,E=0),S===0&&u!==0&&r[u-1].getWidth(l-1)===2&&(r[u].copyCellsFrom(r[u-1],l-1,S++,1,!1),r[u-1].setCell(l-1,C))}r[u].replaceCells(S,l,C);let R=0;for(let y=r.length-1;y>0&&(y>u||r[y].getTrimmedLength()===0);y--)R++;R>0&&(w.push(g+r.length-R),w.push(R)),g+=r.length-1}return w},c.reflowLargerCreateNewLayout=function(m,v){const l=[];let _=0,C=v[_],w=0;for(let g=0;g<m.length;g++)if(C===g){const d=v[++_];m.onDeleteEmitter.fire({index:g-w,amount:d}),g+=d-1,w+=d,C=v[++_]}else l.push(g);return{layout:l,countRemoved:w}},c.reflowLargerApplyNewLayout=function(m,v){const l=[];for(let _=0;_<v.length;_++)l.push(m.get(v[_]));for(let _=0;_<l.length;_++)m.set(_,l[_]);m.length=v.length},c.reflowSmallerGetNewLineLengths=function(m,v,l){const _=[],C=m.map(((f,r)=>p(m,r,v))).reduce(((f,r)=>f+r));let w=0,g=0,d=0;for(;d<C;){if(C-d<l){_.push(C-d);break}w+=l;const f=p(m,g,v);w>f&&(w-=f,g++);const r=m[g].getWidth(w-1)===2;r&&w--;const u=r?l-1:l;_.push(u),d+=u}return _},c.getWrappedLineTrimmedLength=p},5295:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const m=p(8460),v=p(844),l=p(9092);class _ extends v.Disposable{constructor(w,g){super(),this._optionsService=w,this._bufferService=g,this._onBufferActivate=this.register(new m.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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,g){this._normal.resize(w,g),this._alt.resize(w,g),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}c.BufferSet=_},511:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const m=p(482),v=p(643),l=p(3734);class _ extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const g=new _;return g.setFromCharData(w),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(w[v.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(w[v.CHAR_DATA_CHAR_INDEX].length===2){const d=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&d<=56319){const f=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(d-55296)+f-56320+65536|w[v.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=w[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[v.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=w[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=_},643:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const m=p(8460),v=p(844);class l{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}c.Marker=l,l._nextId=1},7116:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(H,c)=>{var p,m,v;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
443
+ `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(p||(c.C0=p={})),(function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"})(m||(c.C1=m={})),(function(l){l.ST=`${p.ESC}\\`})(v||(c.C1_ESCAPED=v={}))},7399:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const m=p(2584),v={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:["'",'"']};c.evaluateKeyboardEvent=function(l,_,C,w){const g={type:0,cancel:!1,key:void 0},d=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?g.key=_?m.C0.ESC+"OA":m.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?g.key=_?m.C0.ESC+"OD":m.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?g.key=_?m.C0.ESC+"OC":m.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(g.key=_?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:g.key=l.ctrlKey?"\b":m.C0.DEL,l.altKey&&(g.key=m.C0.ESC+g.key);break;case 9:if(l.shiftKey){g.key=m.C0.ESC+"[Z";break}g.key=m.C0.HT,g.cancel=!0;break;case 13:g.key=l.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,g.cancel=!0;break;case 27:g.key=m.C0.ESC,l.altKey&&(g.key=m.C0.ESC+m.C0.ESC),g.cancel=!0;break;case 37:if(l.metaKey)break;d?(g.key=m.C0.ESC+"[1;"+(d+1)+"D",g.key===m.C0.ESC+"[1;3D"&&(g.key=m.C0.ESC+(C?"b":"[1;5D"))):g.key=_?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(l.metaKey)break;d?(g.key=m.C0.ESC+"[1;"+(d+1)+"C",g.key===m.C0.ESC+"[1;3C"&&(g.key=m.C0.ESC+(C?"f":"[1;5C"))):g.key=_?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(l.metaKey)break;d?(g.key=m.C0.ESC+"[1;"+(d+1)+"A",C||g.key!==m.C0.ESC+"[1;3A"||(g.key=m.C0.ESC+"[1;5A")):g.key=_?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(l.metaKey)break;d?(g.key=m.C0.ESC+"[1;"+(d+1)+"B",C||g.key!==m.C0.ESC+"[1;3B"||(g.key=m.C0.ESC+"[1;5B")):g.key=_?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(g.key=m.C0.ESC+"[2~");break;case 46:g.key=d?m.C0.ESC+"[3;"+(d+1)+"~":m.C0.ESC+"[3~";break;case 36:g.key=d?m.C0.ESC+"[1;"+(d+1)+"H":_?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:g.key=d?m.C0.ESC+"[1;"+(d+1)+"F":_?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:l.shiftKey?g.type=2:l.ctrlKey?g.key=m.C0.ESC+"[5;"+(d+1)+"~":g.key=m.C0.ESC+"[5~";break;case 34:l.shiftKey?g.type=3:l.ctrlKey?g.key=m.C0.ESC+"[6;"+(d+1)+"~":g.key=m.C0.ESC+"[6~";break;case 112:g.key=d?m.C0.ESC+"[1;"+(d+1)+"P":m.C0.ESC+"OP";break;case 113:g.key=d?m.C0.ESC+"[1;"+(d+1)+"Q":m.C0.ESC+"OQ";break;case 114:g.key=d?m.C0.ESC+"[1;"+(d+1)+"R":m.C0.ESC+"OR";break;case 115:g.key=d?m.C0.ESC+"[1;"+(d+1)+"S":m.C0.ESC+"OS";break;case 116:g.key=d?m.C0.ESC+"[15;"+(d+1)+"~":m.C0.ESC+"[15~";break;case 117:g.key=d?m.C0.ESC+"[17;"+(d+1)+"~":m.C0.ESC+"[17~";break;case 118:g.key=d?m.C0.ESC+"[18;"+(d+1)+"~":m.C0.ESC+"[18~";break;case 119:g.key=d?m.C0.ESC+"[19;"+(d+1)+"~":m.C0.ESC+"[19~";break;case 120:g.key=d?m.C0.ESC+"[20;"+(d+1)+"~":m.C0.ESC+"[20~";break;case 121:g.key=d?m.C0.ESC+"[21;"+(d+1)+"~":m.C0.ESC+"[21~";break;case 122:g.key=d?m.C0.ESC+"[23;"+(d+1)+"~":m.C0.ESC+"[23~";break;case 123:g.key=d?m.C0.ESC+"[24;"+(d+1)+"~":m.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(C&&!w||!l.altKey||l.metaKey)!C||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?g.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(g.key=m.C0.US),l.key==="@"&&(g.key=m.C0.NUL)):l.keyCode===65&&(g.type=1);else{const f=v[l.keyCode],r=f==null?void 0:f[l.shiftKey?1:0];if(r)g.key=m.C0.ESC+r;else if(l.keyCode>=65&&l.keyCode<=90){const u=l.ctrlKey?l.keyCode-64:l.keyCode+32;let S=String.fromCharCode(u);l.shiftKey&&(S=S.toUpperCase()),g.key=m.C0.ESC+S}else if(l.keyCode===32)g.key=m.C0.ESC+(l.ctrlKey?m.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let u=l.code.slice(3,4);l.shiftKey||(u=u.toLowerCase()),g.key=m.C0.ESC+u,g.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?g.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?g.key=m.C0.NUL:l.keyCode>=51&&l.keyCode<=55?g.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?g.key=m.C0.DEL:l.keyCode===219?g.key=m.C0.ESC:l.keyCode===220?g.key=m.C0.FS:l.keyCode===221&&(g.key=m.C0.GS)}return g}},482:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(p){return p>65535?(p-=65536,String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):String.fromCharCode(p)},c.utf32ToString=function(p,m=0,v=p.length){let l="";for(let _=m;_<v;++_){let C=p[_];C>65535?(C-=65536,l+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):l+=String.fromCharCode(C)}return l},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(p,m){const v=p.length;if(!v)return 0;let l=0,_=0;if(this._interim){const C=p.charCodeAt(_++);56320<=C&&C<=57343?m[l++]=1024*(this._interim-55296)+C-56320+65536:(m[l++]=this._interim,m[l++]=C),this._interim=0}for(let C=_;C<v;++C){const w=p.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=v)return this._interim=w,l;const g=p.charCodeAt(C);56320<=g&&g<=57343?m[l++]=1024*(w-55296)+g-56320+65536:(m[l++]=w,m[l++]=g)}else w!==65279&&(m[l++]=w)}return l}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(p,m){const v=p.length;if(!v)return 0;let l,_,C,w,g=0,d=0,f=0;if(this.interim[0]){let S=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let E,R=0;for(;(E=63&this.interim[++R])&&R<4;)A<<=6,A|=E;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=y-R;for(;f<D;){if(f>=v)return 0;if(E=p[f++],(192&E)!=128){f--,S=!0;break}this.interim[R++]=E,A<<=6,A|=63&E}S||(y===2?A<128?f--:m[g++]=A:y===3?A<2048||A>=55296&&A<=57343||A===65279||(m[g++]=A):A<65536||A>1114111||(m[g++]=A)),this.interim.fill(0)}const r=v-4;let u=f;for(;u<v;){for(;!(!(u<r)||128&(l=p[u])||128&(_=p[u+1])||128&(C=p[u+2])||128&(w=p[u+3]));)m[g++]=l,m[g++]=_,m[g++]=C,m[g++]=w,u+=4;if(l=p[u++],l<128)m[g++]=l;else if((224&l)==192){if(u>=v)return this.interim[0]=l,g;if(_=p[u++],(192&_)!=128){u--;continue}if(d=(31&l)<<6|63&_,d<128){u--;continue}m[g++]=d}else if((240&l)==224){if(u>=v)return this.interim[0]=l,g;if(_=p[u++],(192&_)!=128){u--;continue}if(u>=v)return this.interim[0]=l,this.interim[1]=_,g;if(C=p[u++],(192&C)!=128){u--;continue}if(d=(15&l)<<12|(63&_)<<6|63&C,d<2048||d>=55296&&d<=57343||d===65279)continue;m[g++]=d}else if((248&l)==240){if(u>=v)return this.interim[0]=l,g;if(_=p[u++],(192&_)!=128){u--;continue}if(u>=v)return this.interim[0]=l,this.interim[1]=_,g;if(C=p[u++],(192&C)!=128){u--;continue}if(u>=v)return this.interim[0]=l,this.interim[1]=_,this.interim[2]=C,g;if(w=p[u++],(192&w)!=128){u--;continue}if(d=(7&l)<<18|(63&_)<<12|(63&C)<<6|63&w,d<65536||d>1114111)continue;m[g++]=d}}return g}}},225:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const m=p(1480),v=[[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]],l=[[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 _;c.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let C=0;C<v.length;++C)_.fill(0,v[C][0],v[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?_[C]:(function(w,g){let d,f=0,r=g.length-1;if(w<g[0][0]||w>g[r][1])return!1;for(;r>=f;)if(d=f+r>>1,w>g[d][1])f=d+1;else{if(!(w<g[d][0]))return!0;r=d-1}return!1})(C,l)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,w){let g=this.wcwidth(C),d=g===0&&w!==0;if(d){const f=m.UnicodeService.extractWidth(w);f===0?d=!1:f>g&&(g=f)}return m.UnicodeService.createPropertyValue(0,g,d)}}},5981:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const m=p(8460),v=p(844);class l extends v.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const d=this._callbacks.shift();d&&d()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w)}_innerWrite(C=0,w=!0){const g=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const d=this._writeBuffer[this._bufferOffset],f=this._action(d,w);if(f){const u=S=>Date.now()-g>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(g,S);return void f.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(u)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=d.length,Date.now()-g>=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()}}c.WriteBuffer=l},5941:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const p=/^([\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})$/,m=/^[\da-f]+$/;function v(l,_){const C=l.toString(16),w=C.length<2?"0"+C:C;switch(_){case 4:return C[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}c.parseColor=function(l){if(!l)return;let _=l.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const C=p.exec(_);if(C){const w=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/w*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/w*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),m.exec(_)&&[3,6,9,12].includes(_.length))){const C=_.length/3,w=[0,0,0];for(let g=0;g<3;++g){const d=parseInt(_.slice(C*g,C*g+C),16);w[g]=C===1?d<<4:C===2?d:C===3?d>>4:d>>8}return w}},c.toRgbString=function(l,_=16){const[C,w,g]=l;return`rgb:${v(C,_)}/${v(w,_)}/${v(g,_)}`}},5770:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const m=p(482),v=p(8742),l=p(5770),_=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,g){this._handlers[w]===void 0&&(this._handlers[w]=[]);const d=this._handlers[w];return d.push(g),{dispose:()=>{const f=d.indexOf(g);f!==-1&&d.splice(f,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,g){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(w,g,d){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(w,g,d);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(w,g,d))}unhook(w,g=!0){if(this._active.length){let d=!1,f=this._active.length-1,r=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,d=g,r=this._stack.fallThrough,this._stack.paused=!1),!r&&d===!1){for(;f>=0&&(d=this._active[f].unhook(w),d!==!0);f--)if(d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,d;f--}for(;f>=0;f--)if(d=this._active[f].unhook(!1),d instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,d}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const C=new v.Params;C.addParam(0),c.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1}put(w,g,d){this._hitLimit||(this._data+=(0,m.utf32ToString)(w,g,d),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let g=!1;if(this._hitLimit)g=!1;else if(w&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then((d=>(this._params=C,this._data="",this._hitLimit=!1,d)));return this._params=C,this._data="",this._hitLimit=!1,g}}},2015:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const m=p(844),v=p(8742),l=p(6242),_=p(6351);class C{constructor(f){this.table=new Uint8Array(f)}setDefault(f,r){this.table.fill(f<<4|r)}add(f,r,u,S){this.table[r<<8|f]=u<<4|S}addMany(f,r,u,S){for(let A=0;A<f.length;A++)this.table[r<<8|f[A]]=u<<4|S}}c.TransitionTable=C;const w=160;c.VT500_TRANSITION_TABLE=(function(){const d=new C(4095),f=Array.apply(null,Array(256)).map(((R,y)=>y)),r=(R,y)=>f.slice(R,y),u=r(32,127),S=r(0,24);S.push(25),S.push.apply(S,r(28,32));const A=r(0,14);let E;for(E in d.setDefault(1,0),d.addMany(u,0,2,0),A)d.addMany([24,26,153,154],E,3,0),d.addMany(r(128,144),E,3,0),d.addMany(r(144,152),E,3,0),d.add(156,E,0,0),d.add(27,E,11,1),d.add(157,E,4,8),d.addMany([152,158,159],E,0,7),d.add(155,E,11,3),d.add(144,E,11,9);return d.addMany(S,0,3,0),d.addMany(S,1,3,1),d.add(127,1,0,1),d.addMany(S,8,0,8),d.addMany(S,3,3,3),d.add(127,3,0,3),d.addMany(S,4,3,4),d.add(127,4,0,4),d.addMany(S,6,3,6),d.addMany(S,5,3,5),d.add(127,5,0,5),d.addMany(S,2,3,2),d.add(127,2,0,2),d.add(93,1,4,8),d.addMany(u,8,5,8),d.add(127,8,5,8),d.addMany([156,27,24,26,7],8,6,0),d.addMany(r(28,32),8,0,8),d.addMany([88,94,95],1,0,7),d.addMany(u,7,0,7),d.addMany(S,7,0,7),d.add(156,7,0,0),d.add(127,7,0,7),d.add(91,1,11,3),d.addMany(r(64,127),3,7,0),d.addMany(r(48,60),3,8,4),d.addMany([60,61,62,63],3,9,4),d.addMany(r(48,60),4,8,4),d.addMany(r(64,127),4,7,0),d.addMany([60,61,62,63],4,0,6),d.addMany(r(32,64),6,0,6),d.add(127,6,0,6),d.addMany(r(64,127),6,0,0),d.addMany(r(32,48),3,9,5),d.addMany(r(32,48),5,9,5),d.addMany(r(48,64),5,0,6),d.addMany(r(64,127),5,7,0),d.addMany(r(32,48),4,9,5),d.addMany(r(32,48),1,9,2),d.addMany(r(32,48),2,9,2),d.addMany(r(48,127),2,10,0),d.addMany(r(48,80),1,10,0),d.addMany(r(81,88),1,10,0),d.addMany([89,90,92],1,10,0),d.addMany(r(96,127),1,10,0),d.add(80,1,11,9),d.addMany(S,9,0,9),d.add(127,9,0,9),d.addMany(r(28,32),9,0,9),d.addMany(r(32,48),9,9,12),d.addMany(r(48,60),9,8,10),d.addMany([60,61,62,63],9,9,10),d.addMany(S,11,0,11),d.addMany(r(32,128),11,0,11),d.addMany(r(28,32),11,0,11),d.addMany(S,10,0,10),d.add(127,10,0,10),d.addMany(r(28,32),10,0,10),d.addMany(r(48,60),10,8,10),d.addMany([60,61,62,63],10,0,11),d.addMany(r(32,48),10,9,12),d.addMany(S,12,0,12),d.add(127,12,0,12),d.addMany(r(28,32),12,0,12),d.addMany(r(32,48),12,9,12),d.addMany(r(48,64),12,0,11),d.addMany(r(64,127),12,12,13),d.addMany(r(64,127),10,12,13),d.addMany(r(64,127),9,12,13),d.addMany(S,13,13,13),d.addMany(u,13,13,13),d.add(127,13,0,13),d.addMany([27,156,24,26],13,14,0),d.add(w,0,2,0),d.add(w,8,5,8),d.add(w,6,0,6),d.add(w,11,0,11),d.add(w,13,13,13),d})();class g extends m.Disposable{constructor(f=c.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,u,S)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,u)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,m.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(f,r=[64,126]){let u=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(u=f.prefix.charCodeAt(0),u&&60>u||u>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let A=0;A<f.intermediates.length;++A){const E=f.intermediates.charCodeAt(A);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");u<<=8,u|=E}}if(f.final.length!==1)throw new Error("final must be a single byte");const S=f.final.charCodeAt(0);if(r[0]>S||S>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return u<<=8,u|=S,u}identToString(f){const r=[];for(;f;)r.push(String.fromCharCode(255&f)),f>>=8;return r.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,r){const u=this._identifier(f,[48,126]);this._escHandlers[u]===void 0&&(this._escHandlers[u]=[]);const S=this._escHandlers[u];return S.push(r),{dispose:()=>{const A=S.indexOf(r);A!==-1&&S.splice(A,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,r){this._executeHandlers[f.charCodeAt(0)]=r}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,r){const u=this._identifier(f);this._csiHandlers[u]===void 0&&(this._csiHandlers[u]=[]);const S=this._csiHandlers[u];return S.push(r),{dispose:()=>{const A=S.indexOf(r);A!==-1&&S.splice(A,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,r){return this._dcsParser.registerHandler(this._identifier(f),r)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,r){return this._oscParser.registerHandler(f,r)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(f,r,u,S,A){this._parseStack.state=f,this._parseStack.handlers=r,this._parseStack.handlerPos=u,this._parseStack.transition=S,this._parseStack.chunkPos=A}parse(f,r,u){let S,A=0,E=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(u===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(u===!1&&D>-1){for(;D>=0&&(S=y[D](this._params),S!==!0);D--)if(S instanceof Promise)return this._parseStack.handlerPos=D,S}this._parseStack.handlers=[];break;case 4:if(u===!1&&D>-1){for(;D>=0&&(S=y[D](),S!==!0);D--)if(S instanceof Promise)return this._parseStack.handlerPos=D,S}this._parseStack.handlers=[];break;case 6:if(A=f[this._parseStack.chunkPos],S=this._dcsParser.unhook(A!==24&&A!==26,u),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=f[this._parseStack.chunkPos],S=this._oscParser.end(A!==24&&A!==26,u),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=R;y<r;++y){switch(A=f[y],E=this._transitions.table[this.currentState<<8|(A<160?A:w)],E>>4){case 2:for(let z=y+1;;++z){if(z>=r||(A=f[z])<32||A>126&&A<w){this._printHandler(f,y,z),y=z-1;break}if(++z>=r||(A=f[z])<32||A>126&&A<w){this._printHandler(f,y,z),y=z-1;break}if(++z>=r||(A=f[z])<32||A>126&&A<w){this._printHandler(f,y,z),y=z-1;break}if(++z>=r||(A=f[z])<32||A>126&&A<w){this._printHandler(f,y,z),y=z-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const D=this._csiHandlers[this._collect<<8|A];let I=D?D.length-1:-1;for(;I>=0&&(S=D[I](this._params),S!==!0);I--)if(S instanceof Promise)return this._preserveStack(3,D,I,E,y),S;I<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++y<r&&(A=f[y])>47&&A<60);y--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const P=this._escHandlers[this._collect<<8|A];let $=P?P.length-1:-1;for(;$>=0&&(S=P[$](),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(4,P,$,E,y),S;$<0&&this._escHandlerFb(this._collect<<8|A),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|A,this._params);break;case 13:for(let z=y+1;;++z)if(z>=r||(A=f[z])===24||A===26||A===27||A>127&&A<w){this._dcsParser.put(f,y,z),y=z-1;break}break;case 14:if(S=this._dcsParser.unhook(A!==24&&A!==26),S)return this._preserveStack(6,[],0,E,y),S;A===27&&(E|=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 z=y+1;;z++)if(z>=r||(A=f[z])<32||A>127&&A<w){this._oscParser.put(f,y,z),y=z-1;break}break;case 6:if(S=this._oscParser.end(A!==24&&A!==26),S)return this._preserveStack(5,[],0,E,y),S;A===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&E}}}c.EscapeSequenceParser=g},6242:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const m=p(5770),v=p(482),l=[];c.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,C){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(C),{dispose:()=>{const g=w.indexOf(C);g!==-1&&w.splice(g,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,C,w){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(_,C,w);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(_,C,w))}start(){this.reset(),this._state=1}put(_,C,w){if(this._state!==3){if(this._state===1)for(;C<w;){const g=_[C++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&w-C>0&&this._put(_,C,w)}}end(_,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,g=this._active.length-1,d=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,w=C,d=this._stack.fallThrough,this._stack.paused=!1),!d&&w===!1){for(;g>=0&&(w=this._active[g].end(_),w!==!0);g--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,w;g--}for(;g>=0;g--)if(w=this._active[g].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=l,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,C,w){this._hitLimit||(this._data+=(0,v.utf32ToString)(_,C,w),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let C=!1;if(this._hitLimit)C=!1;else if(_&&(C=this._handler(this._data),C instanceof Promise))return C.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,C}}},8742:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const p=2147483647;class m{static fromArray(l){const _=new m;if(!l.length)return _;for(let C=Array.isArray(l[0])?1:0;C<l.length;++C){const w=l[C];if(Array.isArray(w))for(let g=0;g<w.length;++g)_.addSubParam(w[g]);else _.addParam(w)}return _}constructor(l=32,_=32){if(this.maxLength=l,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new m(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let _=0;_<this.length;++_){l.push(this.params[_]);const C=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-C>0&&l.push(Array.prototype.slice.call(this._subParams,C,w))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>p?p:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>p?p:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const _=this._subParamsIdx[l]>>8,C=255&this._subParamsIdx[l];return C-_>0?this._subParams.subarray(_,C):null}getSubParamsAll(){const l={};for(let _=0;_<this.length;++_){const C=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-C>0&&(l[_]=this._subParams.slice(C,w))}return l}addDigit(l){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,w=C[_-1];C[_-1]=~w?Math.min(10*w+l,p):l}}c.Params=m},5741:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let p=this._addons.length-1;p>=0;p--)this._addons[p].instance.dispose()}loadAddon(p,m){const v={instance:m,dispose:m.dispose,isDisposed:!1};this._addons.push(v),m.dispose=()=>this._wrappedAddonDispose(v),m.activate(p)}_wrappedAddonDispose(p){if(p.isDisposed)return;let m=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===p){m=v;break}if(m===-1)throw new Error("Could not dispose an addon that has not been loaded");p.isDisposed=!0,p.dispose.apply(p.instance),this._addons.splice(m,1)}}},8771:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const m=p(3785),v=p(511);c.BufferApiView=class{constructor(l,_){this._buffer=l,this.type=_}init(l){return this._buffer=l,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(l){const _=this._buffer.lines.get(l);if(_)return new m.BufferLineApiView(_)}getNullCell(){return new v.CellData}}},3785:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const m=p(511);c.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,l){if(!(v<0||v>=this._line.length))return l?(this._line.loadCell(v,l),l):this._line.loadCell(v,new m.CellData)}translateToString(v,l,_){return this._line.translateToString(v,l,_)}}},8285:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const m=p(8771),v=p(8460),l=p(844);class _ extends l.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.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)}}c.BufferNamespaceApi=_},7975:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(p){this._core=p}registerCsiHandler(p,m){return this._core.registerCsiHandler(p,(v=>m(v.toArray())))}addCsiHandler(p,m){return this.registerCsiHandler(p,m)}registerDcsHandler(p,m){return this._core.registerDcsHandler(p,((v,l)=>m(v,l.toArray())))}addDcsHandler(p,m){return this.registerDcsHandler(p,m)}registerEscHandler(p,m){return this._core.registerEscHandler(p,m)}addEscHandler(p,m){return this.registerEscHandler(p,m)}registerOscHandler(p,m){return this._core.registerOscHandler(p,m)}addOscHandler(p,m){return this.registerOscHandler(p,m)}}},7090:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(p){this._core=p}register(p){this._core.unicodeService.register(p)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(p){this._core.unicodeService.activeVersion=p}}},744:function(H,c,p){var m=this&&this.__decorate||function(d,f,r,u){var S,A=arguments.length,E=A<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,r):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(d,f,r,u);else for(var R=d.length-1;R>=0;R--)(S=d[R])&&(E=(A<3?S(E):A>3?S(f,r,E):S(f,r))||E);return A>3&&E&&Object.defineProperty(f,r,E),E},v=this&&this.__param||function(d,f){return function(r,u){f(r,u,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const l=p(8460),_=p(844),C=p(5295),w=p(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let g=c.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(d){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(d.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(d.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(d,this))}resize(d,f){this.cols=d,this.rows=f,this.buffers.resize(d,f),this._onResize.fire({cols:d,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(d,f=!1){const r=this.buffer;let u;u=this._cachedBlankLine,u&&u.length===this.cols&&u.getFg(0)===d.fg&&u.getBg(0)===d.bg||(u=r.getBlankLine(d,f),this._cachedBlankLine=u),u.isWrapped=f;const S=r.ybase+r.scrollTop,A=r.ybase+r.scrollBottom;if(r.scrollTop===0){const E=r.lines.isFull;A===r.lines.length-1?E?r.lines.recycle().copyFrom(u):r.lines.push(u.clone()):r.lines.splice(A+1,0,u.clone()),E?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{const E=A-S+1;r.lines.shiftElements(S+1,E-1,-1),r.lines.set(A,u.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(d,f,r){const u=this.buffer;if(d<0){if(u.ydisp===0)return;this.isUserScrolling=!0}else d+u.ydisp>=u.ybase&&(this.isUserScrolling=!1);const S=u.ydisp;u.ydisp=Math.max(Math.min(u.ydisp+d,u.ybase),0),S!==u.ydisp&&(f||this._onScroll.fire(u.ydisp))}};c.BufferService=g=m([v(0,w.IOptionsService)],g)},7994:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(p){this.glevel=p,this.charset=this._charsets[p]}setgCharset(p,m){this._charsets[p]=m,this.glevel===p&&(this.charset=m)}}},1753:function(H,c,p){var m=this&&this.__decorate||function(u,S,A,E){var R,y=arguments.length,D=y<3?S:E===null?E=Object.getOwnPropertyDescriptor(S,A):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,S,A,E);else for(var I=u.length-1;I>=0;I--)(R=u[I])&&(D=(y<3?R(D):y>3?R(S,A,D):R(S,A))||D);return y>3&&D&&Object.defineProperty(S,A,D),D},v=this&&this.__param||function(u,S){return function(A,E){S(A,E,u)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const l=p(2585),_=p(8460),C=p(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:u=>u.button!==4&&u.action===1&&(u.ctrl=!1,u.alt=!1,u.shift=!1,!0)},VT200:{events:19,restrict:u=>u.action!==32},DRAG:{events:23,restrict:u=>u.action!==32||u.button!==3},ANY:{events:31,restrict:u=>!0}};function g(u,S){let A=(u.ctrl?16:0)|(u.shift?4:0)|(u.alt?8:0);return u.button===4?(A|=64,A|=u.action):(A|=3&u.button,4&u.button&&(A|=64),8&u.button&&(A|=128),u.action===32?A|=32:u.action!==0||S||(A|=3)),A}const d=String.fromCharCode,f={DEFAULT:u=>{const S=[g(u,!1)+32,u.col+32,u.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${d(S[0])}${d(S[1])}${d(S[2])}`},SGR:u=>{const S=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${g(u,!0)};${u.col};${u.row}${S}`},SGR_PIXELS:u=>{const S=u.action===0&&u.button!==4?"m":"M";return`\x1B[<${g(u,!0)};${u.x};${u.y}${S}`}};let r=c.CoreMouseService=class extends C.Disposable{constructor(u,S){super(),this._bufferService=u,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const A of Object.keys(w))this.addProtocol(A,w[A]);for(const A of Object.keys(f))this.addEncoding(A,f[A]);this.reset()}addProtocol(u,S){this._protocols[u]=S}addEncoding(u,S){this._encodings[u]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(u){if(!this._protocols[u])throw new Error(`unknown protocol "${u}"`);this._activeProtocol=u,this._onProtocolChange.fire(this._protocols[u].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(u){if(!this._encodings[u])throw new Error(`unknown encoding "${u}"`);this._activeEncoding=u}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(u){if(u.col<0||u.col>=this._bufferService.cols||u.row<0||u.row>=this._bufferService.rows||u.button===4&&u.action===32||u.button===3&&u.action!==32||u.button!==4&&(u.action===2||u.action===3)||(u.col++,u.row++,u.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,u,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(u))return!1;const S=this._encodings[this._activeEncoding](u);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=u,!0}explainEvents(u){return{down:!!(1&u),up:!!(2&u),drag:!!(4&u),move:!!(8&u),wheel:!!(16&u)}}_equalEvents(u,S,A){if(A){if(u.x!==S.x||u.y!==S.y)return!1}else if(u.col!==S.col||u.row!==S.row)return!1;return u.button===S.button&&u.action===S.action&&u.ctrl===S.ctrl&&u.alt===S.alt&&u.shift===S.shift}};c.CoreMouseService=r=m([v(0,l.IBufferService),v(1,l.ICoreService)],r)},6975:function(H,c,p){var m=this&&this.__decorate||function(r,u,S,A){var E,R=arguments.length,y=R<3?u:A===null?A=Object.getOwnPropertyDescriptor(u,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(r,u,S,A);else for(var D=r.length-1;D>=0;D--)(E=r[D])&&(y=(R<3?E(y):R>3?E(u,S,y):E(u,S))||y);return R>3&&y&&Object.defineProperty(u,S,y),y},v=this&&this.__param||function(r,u){return function(S,A){u(S,A,r)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const l=p(1439),_=p(8460),C=p(844),w=p(2585),g=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=c.CoreService=class extends C.Disposable{constructor(r,u,S){super(),this._bufferService=r,this._logService=u,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(d)}reset(){this.modes=(0,l.clone)(g),this.decPrivateModes=(0,l.clone)(d)}triggerDataEvent(r,u=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;u&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),u&&this._onUserInput.fire(),this._logService.debug(`sending data "${r}"`,(()=>r.split("").map((A=>A.charCodeAt(0))))),this._onData.fire(r)}triggerBinaryEvent(r){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${r}"`,(()=>r.split("").map((u=>u.charCodeAt(0))))),this._onBinary.fire(r))}};c.CoreService=f=m([v(0,w.IBufferService),v(1,w.ILogService),v(2,w.IOptionsService)],f)},9074:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const m=p(8055),v=p(8460),l=p(844),_=p(6106);let C=0,w=0;class g extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((r=>r==null?void 0:r.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(r){if(r.marker.isDisposed)return;const u=new d(r);if(u){const S=u.marker.onDispose((()=>u.dispose()));u.onDispose((()=>{u&&(this._decorations.delete(u)&&this._onDecorationRemoved.fire(u),S.dispose())})),this._decorations.insert(u),this._onDecorationRegistered.fire(u)}return u}reset(){for(const r of this._decorations.values())r.dispose();this._decorations.clear()}*getDecorationsAtCell(r,u,S){let A=0,E=0;for(const R of this._decorations.getKeyIterator(u))A=R.options.x??0,E=A+(R.options.width??1),r>=A&&r<E&&(!S||(R.options.layer??"bottom")===S)&&(yield R)}forEachDecorationAtCell(r,u,S,A){this._decorations.forEachByKey(u,(E=>{C=E.options.x??0,w=C+(E.options.width??1),r>=C&&r<w&&(!S||(E.options.layer??"bottom")===S)&&A(E)}))}}c.DecorationService=g;class d extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=m.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=m.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(r){super(),this.options=r,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=r.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const m=p(2585),v=p(8343);class l{constructor(...C){this._entries=new Map;for(const[w,g]of C)this.set(w,g)}set(C,w){const g=this._entries.get(C);return this._entries.set(C,w),g}forEach(C){for(const[w,g]of this._entries.entries())C(w,g)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}c.ServiceCollection=l,c.InstantiationService=class{constructor(){this._services=new l,this._services.set(m.IInstantiationService,this)}setService(_,C){this._services.set(_,C)}getService(_){return this._services.get(_)}createInstance(_,...C){const w=(0,v.getServiceDependencies)(_).sort(((f,r)=>f.index-r.index)),g=[];for(const f of w){const r=this._services.get(f.id);if(!r)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${f.id}.`);g.push(r)}const d=w.length>0?w[0].index:C.length;if(C.length!==d)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${d+1} conflicts with ${C.length} static arguments`);return new _(...C,...g)}}},7866:function(H,c,p){var m=this&&this.__decorate||function(d,f,r,u){var S,A=arguments.length,E=A<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,r):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(d,f,r,u);else for(var R=d.length-1;R>=0;R--)(S=d[R])&&(E=(A<3?S(E):A>3?S(f,r,E):S(f,r))||E);return A>3&&E&&Object.defineProperty(f,r,E),E},v=this&&this.__param||function(d,f){return function(r,u){f(r,u,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const l=p(844),_=p(2585),C={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,g=c.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(d){super(),this._optionsService=d,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(d){for(let f=0;f<d.length;f++)typeof d[f]=="function"&&(d[f]=d[f]())}_log(d,f,r){this._evalLazyOptionalParams(r),d.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...r)}trace(d,...f){var r;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,d,f)}debug(d,...f){var r;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,d,f)}info(d,...f){var r;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,d,f)}warn(d,...f){var r;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,d,f)}error(d,...f){var r;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,d,f)}};c.LogService=g=m([v(0,_.IOptionsService)],g),c.setTraceLogger=function(d){w=d},c.traceCall=function(d,f,r){if(typeof r.value!="function")throw new Error("not supported");const u=r.value;r.value=function(...S){if(w.logLevel!==_.LogLevelEnum.TRACE)return u.apply(this,S);w.trace(`GlyphRenderer#${u.name}(${S.map((E=>JSON.stringify(E))).join(", ")})`);const A=u.apply(this,S);return w.trace(`GlyphRenderer#${u.name} return`,A),A}}},7302:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const m=p(8460),v=p(844),l=p(6114);c.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:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends v.Disposable{constructor(g){super(),this._onOptionChange=this.register(new m.EventEmitter),this.onOptionChange=this._onOptionChange.event;const d={...c.DEFAULT_OPTIONS};for(const f in g)if(f in d)try{const r=g[f];d[f]=this._sanitizeAndValidateOption(f,r)}catch(r){console.error(r)}this.rawOptions=d,this.options={...d},this._setupOptions(),this.register((0,v.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(g,d){return this.onOptionChange((f=>{f===g&&d(this.rawOptions[g])}))}onMultipleOptionChange(g,d){return this.onOptionChange((f=>{g.indexOf(f)!==-1&&d()}))}_setupOptions(){const g=f=>{if(!(f in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},d=(f,r)=>{if(!(f in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);r=this._sanitizeAndValidateOption(f,r),this.rawOptions[f]!==r&&(this.rawOptions[f]=r,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const r={get:g.bind(this,f),set:d.bind(this,f)};Object.defineProperty(this.options,f,r)}}_sanitizeAndValidateOption(g,d){switch(g){case"cursorStyle":if(d||(d=c.DEFAULT_OPTIONS[g]),!(function(f){return f==="block"||f==="underline"||f==="bar"})(d))throw new Error(`"${d}" is not a valid value for ${g}`);break;case"wordSeparator":d||(d=c.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof d=="number"&&1<=d&&d<=1e3)break;d=_.includes(d)?d:c.DEFAULT_OPTIONS[g];break;case"cursorWidth":d=Math.floor(d);case"lineHeight":case"tabStopWidth":if(d<1)throw new Error(`${g} cannot be less than 1, value: ${d}`);break;case"minimumContrastRatio":d=Math.max(1,Math.min(21,Math.round(10*d)/10));break;case"scrollback":if((d=Math.min(d,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${d}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(d<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${d}`);break;case"rows":case"cols":if(!d&&d!==0)throw new Error(`${g} must be numeric, value: ${d}`);break;case"windowsPty":d=d??{}}return d}}c.OptionsService=C},2660:function(H,c,p){var m=this&&this.__decorate||function(C,w,g,d){var f,r=arguments.length,u=r<3?w:d===null?d=Object.getOwnPropertyDescriptor(w,g):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(C,w,g,d);else for(var S=C.length-1;S>=0;S--)(f=C[S])&&(u=(r<3?f(u):r>3?f(w,g,u):f(w,g))||u);return r>3&&u&&Object.defineProperty(w,g,u),u},v=this&&this.__param||function(C,w){return function(g,d){w(g,d,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const l=p(2585);let _=c.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const w=this._bufferService.buffer;if(C.id===void 0){const S=w.addMarker(w.ybase+w.y),A={data:C,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(A,S))),this._dataByLinkId.set(A.id,A),A.id}const g=C,d=this._getEntryIdKey(g),f=this._entriesWithId.get(d);if(f)return this.addLineToLink(f.id,w.ybase+w.y),f.id;const r=w.addMarker(w.ybase+w.y),u={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[r]};return r.onDispose((()=>this._removeMarkerFromLink(u,r))),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(C,w){const g=this._dataByLinkId.get(C);if(g&&g.lines.every((d=>d.line!==w))){const d=this._bufferService.buffer.addMarker(w);g.lines.push(d),d.onDispose((()=>this._removeMarkerFromLink(g,d)))}}getLinkData(C){var w;return(w=this._dataByLinkId.get(C))==null?void 0:w.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,w){const g=C.lines.indexOf(w);g!==-1&&(C.lines.splice(g,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};c.OscLinkService=_=m([v(0,l.IBufferService)],_)},8343:(H,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const p="di$target",m="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(v){return v[m]||[]},c.createDecorator=function(v){if(c.serviceRegistry.has(v))return c.serviceRegistry.get(v);const l=function(_,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,d,f){d[p]===d?d[m].push({id:g,index:f}):(d[m]=[{id:g,index:f}],d[p]=d)})(l,_,w)};return l.toString=()=>v,c.serviceRegistry.set(v,l),l}},2585:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const m=p(8343);var v;c.IBufferService=(0,m.createDecorator)("BufferService"),c.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),c.ICoreService=(0,m.createDecorator)("CoreService"),c.ICharsetService=(0,m.createDecorator)("CharsetService"),c.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(v||(c.LogLevelEnum=v={})),c.ILogService=(0,m.createDecorator)("LogService"),c.IOptionsService=(0,m.createDecorator)("OptionsService"),c.IOscLinkService=(0,m.createDecorator)("OscLinkService"),c.IUnicodeService=(0,m.createDecorator)("UnicodeService"),c.IDecorationService=(0,m.createDecorator)("DecorationService")},1480:(H,c,p)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const m=p(8460),v=p(225);class l{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,w,g=!1){return(16777215&C)<<3|(3&w)<<1|(g?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new m.EventEmitter,this.onChange=this._onChange.event;const C=new v.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let w=0,g=0;const d=C.length;for(let f=0;f<d;++f){let r=C.charCodeAt(f);if(55296<=r&&r<=56319){if(++f>=d)return w+this.wcwidth(r);const A=C.charCodeAt(f);56320<=A&&A<=57343?r=1024*(r-55296)+A-56320+65536:w+=this.wcwidth(A)}const u=this.charProperties(r,g);let S=l.extractWidth(u);l.extractShouldJoin(u)&&(S-=l.extractWidth(g)),w+=S,g=u}return w}charProperties(C,w){return this._activeProvider.charProperties(C,w)}}c.UnicodeService=l}},x={};function U(H){var c=x[H];if(c!==void 0)return c.exports;var p=x[H]={exports:{}};return M[H].call(p.exports,p,p.exports,U),p.exports}var K={};return(()=>{var H=K;Object.defineProperty(H,"__esModule",{value:!0}),H.Terminal=void 0;const c=U(9042),p=U(3236),m=U(844),v=U(5741),l=U(8285),_=U(7975),C=U(7090),w=["cols","rows"];class g extends m.Disposable{constructor(f){super(),this._core=this.register(new p.Terminal(f)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const r=S=>this._core.options[S],u=(S,A)=>{this._checkReadonlyOptions(S),this._core.options[S]=A};for(const S in this._core.options){const A={get:r.bind(this,S),set:u.bind(this,S)};Object.defineProperty(this._publicOptions,S,A)}}_checkReadonlyOptions(f){if(w.includes(f))throw new Error(`Option "${f}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let r="none";switch(this._core.coreMouseService.activeProtocol){case"X10":r="x10";break;case"VT200":r="vt200";break;case"DRAG":r="drag";break;case"ANY":r="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:r,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const r in f)this._publicOptions[r]=f[r]}blur(){this._core.blur()}focus(){this._core.focus()}input(f,r=!0){this._core.input(f,r)}resize(f,r){this._verifyIntegers(f,r),this._core.resize(f,r)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}attachCustomWheelEventHandler(f){this._core.attachCustomWheelEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){return this._checkProposedApi(),this._verifyPositiveIntegers(f.x??0,f.width??0,f.height??0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,r,u){this._verifyIntegers(f,r,u),this._core.select(f,r,u)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,r){this._verifyIntegers(f,r),this._core.selectLines(f,r)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,r){this._core.write(f,r)}writeln(f,r){this._core.write(f),this._core.write(`\r
444
+ `,r)}paste(f){this._core.paste(f)}refresh(f,r){this._verifyIntegers(f,r),this._core.refresh(f,r)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return c}_verifyIntegers(...f){for(const r of f)if(r===1/0||isNaN(r)||r%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const r of f)if(r&&(r===1/0||isNaN(r)||r%1!=0||r<0))throw new Error("This API only accepts positive integers")}}H.Terminal=g})(),K})()))})(gc)),gc.exports}var Y1=F1(),Sc={exports:{}},Gf;function K1(){return Gf||(Gf=1,(function(h,b){(function(M,x){h.exports=x()})(self,(()=>(()=>{var M={};return(()=>{var x=M;Object.defineProperty(x,"__esModule",{value:!0}),x.FitAddon=void 0,x.FitAddon=class{activate(U){this._terminal=U}dispose(){}fit(){const U=this.proposeDimensions();if(!U||!this._terminal||isNaN(U.cols)||isNaN(U.rows))return;const K=this._terminal._core;this._terminal.rows===U.rows&&this._terminal.cols===U.cols||(K._renderService.clear(),this._terminal.resize(U.cols,U.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const U=this._terminal._core,K=U._renderService.dimensions;if(K.css.cell.width===0||K.css.cell.height===0)return;const H=this._terminal.options.scrollback===0?0:U.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),p=parseInt(c.getPropertyValue("height")),m=Math.max(0,parseInt(c.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),l=p-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),_=m-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-H;return{cols:Math.max(2,Math.floor(_/K.css.cell.width)),rows:Math.max(1,Math.floor(l/K.css.cell.height))}}}})(),M})()))})(Sc)),Sc.exports}var G1=K1(),yc={exports:{}},Xf;function X1(){return Xf||(Xf=1,(function(h,b){(function(M,x){h.exports=x()})(self,(()=>(()=>{var M={6:(H,c)=>{function p(v){try{const l=new URL(v),_=l.password&&l.username?`${l.protocol}//${l.username}:${l.password}@${l.host}`:l.username?`${l.protocol}//${l.username}@${l.host}`:`${l.protocol}//${l.host}`;return v.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(c,"__esModule",{value:!0}),c.LinkComputer=c.WebLinkProvider=void 0,c.WebLinkProvider=class{constructor(v,l,_,C={}){this._terminal=v,this._regex=l,this._handler=_,this._options=C}provideLinks(v,l){const _=m.computeLink(v,this._regex,this._terminal,this._handler);l(this._addCallbacks(_))}_addCallbacks(v){return v.map((l=>(l.leave=this._options.leave,l.hover=(_,C)=>{if(this._options.hover){const{range:w}=l;this._options.hover(_,C,w)}},l)))}};class m{static computeLink(l,_,C,w){const g=new RegExp(_.source,(_.flags||"")+"g"),[d,f]=m._getWindowedLineStrings(l-1,C),r=d.join("");let u;const S=[];for(;u=g.exec(r);){const A=u[0];if(!p(A))continue;const[E,R]=m._mapStrIdx(C,f,0,u.index),[y,D]=m._mapStrIdx(C,E,R,A.length);if(E===-1||R===-1||y===-1||D===-1)continue;const I={start:{x:R+1,y:E+1},end:{x:D,y:y+1}};S.push({range:I,text:A,activate:w})}return S}static _getWindowedLineStrings(l,_){let C,w=l,g=l,d=0,f="";const r=[];if(C=_.buffer.active.getLine(l)){const u=C.translateToString(!0);if(C.isWrapped&&u[0]!==" "){for(d=0;(C=_.buffer.active.getLine(--w))&&d<2048&&(f=C.translateToString(!0),d+=f.length,r.push(f),C.isWrapped&&f.indexOf(" ")===-1););r.reverse()}for(r.push(u),d=0;(C=_.buffer.active.getLine(++g))&&C.isWrapped&&d<2048&&(f=C.translateToString(!0),d+=f.length,r.push(f),f.indexOf(" ")===-1););}return[r,w]}static _mapStrIdx(l,_,C,w){const g=l.buffer.active,d=g.getNullCell();let f=C;for(;w;){const r=g.getLine(_);if(!r)return[-1,-1];for(let u=f;u<r.length;++u){r.getCell(u,d);const S=d.getChars();if(d.getWidth()&&(w-=S.length||1,u===r.length-1&&S==="")){const A=g.getLine(_+1);A&&A.isWrapped&&(A.getCell(0,d),d.getWidth()===2&&(w+=1))}if(w<0)return[_,u]}_++,f=0}return[_,f]}}c.LinkComputer=m}},x={};function U(H){var c=x[H];if(c!==void 0)return c.exports;var p=x[H]={exports:{}};return M[H](p,p.exports,U),p.exports}var K={};return(()=>{var H=K;Object.defineProperty(H,"__esModule",{value:!0}),H.WebLinksAddon=void 0;const c=U(6),p=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function m(v,l){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}H.WebLinksAddon=class{constructor(v=m,l={}){this._handler=v,this._options=l}activate(v){this._terminal=v;const l=this._options,_=l.urlRegex||p;this._linkProvider=this._terminal.registerLinkProvider(new c.WebLinkProvider(this._terminal,_,this._handler,l))}dispose(){var v;(v=this._linkProvider)==null||v.dispose()}}})(),K})()))})(yc)),yc.exports}var V1=X1();function Z1(h,b){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal?session=${encodeURIComponent(h)}&token=${encodeURIComponent(b)}`}const Q1=15e3,J1=new Set([4001,4004]),eS='"Geist Mono", ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace';function Yr(h,b){return typeof document>"u"?b:getComputedStyle(document.documentElement).getPropertyValue(h).trim()||b}const tS={black:"#1a1a1e",red:"#f87171",green:"#4ade80",yellow:"#f59e0b",blue:"#3b82f6",magenta:"#9b8fc4",cyan:"#22d3ee",white:"#f3f3f5",brightBlack:"#404046",brightRed:"#ff9b96",brightGreen:"#86efac",brightYellow:"#ffd966",brightBlue:"#60a5fa",brightMagenta:"#c4b5fd",brightCyan:"#67e8f9",brightWhite:"#ffffff"},sS={black:"#3a3a3e",red:"#dc2626",green:"#16a34a",yellow:"#b45309",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#d4d4d8",brightBlack:"#6b6b75",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#f59e0b",brightBlue:"#3b82f6",brightMagenta:"#9b8fc4",brightCyan:"#22d3ee",brightWhite:"#ffffff"};function Vf(h){const b=Yr("--bg",h==="dark"?"#0c0c0e":"#fbfbfc"),M=Yr("--ink",h==="dark"?"#f3f3f5":"#16161a"),x=Yr("--brand",h==="dark"?"#6be195":"#167e3a");return{...h==="dark"?tS:sS,background:b,foreground:M,cursor:x,cursorAccent:b,selectionBackground:`${x}40`}}const iS=({sessionId:h,token:b})=>{const M=q.useRef(null),x=q.useRef(null),[U,K]=q.useState("connecting"),[H,c]=q.useState(null);q.useEffect(()=>Rc(m=>{x.current&&(x.current.options.theme=Vf(m))}),[]),q.useEffect(()=>{var S;const m=M.current;if(!m)return;let v=!1,l=0,_=null,C=null;const w=new Y1.Terminal({cursorBlink:!0,fontSize:13,fontFamily:Yr("--mono",eS),theme:Vf(Dc()),scrollback:1e4,allowProposedApi:!0});x.current=w;const g=new G1.FitAddon;w.loadAddon(g),w.loadAddon(new V1.WebLinksAddon),w.parser.registerCsiHandler({prefix:">",final:"q"},()=>(w.write("\x1BP>|XTerm(370)\x1B\\"),!0)),w.parser.registerOscHandler(52,A=>{var y;const E=A.split(";");if(E.length<2)return!1;const R=E[E.length-1];try{const D=atob(R),I=Uint8Array.from(D,$=>$.charCodeAt(0)),P=new TextDecoder().decode(I);(y=navigator.clipboard)==null||y.writeText(P).catch(()=>{})}catch{}return!0}),w.open(m),g.fit(),(S=document.fonts)==null||S.ready.then(()=>{v||(g.fit(),f())});const d=w.onData(A=>{(C==null?void 0:C.readyState)===WebSocket.OPEN&&C.send(A)}),f=()=>{(C==null?void 0:C.readyState)===WebSocket.OPEN&&C.send(JSON.stringify({type:"resize",cols:w.cols,rows:w.rows}))},r=new ResizeObserver(()=>{g.fit(),f()});r.observe(m);function u(){if(v)return;const A=new WebSocket(Z1(h,b));C=A,A.onopen=()=>{l=0,K("connected"),c(null),g.fit(),f()},A.onmessage=E=>{const R=typeof E.data=="string"?E.data:new TextDecoder().decode(E.data);w.write(R)},A.onclose=E=>{if(v)return;if(J1.has(E.code)){K("error"),c(E.reason||`Connection refused (${E.code})`);return}const R=Math.min(1e3*2**l,Q1);l+=1,K("connecting"),_=setTimeout(u,R)}}return u(),()=>{v=!0,_&&clearTimeout(_),r.disconnect(),d.dispose(),C==null||C.close(),w.dispose(),x.current=null}},[h,b]);const p=U==="connected"?"Connected":U==="error"?H??"Error":"Connecting…";return a.jsxs("div",{className:"harness-terminal",children:[a.jsxs("div",{className:"terminal-statusbar","data-status":U,children:[a.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),a.jsx("span",{className:"terminal-status-label",children:p})]}),a.jsx("div",{ref:M,className:"terminal-screen"})]})},nS=8e3;function aS({message:h,onDismiss:b}){return q.useEffect(()=>{const M=window.setTimeout(b,nS);return()=>window.clearTimeout(M)},[h,b]),a.jsxs("div",{className:"toast",role:"alert","data-testid":"toast",children:[a.jsx("span",{className:"toast-message",children:h}),a.jsx("button",{className:"toast-dismiss","aria-label":"Dismiss",onClick:b,children:"×"})]})}function rS(){const h=q.useRef(null);return q.useEffect(()=>{const b=h.current;if(!b)return;let M=null;const x=()=>{M=null,b.dataset.show="false",b.textContent=""},U=c=>{const p=c.closest("[data-tooltip], [title], [data-tip-stash]");if(!p||p===M)return;const m=p;m.title&&(m.dataset.tipStash=m.title,m.removeAttribute("title"));const v=m.dataset.tooltip||m.dataset.tipStash;if(!v)return;M=p,b.textContent=v,b.dataset.show="true";const l=p.getBoundingClientRect(),{offsetWidth:_,offsetHeight:C}=b,w=p.closest(".rail-workflows");if(w&&w.getBoundingClientRect().right+_+14<=window.innerWidth){const f=w.getBoundingClientRect().right+8,r=Math.min(Math.max(l.top+l.height/2-C/2,6),window.innerHeight-C-6);b.style.transform=`translate(${Math.round(f)}px, ${Math.round(r)}px)`;return}const g=Math.min(Math.max(l.left+l.width/2-_/2,6),window.innerWidth-_-6),d=l.top-C-7>=4?l.top-C-7:l.bottom+7;b.style.transform=`translate(${Math.round(g)}px, ${Math.round(d)}px)`},K=c=>U(c.target),H=c=>{M&&!M.contains(c.relatedTarget)&&x()};return document.addEventListener("pointerover",K,!0),document.addEventListener("pointerout",H,!0),document.addEventListener("pointerdown",x,!0),document.addEventListener("keydown",x,!0),document.addEventListener("scroll",x,!0),window.addEventListener("blur",x),()=>{document.removeEventListener("pointerover",K,!0),document.removeEventListener("pointerout",H,!0),document.removeEventListener("pointerdown",x,!0),document.removeEventListener("keydown",x,!0),document.removeEventListener("scroll",x,!0),window.removeEventListener("blur",x)}},[]),a.jsx("div",{ref:h,className:"app-tooltip","data-show":"false",role:"tooltip","aria-hidden":"true"})}const lS=[{id:"claude-code",label:"Claude Code",mode:"embedded",experimental:!1,installed:!0,installMcpPrompt:"",imageInput:!1},{id:"codex",label:"Codex CLI",mode:"embedded",experimental:!1,installed:!0,installMcpPrompt:"",imageInput:!1}];function oS(h){const b=h.filter(M=>M.id==="sapiom");return b.length===0?h:[...b,...h.filter(M=>M.id!=="sapiom")]}function Nc(h){return h.mode==="embedded"&&h.installed&&yp.includes(h.id)}function cS(h){if(Nc(h))return null;if(h.mode==="external")return`${h.label} runs in its own app. Studio can't launch it yet.`;if(!h.installed){const b=h.installMcpPrompt.trim();return b.length>0?b:`${h.label} isn't on this machine's PATH. Install its CLI, then restart the Studio server.`}return`This Studio build can't launch ${h.label} yet.`}function uS(h,b){var M;return((M=h.find(x=>x.id===b))==null?void 0:M.label)??b}function hS(h){const b=h.split("/").filter(Boolean);return b.length<=2?h:`/${b[0]}/…/${b[b.length-1]}`}function dS({value:h,onChange:b,onSubmit:M,recentDirs:x,listDir:U,onNewDirChange:K}){const[H,c]=q.useState(h),[p,m]=q.useState([]),[v,l]=q.useState(h),[_,C]=q.useState(!1),[w,g]=q.useState(null),[d,f]=q.useState(0),[r,u]=q.useState(!0),[S,A]=q.useState(!1),[E,R]=q.useState(0),y=q.useRef(null),[D,I]=q.useState("none"),P=()=>{const Y=y.current;if(!Y)return;const j=Y.scrollLeft>2,B=Y.scrollLeft+Y.clientWidth<Y.scrollWidth-2;I(j&&B?"both":j?"left":B?"right":"none")};q.useEffect(()=>{P()},[x]),q.useEffect(()=>{let Y=!1;C(!0),g(null),A(!1);const j=T=>{const O=T.replace(/\/+$/,""),Z=O.slice(0,O.lastIndexOf("/"));return!O.includes("/")||Z===O?null:Z||"/"},B=setTimeout(()=>{U(h||void 0).then(T=>{Y||(c(T.path),m(T.dirs),l(T.parent))}).catch(async()=>{const T=j(h);if(!T||Y){Y||g("Couldn't read that directory.");return}try{const O=await U(T);if(Y)return;c(O.path),m(O.dirs),l(O.parent),A(!0)}catch{Y||g("Couldn't read that directory.")}}).finally(()=>!Y&&C(!1))},150);return()=>{Y=!0,clearTimeout(B)}},[h,E]);const $=h.startsWith(H)?h.slice(H.length).replace(/^\//,""):"",z=$?p.filter(Y=>Y.name.toLowerCase().startsWith($.toLowerCase())):p,Q=Math.min(d,Math.max(z.length-1,0)),ne=!_&&!w&&z.length===0&&(S||$!=="");q.useEffect(()=>{K==null||K(ne)},[ne]);const F=Y=>b(Y),W=Y=>{var B;const j=r&&z.length>0;Y.key==="ArrowDown"&&j?(Y.preventDefault(),f(Math.min(Q+1,z.length-1))):Y.key==="ArrowUp"&&j?(Y.preventDefault(),f(Math.max(Q-1,0))):Y.key==="Enter"&&(j?(F(((B=z[Q])==null?void 0:B.path)??z[0].path),f(0)):M())};return a.jsxs("div",{className:"dir-picker",children:[a.jsxs("div",{className:"dir-picker-inputrow",children:[a.jsx("button",{type:"button",className:"dir-picker-up","data-testid":"dir-picker-up",disabled:v===H,onClick:()=>F(v),"aria-label":"Up to parent directory","data-tooltip":"Up to parent directory",children:a.jsx(Se,{name:"CornerLeftUp",size:14})}),a.jsx("input",{id:"new-session-cwd",autoFocus:!0,"aria-label":"Project directory",className:"modal-input dir-picker-input","data-testid":"dir-picker-input",value:h,placeholder:"/path/to/project",onChange:Y=>b(Y.target.value),onKeyDown:W}),a.jsx("button",{type:"button",className:"dir-picker-up dir-picker-browse"+(r?" is-active":""),"data-testid":"dir-picker-browse","aria-pressed":r,onClick:()=>{if(!r){u(!0);return}ne&&H&&H!==h?F(H):u(!1)},"aria-label":"Browse subdirectories","data-tooltip":r?ne?"Browse the nearest existing folder":"Hide the directory listing":"Browse subdirectories",children:a.jsx(Se,{name:"Folder",size:14})})]}),x.length>0&&a.jsx("div",{className:"recent-dirs",ref:y,"data-fade":D,onScroll:P,children:x.map(Y=>a.jsx("button",{type:"button",className:"recent-dir-chip",title:Y,onClick:()=>F(Y),children:hS(Y)},Y))}),r&&a.jsxs("div",{className:"dir-picker-listing","data-testid":"dir-picker-listing",children:[a.jsx("div",{className:"dir-picker-path",children:H}),_&&a.jsx("div",{className:"dir-picker-empty",children:"Loading…"}),!_&&w&&a.jsxs("div",{className:"dir-picker-error","data-testid":"dir-picker-error",role:"alert",children:[a.jsx(Se,{name:"TriangleAlert",size:14}),a.jsx("span",{children:w}),a.jsx("button",{type:"button",className:"btn-ghost dir-picker-retry","data-testid":"dir-picker-retry",onClick:()=>R(Y=>Y+1),children:"Retry"})]}),ne&&a.jsx("div",{className:"dir-picker-newdir","data-testid":"dir-picker-newdir",children:"New folder. It will be created when you start."}),!_&&!w&&!ne&&z.length===0&&a.jsx("div",{className:"dir-picker-empty",children:"No subdirectories"}),!_&&!w&&z.map((Y,j)=>a.jsxs("button",{type:"button",className:"dir-picker-item"+(j===Q?" is-selected":""),"data-testid":`dir-picker-item-${Y.name}`,onMouseEnter:()=>f(j),onClick:()=>F(Y.path),children:[a.jsx(Se,{name:"Folder",size:13}),Y.name]},Y.path))]})]})}function fS({entries:h,activeId:b,testidPrefix:M,onPick:x}){return a.jsx(a.Fragment,{children:h.map(U=>{const K=Nc(U),H=U.id===b,c=cS(U);return a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":H,"aria-disabled":!K||void 0,className:"profile-menu-item provider-item"+(K?"":" is-unavailable"),"data-testid":`${M}-${U.id}`,"data-tooltip":c??void 0,onClick:()=>{K&&x(U.id)},children:[a.jsx("span",{className:"provider-item-check","aria-hidden":"true",children:H&&a.jsx(Se,{name:"Check",size:13})}),a.jsx(On,{kind:U.id,size:13}),U.label]},U.id)})})}function pS({entries:h}){const[b,M]=q.useState(null),x=q.useRef(null);q.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const U=h.filter(H=>H.installMcpPrompt.trim().length>0);if(U.length===0)return null;const K=H=>{var c;(c=navigator.clipboard)==null||c.writeText(H.installMcpPrompt).then(()=>{Nn("mcp.install",{harness:H.id}),M(H.id),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>M(null),1600)}).catch(()=>{})};return a.jsxs("div",{className:"mcp-install","data-testid":"mcp-install",children:[a.jsx("div",{className:"mcp-install-title",children:"Project not on Sapiom yet?"}),a.jsx("p",{className:"mcp-install-hint",children:"Copy the setup prompt for your agent and paste it into a session there. It configures the Sapiom MCP server so the agent can build workflows."}),a.jsx("div",{className:"mcp-install-actions",children:U.map(H=>a.jsxs("button",{type:"button",className:"btn-ghost mcp-install-copy","data-testid":`mcp-install-copy-${H.id}`,onClick:()=>K(H),children:[yp.includes(H.id)&&a.jsx(On,{kind:H.id,size:13}),b===H.id?"Copied":`Copy for ${H.label}`]},H.id))})]})}function wp({recentDirs:h,launchDir:b,listDir:M,onClose:x,onCreate:U,listHarnesses:K,triggerRef:H,mode:c="session",onConnect:p,onScaffold:m,onScan:v,onBrowseTemplates:l}){const _=c==="workspace",[C,w]=q.useState(b??h[0]??""),[g,d]=q.useState(()=>Ti().preferredHarness??"claude-code"),[f,r]=q.useState(lS),[u,S]=q.useState(!1),[A,E]=q.useState(null),[R,y]=q.useState(!1),[D,I]=q.useState(!1),P=q.useCallback(()=>I(!1),[]),$=q.useRef(null),z=q.useRef(null);Zr(!D,{onDismiss:x,containerRef:z,triggerRef:H}),q.useEffect(()=>{if(!K)return;let W=!1;return K().then(Y=>{if(W||Y.length===0)return;r(oS(Y));const j=Y.filter(Nc);d(B=>{var T;return j.some(O=>O.id===B)?B:((T=j[0])==null?void 0:T.id)??B})}).catch(()=>{}),()=>{W=!0}},[K]);const Q=async()=>{const W=C.trim();if(W){S(!0),E(null);try{_&&p?await p(W):await U(W,g),x()}catch(Y){E(Y.message)}finally{S(!1)}}},ne=async()=>{const W=C.trim();if(!(!W||!m)){S(!0),E(null);try{await m(W,g),x()}catch(Y){E(Y.message)}finally{S(!1)}}},F=async()=>{const W=C.trim();if(!(!W||!v)){S(!0),E(null);try{await v(W)>0&&x()}catch(Y){E(Y.message)}finally{S(!1)}}};return a.jsx("div",{className:"modal-backdrop",children:a.jsxs("div",{className:"modal "+(_?"modal-add-workspace":"modal-new-session"),role:"dialog","aria-label":_?"Add project":"New session",ref:z,children:[a.jsxs("div",{className:"modal-header",children:[_?"Add project":"New session",a.jsx("button",{className:"theme-toggle modal-close","aria-label":"Close",title:"Close",onClick:x,disabled:u,children:a.jsx(Se,{name:"X",size:14})})]}),a.jsxs("div",{className:"modal-body",children:[a.jsx("section",{className:"modal-section",children:a.jsx(dS,{value:C,onChange:w,onSubmit:()=>void Q(),recentDirs:h,listDir:M,onNewDirChange:y})}),a.jsx("p",{className:"modal-field-hint",children:_?R?"This folder doesn't exist yet. Add an existing agent project instead, or scaffold a new one here:":"Pick a folder that already contains an agent project (sapiom.json); its workflow joins the rail.":"Pick the project directory the agent runs in; the session is named after the folder."}),_&&R&&m&&a.jsxs("button",{type:"button",className:"btn-ghost modal-scaffold-cta","data-testid":"modal-scaffold-cta",disabled:u||!C.trim(),onClick:()=>void ne(),children:[a.jsx(Se,{name:"Sparkles",size:13}),u?"Starting…":"Start a session here and scaffold an agent"]}),_&&l&&a.jsxs("button",{type:"button",className:"btn-ghost modal-templates-cta","data-testid":"modal-browse-templates",disabled:u,onClick:l,children:[a.jsx(Se,{name:"LayoutTemplate",size:13}),"Start from a template"]}),_&&a.jsx(pS,{entries:f}),A&&a.jsx("div",{className:"modal-error",children:A})]}),a.jsxs("div",{className:"modal-actions",children:[!_&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:$,type:"button",className:"harness-select","data-testid":"harness-select","aria-haspopup":"menu","aria-expanded":D,"aria-label":"Agent for this session","data-tooltip":"Which coding agent runs this session",disabled:u,onClick:()=>I(W=>!W),children:[a.jsx(On,{kind:g,size:14}),a.jsx("span",{className:"harness-select-label",children:uS(f,g)}),a.jsx("span",{className:"disclosure-caret"+(D?" is-open":""),"aria-hidden":"true",children:a.jsx(Se,{name:"ChevronDown",size:12})})]}),a.jsx(Xi,{open:D,anchorRef:$,onDismiss:P,placement:"up-start",className:"session-menu harness-select-menu",role:"menu",testid:"harness-select-menu",children:a.jsx(fS,{entries:f,activeId:g,testidPrefix:"harness-option",onPick:W=>{d(W),P()}})})]}),_&&v&&a.jsxs("button",{type:"button",className:"btn-ghost modal-scan-btn","data-testid":"modal-scan-btn",disabled:u||!C.trim()||R,title:"Find every agent project (sapiom.json) under this folder and add them all",onClick:()=>void F(),children:[a.jsx(Se,{name:"Search",size:13}),u?"Scanning…":"Scan folder for agents"]}),a.jsx("button",{className:"btn-ghost",onClick:x,disabled:u,children:"Cancel"}),a.jsx("button",{className:"btn-primary modal-primary-cta",onClick:()=>void Q(),disabled:u||!C.trim()||_&&R,children:_?u?"Adding…":"Add project":u?"Starting…":"Start session"})]})]})})}const mS="/welcome-hero-dark.png",_S="/welcome-hero-light.png";function vS({recentDirs:h,launchDir:b,listDir:M,onCreateSession:x,listHarnesses:U,onRunSample:K,onUseTemplate:H}){const[c,p]=q.useState(!1),[m,v]=q.useState(!1),[l,_]=q.useState(!1),[C,w]=q.useState(null),g=q.useRef(null),d=q.useRef(null),f=async()=>{_(!0),w(null);try{await K()}catch(r){w(r.message),_(!1)}};return a.jsxs("div",{className:"welcome-panel","data-testid":"welcome-panel",children:[a.jsxs("div",{className:"welcome-card",children:[a.jsxs("div",{className:"welcome-hero","aria-hidden":"true",children:[a.jsx("img",{className:"welcome-hero-dark",src:mS,alt:""}),a.jsx("img",{className:"welcome-hero-light",src:_S,alt:""})]}),a.jsxs("div",{className:"welcome-copy",children:[a.jsx("h1",{className:"welcome-title",children:"Sapiom Studio for full-stack agentic products."}),a.jsx("p",{className:"welcome-intro",children:"Your coding agent in a Sapiom-configured workspace: build agent workflows, see them on the canvas, run and deploy them in one click."}),C&&a.jsx("div",{className:"welcome-error",children:C}),a.jsxs("div",{className:"welcome-hints","data-testid":"welcome-hints",children:[a.jsxs("div",{className:"welcome-hint-chips",children:[a.jsxs("span",{className:"welcome-hint-chip",children:[a.jsx(Se,{name:"Sparkles",size:11})," Visualize"]}),a.jsxs("span",{className:"welcome-hint-chip",children:[a.jsx(Se,{name:"Play",size:11})," Run local"]}),a.jsxs("span",{className:"welcome-hint-chip",children:[a.jsx(Se,{name:"Cloud",size:11})," Deploy"]})]}),a.jsxs("span",{className:"welcome-hints-kbd",children:["or press ",a.jsx("kbd",{children:"⌘K"})]})]})]}),a.jsxs("div",{className:"welcome-footer",children:[a.jsxs("a",{className:"welcome-docs","data-testid":"welcome-docs",href:"https://docs.sapiom.ai",target:"_blank",rel:"noopener noreferrer",children:["Docs ",a.jsx(Se,{name:"ExternalLink",size:12})]}),a.jsx("button",{ref:d,className:"btn-ghost welcome-action","data-testid":"welcome-browse-templates",onClick:()=>v(!0),title:"Start from a template: cloneable gallery templates and bundled starters",children:"Templates"}),a.jsx("button",{className:"btn-ghost welcome-action","data-testid":"welcome-run-sample",onClick:()=>void f(),disabled:l,title:"Seeds order-triage, a small support-ticket triage agent, and opens a session in it",children:l?"Setting up…":"Sample project"}),a.jsx("button",{ref:g,className:"btn-primary welcome-action","data-testid":"welcome-start-project",onClick:()=>p(!0),children:"New project"})]})]}),c&&a.jsx(wp,{recentDirs:h,launchDir:b,listDir:M,onClose:()=>p(!1),onCreate:x,listHarnesses:U,triggerRef:g}),m&&a.jsx(Lc,{launchDir:b,onClose:()=>v(!1),onUse:H,triggerRef:d})]})}const gS="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";function SS({onCollapse:h}){const[b,M]=q.useState(Dc());return q.useEffect(()=>Rc(M),[]),a.jsxs("header",{className:"brand-header",children:[a.jsxs("div",{className:"brand-lockup",children:[a.jsx("img",{src:gS,alt:"",className:"brand-mark"}),a.jsx("span",{className:"brand-name",children:"Sapiom"}),a.jsx("span",{className:"brand-divider"}),a.jsx("span",{className:"brand-product",children:"Studio"})]}),a.jsxs("div",{className:"brand-header-tools",children:[a.jsx("button",{className:"theme-toggle","data-testid":"theme-toggle","aria-label":b==="dark"?"Switch to light mode":"Switch to dark mode",title:b==="dark"?"Switch to light mode":"Switch to dark mode",onClick:av,children:a.jsx(Se,{name:b==="dark"?"Sun":"Moon",size:15})}),a.jsx("button",{className:"theme-toggle","data-testid":"rail-collapse","aria-label":"Collapse workspace panel",title:"Collapse workspace panel",onClick:h,children:a.jsx(Se,{name:"PanelLeftClose",size:15})})]})]})}function yS({authenticated:h,organizationName:b,telemetryOptIn:M,consentSource:x,consentEnvReason:U,onToggleTelemetry:K,onStartAuth:H,onDisconnect:c}){const[p,m]=q.useState(!1),[v,l]=q.useState({status:"idle"}),_=x==="env-forced-off",C=_?!1:M,w=async()=>{const f=!M;m(!0);try{await K(f),Nn("consent.changed",{optIn:f})}finally{m(!1)}},g=async()=>{l({status:"pending"});try{await H()}catch(f){const r=f instanceof Error?f.message:"Could not start sign-in. Try again.";l({status:"error",message:r})}},d=async()=>{m(!0);try{await c()}finally{m(!1)}};return h&&v.status==="pending"&&l({status:"idle"}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"settings-identity",children:h?b??"Signed in":"Not signed in"}),!h&&a.jsx("div",{className:"settings-auth-row",children:v.status==="pending"?a.jsxs("span",{className:"settings-auth-pending","data-testid":"settings-auth-pending",children:[a.jsx(Se,{name:"Loader",size:13}),"Opening browser… waiting for sign-in"]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn-primary settings-connect-btn","data-testid":"settings-connect-btn",onClick:()=>void g(),children:"Connect account"}),v.status==="error"&&a.jsx("p",{className:"settings-note settings-auth-error","data-testid":"settings-auth-error",children:v.message})]})}),h&&a.jsx("div",{className:"settings-auth-row",children:a.jsxs("button",{type:"button",className:"settings-disconnect-btn","data-testid":"settings-disconnect-btn",disabled:p,onClick:()=>void d(),children:[a.jsx(Se,{name:"LogOut",size:13}),p?"Signing out…":"Disconnect"]})}),a.jsxs("label",{className:"settings-toggle-row",children:[a.jsx("span",{children:"Send usage analytics to Sapiom"}),a.jsx("button",{type:"button",role:"switch","aria-checked":C,"data-testid":"telemetry-toggle",className:"toggle-switch"+(C?" is-on":""),disabled:p||_,onClick:()=>void w(),children:a.jsx("span",{className:"toggle-knob"})})]}),_&&a.jsxs("p",{className:"settings-note settings-env-note","data-testid":"telemetry-env-note",children:["Analytics is turned off by ",U?`$${U}`:"an environment variable",". Unset it and restart the Studio server to manage consent here."]}),a.jsxs("p",{className:"settings-note",children:["Prompts, tool calls, and session lifecycle events are always written locally to"," ",a.jsx("code",{children:C1.events}),". With your consent, they’re also sent to Sapiom."]})]})}function Zf({workflow:h,isFocused:b,onFocus:M}){const x=h.definitionId!=null;return a.jsx("div",{className:"workflow-item"+(b?" is-focused":""),"data-testid":`workflow-${h.name}`,children:a.jsxs("button",{className:"tree-row workflow-item-trigger",onClick:()=>M(h.path),"aria-pressed":b,"data-tooltip":b?"Focused agent":"Focus this agent",children:[a.jsx(Se,{name:"Zap",size:13}),a.jsx("span",{className:"tree-row-label",children:h.name}),a.jsx("span",{className:"workflow-status","data-deployed":x,"data-testid":`workflow-status-${h.name}`,title:x?"Deployed to Sapiom":"Draft. Not deployed to Sapiom yet.",children:a.jsx(Se,{name:x?"Cloud":"CloudOff",size:13})})]})})}const bS=h=>h.split("/").filter(Boolean).pop()??h,CS=(h,b)=>h===b||h.startsWith(`${b}/`);function wS(h,b){const M=b.filter(m=>m.status!=="exited"),x=new Set(h),U=new Map;for(const m of b){const v=U.get(m.cwd);(!v||m.createdAt>v)&&U.set(m.cwd,m.createdAt)}const K=Array.from(U.keys()).sort((m,v)=>{const l=(U.get(v)??"").localeCompare(U.get(m)??"");return l!==0?l:m.localeCompare(v)}),H=m=>{let v=null;for(const l of K)CS(m,l)&&(v===null||l.length>v.length)&&(v=l);return v},c=[];for(const m of K){const v=h.filter(_=>x.has(_)&&H(_.path)===m).sort((_,C)=>_.path.localeCompare(C.path)).map(_=>(x.delete(_),{workflow:_})),l=M.filter(_=>_.boundWorkflowPath==null&&H(_.cwd)===m).sort((_,C)=>C.createdAt.localeCompare(_.createdAt)||_.id.localeCompare(C.id));v.length===0&&l.length===0||c.push({cwd:m,label:bS(m),agents:v,bareSessions:l})}const p=Array.from(x).sort((m,v)=>m.path.localeCompare(v.path)).map(m=>({workflow:m}));return{workspaces:c,orphanAgents:p}}const xS="https://app.sapiom.ai/workflows",ES=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),kS=ES?"⌘K":"Ctrl+K";function AS({label:h,cwd:b,collapsed:M,onToggleCollapsed:x,onOpenInEditor:U,onCopyPath:K}){return a.jsxs("div",{className:"workspace-row","data-testid":`workspace-group-${h}`,children:[a.jsxs("button",{className:"workspace-row-main",onClick:x,title:b,"aria-expanded":!M,children:[a.jsx(Se,{name:"Folder",size:13}),a.jsx("span",{className:"tree-row-label",children:h}),a.jsx("span",{className:"workspace-caret"+(M?"":" is-open"),"aria-hidden":"true",children:a.jsx(Se,{name:"ChevronDown",size:13})})]}),a.jsx("button",{className:"workspace-row-action","aria-label":`Copy path for ${h}`,"data-tooltip":"Copy path",onClick:()=>K(b),children:a.jsx(Se,{name:"Copy",size:13})}),a.jsx("button",{className:"workspace-row-action","data-testid":`workspace-open-editor-${h}`,"aria-label":`Open ${h} in editor`,"data-tooltip":"Open in editor",onClick:()=>U(b),children:a.jsx(Se,{name:"Code",size:13})})]})}function DS({label:h,cwd:b,sessionId:M,isFocused:x,onFocus:U,onScaffold:K,onOpenInEditor:H,onCopyPath:c}){return a.jsxs("div",{className:"workspace-row"+(x?" is-selected":""),"data-testid":`workspace-group-${h}`,children:[a.jsxs("button",{className:"workspace-row-main","data-testid":`workspace-focus-${h}`,"aria-label":`Focus ${h}`,"aria-pressed":x,"data-tooltip":"Folder with sessions, no agent yet. Focus to work in it.",onClick:()=>U(b),children:[a.jsx(Se,{name:"Folder",size:13}),a.jsx("span",{className:"tree-row-label",children:h})]}),a.jsx("button",{className:"workspace-row-action","data-testid":`workspace-scaffold-${h}`,"aria-label":`Scaffold an agent in ${h}`,"data-tooltip":"Scaffold an agent here",onClick:()=>K(M),children:a.jsx(Se,{name:"Sparkles",size:13})}),a.jsx("button",{className:"workspace-row-action","data-testid":`workspace-open-editor-${h}`,"aria-label":`Open ${h} in editor`,"data-tooltip":"Open in editor",onClick:()=>H(b),children:a.jsx(Se,{name:"Code",size:13})}),a.jsx("button",{className:"workspace-row-action","aria-label":`Copy path for ${h}`,"data-tooltip":"Copy path",onClick:()=>c(b),children:a.jsx(Se,{name:"Copy",size:13})})]})}function Qf({testid:h,harness:b,title:M,meta:x,cwd:U,resumable:K,isSelected:H,onOpen:c}){return a.jsxs("button",{"data-testid":h,className:"session-dropdown-item"+(H?" is-selected":""),onClick:c,children:[a.jsx("span",{className:"session-item-icon",children:a.jsx(On,{kind:b,size:13})}),a.jsxs("span",{className:"session-item-copy",children:[a.jsx("span",{className:"session-item-title",children:M}),a.jsx("span",{className:"session-item-meta",children:x}),a.jsx("span",{className:"session-item-cwd",children:U})]}),a.jsx("span",{className:"past-session-tag","data-resumable":K,children:K?"resumable":"archived"})]})}function RS({width:h,minWidth:b,workflows:M,sessions:x,activeSessionId:U,focusedAgentPath:K,onFocusAgent:H,onOpenPalette:c,onConnect:p,onCollapse:m,onSelectSession:v,overviewSelected:l,onSelectOverview:_,onReviewSummary:C,history:w,historyLoading:g,onOpenHistory:d,recentDirs:f,launchDir:r,listDir:u,onCreateSession:S,listHarnesses:A,onScaffoldSession:E,onScaffoldInSession:R,onUseTemplate:y,onScanWorkflows:D,onOpenInEditor:I,onToast:P,telemetryOptIn:$,consentSource:z,consentEnvReason:Q,authenticated:ne,organizationName:F,onToggleTelemetry:W,onStartAuth:Y,onDisconnect:j,settingsOpen:B,onSetSettingsOpen:T}){const[O,Z]=q.useState(null),[ae,_e]=q.useState(!1),ge=q.useRef(null),[X,N]=q.useState(!1),ce=q.useRef(null),le=q.useCallback(()=>N(!1),[]),[ye,be]=q.useState(()=>new Set(Ti().collapsedCwds??[])),je=Ce=>{be(Ie=>{const Ke=new Set(Ie);return Ke.has(Ce)?Ke.delete(Ce):Ke.add(Ce),Ke})};q.useEffect(()=>{Ln({collapsedCwds:Array.from(ye)})},[ye]);const Le=x.filter(Ce=>Ce.status==="exited"),Be=()=>{var Ie;const Ce=!X;if(N(Ce),Ce){const Ke=[],rt=Ze=>{Ze&&!Ke.includes(Ze)&&Ke.push(Ze)};rt((Ie=x.find(Ze=>Ze.id===U))==null?void 0:Ie.cwd),x.forEach(Ze=>rt(Ze.cwd)),f.forEach(Ze=>rt(Ze)),Ke.length>0&&d(Ke.slice(0,12))}},Ye=new Set(x.map(Ce=>Ce.id)),Ae=new Set(x.map(Ce=>Ce.agentSessionId).filter(Ce=>Ce!=null)),jt=w.filter(Ce=>!(Ce.harnessSessionId!=null&&Ye.has(Ce.harnessSessionId))&&!Ae.has(Ce.agentSessionId)),ft=[...Le.map(Ce=>({kind:"exited",at:Ce.lastActiveAt,session:Ce})),...jt.map(Ce=>({kind:"summary",at:Ce.lastActiveAt,summary:Ce}))].sort((Ce,Ie)=>Ie.at.localeCompare(Ce.at)),{workspaces:Lt,orphanAgents:mt}=wS(M,x),Ft=Ce=>{var Ie;(Ie=navigator.clipboard)==null||Ie.writeText(Ce).then(()=>P("Path copied.")).catch(()=>P("Couldn't copy the path."))};return a.jsxs("aside",{className:"rail rail-workflows",style:{width:h,minWidth:b},children:[a.jsx(SS,{onCollapse:m}),a.jsx("div",{className:"rail-search",children:a.jsxs("button",{className:"palette-trigger","data-testid":"palette-trigger","aria-label":"Jump to session, workflow, or path",onClick:c,children:[a.jsx(Se,{name:"Search",size:13}),a.jsx("span",{className:"palette-trigger-text",children:"Jump to…"}),a.jsx("span",{className:"palette-trigger-hint",children:kS})]})}),a.jsxs("div",{className:"rail-header",children:["Workspace",a.jsxs("div",{className:"rail-header-actions",children:[a.jsxs("button",{ref:ce,className:"theme-toggle rail-header-btn","data-testid":"history-trigger","aria-label":"Sessions and history",title:"Sessions and history",onClick:Be,children:[a.jsx(Se,{name:"History",size:14}),Le.length>0&&a.jsx("span",{className:"session-history-badge","data-testid":"session-history-badge",children:Le.length})]}),a.jsx("button",{ref:ge,className:"theme-toggle rail-header-btn","data-testid":"add-workspace","aria-label":"Add project",title:"Register an existing agent project folder (sapiom.json). Its agent appears in the rail.",onClick:()=>{N(!1),Z("workspace")},children:a.jsx(Se,{name:"Plus",size:14})})]})]}),a.jsxs("div",{className:"rail-tree",children:[a.jsxs(Xi,{open:X,anchorRef:ce,onDismiss:le,placement:"down-end",className:"connect-card history-card",testid:"history-menu",children:[a.jsxs("div",{className:"connect-card-header",children:[a.jsx("span",{children:"Sessions"}),a.jsx("button",{className:"theme-toggle connect-card-close",onClick:le,"aria-label":"Close",title:"Close",children:a.jsx(Se,{name:"X",size:13})})]}),a.jsxs("div",{className:"connect-card-body history-card-body",children:[a.jsxs("button",{className:"session-dropdown-item session-dropdown-new","data-testid":"new-session-btn",onClick:()=>{N(!1),Z("session")},children:[a.jsx("span",{className:"session-item-icon",children:a.jsx(Se,{name:"Plus",size:13})}),a.jsx("span",{className:"session-item-copy",children:a.jsx("span",{className:"session-item-title",children:"New session…"})})]}),a.jsx("div",{className:"session-dropdown-section",children:"Past sessions"}),ft.map(Ce=>Ce.kind==="exited"?a.jsx(Qf,{testid:`exited-session-${Ce.session.id}`,harness:Ce.session.harness,title:Ce.session.title,meta:Cc(Ce.session),cwd:Ce.session.cwd,resumable:Ce.session.agentSessionId!=null,isSelected:Ce.session.id===U,onOpen:()=>{v(Ce.session.id),N(!1)}},Ce.session.id):a.jsx(Qf,{testid:`history-${Ce.summary.agentSessionId}`,harness:Ce.summary.harness,title:Ce.summary.title,meta:Cc(Ce.summary),cwd:Ce.summary.cwd,resumable:!1,isSelected:!1,onOpen:()=>{C(Ce.summary),N(!1)}},Ce.summary.agentSessionId)),g&&a.jsx("div",{className:"session-dropdown-empty",children:"Loading…"}),!g&&ft.length===0&&a.jsx("div",{className:"session-dropdown-empty",children:"No past sessions yet"})]})]}),a.jsxs("div",{className:"rail-list",children:[Lt.length===0&&mt.length===0&&a.jsx(Ts,{className:"rail-empty",icon:"Folder",title:"No agents yet",body:"Start a session in a project directory, or add a workspace. Agents (sapiom.json) appear here automatically."}),Lt.map(Ce=>{const Ie=ye.has(Ce.cwd);if(Ce.agents.length===0&&Ce.bareSessions.length>0){const rt=Ce.bareSessions[0];return a.jsx("div",{className:"workspace-group",children:a.jsx(DS,{label:Ce.label,cwd:Ce.cwd,sessionId:rt.id,isFocused:Ce.cwd===K,onFocus:H,onScaffold:R,onOpenInEditor:I,onCopyPath:Ft})},Ce.cwd)}return a.jsxs("div",{className:"workspace-group",children:[a.jsx(AS,{label:Ce.label,cwd:Ce.cwd,collapsed:Ie,onToggleCollapsed:()=>je(Ce.cwd),onOpenInEditor:I,onCopyPath:Ft}),!Ie&&Ce.agents.map(rt=>a.jsx(Zf,{workflow:rt.workflow,isFocused:rt.workflow.path===K,onFocus:H},rt.workflow.path))]},Ce.cwd)}),mt.length>0&&a.jsxs("div",{className:"workspace-group",children:[a.jsx("div",{className:"workspace-row",children:a.jsxs("div",{className:"workspace-row-main workspace-row-static","data-tooltip":"Agents that live outside any session folder. Focus one to start a session in its own folder.",children:[a.jsx(Se,{name:"Folder",size:13}),a.jsx("span",{className:"tree-row-label",children:"No workspace"})]})}),mt.map(Ce=>a.jsx(Zf,{workflow:Ce.workflow,isFocused:Ce.workflow.path===K,onFocus:H},Ce.workflow.path))]})]})]}),a.jsx("div",{className:"rail-footer",children:a.jsx(TS,{authenticated:ne,organizationName:F,telemetryOptIn:$,consentSource:z,consentEnvReason:Q,onToggleTelemetry:W,onStartAuth:Y,onDisconnect:j,settingsOpen:B,onSetSettingsOpen:T,overviewSelected:l,onSelectOverview:_})}),O&&a.jsx(wp,{mode:O,recentDirs:f,launchDir:r,listDir:u,onClose:()=>Z(null),onCreate:S,listHarnesses:A,onScaffold:E,onScan:D,onConnect:async Ce=>{await p(Ce)},onBrowseTemplates:()=>{Z(null),_e(!0)},triggerRef:O==="workspace"?ge:ce}),ae&&a.jsx(Lc,{launchDir:r,onClose:()=>_e(!1),onUse:y,triggerRef:ge})]})}function TS({authenticated:h,organizationName:b,telemetryOptIn:M,consentSource:x,consentEnvReason:U,onToggleTelemetry:K,onStartAuth:H,onDisconnect:c,settingsOpen:p,onSetSettingsOpen:m,overviewSelected:v,onSelectOverview:l}){const[_,C]=q.useState(!1),[w,g]=q.useState({status:"idle"}),d=q.useRef(null),f=q.useCallback(()=>C(!1),[]),r=q.useCallback(()=>m(!1),[m]),u=lp(),S=w.status==="pending";h&&w.status==="pending"&&g({status:"idle"});const A=S?"Connecting…":h?b??"Signed in":"Not signed in",E=S?"opening browser":h?"Sapiom account":"connect to get started",R=(b??"S").charAt(0).toUpperCase(),y=async()=>{f(),g({status:"pending"});try{await H()}catch(D){const I=D instanceof Error?D.message:"Could not start sign-in. Try again.";g({status:"error",message:I})}};return a.jsxs("div",{className:"rail-footer-row rail-profile-wrap",children:[a.jsxs("button",{ref:d,className:"rail-profile","data-testid":"brand-identity","aria-haspopup":"menu","aria-expanded":_,title:"Account",onClick:()=>C(D=>!D),children:[a.jsx("span",{className:"rail-profile-avatar","aria-hidden":"true",children:R}),a.jsxs("span",{className:"rail-profile-copy",children:[a.jsx("span",{className:"rail-profile-name",children:A}),a.jsx("span",{className:"rail-profile-meta",children:E})]}),a.jsx("span",{className:"identity-dot","data-authenticated":h,"data-pending":S}),a.jsx(Se,{name:"ChevronDown",size:13})]}),a.jsx(Xi,{open:p,anchorRef:d,onDismiss:r,placement:"up-start",matchWidth:!0,className:"settings-popover",testid:"settings-popover",children:a.jsx(yS,{authenticated:h,organizationName:b,telemetryOptIn:M,consentSource:x,consentEnvReason:U,onToggleTelemetry:K,onStartAuth:H,onDisconnect:c})}),a.jsxs(Xi,{open:_,anchorRef:d,onDismiss:f,placement:"up-start",matchWidth:!0,className:"profile-menu",role:"menu",testid:"profile-menu",children:[a.jsxs("button",{role:"menuitem",className:"profile-menu-item"+(v?" is-selected":""),"data-testid":"rail-overview",onClick:()=>{l(),f()},children:[a.jsx(Se,{name:"Info",size:13}),"Overview"]}),a.jsxs("button",{role:"menuitem",className:"profile-menu-item","data-testid":"profile-open-dashboard",onClick:()=>{window.open(xS,"_blank","noopener,noreferrer"),f()},children:[a.jsx(Se,{name:"ExternalLink",size:13}),"Open Sapiom dashboard"]}),a.jsxs("button",{role:"menuitem",className:"profile-menu-item","data-testid":"settings-trigger",onClick:()=>{m(!0),f()},children:[a.jsx(Se,{name:"Settings",size:13}),"Settings"]}),!h&&a.jsxs("button",{role:"menuitem",className:"profile-menu-item","data-testid":"profile-connect-account",disabled:S,onClick:()=>void y(),children:[a.jsx(Se,{name:"Plug",size:13}),S?"Connecting…":"Connect account"]}),h&&a.jsxs("button",{role:"menuitem",className:"profile-menu-item","data-testid":"profile-disconnect-account",onClick:()=>{c(),f()},children:[a.jsx(Se,{name:"LogOut",size:13}),"Disconnect"]}),u,w.status==="error"&&a.jsx("p",{className:"profile-menu-auth-error","data-testid":"profile-auth-error",children:w.message})]})]})}const MS=new Set([401,403]);function jS(h){return h?h.networkError===!0||h.status===void 0:!1}function LS(h){return(h==null?void 0:h.status)!==void 0&&MS.has(h.status)}function NS(h){const{online:b,error:M}=h;return!b||jS(M)?"offline":LS(M)?"auth":M?"error":"online"}function Jf(){return typeof navigator>"u"?!0:navigator.onLine!==!1}function OS(){const[h,b]=q.useState(Jf);return q.useEffect(()=>{const M=()=>b(Jf());return window.addEventListener("online",M),window.addEventListener("offline",M),M(),()=>{window.removeEventListener("online",M),window.removeEventListener("offline",M)}},[]),h}const ep={deploy:"deploy",prod_run:"prod-run",run_local:"run-local"};function BS(h){return Object.prototype.hasOwnProperty.call(ep,h)?ep[h]:null}const xp=h=>h.split("/").filter(Boolean).pop()??h;function tp(h,b){var M;return(M=b[h.id])!=null&&M.trim()?!1:!h.title||h.title===xp(h.cwd)}function sp(h,b,M){var c;const x=(c=M[h.id])==null?void 0:c.trim();if(x)return x;if(!tp(h,M))return h.title;const U=xp(h.cwd),H=b.filter(p=>p.cwd===h.cwd&&(p.status!=="exited"||p.id===h.id)&&tp(p,M)).sort((p,m)=>p.createdAt.localeCompare(m.createdAt)||p.id.localeCompare(m.id)).findIndex(p=>p.id===h.id);return H>0?`${U} ${H+1}`:U}const Ep="(max-width: 768px)";function wc(){return typeof window<"u"&&window.matchMedia(Ep).matches}function HS(h){const b=window.matchMedia(Ep);return b.addEventListener("change",h),()=>b.removeEventListener("change",h)}function zS(){return q.useSyncExternalStore(HS,wc,()=>!1)}const kp="sapiom-harness-pane-widths",Oc=180,Ap=480,xc=320,Ri=320,Dp=720;function Ec(h,b,M){return Math.min(Math.max(h,b),M)}function US(){const h={rail:xc,canvas:null};if(typeof window>"u")return h;try{const b=window.localStorage.getItem(kp);if(!b)return h;const M=JSON.parse(b);return{rail:Ec(typeof M.rail=="number"?M.rail:xc,Oc,Ap),canvas:typeof M.canvas=="number"?Ec(M.canvas,Ri,Dp):null}}catch{return h}}function ip(h){window.localStorage.setItem(kp,JSON.stringify(h))}function IS(){const[h,b]=q.useState(US),M=(U,K,H,c,p)=>m=>{const v=m.currentTarget;v.setPointerCapture(m.pointerId);const l=m.clientX,_=p(),C=g=>{const d=Ec(_+(g.clientX-l)*K,H,c);b(f=>f[U]===d?f:{...f,[U]:d})},w=()=>{v.removeEventListener("pointermove",C),v.removeEventListener("pointerup",w),b(g=>(ip(g),g))};v.addEventListener("pointermove",C),v.addEventListener("pointerup",w)},x=(U,K)=>{b(H=>{const c={...H,[U]:K};return ip(c),c})};return{widths:h,startRailDrag:M("rail",1,Oc,Ap,()=>h.rail),startCanvasDrag:M("canvas",-1,Ri,Dp,()=>{if(h.canvas!=null)return h.canvas;const U=document.querySelector(".canvas-pane");return U?U.getBoundingClientRect().width:Ri}),resetRail:()=>x("rail",xc),resetCanvas:()=>x("canvas",null)}}const qS=2e3;function $S(h){const b=new URL("/ws/events",window.location.href);b.protocol=b.protocol==="https:"?"wss:":"ws:",b.searchParams.set("token",jn());let M=null,x=null,U=!1;const K=()=>{M=new WebSocket(b),M.addEventListener("message",H=>{try{h(JSON.parse(H.data))}catch{}}),M.addEventListener("close",()=>{U||(x=setTimeout(K,qS))})};return K(),()=>{U=!0,x&&clearTimeout(x),M==null||M.close()}}const np=4e3;function PS(h){if(typeof h=="string")return h;if(h!==null&&typeof h=="object"){const b=h,M=[b.ts,b.level,b.msg??b.message].filter(x=>typeof x=="string"||typeof x=="number");if(M.length>0)return M.map(String).join(" ")}return String(h)}function WS(h){if(!Array.isArray(h)||h.length===0)return;const b=h.map(PS).join(`
445
+ `).trim();if(b!=="")return b.length>np?b.slice(b.length-np):b}function FS(h){return h==="succeeded"?"passed":h==="threw"?"failed":"pending"}function YS(h){return h==="completed"?"completed":h==="failed"?"failed":"running"}function KS(h){var x;const b={id:`${h.step}-${h.attempt}`,name:h.step,status:FS(h.status)};h.input!==void 0&&(b.input=h.input),h.output!==void 0&&(b.output=h.output),(x=h.error)!=null&&x.message&&(b.error=h.error.message);const M=WS(h.logs);return M!==void 0&&(b.logSlice=M),h.calls&&h.calls.length>0&&(b.calls=h.calls.map(U=>({capability:U.capability,stubUsed:U.stubUsed,args:U.args,result:U.result}))),b}function GS(h,b={}){const M={executionId:b.executionId??"",status:YS(b.outcome),steps:h.map(KS),stubbed:!0};return b.unusedStubs&&b.unusedStubs.length>0&&(M.unusedStubs=b.unusedStubs),b.stubWarnings&&b.stubWarnings.length>0&&(M.stubWarnings=b.stubWarnings),M}const dt=ev(),XS=3e3;function VS(){const[h,b]=q.useState(null),[M,x]=q.useState(null),[U,K]=q.useState(!0),[H,c]=q.useState(null),[p,m]=q.useState(null),[v,l]=q.useState(0),[_,C]=q.useState(null),[w,g]=q.useState(null),[d,f]=q.useState([]),[r,u]=q.useState(null),[S,A]=q.useState(!1),[E,R]=q.useState(null),[y,D]=q.useState(new Set),[I,P]=q.useState([]),$=q.useRef(new Map),[z,Q]=q.useState(new Map),[ne,F]=q.useState(new Map),[W,Y]=q.useState(new Map),j=q.useRef(new Map),[B,T]=q.useState(new Map),[O,Z]=q.useState(new Map),[ae,_e]=q.useState(0),ge=q.useCallback(()=>{_e(ee=>ee+1)},[]),X=q.useRef(0),N=q.useCallback(ee=>{X.current+=1,g(ee)},[]),ce=q.useRef([]),le=q.useCallback(ee=>{dt.getRunState(ee).then(ie=>Q(de=>{const ve=de.get(ee);return ve?new Map(de).set(ee,{...ve,run:ie}):de})).catch(()=>{})},[]),ye=q.useCallback((ee,ie,de)=>{const ve=j.current.get(ee);ve&&clearInterval(ve);const Ee=Mn(ce.current.find(ot=>ot.id===ee)),Nt=Date.now();F(ot=>{const Ot=ot.get(ee)??[];return Ot.includes(ie)?ot:new Map(ot).set(ee,[...Ot,ie])}),Y(ot=>{if(!ot.has(ee))return ot;const Ot=new Map(ot);return Ot.delete(ee),Ot});const Yt=async()=>{try{const ot=await dt.getRunState(ie);if(Q(Ot=>new Map(Ot).set(ie,{run:ot,target:de,workflowPath:Ee,observedAt:Nt})),ot.status!=="running"){const Ot=j.current.get(ee);Ot&&clearInterval(Ot),j.current.delete(ee)}}catch{const ot=j.current.get(ee);ot&&clearInterval(ot),j.current.delete(ee)}};Yt(),j.current.set(ee,setInterval(()=>void Yt(),2e3))},[]),be=q.useRef(0),je=q.useCallback(async(ee,ie,de)=>{be.current+=1;const ve=`local-${Date.now()}-${be.current}`,Ee=Mn(ce.current.find(Qe=>Qe.id===ee)),Nt=Date.now(),Yt=[];let ot,Ot,ai;F(Qe=>{const is=Qe.get(ee)??[];return is.includes(ve)?Qe:new Map(Qe).set(ee,[...is,ve])}),Y(Qe=>{if(!Qe.has(ee))return Qe;const is=new Map(Qe);return is.delete(ee),is});const fs=()=>{const Qe=GS(Yt,{executionId:ve,outcome:ot,unusedStubs:Ot,stubWarnings:ai});Q(is=>new Map(is).set(ve,{run:Qe,target:"local",workflowPath:Ee,observedAt:Nt}))};fs();const Es=Qe=>{Qe.kind==="summary"?(ot=Qe.outcome,Ot=Qe.unusedStubs,ai=Qe.stubWarnings):Qe.kind==="error"?(ot="failed",Yt.push({step:"run-local",attempt:1,input:de,status:"threw",error:{name:"RunLocalError",message:Qe.error},logs:[]})):Yt.push(Qe),fs()};try{await dt.runLocal({sourceDir:ie,input:de},Es)}catch(Qe){ot="failed",fs(),u(Qe instanceof ds&&Qe.reason?Qe.reason:Qe.message)}finally{ge()}},[ge]),Le=q.useCallback((ee,ie)=>{Y(de=>new Map(de).set(ee,ie)),le(ie)},[le]),Be=q.useMemo(()=>{const ee=new Map;return ne.forEach((ie,de)=>{const ve=W.get(de),Ee=ve&&ie.includes(ve)?ve:ie[ie.length-1],Nt=Ee?z.get(Ee):void 0;Nt&&ee.set(de,Nt)}),ee},[ne,W,z]);q.useEffect(()=>{ce.current=(h==null?void 0:h.sessions)??[]},[h]),q.useEffect(()=>{const ee=j.current;return()=>{ee.forEach(ie=>clearInterval(ie)),ee.clear()}},[]),q.useEffect(()=>{const ee=$.current;return()=>{ee.forEach(ie=>clearTimeout(ie)),ee.clear()}},[]),q.useEffect(()=>{let ee=!1;return v>0&&(K(!0),c(null),m(null)),Promise.all([dt.getState(),dt.getSettings()]).then(([ie,de])=>{if(ee)return;b(ie),x(de),m(null),ie.tasks&&P(ie.tasks);const ve=ie.sessions.find(Ee=>Ee.status!=="exited");ve&&g(ve.id),ie.workflows[0]&&C(ie.workflows[0].path)}).catch(ie=>{ee||(c(ie.message),m(ie instanceof ds?{status:ie.status}:{networkError:!0}))}).finally(()=>!ee&&K(!1)),()=>{ee=!0}},[v]);const Ye=q.useCallback(()=>l(ee=>ee+1),[]);q.useEffect(()=>{if(!w)return;const ee=h==null?void 0:h.sessions.find(ie=>ie.id===w);C(Mn(ee)??null)},[w]);const Ae=q.useCallback(async()=>{const ee=await dt.listWorkflows();b(ie=>ie&&{...ie,workflows:ee})},[]);q.useEffect(()=>$S(ee=>{if(R(ee),ee.type==="session.status"){if(b(ie=>{if(!ie)return ie;const ve=ie.sessions.some(Ee=>Ee.id===ee.session.id)?ie.sessions.map(Ee=>Ee.id===ee.session.id?ee.session:Ee):[...ie.sessions,ee.session];return{...ie,sessions:ve}}),ee.session.status==="exited"){const ie=ee.session.id,de=$.current.get(ie);de&&(clearTimeout(de),$.current.delete(ie)),D(ve=>{if(!ve.has(ie))return ve;const Ee=new Set(ve);return Ee.delete(ie),Ee})}}else if(ee.type==="workflows.changed")Ae();else if(ee.type==="execution.started")ye(ee.harnessSessionId,ee.executionId,ee.target);else if(ee.type==="port.detected")T(ie=>new Map(ie).set(ee.harnessSessionId,{port:ee.port,url:ee.url}));else if(ee.type==="task.status")P(ie=>ie.some(ve=>ve.id===ee.task.id)?ie.map(ve=>ve.id===ee.task.id?ee.task:ve):[...ie,ee.task]);else if(ee.type==="session.activity"){const ie=ee.harnessSessionId;D(ve=>ve.has(ie)?ve:new Set(ve).add(ie));const de=$.current.get(ie);de&&clearTimeout(de),$.current.set(ie,setTimeout(()=>{$.current.delete(ie),D(ve=>{if(!ve.has(ie))return ve;const Ee=new Set(ve);return Ee.delete(ie),Ee})},XS))}else ee.type==="auth.changed"&&b(ie=>ie&&{...ie,authenticated:ee.authenticated,organizationName:ee.organizationName})}),[Ae,ye]);const jt=q.useCallback(async ee=>{A(!0);try{const ie=await Promise.allSettled(ee.map(ve=>dt.sessionHistory(ve))),de=new Map;for(const ve of ie)if(ve.status==="fulfilled")for(const Ee of ve.value)de.has(Ee.agentSessionId)||de.set(Ee.agentSessionId,Ee);f(Array.from(de.values()).sort((ve,Ee)=>Ee.lastActiveAt.localeCompare(ve.lastActiveAt)))}finally{A(!1)}},[]),ft=q.useCallback(async ee=>{const ie=await dt.createSession(ee);b(ve=>ve&&!ve.sessions.some(Ee=>Ee.id===ie.id)?{...ve,sessions:[...ve.sessions,ie]}:ve),N(ie.id);let de=[];x(ve=>(de=[ee.cwd,...((ve==null?void 0:ve.recentDirs)??[]).filter(Ee=>Ee!==ee.cwd)].slice(0,8),ve&&{...ve,recentDirs:de}));try{const ve=await dt.updateSettings({recentDirs:de});x(Ee=>Ee&&{...Ee,recentDirs:ve.recentDirs})}catch{}return ie},[N]),Lt=q.useCallback(async()=>{var de;const ee=await dt.seedSampleProject(),ie=((de=h==null?void 0:h.availableHarnesses)==null?void 0:de[0])??"claude-code";return ft({cwd:ee.root,harness:ie})},[h==null?void 0:h.availableHarnesses,ft]),mt=q.useCallback(async ee=>{const ie=X.current;try{const de=await dt.resumeSession(ee);return b(ve=>ve&&{...ve,sessions:ve.sessions.map(Ee=>Ee.id===de.id?de:Ee)}),X.current===ie&&N(de.id),de}catch(de){throw u(de instanceof ds&&de.reason?de.reason:de.message),de}},[N]),Ft=q.useCallback(async ee=>{var de;const ie=ee.harnessSessionId??((de=h==null?void 0:h.sessions.find(ve=>ve.agentSessionId===ee.agentSessionId))==null?void 0:de.id);return ie?mt(ie):ft({cwd:ee.cwd,harness:ee.harness})},[h,mt,ft]),Ce=q.useCallback(async ee=>{try{await dt.killSession(ee)}catch(de){throw u(de instanceof ds&&de.reason?de.reason:de.message),de}const ie=((h==null?void 0:h.sessions)??[]).filter(de=>de.id!==ee);if(b(de=>de&&{...de,sessions:ie}),w===ee){const de=ie.find(ve=>ve.status!=="exited");N(de?de.id:null)}},[h,w,N]),Ie=q.useCallback(async ee=>{const ie=await dt.connectWorkflow(ee);return b(de=>de&&{...de,workflows:[...de.workflows.filter(ve=>ve.path!==ie.path),ie]}),ie},[]),Ke=q.useCallback(async ee=>{const ie=await dt.scanWorkflows(ee);return await Ae(),ie},[Ae]),rt=q.useCallback(()=>dt.listHarnesses(),[]),Ze=q.useCallback(async(ee,ie)=>{const de=await dt.bindWorkflow(ee,ie);b(ve=>ve&&{...ve,sessions:ve.sessions.map(Ee=>Ee.id===de.id?de:Ee)})},[]),ct=q.useCallback(async ee=>{const ie=await dt.updateSettings(ee);return x(ie),ee.telemetryOptIn!==void 0&&b(de=>de&&{...de,telemetryOptIn:ie.telemetryOptIn}),ie},[]),Xt=q.useCallback(async(ee,ie)=>{try{await dt.runMacro(ee,ie)}catch(de){u(de instanceof ds&&de.reason?de.reason:de.message)}},[]),xt=q.useCallback(async ee=>{u("Deploying — building on Sapiom…");try{const ie=await dt.deploy(ee,de=>{de.phase==="building"&&u("Deploying — building on Sapiom…")});if(ie.phase==="ready")u("Deployed to Sapiom."),Z(de=>{if(!de.has(ee))return de;const ve=new Map(de);return ve.delete(ee),ve}),await Ae();else if(ie.phase==="error"){const de=ie.hint?`Deploy failed: ${ie.message} (${ie.hint})`:`Deploy failed: ${ie.message}`;u(de),Z(ve=>new Map(ve).set(ee,de))}}catch(ie){const de=ie instanceof ds&&ie.reason?ie.reason:ie.message;u(de),Z(ve=>new Map(ve).set(ee,de))}finally{ge()}},[Ae,ge]),Vt=q.useCallback(async(ee,ie,de)=>{try{const{executionId:ve}=await dt.run({definitionId:ie,input:de});ye(ee,ve,"prod")}catch(ve){u(ve instanceof ds&&ve.reason?ve.reason:ve.message)}finally{ge()}},[ye,ge]),Ge=q.useCallback(async()=>dt.startAuth(),[]),Tt=q.useCallback(async()=>{try{await dt.disconnect()}catch(ee){u(ee instanceof ds&&ee.reason?ee.reason:ee.message)}},[]),yt=q.useCallback(()=>u(null),[]),st=q.useCallback(async(ee,ie)=>{await dt.injectInput(ee,{text:ie,submit:!0})},[]),vt=q.useCallback(ee=>{u(ee)},[]),ue=q.useCallback(ee=>O.get(ee)??null,[O]),we=q.useCallback(ee=>dt.listDir(ee),[]);return{state:h,loading:U,error:H,errorKind:p,reload:Ye,settings:M,bootToken:jn(),selectedWorkflowPath:_,setSelectedWorkflowPath:C,activeSessionId:w,setActiveSessionId:N,history:d,historyLoading:S,loadHistory:jt,createSession:ft,createSampleSession:Lt,resumeSession:mt,resumeFromHistory:Ft,closeSession:Ce,connectWorkflow:Ie,scanWorkflows:Ke,listHarnesses:rt,bindWorkflow:Ze,updateSettings:ct,runMacro:Xt,deploy:xt,startProdRun:Vt,runLocal:je,injectInput:st,showToast:vt,lastDeployErrorFor:ue,directActionSettleSeq:ae,listDir:we,lastMessage:E,runsBySession:Be,runsByExecution:z,runIdsBySession:ne,selectRun:Le,previewBySession:B,toast:r,dismissToast:yt,busySessionIds:y,tasks:I,api:dt,startAuth:Ge,disconnect:Tt}}function Fr(h,b){return b?h.filter(M=>M.status!=="exited"&&(M.boundWorkflowPath===b||M.boundWorkflowPath==null&&M.cwd===b)).sort((M,x)=>M.createdAt.localeCompare(x.createdAt)||M.id.localeCompare(x.id)):[]}const ZS=()=>{var Vt,Ge,Tt,yt,st,vt;const h=VS(),b=OS(),[M,x]=q.useState(!1),[U,K]=q.useState(!1),[H,c]=q.useState(null),[p,m]=q.useState(!1),[v,l]=q.useState(()=>{const ue=Ti().rightTab;return ue==="canvas"||ue==="steps"||ue==="code"?ue:"canvas"}),[_,C]=q.useState(v==="code"),[w,g]=q.useState(null),[d,f]=q.useState(!1),[r,u]=q.useState(()=>Ti().sessionNames??{}),S=(ue,we)=>{u(ee=>{const ie={...ee},de=we.trim();return de?ie[ue]=de:delete ie[ue],Ln({sessionNames:ie}),ie})},[A,E]=q.useState(()=>wc()||(Ti().railCollapsed??!1)),[R,y]=q.useState(()=>wc()||(Ti().rightCollapsed??!1)),D=zS(),{widths:I,startRailDrag:P,startCanvasDrag:$,resetRail:z,resetCanvas:Q}=IS();q.useEffect(()=>{const ue=we=>{var ie;const ee=we.key.toLowerCase();if((we.metaKey||we.ctrlKey)&&(ee==="k"||ee==="p")){we.preventDefault(),x(!0);return}if((we.metaKey||we.ctrlKey)&&/^[1-9]$/.test(we.key)){const ve=Fr(((ie=h.state)==null?void 0:ie.sessions)??[],H)[Number(we.key)-1];ve&&(we.preventDefault(),K(!1),g(null),h.setActiveSessionId(ve.id))}};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[(Vt=h.state)==null?void 0:Vt.sessions,H]),q.useEffect(()=>{var ee;if(!M||!h.state)return;const ue=[],we=ie=>{ie&&!ue.includes(ie)&&ue.push(ie)};h.state.sessions.forEach(ie=>we(ie.cwd)),(((ee=h.settings)==null?void 0:ee.recentDirs)??[]).forEach(ie=>we(ie)),ue.length>0&&h.loadHistory(ue.slice(0,12))},[M]);const ne=q.useRef(!1);q.useEffect(()=>{var we;if(ne.current||!h.state)return;ne.current=!0;const ue=h.state.sessions.find(ee=>ee.id===h.activeSessionId);c(Mn(ue)??((we=h.state.workflows[0])==null?void 0:we.path)??null)},[h.state,h.activeSessionId]);const F=q.useRef(D);if(q.useEffect(()=>{F.current!==D&&(F.current=D,E(D),y(D))},[D]),q.useEffect(()=>{D||Ln({railCollapsed:A,rightCollapsed:R})},[A,R,D]),q.useEffect(()=>{Ln({rightTab:v})},[v]),h.loading)return a.jsx("div",{className:"app-status",children:"Loading Sapiom Studio…"});if(h.error||!h.state){const ue=NS({online:b,error:h.errorKind});return a.jsx(_1,{status:ue==="online"?"error":ue,onRetry:h.reload,detail:h.error,onStartAuth:ue==="auth"?h.startAuth:void 0})}const{state:W}=h,Y=W.sessions.find(ue=>ue.id===h.activeSessionId)??null,j=Mn(Y),B=W.workflows.find(ue=>ue.path===j)??null,T=W.workflows.find(ue=>ue.path===H)??null,O=Fr(W.sessions,H),Z=W.sessions.some(ue=>ue.status!=="exited"),ae=U||W.firstRun===!0&&!Z,_e=!ae&&w!=null,ge=!ae&&!_e&&(Y==null?void 0:Y.status)==="exited",X=!ae&&!_e&&!ge&&T!=null&&O.length===0,N=!ae&&!_e&&!ge&&!X&&Y!=null&&Y.status!=="exited",ce=N&&O.length>0,le=X?null:B,ye=X?(T==null?void 0:T.name)??null:null,be=h.activeSessionId?h.runsBySession.get(h.activeSessionId)??null:null,je=h.activeSessionId?(h.runIdsBySession.get(h.activeSessionId)??[]).map(ue=>h.runsByExecution.get(ue)).filter(ue=>ue!==void 0):[],Le=()=>{D&&E(!0)},Be=async(ue,we)=>{K(!1),g(null),c(ue),Le();const ee=await h.createSession({cwd:ue,harness:we});return Nn("session.created"),ee},Ye=async(ue,we)=>{await Be(ue,we)},Ae=(ue,we,ee)=>{const ie=async de=>{try{await h.injectInput(ue,we)}catch(ve){if(de<6&&ve instanceof ds&&ve.status===409){window.setTimeout(()=>void ie(de+1),1500);return}h.showToast(ee)}};ie(0)},jt=async(ue,we)=>{const ee=await Be(ue,we);Ae(ee.id,"Scaffold a new Sapiom agent project in this directory: run `sapiom agents init .`, then use the sapiom-agent-authoring skill to define the first workflow.","Couldn't send the scaffold prompt. Ask the agent to run sapiom agents init.")},ft=ue=>{(async()=>{const we=Fr(W.sessions,ue.path)[0],ee=(we==null?void 0:we.cwd)??ue.path;try{const ie=await Be(ee,"claude-code");await h.bindWorkflow(ie.id,ue.path),c(ue.path)}catch(ie){h.showToast(ie.message||"Couldn't start the session.")}})()},Lt=ue=>{Ae(ue,"Scaffold a new Sapiom agent project in this directory: run `sapiom agents init .`, then use the sapiom-agent-authoring skill to define the first workflow.","Couldn't send the scaffold prompt. Ask the agent to run sapiom agents init.")},mt=async(ue,we)=>{const ee=await Be(ue,"claude-code");Ae(ee.id,z1(we,ue),we.kind==="gallery"?"Couldn't send the clone prompt. Ask the agent to run sapiom_dev_agents_clone.":"Couldn't send the starter prompt. Ask the agent to run sapiom agents init.")},Ft=async ue=>{const we=await h.scanWorkflows(ue);return h.showToast(we.length===0?"No agent projects found under this folder.":we.length===1?"Found 1 agent project.":`Found ${we.length} agent projects.`),we.length},Ce=ue=>{K(!1),g(null),Le();const we=W.sessions.find(ee=>ee.id===ue);we&&c(Mn(we)??we.cwd),h.setActiveSessionId(ue)},Ie=ue=>{K(!1),g(null),h.setActiveSessionId(ue)},Ke=ue=>{(async()=>{const we=O.find(ie=>ie.id!==ue)??null,ee=h.activeSessionId===ue;try{await h.closeSession(ue)}catch{return}ee&&h.setActiveSessionId(we?we.id:null)})()},rt=ue=>{K(!1),g(ue),Le()},Ze=ue=>{var ee;const we=((ee=h.settings)==null?void 0:ee.editorUrlTemplate)??"vscode://file{path}";window.location.href=we.replace("{path}",encodeURI(ue))},ct=ue=>{K(!1),g(null),c(ue),Le();const we=Fr(W.sessions,ue);if(we.some(ie=>ie.id===h.activeSessionId))return;const ee=we[we.length-1]??null;h.setActiveSessionId(ee?ee.id:null)},Xt=async ue=>{Le();const we=W.sessions.filter(Ee=>Ee.status!=="exited"),ee=Ee=>Ee.boundWorkflowPath===ue||ue===Ee.cwd||ue.startsWith(`${Ee.cwd}/`),ie=we.find(Ee=>Ee.id===h.activeSessionId),de=ie&&ee(ie)?ie:we.filter(ee).sort((Ee,Nt)=>Nt.cwd.length-Ee.cwd.length||Nt.createdAt.localeCompare(Ee.createdAt))[0];let ve;if(de)K(!1),g(null),de.id!==h.activeSessionId&&h.setActiveSessionId(de.id),ve=de.id;else try{ve=(await Be(ue,"claude-code")).id}catch(Ee){return h.showToast(Ee.message||"Couldn't start a session in this folder."),null}return await h.bindWorkflow(ve,ue),c(ue),ve},xt=(ue,we)=>{(async()=>{let ee=h.activeSessionId;if(ue&&(ee=await Xt(ue.path)??ee),we.action.kind==="open-url"){window.open(sv(we.action.url,ue),"_blank","noopener,noreferrer");return}if(!ee)return;const ie=BS(we.id);if(ie!==null){if(ie==="deploy")ue?h.deploy(ue.path):h.showToast("Select a workflow first.");else if(ie==="prod-run")if((ue==null?void 0:ue.definitionId)!=null)h.startProdRun(ee,String(ue.definitionId));else{const de=ue?h.lastDeployErrorFor(ue.path):null;h.showToast(de?"Last deploy failed — retry Deploy.":"This agent isn't deployed yet — deploy it first.")}else ie==="run-local"&&(ue?h.runLocal(ee,ue.path):h.showToast("Select a workflow first."));return}h.runMacro(we.id,{harnessSessionId:ee,workflowPath:ue==null?void 0:ue.path})})()};return a.jsxs("div",{className:"app-shell",children:[D&&!A&&a.jsx("div",{className:"shell-scrim","data-testid":"rail-drawer-scrim","aria-hidden":"true",onClick:()=>E(!0)}),!A&&a.jsx(RS,{width:I.rail,minWidth:Oc,workflows:W.workflows,sessions:W.sessions,activeSessionId:h.activeSessionId,focusedAgentPath:H,onFocusAgent:ct,onOpenPalette:()=>x(!0),onConnect:async ue=>{await h.connectWorkflow(ue)},onCollapse:()=>E(!0),onSelectSession:Ce,overviewSelected:U,onSelectOverview:()=>{K(!0),g(null),Le()},onReviewSummary:rt,history:h.history,historyLoading:h.historyLoading,onOpenHistory:ue=>void h.loadHistory(ue),recentDirs:((Ge=h.settings)==null?void 0:Ge.recentDirs)??[],launchDir:W.launchDir??null,listDir:h.listDir,onCreateSession:Ye,listHarnesses:h.listHarnesses,onScaffoldSession:jt,onScaffoldInSession:Lt,onUseTemplate:mt,onScanWorkflows:Ft,onOpenInEditor:Ze,onToast:h.showToast,telemetryOptIn:((Tt=h.settings)==null?void 0:Tt.telemetryOptIn)??W.telemetryOptIn,consentSource:W.consentSource,consentEnvReason:W.consentEnvReason,authenticated:W.authenticated,organizationName:W.organizationName,onToggleTelemetry:async ue=>{await h.updateSettings({telemetryOptIn:ue})},onStartAuth:h.startAuth,onDisconnect:h.disconnect,settingsOpen:p,onSetSettingsOpen:m}),!A&&!D&&a.jsx("div",{className:"pane-resize-handle pane-resize-handle-rail",style:{left:I.rail},onPointerDown:P,onDoubleClick:z,role:"separator","aria-orientation":"vertical","aria-label":"Resize workspace rail","data-testid":"resize-handle-rail"}),a.jsxs("div",{className:"workspace-main",children:[!b&&a.jsx(v1,{}),W.consentSource==="default-silent"&&!((yt=h.settings)!=null&&yt.telemetryNoticeDismissed)&&a.jsx(B1,{onDismiss:()=>{h.updateSettings({telemetryNoticeDismissed:!0})},onOpenSettings:()=>m(!0)}),a.jsxs("div",{className:"app",style:{gridTemplateColumns:D?"minmax(0, 1fr)":R?`minmax(${Ri}px, 1fr)`:I.canvas==null?`minmax(${Ri}px, 1fr) minmax(${Ri}px, 1fr)`:`minmax(${Ri}px, 1fr) minmax(${Ri}px, ${I.canvas}px)`},children:[a.jsxs("div",{className:"center-pane",children:[a.jsx(L1,{overviewMode:ae,openedAgentName:ye,reviewTitle:!ae&&w?w.title:null,activeSession:N||ge?Y:null,sessionName:Y?sp(Y,W.sessions,r):null,onRenameSession:S,boundWorkflowName:(B==null?void 0:B.name)??null,busy:Y!=null&&h.busySessionIds.has(Y.id),onCloseSession:ue=>void h.closeSession(ue),onOpenInEditor:Ze,onToast:h.showToast,onExpandRail:A?()=>E(!1):null,onExpandRight:R?()=>y(!1):null}),ce&&a.jsx(O1,{sessions:O,activeSessionId:h.activeSessionId,busySessionIds:h.busySessionIds,labelOf:ue=>sp(ue,W.sessions,r),agentName:(T==null?void 0:T.name)??(Y==null?void 0:Y.title)??"this agent",onSelect:Ie,onClose:Ke,onNew:()=>{T?ft(T):H&&Ye(H,"claude-code")}}),N&&Y&&B&&a.jsx(N1,{workflow:B,activeSessionId:h.activeSessionId,sessionReady:Y.ready===!0&&Y.status!=="exited",macros:W.macros,onRunMacro:ue=>xt(B,ue),preview:h.previewBySession.get(Y.id)??null,lastDeployError:h.lastDeployErrorFor(B.path),authenticated:W.authenticated,directActionSettleSeq:h.directActionSettleSeq}),a.jsx("div",{className:"terminal-slot",children:ae?a.jsx(vS,{recentDirs:((st=h.settings)==null?void 0:st.recentDirs)??[],launchDir:W.launchDir??null,listDir:h.listDir,onCreateSession:Ye,listHarnesses:h.listHarnesses,onUseTemplate:mt,onRunSample:async()=>{const ue=await h.createSampleSession();K(!1),g(null),c(ue.cwd)}}):_e&&w?a.jsx(y1,{summary:w,resumable:w.harnessSessionId!=null&&W.sessions.some(ue=>ue.id===w.harnessSessionId)||W.sessions.some(ue=>ue.agentSessionId!=null&&ue.agentSessionId===w.agentSessionId),onStart:()=>{const ue=w;g(null),h.resumeFromHistory(ue)},onClose:()=>g(null)}):ge&&Y?a.jsx(S1,{session:Y,onResume:()=>void h.resumeSession(Y.id),onClose:()=>void h.closeSession(Y.id)}):X&&T?a.jsx(Ts,{className:"terminal-empty",testId:"open-agent-empty",icon:"Radio",title:`No running session for ${T.name}`,body:"Start a session to map, run, and inspect this agent.",cta:a.jsxs("button",{className:"btn-primary","data-testid":"open-agent-start-session",onClick:()=>ft(T),children:[a.jsx(Se,{name:"Plus",size:14})," Start session"]})}):N&&h.activeSessionId?a.jsx(k1,{sessionId:h.activeSessionId,harness:(Y==null?void 0:Y.harness)??"claude-code",api:h.api,showToast:h.showToast,children:a.jsx("div",{className:"agent-view","data-testid":"agent-view",children:a.jsx("div",{className:"agent-view-panel",id:"agent-panel-terminal",children:a.jsx(iS,{sessionId:h.activeSessionId,token:h.bootToken})})})}):a.jsx(Ts,{className:"terminal-empty",icon:"Radio",title:"No active session",body:"Focus an agent in the workspace panel, then start a session. Your coding agent runs right here, in a real terminal. ⌘K jumps anywhere."})})]}),!R&&!D&&a.jsx("div",{className:"pane-resize-handle pane-resize-handle-canvas",style:{right:I.canvas??"50%"},onPointerDown:$,onDoubleClick:Q,role:"separator","aria-orientation":"vertical","aria-label":"Resize canvas pane","data-testid":"resize-handle-canvas"}),D&&!R&&a.jsx("div",{className:"shell-scrim","data-testid":"right-sheet-scrim","aria-hidden":"true",onClick:()=>y(!0)}),a.jsxs("div",{className:"right-pane"+(R?" is-collapsed":""),children:[a.jsxs("div",{className:"right-pane-tabs",role:"tablist","aria-label":"Right pane",children:[a.jsx("button",{role:"tab","aria-selected":v==="canvas",className:"right-pane-tab"+(v==="canvas"?" is-active":""),onClick:()=>l("canvas"),"data-testid":"right-tab-canvas",children:"Canvas"}),a.jsx("button",{role:"tab","aria-selected":v==="steps",className:"right-pane-tab"+(v==="steps"?" is-active":""),onClick:()=>l("steps"),"data-testid":"right-tab-steps",children:"Steps"}),a.jsx("button",{role:"tab","aria-selected":v==="code",className:"right-pane-tab"+(v==="code"?" is-active":""),onClick:()=>{l("code"),C(!0)},"data-testid":"right-tab-code",children:"Code"}),a.jsx("button",{className:"theme-toggle right-pane-collapse","data-testid":"right-collapse","aria-label":"Collapse canvas panel",title:"Collapse canvas panel",onClick:()=>y(!0),children:a.jsx(Se,{name:"PanelRightClose",size:15})})]}),a.jsx("div",{className:"right-pane-panel"+(v==="canvas"||v==="steps"?"":" is-hidden"),"data-testid":"right-panel-canvas",children:a.jsx(Z0,{sessionId:h.activeSessionId,lastMessage:h.lastMessage,boundWorkflow:le,noSessionAgent:ye,activeSessionId:h.activeSessionId,overviewActive:ae,sessionExited:ge,macros:W.macros,tasks:h.tasks,surface:v==="steps"?"steps":"board",onOpenSteps:()=>l("steps"),run:(be==null?void 0:be.run)??null,runTarget:(be==null?void 0:be.target)??null,runs:je,onSelectRun:ue=>{h.activeSessionId&&h.selectRun(h.activeSessionId,ue)},workflows:W.workflows,onOpenWorkflow:ue=>void Xt(ue),onRunMacro:ue=>xt(B,ue),onInjectPrompt:ue=>{h.activeSessionId&&h.injectInput(h.activeSessionId,ue)}})}),(v==="code"||_)&&a.jsx("div",{className:"right-pane-panel"+(v==="code"?"":" is-hidden"),"data-testid":"right-panel-code",children:a.jsx(u1,{boundWorkflow:le,noSessionAgent:ye,agentsBaseUrl:W.agentsBaseUrl})})]})]})]}),M&&a.jsx(p1,{sessions:W.sessions,workflows:W.workflows,recentDirs:((vt=h.settings)==null?void 0:vt.recentDirs)??[],history:h.history,listDir:h.listDir,onSelectSession:Ce,onReviewSummary:rt,onOpenPath:ue=>void Ye(ue,"claude-code"),onBrowseTemplates:()=>f(!0),onClose:()=>x(!1)}),d&&a.jsx(Lc,{launchDir:(Y==null?void 0:Y.cwd)??W.launchDir??null,onClose:()=>f(!1),onUse:mt}),h.toast&&a.jsx(aS,{message:h.toast,onDismiss:h.dismissToast}),a.jsx(rS,{})]})};window.addEventListener("scroll",()=>{(window.scrollX!==0||window.scrollY!==0)&&window.scrollTo(0,0)},{passive:!0});G_.createRoot(document.getElementById("root")).render(a.jsx(q.StrictMode,{children:a.jsx(ZS,{})}));