@gbasin/agentboard-linux-arm64 0.1.0

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.
@@ -0,0 +1,301 @@
1
+ var Nw=Object.defineProperty;var jw=(e,t,r)=>t in e?Nw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rr=(e,t,r)=>jw(e,typeof t!="symbol"?t+"":t,r);function Fw(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();function $w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uv={exports:{}},Nl={},hv={exports:{}},Ne={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Po=Symbol.for("react.element"),Hw=Symbol.for("react.portal"),zw=Symbol.for("react.fragment"),Uw=Symbol.for("react.strict_mode"),Ww=Symbol.for("react.profiler"),Vw=Symbol.for("react.provider"),Kw=Symbol.for("react.context"),Gw=Symbol.for("react.forward_ref"),qw=Symbol.for("react.suspense"),Xw=Symbol.for("react.memo"),Yw=Symbol.for("react.lazy"),Qf=Symbol.iterator;function Jw(e){return e===null||typeof e!="object"?null:(e=Qf&&e[Qf]||e["@@iterator"],typeof e=="function"?e:null)}var dv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fv=Object.assign,pv={};function as(e,t,r){this.props=e,this.context=t,this.refs=pv,this.updater=r||dv}as.prototype.isReactComponent={};as.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};as.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mv(){}mv.prototype=as.prototype;function Yh(e,t,r){this.props=e,this.context=t,this.refs=pv,this.updater=r||dv}var Jh=Yh.prototype=new mv;Jh.constructor=Yh;fv(Jh,as.prototype);Jh.isPureReactComponent=!0;var Zf=Array.isArray,gv=Object.prototype.hasOwnProperty,Qh={current:null},vv={key:!0,ref:!0,__self:!0,__source:!0};function _v(e,t,r){var n,s={},a=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)gv.call(t,n)&&!vv.hasOwnProperty(n)&&(s[n]=t[n]);var i=arguments.length-2;if(i===1)s.children=r;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];s.children=o}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)s[n]===void 0&&(s[n]=i[n]);return{$$typeof:Po,type:e,key:a,ref:l,props:s,_owner:Qh.current}}function Qw(e,t){return{$$typeof:Po,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Po}function Zw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ep=/\/+/g;function cc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zw(""+e.key):t.toString(36)}function Ra(e,t,r,n,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Po:case Hw:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+cc(l,0):n,Zf(s)?(r="",e!=null&&(r=e.replace(ep,"$&/")+"/"),Ra(s,t,r,"",function(c){return c})):s!=null&&(Zh(s)&&(s=Qw(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(ep,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",Zf(e))for(var i=0;i<e.length;i++){a=e[i];var o=n+cc(a,i);l+=Ra(a,t,r,o,s)}else if(o=Jw(e),typeof o=="function")for(e=o.call(e),i=0;!(a=e.next()).done;)a=a.value,o=n+cc(a,i++),l+=Ra(a,t,r,o,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Jo(e,t,r){if(e==null)return e;var n=[],s=0;return Ra(e,n,"","",function(a){return t.call(r,a,s++)}),n}function eS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qt={current:null},Ta={transition:null},tS={ReactCurrentDispatcher:qt,ReactCurrentBatchConfig:Ta,ReactCurrentOwner:Qh};function yv(){throw Error("act(...) is not supported in production builds of React.")}Ne.Children={map:Jo,forEach:function(e,t,r){Jo(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Jo(e,function(){t++}),t},toArray:function(e){return Jo(e,function(t){return t})||[]},only:function(e){if(!Zh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ne.Component=as;Ne.Fragment=zw;Ne.Profiler=Ww;Ne.PureComponent=Yh;Ne.StrictMode=Uw;Ne.Suspense=qw;Ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tS;Ne.act=yv;Ne.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=fv({},e.props),s=e.key,a=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,l=Qh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(o in t)gv.call(t,o)&&!vv.hasOwnProperty(o)&&(n[o]=t[o]===void 0&&i!==void 0?i[o]:t[o])}var o=arguments.length-2;if(o===1)n.children=r;else if(1<o){i=Array(o);for(var c=0;c<o;c++)i[c]=arguments[c+2];n.children=i}return{$$typeof:Po,type:e.type,key:s,ref:a,props:n,_owner:l}};Ne.createContext=function(e){return e={$$typeof:Kw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Vw,_context:e},e.Consumer=e};Ne.createElement=_v;Ne.createFactory=function(e){var t=_v.bind(null,e);return t.type=e,t};Ne.createRef=function(){return{current:null}};Ne.forwardRef=function(e){return{$$typeof:Gw,render:e}};Ne.isValidElement=Zh;Ne.lazy=function(e){return{$$typeof:Yw,_payload:{_status:-1,_result:e},_init:eS}};Ne.memo=function(e,t){return{$$typeof:Xw,type:e,compare:t===void 0?null:t}};Ne.startTransition=function(e){var t=Ta.transition;Ta.transition={};try{e()}finally{Ta.transition=t}};Ne.unstable_act=yv;Ne.useCallback=function(e,t){return qt.current.useCallback(e,t)};Ne.useContext=function(e){return qt.current.useContext(e)};Ne.useDebugValue=function(){};Ne.useDeferredValue=function(e){return qt.current.useDeferredValue(e)};Ne.useEffect=function(e,t){return qt.current.useEffect(e,t)};Ne.useId=function(){return qt.current.useId()};Ne.useImperativeHandle=function(e,t,r){return qt.current.useImperativeHandle(e,t,r)};Ne.useInsertionEffect=function(e,t){return qt.current.useInsertionEffect(e,t)};Ne.useLayoutEffect=function(e,t){return qt.current.useLayoutEffect(e,t)};Ne.useMemo=function(e,t){return qt.current.useMemo(e,t)};Ne.useReducer=function(e,t,r){return qt.current.useReducer(e,t,r)};Ne.useRef=function(e){return qt.current.useRef(e)};Ne.useState=function(e){return qt.current.useState(e)};Ne.useSyncExternalStore=function(e,t,r){return qt.current.useSyncExternalStore(e,t,r)};Ne.useTransition=function(){return qt.current.useTransition()};Ne.version="18.3.1";hv.exports=Ne;var k=hv.exports;const mt=$w(k),wv=Fw({__proto__:null,default:mt},[k]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var rS=k,nS=Symbol.for("react.element"),iS=Symbol.for("react.fragment"),sS=Object.prototype.hasOwnProperty,oS=rS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,aS={key:!0,ref:!0,__self:!0,__source:!0};function Sv(e,t,r){var n,s={},a=null,l=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)sS.call(t,n)&&!aS.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:nS,type:e,key:a,ref:l,props:s,_owner:oS.current}}Nl.Fragment=iS;Nl.jsx=Sv;Nl.jsxs=Sv;uv.exports=Nl;var D=uv.exports,xv={exports:{}},lr={},bv={exports:{}},Cv={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(O,R){var P=O.length;O.push(R);e:for(;0<P;){var N=P-1>>>1,F=O[N];if(0<s(F,R))O[N]=R,O[P]=F,P=N;else break e}}function r(O){return O.length===0?null:O[0]}function n(O){if(O.length===0)return null;var R=O[0],P=O.pop();if(P!==R){O[0]=P;e:for(var N=0,F=O.length,V=F>>>1;N<V;){var q=2*(N+1)-1,Q=O[q],Z=q+1,z=O[Z];if(0>s(Q,P))Z<F&&0>s(z,Q)?(O[N]=z,O[Z]=P,N=Z):(O[N]=Q,O[q]=P,N=q);else if(Z<F&&0>s(z,P))O[N]=z,O[Z]=P,N=Z;else break e}}return R}function s(O,R){var P=O.sortIndex-R.sortIndex;return P!==0?P:O.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,i=l.now();e.unstable_now=function(){return l.now()-i}}var o=[],c=[],p=1,u=null,m=3,_=!1,y=!1,v=!1,h=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(O){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=O)n(c),R.sortIndex=R.expirationTime,t(o,R);else break;R=r(c)}}function w(O){if(v=!1,g(O),!y)if(r(o)!==null)y=!0,j(b);else{var R=r(c);R!==null&&$(w,R.startTime-O)}}function b(O,R){y=!1,v&&(v=!1,f(S),S=-1),_=!0;var P=m;try{for(g(R),u=r(o);u!==null&&(!(u.expirationTime>R)||O&&!A());){var N=u.callback;if(typeof N=="function"){u.callback=null,m=u.priorityLevel;var F=N(u.expirationTime<=R);R=e.unstable_now(),typeof F=="function"?u.callback=F:u===r(o)&&n(o),g(R)}else n(o);u=r(o)}if(u!==null)var V=!0;else{var q=r(c);q!==null&&$(w,q.startTime-R),V=!1}return V}finally{u=null,m=P,_=!1}}var x=!1,C=null,S=-1,E=5,L=-1;function A(){return!(e.unstable_now()-L<E)}function M(){if(C!==null){var O=e.unstable_now();L=O;var R=!0;try{R=C(!0,O)}finally{R?T():(x=!1,C=null)}}else x=!1}var T;if(typeof d=="function")T=function(){d(M)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,H=B.port2;B.port1.onmessage=M,T=function(){H.postMessage(null)}}else T=function(){h(M,0)};function j(O){C=O,x||(x=!0,T())}function $(O,R){S=h(function(){O(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_continueExecution=function(){y||_||(y=!0,j(b))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(o)},e.unstable_next=function(O){switch(m){case 1:case 2:case 3:var R=3;break;default:R=m}var P=m;m=R;try{return O()}finally{m=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,R){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var P=m;m=O;try{return R()}finally{m=P}},e.unstable_scheduleCallback=function(O,R,P){var N=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?N+P:N):P=N,O){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=P+F,O={id:p++,callback:R,priorityLevel:O,startTime:P,expirationTime:F,sortIndex:-1},P>N?(O.sortIndex=P,t(c,O),r(o)===null&&O===r(c)&&(v?(f(S),S=-1):v=!0,$(w,P-N))):(O.sortIndex=F,t(o,O),y||_||(y=!0,j(b))),O},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(O){var R=m;return function(){var P=m;m=R;try{return O.apply(this,arguments)}finally{m=P}}}})(Cv);bv.exports=Cv;var lS=bv.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var cS=k,ar=lS;function se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ev=new Set,io={};function pi(e,t){Qi(e,t),Qi(e+"Capture",t)}function Qi(e,t){for(io[e]=t,e=0;e<t.length;e++)Ev.add(t[e])}var tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pu=Object.prototype.hasOwnProperty,uS=/^[: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]*$/,tp={},rp={};function hS(e){return pu.call(rp,e)?!0:pu.call(tp,e)?!1:uS.test(e)?rp[e]=!0:(tp[e]=!0,!1)}function dS(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function fS(e,t,r,n){if(t===null||typeof t>"u"||dS(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xt(e,t,r,n,s,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var It={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){It[e]=new Xt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];It[t]=new Xt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){It[e]=new Xt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){It[e]=new Xt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){It[e]=new Xt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){It[e]=new Xt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){It[e]=new Xt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){It[e]=new Xt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){It[e]=new Xt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ed=/[\-:]([a-z])/g;function td(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ed,td);It[t]=new Xt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ed,td);It[t]=new Xt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ed,td);It[t]=new Xt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){It[e]=new Xt(e,1,!1,e.toLowerCase(),null,!1,!1)});It.xlinkHref=new Xt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){It[e]=new Xt(e,1,!1,e.toLowerCase(),null,!0,!0)});function rd(e,t,r,n){var s=It.hasOwnProperty(t)?It[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(fS(t,r,s,n)&&(r=null),n||s===null?hS(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var an=cS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qo=Symbol.for("react.element"),bi=Symbol.for("react.portal"),Ci=Symbol.for("react.fragment"),nd=Symbol.for("react.strict_mode"),mu=Symbol.for("react.profiler"),kv=Symbol.for("react.provider"),Lv=Symbol.for("react.context"),id=Symbol.for("react.forward_ref"),gu=Symbol.for("react.suspense"),vu=Symbol.for("react.suspense_list"),sd=Symbol.for("react.memo"),mn=Symbol.for("react.lazy"),Rv=Symbol.for("react.offscreen"),np=Symbol.iterator;function ws(e){return e===null||typeof e!="object"?null:(e=np&&e[np]||e["@@iterator"],typeof e=="function"?e:null)}var ot=Object.assign,uc;function As(e){if(uc===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);uc=t&&t[1]||""}return`
34
+ `+uc+e}var hc=!1;function dc(e,t){if(!e||hc)return"";hc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
+ `),a=n.stack.split(`
36
+ `),l=s.length-1,i=a.length-1;1<=l&&0<=i&&s[l]!==a[i];)i--;for(;1<=l&&0<=i;l--,i--)if(s[l]!==a[i]){if(l!==1||i!==1)do if(l--,i--,0>i||s[l]!==a[i]){var o=`
37
+ `+s[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=i);break}}}finally{hc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?As(e):""}function pS(e){switch(e.tag){case 5:return As(e.type);case 16:return As("Lazy");case 13:return As("Suspense");case 19:return As("SuspenseList");case 0:case 2:case 15:return e=dc(e.type,!1),e;case 11:return e=dc(e.type.render,!1),e;case 1:return e=dc(e.type,!0),e;default:return""}}function _u(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ci:return"Fragment";case bi:return"Portal";case mu:return"Profiler";case nd:return"StrictMode";case gu:return"Suspense";case vu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lv:return(e.displayName||"Context")+".Consumer";case kv:return(e._context.displayName||"Context")+".Provider";case id:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sd:return t=e.displayName||null,t!==null?t:_u(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return _u(e(t))}catch{}}return null}function mS(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _u(t);case 8:return t===nd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Mn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gS(e){var t=Tv(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zo(e){e._valueTracker||(e._valueTracker=gS(e))}function Dv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Tv(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Xa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yu(e,t){var r=t.checked;return ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ip(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Mn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mv(e,t){t=t.checked,t!=null&&rd(e,"checked",t,!1)}function wu(e,t){Mv(e,t);var r=Mn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Su(e,t.type,r):t.hasOwnProperty("defaultValue")&&Su(e,t.type,Mn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function sp(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Su(e,t,r){(t!=="number"||Xa(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ps=Array.isArray;function $i(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Mn(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function xu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return ot({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function op(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(se(92));if(Ps(r)){if(1<r.length)throw Error(se(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Mn(r)}}function Av(e,t){var r=Mn(t.value),n=Mn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function ap(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Pv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function bu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Pv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ea,Iv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ea=ea||document.createElement("div"),ea.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ea.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function so(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var $s={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vS=["Webkit","ms","Moz","O"];Object.keys($s).forEach(function(e){vS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$s[t]=$s[e]})});function Bv(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||$s.hasOwnProperty(e)&&$s[e]?(""+t).trim():t+"px"}function Ov(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Bv(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var _S=ot({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cu(e,t){if(t){if(_S[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function Eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ku=null;function od(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lu=null,Hi=null,zi=null;function lp(e){if(e=Oo(e)){if(typeof Lu!="function")throw Error(se(280));var t=e.stateNode;t&&(t=zl(t),Lu(e.stateNode,e.type,t))}}function Nv(e){Hi?zi?zi.push(e):zi=[e]:Hi=e}function jv(){if(Hi){var e=Hi,t=zi;if(zi=Hi=null,lp(e),t)for(e=0;e<t.length;e++)lp(t[e])}}function Fv(e,t){return e(t)}function $v(){}var fc=!1;function Hv(e,t,r){if(fc)return e(t,r);fc=!0;try{return Fv(e,t,r)}finally{fc=!1,(Hi!==null||zi!==null)&&($v(),jv())}}function oo(e,t){var r=e.stateNode;if(r===null)return null;var n=zl(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(se(231,t,typeof r));return r}var Ru=!1;if(tn)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){Ru=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{Ru=!1}function yS(e,t,r,n,s,a,l,i,o){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(p){this.onError(p)}}var Hs=!1,Ya=null,Ja=!1,Tu=null,wS={onError:function(e){Hs=!0,Ya=e}};function SS(e,t,r,n,s,a,l,i,o){Hs=!1,Ya=null,yS.apply(wS,arguments)}function xS(e,t,r,n,s,a,l,i,o){if(SS.apply(this,arguments),Hs){if(Hs){var c=Ya;Hs=!1,Ya=null}else throw Error(se(198));Ja||(Ja=!0,Tu=c)}}function mi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function zv(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 cp(e){if(mi(e)!==e)throw Error(se(188))}function bS(e){var t=e.alternate;if(!t){if(t=mi(e),t===null)throw Error(se(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var a=s.alternate;if(a===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===r)return cp(s),e;if(a===n)return cp(s),t;a=a.sibling}throw Error(se(188))}if(r.return!==n.return)r=s,n=a;else{for(var l=!1,i=s.child;i;){if(i===r){l=!0,r=s,n=a;break}if(i===n){l=!0,n=s,r=a;break}i=i.sibling}if(!l){for(i=a.child;i;){if(i===r){l=!0,r=a,n=s;break}if(i===n){l=!0,n=a,r=s;break}i=i.sibling}if(!l)throw Error(se(189))}}if(r.alternate!==n)throw Error(se(190))}if(r.tag!==3)throw Error(se(188));return r.stateNode.current===r?e:t}function Uv(e){return e=bS(e),e!==null?Wv(e):null}function Wv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Wv(e);if(t!==null)return t;e=e.sibling}return null}var Vv=ar.unstable_scheduleCallback,up=ar.unstable_cancelCallback,CS=ar.unstable_shouldYield,ES=ar.unstable_requestPaint,ft=ar.unstable_now,kS=ar.unstable_getCurrentPriorityLevel,ad=ar.unstable_ImmediatePriority,Kv=ar.unstable_UserBlockingPriority,Qa=ar.unstable_NormalPriority,LS=ar.unstable_LowPriority,Gv=ar.unstable_IdlePriority,jl=null,jr=null;function RS(e){if(jr&&typeof jr.onCommitFiberRoot=="function")try{jr.onCommitFiberRoot(jl,e,void 0,(e.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:MS,TS=Math.log,DS=Math.LN2;function MS(e){return e>>>=0,e===0?32:31-(TS(e)/DS|0)|0}var ta=64,ra=4194304;function Is(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Za(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,l=r&268435455;if(l!==0){var i=l&~s;i!==0?n=Is(i):(a&=l,a!==0&&(n=Is(a)))}else l=r&~s,l!==0?n=Is(l):a!==0&&(n=Is(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Rr(t),s=1<<r,n|=e[r],t&=~s;return n}function AS(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function PS(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Rr(a),i=1<<l,o=s[l];o===-1?(!(i&r)||i&n)&&(s[l]=AS(i,t)):o<=t&&(e.expiredLanes|=i),a&=~i}}function Du(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qv(){var e=ta;return ta<<=1,!(ta&4194240)&&(ta=64),e}function pc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Io(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rr(t),e[t]=r}function IS(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Rr(r),a=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~a}}function ld(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Rr(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Ve=0;function Xv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yv,cd,Jv,Qv,Zv,Mu=!1,na=[],bn=null,Cn=null,En=null,ao=new Map,lo=new Map,_n=[],BS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function hp(e,t){switch(e){case"focusin":case"focusout":bn=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":ao.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":lo.delete(t.pointerId)}}function xs(e,t,r,n,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[s]},t!==null&&(t=Oo(t),t!==null&&cd(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function OS(e,t,r,n,s){switch(t){case"focusin":return bn=xs(bn,e,t,r,n,s),!0;case"dragenter":return Cn=xs(Cn,e,t,r,n,s),!0;case"mouseover":return En=xs(En,e,t,r,n,s),!0;case"pointerover":var a=s.pointerId;return ao.set(a,xs(ao.get(a)||null,e,t,r,n,s)),!0;case"gotpointercapture":return a=s.pointerId,lo.set(a,xs(lo.get(a)||null,e,t,r,n,s)),!0}return!1}function e_(e){var t=Qn(e.target);if(t!==null){var r=mi(t);if(r!==null){if(t=r.tag,t===13){if(t=zv(r),t!==null){e.blockedOn=t,Zv(e.priority,function(){Jv(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Da(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Au(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);ku=n,r.target.dispatchEvent(n),ku=null}else return t=Oo(r),t!==null&&cd(t),e.blockedOn=r,!1;t.shift()}return!0}function dp(e,t,r){Da(e)&&r.delete(t)}function NS(){Mu=!1,bn!==null&&Da(bn)&&(bn=null),Cn!==null&&Da(Cn)&&(Cn=null),En!==null&&Da(En)&&(En=null),ao.forEach(dp),lo.forEach(dp)}function bs(e,t){e.blockedOn===t&&(e.blockedOn=null,Mu||(Mu=!0,ar.unstable_scheduleCallback(ar.unstable_NormalPriority,NS)))}function co(e){function t(s){return bs(s,e)}if(0<na.length){bs(na[0],e);for(var r=1;r<na.length;r++){var n=na[r];n.blockedOn===e&&(n.blockedOn=null)}}for(bn!==null&&bs(bn,e),Cn!==null&&bs(Cn,e),En!==null&&bs(En,e),ao.forEach(t),lo.forEach(t),r=0;r<_n.length;r++)n=_n[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<_n.length&&(r=_n[0],r.blockedOn===null);)e_(r),r.blockedOn===null&&_n.shift()}var Ui=an.ReactCurrentBatchConfig,el=!0;function jS(e,t,r,n){var s=Ve,a=Ui.transition;Ui.transition=null;try{Ve=1,ud(e,t,r,n)}finally{Ve=s,Ui.transition=a}}function FS(e,t,r,n){var s=Ve,a=Ui.transition;Ui.transition=null;try{Ve=4,ud(e,t,r,n)}finally{Ve=s,Ui.transition=a}}function ud(e,t,r,n){if(el){var s=Au(e,t,r,n);if(s===null)Cc(e,t,n,tl,r),hp(e,n);else if(OS(s,e,t,r,n))n.stopPropagation();else if(hp(e,n),t&4&&-1<BS.indexOf(e)){for(;s!==null;){var a=Oo(s);if(a!==null&&Yv(a),a=Au(e,t,r,n),a===null&&Cc(e,t,n,tl,r),a===s)break;s=a}s!==null&&n.stopPropagation()}else Cc(e,t,n,null,r)}}var tl=null;function Au(e,t,r,n){if(tl=null,e=od(n),e=Qn(e),e!==null)if(t=mi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=zv(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return tl=e,null}function t_(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kS()){case ad:return 1;case Kv:return 4;case Qa:case LS:return 16;case Gv:return 536870912;default:return 16}default:return 16}}var wn=null,hd=null,Ma=null;function r_(){if(Ma)return Ma;var e,t=hd,r=t.length,n,s="value"in wn?wn.value:wn.textContent,a=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[a-n];n++);return Ma=s.slice(e,1<n?1-n:void 0)}function Aa(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 ia(){return!0}function fp(){return!1}function cr(e){function t(r,n,s,a,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(r=e[i],this[i]=r?r(a):a[i]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?ia:fp,this.isPropagationStopped=fp,this}return ot(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ia)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ia)},persist:function(){},isPersistent:ia}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dd=cr(ls),Bo=ot({},ls,{view:0,detail:0}),$S=cr(Bo),mc,gc,Cs,Fl=ot({},Bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fd,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!==Cs&&(Cs&&e.type==="mousemove"?(mc=e.screenX-Cs.screenX,gc=e.screenY-Cs.screenY):gc=mc=0,Cs=e),mc)},movementY:function(e){return"movementY"in e?e.movementY:gc}}),pp=cr(Fl),HS=ot({},Fl,{dataTransfer:0}),zS=cr(HS),US=ot({},Bo,{relatedTarget:0}),vc=cr(US),WS=ot({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),VS=cr(WS),KS=ot({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),GS=cr(KS),qS=ot({},ls,{data:0}),mp=cr(qS),XS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YS={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"},JS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=JS[e])?!!t[e]:!1}function fd(){return QS}var ZS=ot({},Bo,{key:function(e){if(e.key){var t=XS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Aa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?YS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fd,charCode:function(e){return e.type==="keypress"?Aa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Aa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ex=cr(ZS),tx=ot({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=cr(tx),rx=ot({},Bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fd}),nx=cr(rx),ix=ot({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),sx=cr(ix),ox=ot({},Fl,{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}),ax=cr(ox),lx=[9,13,27,32],pd=tn&&"CompositionEvent"in window,zs=null;tn&&"documentMode"in document&&(zs=document.documentMode);var cx=tn&&"TextEvent"in window&&!zs,n_=tn&&(!pd||zs&&8<zs&&11>=zs),vp=" ",_p=!1;function i_(e,t){switch(e){case"keyup":return lx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function s_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ei=!1;function ux(e,t){switch(e){case"compositionend":return s_(t);case"keypress":return t.which!==32?null:(_p=!0,vp);case"textInput":return e=t.data,e===vp&&_p?null:e;default:return null}}function hx(e,t){if(Ei)return e==="compositionend"||!pd&&i_(e,t)?(e=r_(),Ma=hd=wn=null,Ei=!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 n_&&t.locale!=="ko"?null:t.data;default:return null}}var dx={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 yp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dx[e.type]:t==="textarea"}function o_(e,t,r,n){Nv(n),t=rl(t,"onChange"),0<t.length&&(r=new dd("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Us=null,uo=null;function fx(e){v_(e,0)}function $l(e){var t=Ri(e);if(Dv(t))return e}function px(e,t){if(e==="change")return t}var a_=!1;if(tn){var _c;if(tn){var yc="oninput"in document;if(!yc){var wp=document.createElement("div");wp.setAttribute("oninput","return;"),yc=typeof wp.oninput=="function"}_c=yc}else _c=!1;a_=_c&&(!document.documentMode||9<document.documentMode)}function Sp(){Us&&(Us.detachEvent("onpropertychange",l_),uo=Us=null)}function l_(e){if(e.propertyName==="value"&&$l(uo)){var t=[];o_(t,uo,e,od(e)),Hv(fx,t)}}function mx(e,t,r){e==="focusin"?(Sp(),Us=t,uo=r,Us.attachEvent("onpropertychange",l_)):e==="focusout"&&Sp()}function gx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $l(uo)}function vx(e,t){if(e==="click")return $l(t)}function _x(e,t){if(e==="input"||e==="change")return $l(t)}function yx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dr=typeof Object.is=="function"?Object.is:yx;function ho(e,t){if(Dr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!pu.call(t,s)||!Dr(e[s],t[s]))return!1}return!0}function xp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bp(e,t){var r=xp(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=xp(r)}}function c_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?c_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function u_(){for(var e=window,t=Xa();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Xa(e.document)}return t}function md(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function wx(e){var t=u_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&c_(r.ownerDocument.documentElement,r)){if(n!==null&&md(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=bp(r,a);var l=bp(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Sx=tn&&"documentMode"in document&&11>=document.documentMode,ki=null,Pu=null,Ws=null,Iu=!1;function Cp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Iu||ki==null||ki!==Xa(n)||(n=ki,"selectionStart"in n&&md(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ws&&ho(Ws,n)||(Ws=n,n=rl(Pu,"onSelect"),0<n.length&&(t=new dd("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=ki)))}function sa(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Li={animationend:sa("Animation","AnimationEnd"),animationiteration:sa("Animation","AnimationIteration"),animationstart:sa("Animation","AnimationStart"),transitionend:sa("Transition","TransitionEnd")},wc={},h_={};tn&&(h_=document.createElement("div").style,"AnimationEvent"in window||(delete Li.animationend.animation,delete Li.animationiteration.animation,delete Li.animationstart.animation),"TransitionEvent"in window||delete Li.transitionend.transition);function Hl(e){if(wc[e])return wc[e];if(!Li[e])return e;var t=Li[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in h_)return wc[e]=t[r];return e}var d_=Hl("animationend"),f_=Hl("animationiteration"),p_=Hl("animationstart"),m_=Hl("transitionend"),g_=new Map,Ep="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){g_.set(e,t),pi(t,[e])}for(var Sc=0;Sc<Ep.length;Sc++){var xc=Ep[Sc],xx=xc.toLowerCase(),bx=xc[0].toUpperCase()+xc.slice(1);Bn(xx,"on"+bx)}Bn(d_,"onAnimationEnd");Bn(f_,"onAnimationIteration");Bn(p_,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(m_,"onTransitionEnd");Qi("onMouseEnter",["mouseout","mouseover"]);Qi("onMouseLeave",["mouseout","mouseover"]);Qi("onPointerEnter",["pointerout","pointerover"]);Qi("onPointerLeave",["pointerout","pointerover"]);pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pi("onBeforeInput",["compositionend","keypress","textInput","paste"]);pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bs="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(" "),Cx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bs));function kp(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,xS(n,t,void 0,e),e.currentTarget=null}function v_(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var l=n.length-1;0<=l;l--){var i=n[l],o=i.instance,c=i.currentTarget;if(i=i.listener,o!==a&&s.isPropagationStopped())break e;kp(s,i,c),a=o}else for(l=0;l<n.length;l++){if(i=n[l],o=i.instance,c=i.currentTarget,i=i.listener,o!==a&&s.isPropagationStopped())break e;kp(s,i,c),a=o}}}if(Ja)throw e=Tu,Ja=!1,Tu=null,e}function Je(e,t){var r=t[Fu];r===void 0&&(r=t[Fu]=new Set);var n=e+"__bubble";r.has(n)||(__(t,e,2,!1),r.add(n))}function bc(e,t,r){var n=0;t&&(n|=4),__(r,e,n,t)}var oa="_reactListening"+Math.random().toString(36).slice(2);function fo(e){if(!e[oa]){e[oa]=!0,Ev.forEach(function(r){r!=="selectionchange"&&(Cx.has(r)||bc(r,!1,e),bc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oa]||(t[oa]=!0,bc("selectionchange",!1,t))}}function __(e,t,r,n){switch(t_(t)){case 1:var s=jS;break;case 4:s=FS;break;default:s=ud}r=s.bind(null,t,r,e),s=void 0,!Ru||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Cc(e,t,r,n,s){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var i=n.stateNode.containerInfo;if(i===s||i.nodeType===8&&i.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===s||o.nodeType===8&&o.parentNode===s))return;l=l.return}for(;i!==null;){if(l=Qn(i),l===null)return;if(o=l.tag,o===5||o===6){n=a=l;continue e}i=i.parentNode}}n=n.return}Hv(function(){var c=a,p=od(r),u=[];e:{var m=g_.get(e);if(m!==void 0){var _=dd,y=e;switch(e){case"keypress":if(Aa(r)===0)break e;case"keydown":case"keyup":_=ex;break;case"focusin":y="focus",_=vc;break;case"focusout":y="blur",_=vc;break;case"beforeblur":case"afterblur":_=vc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=pp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=zS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=nx;break;case d_:case f_:case p_:_=VS;break;case m_:_=sx;break;case"scroll":_=$S;break;case"wheel":_=ax;break;case"copy":case"cut":case"paste":_=GS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=gp}var v=(t&4)!==0,h=!v&&e==="scroll",f=v?m!==null?m+"Capture":null:m;v=[];for(var d=c,g;d!==null;){g=d;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,f!==null&&(w=oo(d,f),w!=null&&v.push(po(d,w,g)))),h)break;d=d.return}0<v.length&&(m=new _(m,y,null,r,p),u.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",m&&r!==ku&&(y=r.relatedTarget||r.fromElement)&&(Qn(y)||y[rn]))break e;if((_||m)&&(m=p.window===p?p:(m=p.ownerDocument)?m.defaultView||m.parentWindow:window,_?(y=r.relatedTarget||r.toElement,_=c,y=y?Qn(y):null,y!==null&&(h=mi(y),y!==h||y.tag!==5&&y.tag!==6)&&(y=null)):(_=null,y=c),_!==y)){if(v=pp,w="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=gp,w="onPointerLeave",f="onPointerEnter",d="pointer"),h=_==null?m:Ri(_),g=y==null?m:Ri(y),m=new v(w,d+"leave",_,r,p),m.target=h,m.relatedTarget=g,w=null,Qn(p)===c&&(v=new v(f,d+"enter",y,r,p),v.target=g,v.relatedTarget=h,w=v),h=w,_&&y)t:{for(v=_,f=y,d=0,g=v;g;g=wi(g))d++;for(g=0,w=f;w;w=wi(w))g++;for(;0<d-g;)v=wi(v),d--;for(;0<g-d;)f=wi(f),g--;for(;d--;){if(v===f||f!==null&&v===f.alternate)break t;v=wi(v),f=wi(f)}v=null}else v=null;_!==null&&Lp(u,m,_,v,!1),y!==null&&h!==null&&Lp(u,h,y,v,!0)}}e:{if(m=c?Ri(c):window,_=m.nodeName&&m.nodeName.toLowerCase(),_==="select"||_==="input"&&m.type==="file")var b=px;else if(yp(m))if(a_)b=_x;else{b=gx;var x=mx}else(_=m.nodeName)&&_.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(b=vx);if(b&&(b=b(e,c))){o_(u,b,r,p);break e}x&&x(e,m,c),e==="focusout"&&(x=m._wrapperState)&&x.controlled&&m.type==="number"&&Su(m,"number",m.value)}switch(x=c?Ri(c):window,e){case"focusin":(yp(x)||x.contentEditable==="true")&&(ki=x,Pu=c,Ws=null);break;case"focusout":Ws=Pu=ki=null;break;case"mousedown":Iu=!0;break;case"contextmenu":case"mouseup":case"dragend":Iu=!1,Cp(u,r,p);break;case"selectionchange":if(Sx)break;case"keydown":case"keyup":Cp(u,r,p)}var C;if(pd)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ei?i_(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(n_&&r.locale!=="ko"&&(Ei||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ei&&(C=r_()):(wn=p,hd="value"in wn?wn.value:wn.textContent,Ei=!0)),x=rl(c,S),0<x.length&&(S=new mp(S,e,null,r,p),u.push({event:S,listeners:x}),C?S.data=C:(C=s_(r),C!==null&&(S.data=C)))),(C=cx?ux(e,r):hx(e,r))&&(c=rl(c,"onBeforeInput"),0<c.length&&(p=new mp("onBeforeInput","beforeinput",null,r,p),u.push({event:p,listeners:c}),p.data=C))}v_(u,t)})}function po(e,t,r){return{instance:e,listener:t,currentTarget:r}}function rl(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=oo(e,r),a!=null&&n.unshift(po(e,a,s)),a=oo(e,t),a!=null&&n.push(po(e,a,s))),e=e.return}return n}function wi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lp(e,t,r,n,s){for(var a=t._reactName,l=[];r!==null&&r!==n;){var i=r,o=i.alternate,c=i.stateNode;if(o!==null&&o===n)break;i.tag===5&&c!==null&&(i=c,s?(o=oo(r,a),o!=null&&l.unshift(po(r,o,i))):s||(o=oo(r,a),o!=null&&l.push(po(r,o,i)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var Ex=/\r\n?/g,kx=/\u0000|\uFFFD/g;function Rp(e){return(typeof e=="string"?e:""+e).replace(Ex,`
38
+ `).replace(kx,"")}function aa(e,t,r){if(t=Rp(t),Rp(e)!==t&&r)throw Error(se(425))}function nl(){}var Bu=null,Ou=null;function Nu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ju=typeof setTimeout=="function"?setTimeout:void 0,Lx=typeof clearTimeout=="function"?clearTimeout:void 0,Tp=typeof Promise=="function"?Promise:void 0,Rx=typeof queueMicrotask=="function"?queueMicrotask:typeof Tp<"u"?function(e){return Tp.resolve(null).then(e).catch(Tx)}:ju;function Tx(e){setTimeout(function(){throw e})}function Ec(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),co(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);co(t)}function kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Dp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var cs=Math.random().toString(36).slice(2),Or="__reactFiber$"+cs,mo="__reactProps$"+cs,rn="__reactContainer$"+cs,Fu="__reactEvents$"+cs,Dx="__reactListeners$"+cs,Mx="__reactHandles$"+cs;function Qn(e){var t=e[Or];if(t)return t;for(var r=e.parentNode;r;){if(t=r[rn]||r[Or]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Dp(e);e!==null;){if(r=e[Or])return r;e=Dp(e)}return t}e=r,r=e.parentNode}return null}function Oo(e){return e=e[Or]||e[rn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ri(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function zl(e){return e[mo]||null}var $u=[],Ti=-1;function On(e){return{current:e}}function Qe(e){0>Ti||(e.current=$u[Ti],$u[Ti]=null,Ti--)}function qe(e,t){Ti++,$u[Ti]=e.current,e.current=t}var An={},Ht=On(An),Qt=On(!1),ci=An;function Zi(e,t){var r=e.type.contextTypes;if(!r)return An;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Zt(e){return e=e.childContextTypes,e!=null}function il(){Qe(Qt),Qe(Ht)}function Mp(e,t,r){if(Ht.current!==An)throw Error(se(168));qe(Ht,t),qe(Qt,r)}function y_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(se(108,mS(e)||"Unknown",s));return ot({},r,n)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||An,ci=Ht.current,qe(Ht,e),qe(Qt,Qt.current),!0}function Ap(e,t,r){var n=e.stateNode;if(!n)throw Error(se(169));r?(e=y_(e,t,ci),n.__reactInternalMemoizedMergedChildContext=e,Qe(Qt),Qe(Ht),qe(Ht,e)):Qe(Qt),qe(Qt,r)}var Xr=null,Ul=!1,kc=!1;function w_(e){Xr===null?Xr=[e]:Xr.push(e)}function Ax(e){Ul=!0,w_(e)}function Nn(){if(!kc&&Xr!==null){kc=!0;var e=0,t=Ve;try{var r=Xr;for(Ve=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Xr=null,Ul=!1}catch(s){throw Xr!==null&&(Xr=Xr.slice(e+1)),Vv(ad,Nn),s}finally{Ve=t,kc=!1}}return null}var Di=[],Mi=0,ol=null,al=0,dr=[],fr=0,ui=null,Jr=1,Qr="";function Xn(e,t){Di[Mi++]=al,Di[Mi++]=ol,ol=e,al=t}function S_(e,t,r){dr[fr++]=Jr,dr[fr++]=Qr,dr[fr++]=ui,ui=e;var n=Jr;e=Qr;var s=32-Rr(n)-1;n&=~(1<<s),r+=1;var a=32-Rr(t)+s;if(30<a){var l=s-s%5;a=(n&(1<<l)-1).toString(32),n>>=l,s-=l,Jr=1<<32-Rr(t)+s|r<<s|n,Qr=a+e}else Jr=1<<a|r<<s|n,Qr=e}function gd(e){e.return!==null&&(Xn(e,1),S_(e,1,0))}function vd(e){for(;e===ol;)ol=Di[--Mi],Di[Mi]=null,al=Di[--Mi],Di[Mi]=null;for(;e===ui;)ui=dr[--fr],dr[fr]=null,Qr=dr[--fr],dr[fr]=null,Jr=dr[--fr],dr[fr]=null}var sr=null,ir=null,tt=!1,Er=null;function x_(e,t){var r=pr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Pp(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sr=e,ir=kn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sr=e,ir=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ui!==null?{id:Jr,overflow:Qr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=pr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,sr=e,ir=null,!0):!1;default:return!1}}function Hu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function zu(e){if(tt){var t=ir;if(t){var r=t;if(!Pp(e,t)){if(Hu(e))throw Error(se(418));t=kn(r.nextSibling);var n=sr;t&&Pp(e,t)?x_(n,r):(e.flags=e.flags&-4097|2,tt=!1,sr=e)}}else{if(Hu(e))throw Error(se(418));e.flags=e.flags&-4097|2,tt=!1,sr=e}}}function Ip(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sr=e}function la(e){if(e!==sr)return!1;if(!tt)return Ip(e),tt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Nu(e.type,e.memoizedProps)),t&&(t=ir)){if(Hu(e))throw b_(),Error(se(418));for(;t;)x_(e,t),t=kn(t.nextSibling)}if(Ip(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){ir=kn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}ir=null}}else ir=sr?kn(e.stateNode.nextSibling):null;return!0}function b_(){for(var e=ir;e;)e=kn(e.nextSibling)}function es(){ir=sr=null,tt=!1}function _d(e){Er===null?Er=[e]:Er.push(e)}var Px=an.ReactCurrentBatchConfig;function Es(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(se(309));var n=r.stateNode}if(!n)throw Error(se(147,e));var s=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var i=s.refs;l===null?delete i[a]:i[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(se(284));if(!r._owner)throw Error(se(290,e))}return e}function ca(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bp(e){var t=e._init;return t(e._payload)}function C_(e){function t(f,d){if(e){var g=f.deletions;g===null?(f.deletions=[d],f.flags|=16):g.push(d)}}function r(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function n(f,d){for(f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function s(f,d){return f=Dn(f,d),f.index=0,f.sibling=null,f}function a(f,d,g){return f.index=g,e?(g=f.alternate,g!==null?(g=g.index,g<d?(f.flags|=2,d):g):(f.flags|=2,d)):(f.flags|=1048576,d)}function l(f){return e&&f.alternate===null&&(f.flags|=2),f}function i(f,d,g,w){return d===null||d.tag!==6?(d=Pc(g,f.mode,w),d.return=f,d):(d=s(d,g),d.return=f,d)}function o(f,d,g,w){var b=g.type;return b===Ci?p(f,d,g.props.children,w,g.key):d!==null&&(d.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===mn&&Bp(b)===d.type)?(w=s(d,g.props),w.ref=Es(f,d,g),w.return=f,w):(w=Fa(g.type,g.key,g.props,null,f.mode,w),w.ref=Es(f,d,g),w.return=f,w)}function c(f,d,g,w){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=Ic(g,f.mode,w),d.return=f,d):(d=s(d,g.children||[]),d.return=f,d)}function p(f,d,g,w,b){return d===null||d.tag!==7?(d=oi(g,f.mode,w,b),d.return=f,d):(d=s(d,g),d.return=f,d)}function u(f,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Pc(""+d,f.mode,g),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Qo:return g=Fa(d.type,d.key,d.props,null,f.mode,g),g.ref=Es(f,null,d),g.return=f,g;case bi:return d=Ic(d,f.mode,g),d.return=f,d;case mn:var w=d._init;return u(f,w(d._payload),g)}if(Ps(d)||ws(d))return d=oi(d,f.mode,g,null),d.return=f,d;ca(f,d)}return null}function m(f,d,g,w){var b=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:i(f,d,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Qo:return g.key===b?o(f,d,g,w):null;case bi:return g.key===b?c(f,d,g,w):null;case mn:return b=g._init,m(f,d,b(g._payload),w)}if(Ps(g)||ws(g))return b!==null?null:p(f,d,g,w,null);ca(f,g)}return null}function _(f,d,g,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return f=f.get(g)||null,i(d,f,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Qo:return f=f.get(w.key===null?g:w.key)||null,o(d,f,w,b);case bi:return f=f.get(w.key===null?g:w.key)||null,c(d,f,w,b);case mn:var x=w._init;return _(f,d,g,x(w._payload),b)}if(Ps(w)||ws(w))return f=f.get(g)||null,p(d,f,w,b,null);ca(d,w)}return null}function y(f,d,g,w){for(var b=null,x=null,C=d,S=d=0,E=null;C!==null&&S<g.length;S++){C.index>S?(E=C,C=null):E=C.sibling;var L=m(f,C,g[S],w);if(L===null){C===null&&(C=E);break}e&&C&&L.alternate===null&&t(f,C),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L,C=E}if(S===g.length)return r(f,C),tt&&Xn(f,S),b;if(C===null){for(;S<g.length;S++)C=u(f,g[S],w),C!==null&&(d=a(C,d,S),x===null?b=C:x.sibling=C,x=C);return tt&&Xn(f,S),b}for(C=n(f,C);S<g.length;S++)E=_(C,f,S,g[S],w),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?S:E.key),d=a(E,d,S),x===null?b=E:x.sibling=E,x=E);return e&&C.forEach(function(A){return t(f,A)}),tt&&Xn(f,S),b}function v(f,d,g,w){var b=ws(g);if(typeof b!="function")throw Error(se(150));if(g=b.call(g),g==null)throw Error(se(151));for(var x=b=null,C=d,S=d=0,E=null,L=g.next();C!==null&&!L.done;S++,L=g.next()){C.index>S?(E=C,C=null):E=C.sibling;var A=m(f,C,L.value,w);if(A===null){C===null&&(C=E);break}e&&C&&A.alternate===null&&t(f,C),d=a(A,d,S),x===null?b=A:x.sibling=A,x=A,C=E}if(L.done)return r(f,C),tt&&Xn(f,S),b;if(C===null){for(;!L.done;S++,L=g.next())L=u(f,L.value,w),L!==null&&(d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return tt&&Xn(f,S),b}for(C=n(f,C);!L.done;S++,L=g.next())L=_(C,f,S,L.value,w),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?S:L.key),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return e&&C.forEach(function(M){return t(f,M)}),tt&&Xn(f,S),b}function h(f,d,g,w){if(typeof g=="object"&&g!==null&&g.type===Ci&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Qo:e:{for(var b=g.key,x=d;x!==null;){if(x.key===b){if(b=g.type,b===Ci){if(x.tag===7){r(f,x.sibling),d=s(x,g.props.children),d.return=f,f=d;break e}}else if(x.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===mn&&Bp(b)===x.type){r(f,x.sibling),d=s(x,g.props),d.ref=Es(f,x,g),d.return=f,f=d;break e}r(f,x);break}else t(f,x);x=x.sibling}g.type===Ci?(d=oi(g.props.children,f.mode,w,g.key),d.return=f,f=d):(w=Fa(g.type,g.key,g.props,null,f.mode,w),w.ref=Es(f,d,g),w.return=f,f=w)}return l(f);case bi:e:{for(x=g.key;d!==null;){if(d.key===x)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){r(f,d.sibling),d=s(d,g.children||[]),d.return=f,f=d;break e}else{r(f,d);break}else t(f,d);d=d.sibling}d=Ic(g,f.mode,w),d.return=f,f=d}return l(f);case mn:return x=g._init,h(f,d,x(g._payload),w)}if(Ps(g))return y(f,d,g,w);if(ws(g))return v(f,d,g,w);ca(f,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(r(f,d.sibling),d=s(d,g),d.return=f,f=d):(r(f,d),d=Pc(g,f.mode,w),d.return=f,f=d),l(f)):r(f,d)}return h}var ts=C_(!0),E_=C_(!1),ll=On(null),cl=null,Ai=null,yd=null;function wd(){yd=Ai=cl=null}function Sd(e){var t=ll.current;Qe(ll),e._currentValue=t}function Uu(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Wi(e,t){cl=e,yd=Ai=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Jt=!0),e.firstContext=null)}function _r(e){var t=e._currentValue;if(yd!==e)if(e={context:e,memoizedValue:t,next:null},Ai===null){if(cl===null)throw Error(se(308));Ai=e,cl.dependencies={lanes:0,firstContext:e}}else Ai=Ai.next=e;return t}var Zn=null;function xd(e){Zn===null?Zn=[e]:Zn.push(e)}function k_(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,xd(t)):(r.next=s.next,s.next=r),t.interleaved=r,nn(e,n)}function nn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var gn=!1;function bd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function L_(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Zr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ln(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ze&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,nn(e,r)}return s=n.interleaved,s===null?(t.next=t,xd(n)):(t.next=s.next,s.next=t),n.interleaved=t,nn(e,r)}function Pa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ld(e,r)}}function Op(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=l:a=a.next=l,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ul(e,t,r,n){var s=e.updateQueue;gn=!1;var a=s.firstBaseUpdate,l=s.lastBaseUpdate,i=s.shared.pending;if(i!==null){s.shared.pending=null;var o=i,c=o.next;o.next=null,l===null?a=c:l.next=c,l=o;var p=e.alternate;p!==null&&(p=p.updateQueue,i=p.lastBaseUpdate,i!==l&&(i===null?p.firstBaseUpdate=c:i.next=c,p.lastBaseUpdate=o))}if(a!==null){var u=s.baseState;l=0,p=c=o=null,i=a;do{var m=i.lane,_=i.eventTime;if((n&m)===m){p!==null&&(p=p.next={eventTime:_,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var y=e,v=i;switch(m=t,_=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){u=y.call(_,u,m);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,m=typeof y=="function"?y.call(_,u,m):y,m==null)break e;u=ot({},u,m);break e;case 2:gn=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[i]:m.push(i))}else _={eventTime:_,lane:m,tag:i.tag,payload:i.payload,callback:i.callback,next:null},p===null?(c=p=_,o=u):p=p.next=_,l|=m;if(i=i.next,i===null){if(i=s.shared.pending,i===null)break;m=i,i=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(p===null&&(o=u),s.baseState=o,s.firstBaseUpdate=c,s.lastBaseUpdate=p,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);di|=l,e.lanes=l,e.memoizedState=u}}function Np(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(se(191,s));s.call(n)}}}var No={},Fr=On(No),go=On(No),vo=On(No);function ei(e){if(e===No)throw Error(se(174));return e}function Cd(e,t){switch(qe(vo,t),qe(go,e),qe(Fr,No),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:bu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=bu(t,e)}Qe(Fr),qe(Fr,t)}function rs(){Qe(Fr),Qe(go),Qe(vo)}function R_(e){ei(vo.current);var t=ei(Fr.current),r=bu(t,e.type);t!==r&&(qe(go,e),qe(Fr,r))}function Ed(e){go.current===e&&(Qe(Fr),Qe(go))}var nt=On(0);function hl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Lc=[];function kd(){for(var e=0;e<Lc.length;e++)Lc[e]._workInProgressVersionPrimary=null;Lc.length=0}var Ia=an.ReactCurrentDispatcher,Rc=an.ReactCurrentBatchConfig,hi=0,st=null,yt=null,xt=null,dl=!1,Vs=!1,_o=0,Ix=0;function Bt(){throw Error(se(321))}function Ld(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Dr(e[r],t[r]))return!1;return!0}function Rd(e,t,r,n,s,a){if(hi=a,st=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ia.current=e===null||e.memoizedState===null?jx:Fx,e=r(n,s),Vs){a=0;do{if(Vs=!1,_o=0,25<=a)throw Error(se(301));a+=1,xt=yt=null,t.updateQueue=null,Ia.current=$x,e=r(n,s)}while(Vs)}if(Ia.current=fl,t=yt!==null&&yt.next!==null,hi=0,xt=yt=st=null,dl=!1,t)throw Error(se(300));return e}function Td(){var e=_o!==0;return _o=0,e}function Br(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?st.memoizedState=xt=e:xt=xt.next=e,xt}function yr(){if(yt===null){var e=st.alternate;e=e!==null?e.memoizedState:null}else e=yt.next;var t=xt===null?st.memoizedState:xt.next;if(t!==null)xt=t,yt=e;else{if(e===null)throw Error(se(310));yt=e,e={memoizedState:yt.memoizedState,baseState:yt.baseState,baseQueue:yt.baseQueue,queue:yt.queue,next:null},xt===null?st.memoizedState=xt=e:xt=xt.next=e}return xt}function yo(e,t){return typeof t=="function"?t(e):t}function Tc(e){var t=yr(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var n=yt,s=n.baseQueue,a=r.pending;if(a!==null){if(s!==null){var l=s.next;s.next=a.next,a.next=l}n.baseQueue=s=a,r.pending=null}if(s!==null){a=s.next,n=n.baseState;var i=l=null,o=null,c=a;do{var p=c.lane;if((hi&p)===p)o!==null&&(o=o.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};o===null?(i=o=u,l=n):o=o.next=u,st.lanes|=p,di|=p}c=c.next}while(c!==null&&c!==a);o===null?l=n:o.next=i,Dr(n,t.memoizedState)||(Jt=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=o,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do a=s.lane,st.lanes|=a,di|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Dc(e){var t=yr(),r=t.queue;if(r===null)throw Error(se(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,a=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do a=e(a,l.action),l=l.next;while(l!==s);Dr(a,t.memoizedState)||(Jt=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function T_(){}function D_(e,t){var r=st,n=yr(),s=t(),a=!Dr(n.memoizedState,s);if(a&&(n.memoizedState=s,Jt=!0),n=n.queue,Dd(P_.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||xt!==null&&xt.memoizedState.tag&1){if(r.flags|=2048,wo(9,A_.bind(null,r,n,s,t),void 0,null),Lt===null)throw Error(se(349));hi&30||M_(r,t,s)}return s}function M_(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=st.updateQueue,t===null?(t={lastEffect:null,stores:null},st.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function A_(e,t,r,n){t.value=r,t.getSnapshot=n,I_(t)&&B_(e)}function P_(e,t,r){return r(function(){I_(t)&&B_(e)})}function I_(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Dr(e,r)}catch{return!0}}function B_(e){var t=nn(e,1);t!==null&&Tr(t,e,1,-1)}function jp(e){var t=Br();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yo,lastRenderedState:e},t.queue=e,e=e.dispatch=Nx.bind(null,st,e),[t.memoizedState,e]}function wo(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=st.updateQueue,t===null?(t={lastEffect:null,stores:null},st.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function O_(){return yr().memoizedState}function Ba(e,t,r,n){var s=Br();st.flags|=e,s.memoizedState=wo(1|t,r,void 0,n===void 0?null:n)}function Wl(e,t,r,n){var s=yr();n=n===void 0?null:n;var a=void 0;if(yt!==null){var l=yt.memoizedState;if(a=l.destroy,n!==null&&Ld(n,l.deps)){s.memoizedState=wo(t,r,a,n);return}}st.flags|=e,s.memoizedState=wo(1|t,r,a,n)}function Fp(e,t){return Ba(8390656,8,e,t)}function Dd(e,t){return Wl(2048,8,e,t)}function N_(e,t){return Wl(4,2,e,t)}function j_(e,t){return Wl(4,4,e,t)}function F_(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $_(e,t,r){return r=r!=null?r.concat([e]):null,Wl(4,4,F_.bind(null,t,e),r)}function Md(){}function H_(e,t){var r=yr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Ld(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function z_(e,t){var r=yr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Ld(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function U_(e,t,r){return hi&21?(Dr(r,t)||(r=qv(),st.lanes|=r,di|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Jt=!0),e.memoizedState=r)}function Bx(e,t){var r=Ve;Ve=r!==0&&4>r?r:4,e(!0);var n=Rc.transition;Rc.transition={};try{e(!1),t()}finally{Ve=r,Rc.transition=n}}function W_(){return yr().memoizedState}function Ox(e,t,r){var n=Tn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},V_(e))K_(t,r);else if(r=k_(e,t,r,n),r!==null){var s=Gt();Tr(r,e,n,s),G_(r,t,n)}}function Nx(e,t,r){var n=Tn(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(V_(e))K_(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,i=a(l,r);if(s.hasEagerState=!0,s.eagerState=i,Dr(i,l)){var o=t.interleaved;o===null?(s.next=s,xd(t)):(s.next=o.next,o.next=s),t.interleaved=s;return}}catch{}finally{}r=k_(e,t,s,n),r!==null&&(s=Gt(),Tr(r,e,n,s),G_(r,t,n))}}function V_(e){var t=e.alternate;return e===st||t!==null&&t===st}function K_(e,t){Vs=dl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function G_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ld(e,r)}}var fl={readContext:_r,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},jx={readContext:_r,useCallback:function(e,t){return Br().memoizedState=[e,t===void 0?null:t],e},useContext:_r,useEffect:Fp,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ba(4194308,4,F_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ba(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ba(4,2,e,t)},useMemo:function(e,t){var r=Br();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Br();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Ox.bind(null,st,e),[n.memoizedState,e]},useRef:function(e){var t=Br();return e={current:e},t.memoizedState=e},useState:jp,useDebugValue:Md,useDeferredValue:function(e){return Br().memoizedState=e},useTransition:function(){var e=jp(!1),t=e[0];return e=Bx.bind(null,e[1]),Br().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=st,s=Br();if(tt){if(r===void 0)throw Error(se(407));r=r()}else{if(r=t(),Lt===null)throw Error(se(349));hi&30||M_(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,Fp(P_.bind(null,n,a,e),[e]),n.flags|=2048,wo(9,A_.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Br(),t=Lt.identifierPrefix;if(tt){var r=Qr,n=Jr;r=(n&~(1<<32-Rr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=_o++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Ix++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Fx={readContext:_r,useCallback:H_,useContext:_r,useEffect:Dd,useImperativeHandle:$_,useInsertionEffect:N_,useLayoutEffect:j_,useMemo:z_,useReducer:Tc,useRef:O_,useState:function(){return Tc(yo)},useDebugValue:Md,useDeferredValue:function(e){var t=yr();return U_(t,yt.memoizedState,e)},useTransition:function(){var e=Tc(yo)[0],t=yr().memoizedState;return[e,t]},useMutableSource:T_,useSyncExternalStore:D_,useId:W_,unstable_isNewReconciler:!1},$x={readContext:_r,useCallback:H_,useContext:_r,useEffect:Dd,useImperativeHandle:$_,useInsertionEffect:N_,useLayoutEffect:j_,useMemo:z_,useReducer:Dc,useRef:O_,useState:function(){return Dc(yo)},useDebugValue:Md,useDeferredValue:function(e){var t=yr();return yt===null?t.memoizedState=e:U_(t,yt.memoizedState,e)},useTransition:function(){var e=Dc(yo)[0],t=yr().memoizedState;return[e,t]},useMutableSource:T_,useSyncExternalStore:D_,useId:W_,unstable_isNewReconciler:!1};function br(e,t){if(e&&e.defaultProps){t=ot({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Wu(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ot({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Vl={isMounted:function(e){return(e=e._reactInternals)?mi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Gt(),s=Tn(e),a=Zr(n,s);a.payload=t,r!=null&&(a.callback=r),t=Ln(e,a,s),t!==null&&(Tr(t,e,s,n),Pa(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Gt(),s=Tn(e),a=Zr(n,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Ln(e,a,s),t!==null&&(Tr(t,e,s,n),Pa(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Gt(),n=Tn(e),s=Zr(r,n);s.tag=2,t!=null&&(s.callback=t),t=Ln(e,s,n),t!==null&&(Tr(t,e,n,r),Pa(t,e,n))}};function $p(e,t,r,n,s,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):t.prototype&&t.prototype.isPureReactComponent?!ho(r,n)||!ho(s,a):!0}function q_(e,t,r){var n=!1,s=An,a=t.contextType;return typeof a=="object"&&a!==null?a=_r(a):(s=Zt(t)?ci:Ht.current,n=t.contextTypes,a=(n=n!=null)?Zi(e,s):An),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vl,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function Hp(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Vl.enqueueReplaceState(t,t.state,null)}function Vu(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},bd(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=_r(a):(a=Zt(t)?ci:Ht.current,s.context=Zi(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Wu(e,t,a,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Vl.enqueueReplaceState(s,s.state,null),ul(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ns(e,t){try{var r="",n=t;do r+=pS(n),n=n.return;while(n);var s=r}catch(a){s=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:s,digest:null}}function Mc(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ku(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Hx=typeof WeakMap=="function"?WeakMap:Map;function X_(e,t,r){r=Zr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){ml||(ml=!0,rh=n),Ku(e,t)},r}function Y_(e,t,r){r=Zr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Ku(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Ku(e,t),typeof n!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function zp(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Hx;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=tb.bind(null,e,t,r),t.then(e,e))}function Up(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Wp(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Zr(-1,1),t.tag=2,Ln(r,t,1))),r.lanes|=1),e)}var zx=an.ReactCurrentOwner,Jt=!1;function Wt(e,t,r,n){t.child=e===null?E_(t,null,r,n):ts(t,e.child,r,n)}function Vp(e,t,r,n,s){r=r.render;var a=t.ref;return Wi(t,s),n=Rd(e,t,r,n,a,s),r=Td(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sn(e,t,s)):(tt&&r&&gd(t),t.flags|=1,Wt(e,t,n,s),t.child)}function Kp(e,t,r,n,s){if(e===null){var a=r.type;return typeof a=="function"&&!Fd(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,J_(e,t,a,n,s)):(e=Fa(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var l=a.memoizedProps;if(r=r.compare,r=r!==null?r:ho,r(l,n)&&e.ref===t.ref)return sn(e,t,s)}return t.flags|=1,e=Dn(a,n),e.ref=t.ref,e.return=t,t.child=e}function J_(e,t,r,n,s){if(e!==null){var a=e.memoizedProps;if(ho(a,n)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=n=a,(e.lanes&s)!==0)e.flags&131072&&(Jt=!0);else return t.lanes=e.lanes,sn(e,t,s)}return Gu(e,t,r,n,s)}function Q_(e,t,r){var n=t.pendingProps,s=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qe(Ii,nr),nr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qe(Ii,nr),nr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,qe(Ii,nr),nr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,qe(Ii,nr),nr|=n;return Wt(e,t,s,r),t.child}function Z_(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Gu(e,t,r,n,s){var a=Zt(r)?ci:Ht.current;return a=Zi(t,a),Wi(t,s),r=Rd(e,t,r,n,a,s),n=Td(),e!==null&&!Jt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,sn(e,t,s)):(tt&&n&&gd(t),t.flags|=1,Wt(e,t,r,s),t.child)}function Gp(e,t,r,n,s){if(Zt(r)){var a=!0;sl(t)}else a=!1;if(Wi(t,s),t.stateNode===null)Oa(e,t),q_(t,r,n),Vu(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,i=t.memoizedProps;l.props=i;var o=l.context,c=r.contextType;typeof c=="object"&&c!==null?c=_r(c):(c=Zt(r)?ci:Ht.current,c=Zi(t,c));var p=r.getDerivedStateFromProps,u=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";u||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==n||o!==c)&&Hp(t,l,n,c),gn=!1;var m=t.memoizedState;l.state=m,ul(t,n,l,s),o=t.memoizedState,i!==n||m!==o||Qt.current||gn?(typeof p=="function"&&(Wu(t,r,p,n),o=t.memoizedState),(i=gn||$p(t,r,i,n,m,o,c))?(u||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=o),l.props=n,l.state=o,l.context=c,n=i):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,L_(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:br(t.type,i),l.props=c,u=t.pendingProps,m=l.context,o=r.contextType,typeof o=="object"&&o!==null?o=_r(o):(o=Zt(r)?ci:Ht.current,o=Zi(t,o));var _=r.getDerivedStateFromProps;(p=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==u||m!==o)&&Hp(t,l,n,o),gn=!1,m=t.memoizedState,l.state=m,ul(t,n,l,s);var y=t.memoizedState;i!==u||m!==y||Qt.current||gn?(typeof _=="function"&&(Wu(t,r,_,n),y=t.memoizedState),(c=gn||$p(t,r,c,n,m,y,o)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,y,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,y,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),l.props=n,l.state=y,l.context=o,n=c):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return qu(e,t,r,n,a,s)}function qu(e,t,r,n,s,a){Z_(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&Ap(t,r,!1),sn(e,t,a);n=t.stateNode,zx.current=t;var i=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=ts(t,e.child,null,a),t.child=ts(t,null,i,a)):Wt(e,t,i,a),t.memoizedState=n.state,s&&Ap(t,r,!0),t.child}function e0(e){var t=e.stateNode;t.pendingContext?Mp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Mp(e,t.context,!1),Cd(e,t.containerInfo)}function qp(e,t,r,n,s){return es(),_d(s),t.flags|=256,Wt(e,t,r,n),t.child}var Xu={dehydrated:null,treeContext:null,retryLane:0};function Yu(e){return{baseLanes:e,cachePool:null,transitions:null}}function t0(e,t,r){var n=t.pendingProps,s=nt.current,a=!1,l=(t.flags&128)!==0,i;if((i=l)||(i=e!==null&&e.memoizedState===null?!1:(s&2)!==0),i?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),qe(nt,s&1),e===null)return zu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,a?(n=t.mode,a=t.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=ql(l,n,0,null),e=oi(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Yu(r),t.memoizedState=Xu,e):Ad(t,l));if(s=e.memoizedState,s!==null&&(i=s.dehydrated,i!==null))return Ux(e,t,l,n,i,s,r);if(a){a=n.fallback,l=t.mode,s=e.child,i=s.sibling;var o={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=o,t.deletions=null):(n=Dn(s,o),n.subtreeFlags=s.subtreeFlags&14680064),i!==null?a=Dn(i,a):(a=oi(a,l,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,l=e.child.memoizedState,l=l===null?Yu(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=Xu,n}return a=e.child,e=a.sibling,n=Dn(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Ad(e,t){return t=ql({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ua(e,t,r,n){return n!==null&&_d(n),ts(t,e.child,null,r),e=Ad(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ux(e,t,r,n,s,a,l){if(r)return t.flags&256?(t.flags&=-257,n=Mc(Error(se(422))),ua(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,s=t.mode,n=ql({mode:"visible",children:n.children},s,0,null),a=oi(a,s,l,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&ts(t,e.child,null,l),t.child.memoizedState=Yu(l),t.memoizedState=Xu,a);if(!(t.mode&1))return ua(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var i=n.dgst;return n=i,a=Error(se(419)),n=Mc(a,n,void 0),ua(e,t,l,n)}if(i=(l&e.childLanes)!==0,Jt||i){if(n=Lt,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,nn(e,s),Tr(n,e,s,-1))}return jd(),n=Mc(Error(se(421))),ua(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=rb.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,ir=kn(s.nextSibling),sr=t,tt=!0,Er=null,e!==null&&(dr[fr++]=Jr,dr[fr++]=Qr,dr[fr++]=ui,Jr=e.id,Qr=e.overflow,ui=t),t=Ad(t,n.children),t.flags|=4096,t)}function Xp(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Uu(e.return,t,r)}function Ac(e,t,r,n,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=s)}function r0(e,t,r){var n=t.pendingProps,s=n.revealOrder,a=n.tail;if(Wt(e,t,n.children,r),n=nt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xp(e,r,t);else if(e.tag===19)Xp(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(qe(nt,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&hl(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),Ac(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&hl(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}Ac(t,!0,r,null,a);break;case"together":Ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Oa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),di|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,r=Dn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Dn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Wx(e,t,r){switch(t.tag){case 3:e0(t),es();break;case 5:R_(t);break;case 1:Zt(t.type)&&sl(t);break;case 4:Cd(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;qe(ll,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(qe(nt,nt.current&1),t.flags|=128,null):r&t.child.childLanes?t0(e,t,r):(qe(nt,nt.current&1),e=sn(e,t,r),e!==null?e.sibling:null);qe(nt,nt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return r0(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),qe(nt,nt.current),n)break;return null;case 22:case 23:return t.lanes=0,Q_(e,t,r)}return sn(e,t,r)}var n0,Ju,i0,s0;n0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ju=function(){};i0=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,ei(Fr.current);var a=null;switch(r){case"input":s=yu(e,s),n=yu(e,n),a=[];break;case"select":s=ot({},s,{value:void 0}),n=ot({},n,{value:void 0}),a=[];break;case"textarea":s=xu(e,s),n=xu(e,n),a=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=nl)}Cu(r,n);var l;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var i=s[c];for(l in i)i.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(io.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var o=n[c];if(i=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&o!==i&&(o!=null||i!=null))if(c==="style")if(i){for(l in i)!i.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in o)o.hasOwnProperty(l)&&i[l]!==o[l]&&(r||(r={}),r[l]=o[l])}else r||(a||(a=[]),a.push(c,r)),r=o;else c==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,i=i?i.__html:void 0,o!=null&&i!==o&&(a=a||[]).push(c,o)):c==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(c,""+o):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(io.hasOwnProperty(c)?(o!=null&&c==="onScroll"&&Je("scroll",e),a||i===o||(a=[])):(a=a||[]).push(c,o))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};s0=function(e,t,r,n){r!==n&&(t.flags|=4)};function ks(e,t){if(!tt)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Vx(e,t,r){var n=t.pendingProps;switch(vd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(t),null;case 1:return Zt(t.type)&&il(),Ot(t),null;case 3:return n=t.stateNode,rs(),Qe(Qt),Qe(Ht),kd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(la(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Er!==null&&(sh(Er),Er=null))),Ju(e,t),Ot(t),null;case 5:Ed(t);var s=ei(vo.current);if(r=t.type,e!==null&&t.stateNode!=null)i0(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(se(166));return Ot(t),null}if(e=ei(Fr.current),la(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Or]=t,n[mo]=a,e=(t.mode&1)!==0,r){case"dialog":Je("cancel",n),Je("close",n);break;case"iframe":case"object":case"embed":Je("load",n);break;case"video":case"audio":for(s=0;s<Bs.length;s++)Je(Bs[s],n);break;case"source":Je("error",n);break;case"img":case"image":case"link":Je("error",n),Je("load",n);break;case"details":Je("toggle",n);break;case"input":ip(n,a),Je("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Je("invalid",n);break;case"textarea":op(n,a),Je("invalid",n)}Cu(r,a),s=null;for(var l in a)if(a.hasOwnProperty(l)){var i=a[l];l==="children"?typeof i=="string"?n.textContent!==i&&(a.suppressHydrationWarning!==!0&&aa(n.textContent,i,e),s=["children",i]):typeof i=="number"&&n.textContent!==""+i&&(a.suppressHydrationWarning!==!0&&aa(n.textContent,i,e),s=["children",""+i]):io.hasOwnProperty(l)&&i!=null&&l==="onScroll"&&Je("scroll",n)}switch(r){case"input":Zo(n),sp(n,a,!0);break;case"textarea":Zo(n),ap(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=nl)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Pv(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[Or]=t,e[mo]=n,n0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Eu(r,n),r){case"dialog":Je("cancel",e),Je("close",e),s=n;break;case"iframe":case"object":case"embed":Je("load",e),s=n;break;case"video":case"audio":for(s=0;s<Bs.length;s++)Je(Bs[s],e);s=n;break;case"source":Je("error",e),s=n;break;case"img":case"image":case"link":Je("error",e),Je("load",e),s=n;break;case"details":Je("toggle",e),s=n;break;case"input":ip(e,n),s=yu(e,n),Je("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=ot({},n,{value:void 0}),Je("invalid",e);break;case"textarea":op(e,n),s=xu(e,n),Je("invalid",e);break;default:s=n}Cu(r,s),i=s;for(a in i)if(i.hasOwnProperty(a)){var o=i[a];a==="style"?Ov(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&Iv(e,o)):a==="children"?typeof o=="string"?(r!=="textarea"||o!=="")&&so(e,o):typeof o=="number"&&so(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(io.hasOwnProperty(a)?o!=null&&a==="onScroll"&&Je("scroll",e):o!=null&&rd(e,a,o,l))}switch(r){case"input":Zo(e),sp(e,n,!1);break;case"textarea":Zo(e),ap(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Mn(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?$i(e,!!n.multiple,a,!1):n.defaultValue!=null&&$i(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=nl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ot(t),null;case 6:if(e&&t.stateNode!=null)s0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(se(166));if(r=ei(vo.current),ei(Fr.current),la(t)){if(n=t.stateNode,r=t.memoizedProps,n[Or]=t,(a=n.nodeValue!==r)&&(e=sr,e!==null))switch(e.tag){case 3:aa(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&aa(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Or]=t,t.stateNode=n}return Ot(t),null;case 13:if(Qe(nt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(tt&&ir!==null&&t.mode&1&&!(t.flags&128))b_(),es(),t.flags|=98560,a=!1;else if(a=la(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(se(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(se(317));a[Or]=t}else es(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ot(t),a=!1}else Er!==null&&(sh(Er),Er=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||nt.current&1?St===0&&(St=3):jd())),t.updateQueue!==null&&(t.flags|=4),Ot(t),null);case 4:return rs(),Ju(e,t),e===null&&fo(t.stateNode.containerInfo),Ot(t),null;case 10:return Sd(t.type._context),Ot(t),null;case 17:return Zt(t.type)&&il(),Ot(t),null;case 19:if(Qe(nt),a=t.memoizedState,a===null)return Ot(t),null;if(n=(t.flags&128)!==0,l=a.rendering,l===null)if(n)ks(a,!1);else{if(St!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=hl(e),l!==null){for(t.flags|=128,ks(a,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return qe(nt,nt.current&1|2),t.child}e=e.sibling}a.tail!==null&&ft()>is&&(t.flags|=128,n=!0,ks(a,!1),t.lanes=4194304)}else{if(!n)if(e=hl(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ks(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!tt)return Ot(t),null}else 2*ft()-a.renderingStartTime>is&&r!==1073741824&&(t.flags|=128,n=!0,ks(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(r=a.last,r!==null?r.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ft(),t.sibling=null,r=nt.current,qe(nt,n?r&1|2:r&1),t):(Ot(t),null);case 22:case 23:return Nd(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?nr&1073741824&&(Ot(t),t.subtreeFlags&6&&(t.flags|=8192)):Ot(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function Kx(e,t){switch(vd(t),t.tag){case 1:return Zt(t.type)&&il(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(),Qe(Qt),Qe(Ht),kd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ed(t),null;case 13:if(Qe(nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qe(nt),null;case 4:return rs(),null;case 10:return Sd(t.type._context),null;case 22:case 23:return Nd(),null;case 24:return null;default:return null}}var ha=!1,jt=!1,Gx=typeof WeakSet=="function"?WeakSet:Set,_e=null;function Pi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ht(e,t,n)}else r.current=null}function Qu(e,t,r){try{r()}catch(n){ht(e,t,n)}}var Yp=!1;function qx(e,t){if(Bu=el,e=u_(),md(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var l=0,i=-1,o=-1,c=0,p=0,u=e,m=null;t:for(;;){for(var _;u!==r||s!==0&&u.nodeType!==3||(i=l+s),u!==a||n!==0&&u.nodeType!==3||(o=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(_=u.firstChild)!==null;)m=u,u=_;for(;;){if(u===e)break t;if(m===r&&++c===s&&(i=l),m===a&&++p===n&&(o=l),(_=u.nextSibling)!==null)break;u=m,m=u.parentNode}u=_}r=i===-1||o===-1?null:{start:i,end:o}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ou={focusedElem:e,selectionRange:r},el=!1,_e=t;_e!==null;)if(t=_e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_e=e;else for(;_e!==null;){t=_e;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,h=y.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?v:br(t.type,v),h);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(w){ht(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,_e=e;break}_e=t.return}return y=Yp,Yp=!1,y}function Ks(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&Qu(t,r,a)}s=s.next}while(s!==n)}}function Kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Zu(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function o0(e){var t=e.alternate;t!==null&&(e.alternate=null,o0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Or],delete t[mo],delete t[Fu],delete t[Dx],delete t[Mx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function a0(e){return e.tag===5||e.tag===3||e.tag===4}function Jp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||a0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function eh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=nl));else if(n!==4&&(e=e.child,e!==null))for(eh(e,t,r),e=e.sibling;e!==null;)eh(e,t,r),e=e.sibling}function th(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(th(e,t,r),e=e.sibling;e!==null;)th(e,t,r),e=e.sibling}var Dt=null,Cr=!1;function un(e,t,r){for(r=r.child;r!==null;)l0(e,t,r),r=r.sibling}function l0(e,t,r){if(jr&&typeof jr.onCommitFiberUnmount=="function")try{jr.onCommitFiberUnmount(jl,r)}catch{}switch(r.tag){case 5:jt||Pi(r,t);case 6:var n=Dt,s=Cr;Dt=null,un(e,t,r),Dt=n,Cr=s,Dt!==null&&(Cr?(e=Dt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Dt.removeChild(r.stateNode));break;case 18:Dt!==null&&(Cr?(e=Dt,r=r.stateNode,e.nodeType===8?Ec(e.parentNode,r):e.nodeType===1&&Ec(e,r),co(e)):Ec(Dt,r.stateNode));break;case 4:n=Dt,s=Cr,Dt=r.stateNode.containerInfo,Cr=!0,un(e,t,r),Dt=n,Cr=s;break;case 0:case 11:case 14:case 15:if(!jt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&Qu(r,t,l),s=s.next}while(s!==n)}un(e,t,r);break;case 1:if(!jt&&(Pi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(i){ht(r,t,i)}un(e,t,r);break;case 21:un(e,t,r);break;case 22:r.mode&1?(jt=(n=jt)||r.memoizedState!==null,un(e,t,r),jt=n):un(e,t,r);break;default:un(e,t,r)}}function Qp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Gx),t.forEach(function(n){var s=nb.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function wr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var a=e,l=t,i=l;e:for(;i!==null;){switch(i.tag){case 5:Dt=i.stateNode,Cr=!1;break e;case 3:Dt=i.stateNode.containerInfo,Cr=!0;break e;case 4:Dt=i.stateNode.containerInfo,Cr=!0;break e}i=i.return}if(Dt===null)throw Error(se(160));l0(a,l,s),Dt=null,Cr=!1;var o=s.alternate;o!==null&&(o.return=null),s.return=null}catch(c){ht(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)c0(t,e),t=t.sibling}function c0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wr(t,e),Ir(e),n&4){try{Ks(3,e,e.return),Kl(3,e)}catch(v){ht(e,e.return,v)}try{Ks(5,e,e.return)}catch(v){ht(e,e.return,v)}}break;case 1:wr(t,e),Ir(e),n&512&&r!==null&&Pi(r,r.return);break;case 5:if(wr(t,e),Ir(e),n&512&&r!==null&&Pi(r,r.return),e.flags&32){var s=e.stateNode;try{so(s,"")}catch(v){ht(e,e.return,v)}}if(n&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,l=r!==null?r.memoizedProps:a,i=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{i==="input"&&a.type==="radio"&&a.name!=null&&Mv(s,a),Eu(i,l);var c=Eu(i,a);for(l=0;l<o.length;l+=2){var p=o[l],u=o[l+1];p==="style"?Ov(s,u):p==="dangerouslySetInnerHTML"?Iv(s,u):p==="children"?so(s,u):rd(s,p,u,c)}switch(i){case"input":wu(s,a);break;case"textarea":Av(s,a);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var _=a.value;_!=null?$i(s,!!a.multiple,_,!1):m!==!!a.multiple&&(a.defaultValue!=null?$i(s,!!a.multiple,a.defaultValue,!0):$i(s,!!a.multiple,a.multiple?[]:"",!1))}s[mo]=a}catch(v){ht(e,e.return,v)}}break;case 6:if(wr(t,e),Ir(e),n&4){if(e.stateNode===null)throw Error(se(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(v){ht(e,e.return,v)}}break;case 3:if(wr(t,e),Ir(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{co(t.containerInfo)}catch(v){ht(e,e.return,v)}break;case 4:wr(t,e),Ir(e);break;case 13:wr(t,e),Ir(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(Bd=ft())),n&4&&Qp(e);break;case 22:if(p=r!==null&&r.memoizedState!==null,e.mode&1?(jt=(c=jt)||p,wr(t,e),jt=c):wr(t,e),Ir(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(_e=e,p=e.child;p!==null;){for(u=_e=p;_e!==null;){switch(m=_e,_=m.child,m.tag){case 0:case 11:case 14:case 15:Ks(4,m,m.return);break;case 1:Pi(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ht(n,r,v)}}break;case 5:Pi(m,m.return);break;case 22:if(m.memoizedState!==null){em(u);continue}}_!==null?(_.return=m,_e=_):em(u)}p=p.sibling}e:for(p=null,u=e;;){if(u.tag===5){if(p===null){p=u;try{s=u.stateNode,c?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(i=u.stateNode,o=u.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,i.style.display=Bv("display",l))}catch(v){ht(e,e.return,v)}}}else if(u.tag===6){if(p===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(v){ht(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:wr(t,e),Ir(e),n&4&&Qp(e);break;case 21:break;default:wr(t,e),Ir(e)}}function Ir(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(a0(r)){var n=r;break e}r=r.return}throw Error(se(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(so(s,""),n.flags&=-33);var a=Jp(e);th(e,a,s);break;case 3:case 4:var l=n.stateNode.containerInfo,i=Jp(e);eh(e,i,l);break;default:throw Error(se(161))}}catch(o){ht(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Xx(e,t,r){_e=e,u0(e)}function u0(e,t,r){for(var n=(e.mode&1)!==0;_e!==null;){var s=_e,a=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||ha;if(!l){var i=s.alternate,o=i!==null&&i.memoizedState!==null||jt;i=ha;var c=jt;if(ha=l,(jt=o)&&!c)for(_e=s;_e!==null;)l=_e,o=l.child,l.tag===22&&l.memoizedState!==null?tm(s):o!==null?(o.return=l,_e=o):tm(s);for(;a!==null;)_e=a,u0(a),a=a.sibling;_e=s,ha=i,jt=c}Zp(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,_e=a):Zp(e)}}function Zp(e){for(;_e!==null;){var t=_e;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||Kl(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!jt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:br(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Np(t,a,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Np(t,l,r)}break;case 5:var i=t.stateNode;if(r===null&&t.flags&4){r=i;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&r.focus();break;case"img":o.src&&(r.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var u=p.dehydrated;u!==null&&co(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}jt||t.flags&512&&Zu(t)}catch(m){ht(t,t.return,m)}}if(t===e){_e=null;break}if(r=t.sibling,r!==null){r.return=t.return,_e=r;break}_e=t.return}}function em(e){for(;_e!==null;){var t=_e;if(t===e){_e=null;break}var r=t.sibling;if(r!==null){r.return=t.return,_e=r;break}_e=t.return}}function tm(e){for(;_e!==null;){var t=_e;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Kl(4,t)}catch(o){ht(t,r,o)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(o){ht(t,s,o)}}var a=t.return;try{Zu(t)}catch(o){ht(t,a,o)}break;case 5:var l=t.return;try{Zu(t)}catch(o){ht(t,l,o)}}}catch(o){ht(t,t.return,o)}if(t===e){_e=null;break}var i=t.sibling;if(i!==null){i.return=t.return,_e=i;break}_e=t.return}}var Yx=Math.ceil,pl=an.ReactCurrentDispatcher,Pd=an.ReactCurrentOwner,gr=an.ReactCurrentBatchConfig,ze=0,Lt=null,gt=null,Pt=0,nr=0,Ii=On(0),St=0,So=null,di=0,Gl=0,Id=0,Gs=null,Yt=null,Bd=0,is=1/0,qr=null,ml=!1,rh=null,Rn=null,da=!1,Sn=null,gl=0,qs=0,nh=null,Na=-1,ja=0;function Gt(){return ze&6?ft():Na!==-1?Na:Na=ft()}function Tn(e){return e.mode&1?ze&2&&Pt!==0?Pt&-Pt:Px.transition!==null?(ja===0&&(ja=qv()),ja):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:t_(e.type)),e):1}function Tr(e,t,r,n){if(50<qs)throw qs=0,nh=null,Error(se(185));Io(e,r,n),(!(ze&2)||e!==Lt)&&(e===Lt&&(!(ze&2)&&(Gl|=r),St===4&&yn(e,Pt)),er(e,n),r===1&&ze===0&&!(t.mode&1)&&(is=ft()+500,Ul&&Nn()))}function er(e,t){var r=e.callbackNode;PS(e,t);var n=Za(e,e===Lt?Pt:0);if(n===0)r!==null&&up(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&up(r),t===1)e.tag===0?Ax(rm.bind(null,e)):w_(rm.bind(null,e)),Rx(function(){!(ze&6)&&Nn()}),r=null;else{switch(Xv(n)){case 1:r=ad;break;case 4:r=Kv;break;case 16:r=Qa;break;case 536870912:r=Gv;break;default:r=Qa}r=_0(r,h0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function h0(e,t){if(Na=-1,ja=0,ze&6)throw Error(se(327));var r=e.callbackNode;if(Vi()&&e.callbackNode!==r)return null;var n=Za(e,e===Lt?Pt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=vl(e,n);else{t=n;var s=ze;ze|=2;var a=f0();(Lt!==e||Pt!==t)&&(qr=null,is=ft()+500,si(e,t));do try{Zx();break}catch(i){d0(e,i)}while(!0);wd(),pl.current=a,ze=s,gt!==null?t=0:(Lt=null,Pt=0,t=St)}if(t!==0){if(t===2&&(s=Du(e),s!==0&&(n=s,t=ih(e,s))),t===1)throw r=So,si(e,0),yn(e,n),er(e,ft()),r;if(t===6)yn(e,n);else{if(s=e.current.alternate,!(n&30)&&!Jx(s)&&(t=vl(e,n),t===2&&(a=Du(e),a!==0&&(n=a,t=ih(e,a))),t===1))throw r=So,si(e,0),yn(e,n),er(e,ft()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(se(345));case 2:Yn(e,Yt,qr);break;case 3:if(yn(e,n),(n&130023424)===n&&(t=Bd+500-ft(),10<t)){if(Za(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Gt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=ju(Yn.bind(null,e,Yt,qr),t);break}Yn(e,Yt,qr);break;case 4:if(yn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-Rr(n);a=1<<l,l=t[l],l>s&&(s=l),n&=~a}if(n=s,n=ft()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Yx(n/1960))-n,10<n){e.timeoutHandle=ju(Yn.bind(null,e,Yt,qr),n);break}Yn(e,Yt,qr);break;case 5:Yn(e,Yt,qr);break;default:throw Error(se(329))}}}return er(e,ft()),e.callbackNode===r?h0.bind(null,e):null}function ih(e,t){var r=Gs;return e.current.memoizedState.isDehydrated&&(si(e,t).flags|=256),e=vl(e,t),e!==2&&(t=Yt,Yt=r,t!==null&&sh(t)),e}function sh(e){Yt===null?Yt=e:Yt.push.apply(Yt,e)}function Jx(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],a=s.getSnapshot;s=s.value;try{if(!Dr(a(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yn(e,t){for(t&=~Id,t&=~Gl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Rr(t),n=1<<r;e[r]=-1,t&=~n}}function rm(e){if(ze&6)throw Error(se(327));Vi();var t=Za(e,0);if(!(t&1))return er(e,ft()),null;var r=vl(e,t);if(e.tag!==0&&r===2){var n=Du(e);n!==0&&(t=n,r=ih(e,n))}if(r===1)throw r=So,si(e,0),yn(e,t),er(e,ft()),r;if(r===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yn(e,Yt,qr),er(e,ft()),null}function Od(e,t){var r=ze;ze|=1;try{return e(t)}finally{ze=r,ze===0&&(is=ft()+500,Ul&&Nn())}}function fi(e){Sn!==null&&Sn.tag===0&&!(ze&6)&&Vi();var t=ze;ze|=1;var r=gr.transition,n=Ve;try{if(gr.transition=null,Ve=1,e)return e()}finally{Ve=n,gr.transition=r,ze=t,!(ze&6)&&Nn()}}function Nd(){nr=Ii.current,Qe(Ii)}function si(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Lx(r)),gt!==null)for(r=gt.return;r!==null;){var n=r;switch(vd(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&il();break;case 3:rs(),Qe(Qt),Qe(Ht),kd();break;case 5:Ed(n);break;case 4:rs();break;case 13:Qe(nt);break;case 19:Qe(nt);break;case 10:Sd(n.type._context);break;case 22:case 23:Nd()}r=r.return}if(Lt=e,gt=e=Dn(e.current,null),Pt=nr=t,St=0,So=null,Id=Gl=di=0,Yt=Gs=null,Zn!==null){for(t=0;t<Zn.length;t++)if(r=Zn[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,a=r.pending;if(a!==null){var l=a.next;a.next=s,n.next=l}r.pending=n}Zn=null}return e}function d0(e,t){do{var r=gt;try{if(wd(),Ia.current=fl,dl){for(var n=st.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}dl=!1}if(hi=0,xt=yt=st=null,Vs=!1,_o=0,Pd.current=null,r===null||r.return===null){St=1,So=t,gt=null;break}e:{var a=e,l=r.return,i=r,o=t;if(t=Pt,i.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=o,p=i,u=p.tag;if(!(p.mode&1)&&(u===0||u===11||u===15)){var m=p.alternate;m?(p.updateQueue=m.updateQueue,p.memoizedState=m.memoizedState,p.lanes=m.lanes):(p.updateQueue=null,p.memoizedState=null)}var _=Up(l);if(_!==null){_.flags&=-257,Wp(_,l,i,a,t),_.mode&1&&zp(a,c,t),t=_,o=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(o),t.updateQueue=v}else y.add(o);break e}else{if(!(t&1)){zp(a,c,t),jd();break e}o=Error(se(426))}}else if(tt&&i.mode&1){var h=Up(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),Wp(h,l,i,a,t),_d(ns(o,i));break e}}a=o=ns(o,i),St!==4&&(St=2),Gs===null?Gs=[a]:Gs.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var f=X_(a,o,t);Op(a,f);break e;case 1:i=o;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Rn===null||!Rn.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=Y_(a,i,t);Op(a,w);break e}}a=a.return}while(a!==null)}m0(r)}catch(b){t=b,gt===r&&r!==null&&(gt=r=r.return);continue}break}while(!0)}function f0(){var e=pl.current;return pl.current=fl,e===null?fl:e}function jd(){(St===0||St===3||St===2)&&(St=4),Lt===null||!(di&268435455)&&!(Gl&268435455)||yn(Lt,Pt)}function vl(e,t){var r=ze;ze|=2;var n=f0();(Lt!==e||Pt!==t)&&(qr=null,si(e,t));do try{Qx();break}catch(s){d0(e,s)}while(!0);if(wd(),ze=r,pl.current=n,gt!==null)throw Error(se(261));return Lt=null,Pt=0,St}function Qx(){for(;gt!==null;)p0(gt)}function Zx(){for(;gt!==null&&!CS();)p0(gt)}function p0(e){var t=v0(e.alternate,e,nr);e.memoizedProps=e.pendingProps,t===null?m0(e):gt=t,Pd.current=null}function m0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Kx(r,t),r!==null){r.flags&=32767,gt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{St=6,gt=null;return}}else if(r=Vx(r,t,nr),r!==null){gt=r;return}if(t=t.sibling,t!==null){gt=t;return}gt=t=e}while(t!==null);St===0&&(St=5)}function Yn(e,t,r){var n=Ve,s=gr.transition;try{gr.transition=null,Ve=1,eb(e,t,r,n)}finally{gr.transition=s,Ve=n}return null}function eb(e,t,r,n){do Vi();while(Sn!==null);if(ze&6)throw Error(se(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(IS(e,a),e===Lt&&(gt=Lt=null,Pt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||da||(da=!0,_0(Qa,function(){return Vi(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=gr.transition,gr.transition=null;var l=Ve;Ve=1;var i=ze;ze|=4,Pd.current=null,qx(e,r),c0(r,e),wx(Ou),el=!!Bu,Ou=Bu=null,e.current=r,Xx(r),ES(),ze=i,Ve=l,gr.transition=a}else e.current=r;if(da&&(da=!1,Sn=e,gl=s),a=e.pendingLanes,a===0&&(Rn=null),RS(r.stateNode),er(e,ft()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(ml)throw ml=!1,e=rh,rh=null,e;return gl&1&&e.tag!==0&&Vi(),a=e.pendingLanes,a&1?e===nh?qs++:(qs=0,nh=e):qs=0,Nn(),null}function Vi(){if(Sn!==null){var e=Xv(gl),t=gr.transition,r=Ve;try{if(gr.transition=null,Ve=16>e?16:e,Sn===null)var n=!1;else{if(e=Sn,Sn=null,gl=0,ze&6)throw Error(se(331));var s=ze;for(ze|=4,_e=e.current;_e!==null;){var a=_e,l=a.child;if(_e.flags&16){var i=a.deletions;if(i!==null){for(var o=0;o<i.length;o++){var c=i[o];for(_e=c;_e!==null;){var p=_e;switch(p.tag){case 0:case 11:case 15:Ks(8,p,a)}var u=p.child;if(u!==null)u.return=p,_e=u;else for(;_e!==null;){p=_e;var m=p.sibling,_=p.return;if(o0(p),p===c){_e=null;break}if(m!==null){m.return=_,_e=m;break}_e=_}}}var y=a.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var h=v.sibling;v.sibling=null,v=h}while(v!==null)}}_e=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,_e=l;else e:for(;_e!==null;){if(a=_e,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ks(9,a,a.return)}var f=a.sibling;if(f!==null){f.return=a.return,_e=f;break e}_e=a.return}}var d=e.current;for(_e=d;_e!==null;){l=_e;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,_e=g;else e:for(l=d;_e!==null;){if(i=_e,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:Kl(9,i)}}catch(b){ht(i,i.return,b)}if(i===l){_e=null;break e}var w=i.sibling;if(w!==null){w.return=i.return,_e=w;break e}_e=i.return}}if(ze=s,Nn(),jr&&typeof jr.onPostCommitFiberRoot=="function")try{jr.onPostCommitFiberRoot(jl,e)}catch{}n=!0}return n}finally{Ve=r,gr.transition=t}}return!1}function nm(e,t,r){t=ns(r,t),t=X_(e,t,1),e=Ln(e,t,1),t=Gt(),e!==null&&(Io(e,1,t),er(e,t))}function ht(e,t,r){if(e.tag===3)nm(e,e,r);else for(;t!==null;){if(t.tag===3){nm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Rn===null||!Rn.has(n))){e=ns(r,e),e=Y_(t,e,1),t=Ln(t,e,1),e=Gt(),t!==null&&(Io(t,1,e),er(t,e));break}}t=t.return}}function tb(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Gt(),e.pingedLanes|=e.suspendedLanes&r,Lt===e&&(Pt&r)===r&&(St===4||St===3&&(Pt&130023424)===Pt&&500>ft()-Bd?si(e,0):Id|=r),er(e,t)}function g0(e,t){t===0&&(e.mode&1?(t=ra,ra<<=1,!(ra&130023424)&&(ra=4194304)):t=1);var r=Gt();e=nn(e,t),e!==null&&(Io(e,t,r),er(e,r))}function rb(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),g0(e,r)}function nb(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(se(314))}n!==null&&n.delete(t),g0(e,r)}var v0;v0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)Jt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Jt=!1,Wx(e,t,r);Jt=!!(e.flags&131072)}else Jt=!1,tt&&t.flags&1048576&&S_(t,al,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Oa(e,t),e=t.pendingProps;var s=Zi(t,Ht.current);Wi(t,r),s=Rd(null,t,n,e,s,r);var a=Td();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zt(n)?(a=!0,sl(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,bd(t),s.updater=Vl,t.stateNode=s,s._reactInternals=t,Vu(t,n,e,r),t=qu(null,t,n,!0,a,r)):(t.tag=0,tt&&a&&gd(t),Wt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Oa(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=sb(n),e=br(n,e),s){case 0:t=Gu(null,t,n,e,r);break e;case 1:t=Gp(null,t,n,e,r);break e;case 11:t=Vp(null,t,n,e,r);break e;case 14:t=Kp(null,t,n,br(n.type,e),r);break e}throw Error(se(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:br(n,s),Gu(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:br(n,s),Gp(e,t,n,s,r);case 3:e:{if(e0(t),e===null)throw Error(se(387));n=t.pendingProps,a=t.memoizedState,s=a.element,L_(e,t),ul(t,n,null,r);var l=t.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=ns(Error(se(423)),t),t=qp(e,t,n,r,s);break e}else if(n!==s){s=ns(Error(se(424)),t),t=qp(e,t,n,r,s);break e}else for(ir=kn(t.stateNode.containerInfo.firstChild),sr=t,tt=!0,Er=null,r=E_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(es(),n===s){t=sn(e,t,r);break e}Wt(e,t,n,r)}t=t.child}return t;case 5:return R_(t),e===null&&zu(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,l=s.children,Nu(n,s)?l=null:a!==null&&Nu(n,a)&&(t.flags|=32),Z_(e,t),Wt(e,t,l,r),t.child;case 6:return e===null&&zu(t),null;case 13:return t0(e,t,r);case 4:return Cd(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ts(t,null,n,r):Wt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:br(n,s),Vp(e,t,n,s,r);case 7:return Wt(e,t,t.pendingProps,r),t.child;case 8:return Wt(e,t,t.pendingProps.children,r),t.child;case 12:return Wt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,l=s.value,qe(ll,n._currentValue),n._currentValue=l,a!==null)if(Dr(a.value,l)){if(a.children===s.children&&!Qt.current){t=sn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var i=a.dependencies;if(i!==null){l=a.child;for(var o=i.firstContext;o!==null;){if(o.context===n){if(a.tag===1){o=Zr(-1,r&-r),o.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?o.next=o:(o.next=p.next,p.next=o),c.pending=o}}a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),Uu(a.return,r,t),i.lanes|=r;break}o=o.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(se(341));l.lanes|=r,i=l.alternate,i!==null&&(i.lanes|=r),Uu(l,r,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Wt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Wi(t,r),s=_r(s),n=n(s),t.flags|=1,Wt(e,t,n,r),t.child;case 14:return n=t.type,s=br(n,t.pendingProps),s=br(n.type,s),Kp(e,t,n,s,r);case 15:return J_(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:br(n,s),Oa(e,t),t.tag=1,Zt(n)?(e=!0,sl(t)):e=!1,Wi(t,r),q_(t,n,s),Vu(t,n,s,r),qu(null,t,n,!0,e,r);case 19:return r0(e,t,r);case 22:return Q_(e,t,r)}throw Error(se(156,t.tag))};function _0(e,t){return Vv(e,t)}function ib(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pr(e,t,r,n){return new ib(e,t,r,n)}function Fd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sb(e){if(typeof e=="function")return Fd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===id)return 11;if(e===sd)return 14}return 2}function Dn(e,t){var r=e.alternate;return r===null?(r=pr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Fa(e,t,r,n,s,a){var l=2;if(n=e,typeof e=="function")Fd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Ci:return oi(r.children,s,a,t);case nd:l=8,s|=8;break;case mu:return e=pr(12,r,t,s|2),e.elementType=mu,e.lanes=a,e;case gu:return e=pr(13,r,t,s),e.elementType=gu,e.lanes=a,e;case vu:return e=pr(19,r,t,s),e.elementType=vu,e.lanes=a,e;case Rv:return ql(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kv:l=10;break e;case Lv:l=9;break e;case id:l=11;break e;case sd:l=14;break e;case mn:l=16,n=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=pr(l,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function oi(e,t,r,n){return e=pr(7,e,n,t),e.lanes=r,e}function ql(e,t,r,n){return e=pr(22,e,n,t),e.elementType=Rv,e.lanes=r,e.stateNode={isHidden:!1},e}function Pc(e,t,r){return e=pr(6,e,null,t),e.lanes=r,e}function Ic(e,t,r){return t=pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ob(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pc(0),this.expirationTimes=pc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pc(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function $d(e,t,r,n,s,a,l,i,o){return e=new ob(e,t,r,i,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=pr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},bd(a),e}function ab(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:bi,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function y0(e){if(!e)return An;e=e._reactInternals;e:{if(mi(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Zt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var r=e.type;if(Zt(r))return y_(e,r,t)}return t}function w0(e,t,r,n,s,a,l,i,o){return e=$d(r,n,!0,e,s,a,l,i,o),e.context=y0(null),r=e.current,n=Gt(),s=Tn(r),a=Zr(n,s),a.callback=t??null,Ln(r,a,s),e.current.lanes=s,Io(e,s,n),er(e,n),e}function Xl(e,t,r,n){var s=t.current,a=Gt(),l=Tn(s);return r=y0(r),t.context===null?t.context=r:t.pendingContext=r,t=Zr(a,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ln(s,t,l),e!==null&&(Tr(e,s,l,a),Pa(e,s,l)),l}function _l(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function im(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Hd(e,t){im(e,t),(e=e.alternate)&&im(e,t)}function lb(){return null}var S0=typeof reportError=="function"?reportError:function(e){console.error(e)};function zd(e){this._internalRoot=e}Yl.prototype.render=zd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Xl(e,t,null,null)};Yl.prototype.unmount=zd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fi(function(){Xl(null,e,null,null)}),t[rn]=null}};function Yl(e){this._internalRoot=e}Yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qv();e={blockedOn:null,target:e,priority:t};for(var r=0;r<_n.length&&t!==0&&t<_n[r].priority;r++);_n.splice(r,0,e),r===0&&e_(e)}};function Ud(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Jl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sm(){}function cb(e,t,r,n,s){if(s){if(typeof n=="function"){var a=n;n=function(){var c=_l(l);a.call(c)}}var l=w0(t,n,e,0,null,!1,!1,"",sm);return e._reactRootContainer=l,e[rn]=l.current,fo(e.nodeType===8?e.parentNode:e),fi(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var i=n;n=function(){var c=_l(o);i.call(c)}}var o=$d(e,0,!1,null,null,!1,!1,"",sm);return e._reactRootContainer=o,e[rn]=o.current,fo(e.nodeType===8?e.parentNode:e),fi(function(){Xl(t,o,r,n)}),o}function Ql(e,t,r,n,s){var a=r._reactRootContainer;if(a){var l=a;if(typeof s=="function"){var i=s;s=function(){var o=_l(l);i.call(o)}}Xl(t,l,e,s)}else l=cb(r,t,e,s,n);return _l(l)}Yv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Is(t.pendingLanes);r!==0&&(ld(t,r|1),er(t,ft()),!(ze&6)&&(is=ft()+500,Nn()))}break;case 13:fi(function(){var n=nn(e,1);if(n!==null){var s=Gt();Tr(n,e,1,s)}}),Hd(e,1)}};cd=function(e){if(e.tag===13){var t=nn(e,134217728);if(t!==null){var r=Gt();Tr(t,e,134217728,r)}Hd(e,134217728)}};Jv=function(e){if(e.tag===13){var t=Tn(e),r=nn(e,t);if(r!==null){var n=Gt();Tr(r,e,t,n)}Hd(e,t)}};Qv=function(){return Ve};Zv=function(e,t){var r=Ve;try{return Ve=e,t()}finally{Ve=r}};Lu=function(e,t,r){switch(t){case"input":if(wu(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=zl(n);if(!s)throw Error(se(90));Dv(n),wu(n,s)}}}break;case"textarea":Av(e,r);break;case"select":t=r.value,t!=null&&$i(e,!!r.multiple,t,!1)}};Fv=Od;$v=fi;var ub={usingClientEntryPoint:!1,Events:[Oo,Ri,zl,Nv,jv,Od]},Ls={findFiberByHostInstance:Qn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hb={bundleType:Ls.bundleType,version:Ls.version,rendererPackageName:Ls.rendererPackageName,rendererConfig:Ls.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:an.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Uv(e),e===null?null:e.stateNode},findFiberByHostInstance:Ls.findFiberByHostInstance||lb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fa.isDisabled&&fa.supportsFiber)try{jl=fa.inject(hb),jr=fa}catch{}}lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ub;lr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ud(t))throw Error(se(200));return ab(e,t,null,r)};lr.createRoot=function(e,t){if(!Ud(e))throw Error(se(299));var r=!1,n="",s=S0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=$d(e,1,!1,null,null,r,!1,n,s),e[rn]=t.current,fo(e.nodeType===8?e.parentNode:e),new zd(t)};lr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=Uv(t),e=e===null?null:e.stateNode,e};lr.flushSync=function(e){return fi(e)};lr.hydrate=function(e,t,r){if(!Jl(t))throw Error(se(200));return Ql(null,e,t,!0,r)};lr.hydrateRoot=function(e,t,r){if(!Ud(e))throw Error(se(405));var n=r!=null&&r.hydratedSources||null,s=!1,a="",l=S0;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=w0(t,null,e,1,r??null,s,!1,a,l),e[rn]=t.current,fo(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Yl(t)};lr.render=function(e,t,r){if(!Jl(t))throw Error(se(200));return Ql(null,e,t,!1,r)};lr.unmountComponentAtNode=function(e){if(!Jl(e))throw Error(se(40));return e._reactRootContainer?(fi(function(){Ql(null,null,e,!1,function(){e._reactRootContainer=null,e[rn]=null})}),!0):!1};lr.unstable_batchedUpdates=Od;lr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Jl(r))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return Ql(e,t,r,!1,n)};lr.version="18.3.1-next-f1338f8080-20240426";function x0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x0)}catch(e){console.error(e)}}x0(),xv.exports=lr;var Nr=xv.exports,b0,om=Nr;b0=om.createRoot,om.hydrateRoot;const am=e=>{let t;const r=new Set,n=(c,p)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const m=t;t=p??(typeof u!="object"||u===null)?u:Object.assign({},t,u),r.forEach(_=>_(t,m))}},s=()=>t,i={setState:n,getState:s,getInitialState:()=>o,subscribe:c=>(r.add(c),()=>r.delete(c))},o=t=e(n,s,i);return i},db=e=>e?am(e):am,fb=e=>e;function pb(e,t=fb){const r=mt.useSyncExternalStore(e.subscribe,mt.useCallback(()=>t(e.getState()),[e,t]),mt.useCallback(()=>t(e.getInitialState()),[e,t]));return mt.useDebugValue(r),r}const mb=e=>{const t=db(e),r=n=>pb(t,n);return Object.assign(r,t),r},Wd=e=>mb;function Zl(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var a;const l=o=>o===null?null:JSON.parse(o,void 0),i=(a=r.getItem(s))!=null?a:null;return i instanceof Promise?i.then(l):l(i)},setItem:(s,a)=>r.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>r.removeItem(s)}}const oh=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return oh(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return oh(n)(r)}}}},gb=(e,t)=>(r,n,s)=>{let a={storage:Zl(()=>localStorage),partialize:v=>v,version:0,merge:(v,h)=>({...h,...v}),...t},l=!1;const i=new Set,o=new Set;let c=a.storage;if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,s);const p=()=>{const v=a.partialize({...n()});return c.setItem(a.name,{state:v,version:a.version})},u=s.setState;s.setState=(v,h)=>(u(v,h),p());const m=e((...v)=>(r(...v),p()),n,s);s.getInitialState=()=>m;let _;const y=()=>{var v,h;if(!c)return;l=!1,i.forEach(d=>{var g;return d((g=n())!=null?g:m)});const f=((h=a.onRehydrateStorage)==null?void 0:h.call(a,(v=n())!=null?v:m))||void 0;return oh(c.getItem.bind(c))(a.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==a.version){if(a.migrate){const g=a.migrate(d.state,d.version);return g instanceof Promise?g.then(w=>[!0,w]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,d.state];return[!1,void 0]}).then(d=>{var g;const[w,b]=d;if(_=a.merge(b,(g=n())!=null?g:m),r(_,!0),w)return p()}).then(()=>{f==null||f(_,void 0),_=n(),l=!0,o.forEach(d=>d(_))}).catch(d=>{f==null||f(void 0,d)})};return s.persist={setOptions:v=>{a={...a,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:v=>(i.add(v),()=>{i.delete(v)}),onFinishHydration:v=>(o.add(v),()=>{o.delete(v)})},a.skipHydration||y(),_||m},Vd=gb;function vb(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,r)=>{e.set(t,r)},removeItem:t=>{e.delete(t)}}}const Si=vb(),Kd={getItem:e=>{if(typeof localStorage>"u")return Si.getItem(e);try{return localStorage.getItem(e)}catch{return Si.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>"u"){Si.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{Si.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>"u"){Si.removeItem(e);return}try{localStorage.removeItem(e)}catch{Si.removeItem(e)}}},ah="~/Documents/GitHub",_b="claude",Ki=50,lh=[{id:"jetbrains-mono",label:"JetBrains Mono",family:'"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace'},{id:"system",label:"System Default",family:'ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace'},{id:"custom",label:"Custom",family:""}];function yb(e,t){if(e==="custom"&&t.trim())return t.trim();const r=lh.find(n=>n.id===e);return(r==null?void 0:r.family)||lh[0].family}const pa=[{id:"claude",label:"Claude",command:"claude",isBuiltIn:!0,agentType:"claude"},{id:"codex",label:"Codex",command:"codex",isBuiltIn:!0,agentType:"codex"},{id:"pi",label:"Pi",command:"pi",isBuiltIn:!0,agentType:"pi"}];function wb(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&t.id.length>=1&&t.id.length<=128&&typeof t.label=="string"&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command=="string"&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn=="boolean"&&(t.agentType===void 0||t.agentType==="claude"||t.agentType==="codex"||t.agentType==="pi")}function lm(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function Bc(e){return e.command.trim()}function cm(e){for(let r=0;r<100;r++){const n=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(n))return n}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function um(e,t){var r;return e.some(n=>n.id===t)?t:((r=e[0])==null?void 0:r.id)||"claude"}const C0=180,E0=400,Sb=240,ue=Wd()(Vd((e,t)=>({defaultProjectDir:ah,setDefaultProjectDir:r=>e({defaultProjectDir:r}),defaultCommand:_b,setDefaultCommand:r=>e({defaultCommand:r}),lastProjectPath:null,setLastProjectPath:r=>e({lastProjectPath:r}),recentPaths:[],addRecentPath:r=>e(n=>({recentPaths:[r,...n.recentPaths.filter(s=>s!==r)].slice(0,5)})),sessionSortMode:"created",setSessionSortMode:r=>e({sessionSortMode:r}),sessionSortDirection:"desc",setSessionSortDirection:r=>e({sessionSortDirection:r}),manualSessionOrder:[],setManualSessionOrder:r=>e({manualSessionOrder:r}),useWebGL:!0,setUseWebGL:r=>e({useWebGL:r}),fontSize:13,setFontSize:r=>e({fontSize:Math.max(6,Math.min(24,r))}),lineHeight:1,setLineHeight:r=>e({lineHeight:Math.max(1,Math.min(2,r))}),letterSpacing:0,setLetterSpacing:r=>e({letterSpacing:Math.max(-3,Math.min(3,r))}),fontOption:"jetbrains-mono",setFontOption:r=>e({fontOption:r}),customFontFamily:"",setCustomFontFamily:r=>e({customFontFamily:r.slice(0,256)}),shortcutModifier:"auto",setShortcutModifier:r=>e({shortcutModifier:r}),showProjectName:!0,setShowProjectName:r=>e({showProjectName:r}),showLastUserMessage:!0,setShowLastUserMessage:r=>e({showLastUserMessage:r}),showSessionIdPrefix:!1,setShowSessionIdPrefix:r=>e({showSessionIdPrefix:r}),inactiveSessionsExpanded:!1,setInactiveSessionsExpanded:r=>e({inactiveSessionsExpanded:r}),sidebarWidth:Sb,setSidebarWidth:r=>e({sidebarWidth:Math.max(C0,Math.min(E0,r))}),projectFilters:[],setProjectFilters:r=>e({projectFilters:r}),hostFilters:[],setHostFilters:r=>e({hostFilters:r}),soundOnPermission:!1,setSoundOnPermission:r=>e({soundOnPermission:r}),soundOnIdle:!1,setSoundOnIdle:r=>e({soundOnIdle:r}),commandPresets:pa,setCommandPresets:r=>e({commandPresets:r}),defaultPresetId:"claude",setDefaultPresetId:r=>e({defaultPresetId:r}),updatePresetCommand:(r,n)=>{const{commandPresets:s}=t(),a=s.map(l=>l.id===r?{...l,command:n.trim().slice(0,1024)}:l);e({commandPresets:a})},addPreset:r=>{const{commandPresets:n}=t();if(n.length>=Ki){console.warn("[agentboard:settings] Max presets reached");return}const s=new Set(n.map(l=>l.id)),a={...lm({...r,id:"",isBuiltIn:!1}),id:cm(s),isBuiltIn:!1};e({commandPresets:[...n,a]})},removePreset:r=>{const{commandPresets:n,defaultPresetId:s}=t(),a=n.find(o=>o.id===r);if(!a||a.isBuiltIn)return;const l=n.filter(o=>o.id!==r),i=r===s?um(l,s):s;e({commandPresets:l,defaultPresetId:i})}}),{name:"agentboard-settings",storage:Zl(()=>Kd),version:4,partialize:e=>{const{manualSessionOrder:t,...r}=e;return r},migrate:(e,t)=>{const r=e,n=m=>{if(typeof m.command=="string")return m;const _=typeof m.baseCommand=="string"?m.baseCommand.trim():"",y=typeof m.modifiers=="string"?m.modifiers.trim():"",v=y?`${_} ${y}`:_;return{id:m.id,label:m.label,command:v||"claude",isBuiltIn:m.isBuiltIn,agentType:m.agentType}};if(t===0||!Array.isArray(r.commandPresets)){const m=typeof r.defaultCommand=="string"?r.defaultCommand:"claude",_=[...pa];let y="claude";if(m==="codex")y="codex";else if(m!=="claude"){const v=new Set(_.map(f=>f.id)),h={id:cm(v),label:"Migrated",command:m,isBuiltIn:!1};_.push(h),y=h.id}return console.info("[agentboard:settings] Migrated from v0 to v2"),{...r,commandPresets:_,defaultPresetId:y,defaultCommand:m,recentPaths:[]}}const l=r.commandPresets.map(n).filter(wb);if(!(l.some(m=>m.id==="claude")&&l.some(m=>m.id==="codex"))||l.length===0)return console.warn("[agentboard:settings] Invalid presets, resetting to defaults"),{...r,commandPresets:pa,defaultPresetId:"claude"};const o=l.length>Ki?[...l.filter(m=>m.isBuiltIn),...l.filter(m=>!m.isBuiltIn).slice(0,Ki-2)]:l,c=new Set(o.map(m=>m.id)),p=pa.filter(m=>m.isBuiltIn&&!c.has(m.id)),u=[...o,...p];return t<4&&console.info(`[agentboard:settings] Migrated from v${t} to v4 (ensured all built-in presets)`),{...r,commandPresets:u.map(lm),defaultPresetId:um(o,r.defaultPresetId)}}}));function xb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z"}))}const bb=k.forwardRef(xb);function Cb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"}))}const Gd=k.forwardRef(Cb);function Eb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"}))}const kb=k.forwardRef(Eb);function Lb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z"}))}const k0=k.forwardRef(Lb);function Rb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5"}))}const Tb=k.forwardRef(Rb);function Db({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z"}))}const Mb=k.forwardRef(Db);function Ab({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z"}))}const L0=k.forwardRef(Ab);function Pb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z"}))}const R0=k.forwardRef(Pb);function Ib({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z"}))}const Bb=k.forwardRef(Ib);function Ob({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778"}))}const Nb=k.forwardRef(Ob);function jb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12h18M3 6h18M3 18h18"}))}const Fb=k.forwardRef(jb);function $b({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3"}))}const Hb=k.forwardRef($b);function zb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.377 15.616L2.72 21.273m8.974-14.631l-1.56 1.56a2.1 2.1 0 01-.264.242 1 1 0 01-.207.111c-.082.032-.17.05-.347.085l-3.665.733c-.952.19-1.428.286-1.65.537a1 1 0 00-.243.8c.046.333.39.677 1.076 1.363l7.086 7.086c.686.687 1.03 1.03 1.362 1.076a1 1 0 00.801-.242c.251-.223.346-.7.537-1.651l.733-3.665c.035-.176.053-.265.085-.347a.997.997 0 01.11-.207c.051-.072.115-.136.242-.263l1.561-1.561c.082-.082.122-.122.167-.158.04-.031.082-.06.126-.085.05-.029.103-.051.208-.097l2.495-1.069c.727-.312 1.091-.467 1.256-.72a1 1 0 00.144-.747c-.06-.295-.34-.575-.9-1.135l-5.142-5.143c-.56-.56-.84-.84-1.135-.9a1 1 0 00-.748.145c-.252.165-.407.529-.72 1.256l-1.068 2.495a2.096 2.096 0 01-.097.208.998.998 0 01-.085.126 2.065 2.065 0 01-.158.167z"}))}const yl=k.forwardRef(zb);function Ub({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v14m-7-7h14"}))}const T0=k.forwardRef(Ub);function Wb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z"}))}const Vb=k.forwardRef(Wb);function Kb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z"}))}const Gb=k.forwardRef(Kb);function qb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 17l6-6-6-6m8 14h8"}))}const Xb=k.forwardRef(qb);function Yb({title:e,titleId:t,...r},n){return k.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?k.createElement("title",{id:t},e):null,k.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6L6 18M6 6l12 12"}))}const ch=k.forwardRef(Yb);function jo(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),r=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||r}function Jb(){return typeof navigator>"u"?!1:jo()&&navigator.standalone===!0}function Qb(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Fo(e){return e==="auto"?Qb()?"ctrl-option":"ctrl-shift":e}const Zb={"ctrl-option":"⌃⌥","ctrl-shift":"⌃⇧","cmd-option":"⌘⌥","cmd-shift":"⌘⇧"};function Gi(e){return Zb[e]}function eC(e,t){switch(t){case"ctrl-option":return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case"ctrl-shift":return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case"cmd-option":return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case"cmd-shift":return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}const tC={connected:"bg-working",connecting:"bg-approval",reconnecting:"bg-approval",disconnected:"bg-danger",error:"bg-danger"};function rC({connectionStatus:e,onNewSession:t,onOpenSettings:r,tailscaleIp:n}){const[s,a]=k.useState(!1),l=ue(c=>c.shortcutModifier),i=Gi(Fo(l)),o=()=>{if(!n)return;const c=`http://${n}:${window.location.port||"4040"}`;navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),1500)};return D.jsxs("header",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("h1",{className:"text-sm font-semibold tracking-tight text-primary text-balance",children:"AGENTBOARD"}),D.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted",children:[D.jsx("span",{className:`h-2 w-2 rounded-full ${tC[e]}`}),n&&D.jsxs("button",{onClick:o,className:"ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer",title:"Tailscale IP - click to copy remote access URL",children:[D.jsx("span",{className:"leading-none translate-y-[1px]",children:s?"Copied!":n}),!s&&D.jsx(k0,{width:12,height:12,className:"shrink-0"})]})]})]}),D.jsxs("div",{className:"flex items-center gap-1.5",children:[D.jsx("button",{onClick:t,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all",title:`New session (${i}N)`,"aria-label":"New session",children:D.jsx(T0,{width:16,height:16})}),D.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"Settings","aria-label":"Settings",children:D.jsx(Gb,{width:14,height:14})})]})]})}const qd=k.createContext({});function Xd(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yd=typeof window<"u",D0=Yd?k.useLayoutEffect:k.useEffect,ec=k.createContext(null);function Jd(e,t){e.indexOf(t)===-1&&e.push(t)}function Qd(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Hr=(e,t,r)=>r>t?t:r<e?e:r;let Zd=()=>{};const on={},M0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function A0(e){return typeof e=="object"&&e!==null}const P0=e=>/^0[^.\s]+$/u.test(e);function ef(e){let t;return()=>(t===void 0&&(t=e()),t)}const vr=e=>e,nC=(e,t)=>r=>t(e(r)),$o=(...e)=>e.reduce(nC),xo=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class tf{constructor(){this.subscriptions=[]}add(t){return Jd(this.subscriptions,t),()=>Qd(this.subscriptions,t)}notify(t,r,n){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,r,n);else for(let a=0;a<s;a++){const l=this.subscriptions[a];l&&l(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const en=e=>e*1e3,mr=e=>e/1e3;function I0(e,t){return t?e*(1e3/t):0}const B0=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,iC=1e-7,sC=12;function oC(e,t,r,n,s){let a,l,i=0;do l=t+(r-t)/2,a=B0(l,n,s)-e,a>0?r=l:t=l;while(Math.abs(a)>iC&&++i<sC);return l}function Ho(e,t,r,n){if(e===t&&r===n)return vr;const s=a=>oC(a,0,1,e,r);return a=>a===0||a===1?a:B0(s(a),t,n)}const O0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,N0=e=>t=>1-e(1-t),j0=Ho(.33,1.53,.69,.99),rf=N0(j0),F0=O0(rf),$0=e=>(e*=2)<1?.5*rf(e):.5*(2-Math.pow(2,-10*(e-1))),nf=e=>1-Math.sin(Math.acos(e)),H0=N0(nf),z0=O0(nf),aC=Ho(.42,0,1,1),lC=Ho(0,0,.58,1),U0=Ho(.42,0,.58,1),cC=e=>Array.isArray(e)&&typeof e[0]!="number",W0=e=>Array.isArray(e)&&typeof e[0]=="number",uC={linear:vr,easeIn:aC,easeInOut:U0,easeOut:lC,circIn:nf,circInOut:z0,circOut:H0,backIn:rf,backInOut:F0,backOut:j0,anticipate:$0},hC=e=>typeof e=="string",hm=e=>{if(W0(e)){Zd(e.length===4);const[t,r,n,s]=e;return Ho(t,r,n,s)}else if(hC(e))return uC[e];return e},ma=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function dC(e,t){let r=new Set,n=new Set,s=!1,a=!1;const l=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function o(p){l.has(p)&&(c.schedule(p),e()),p(i)}const c={schedule:(p,u=!1,m=!1)=>{const y=m&&s?r:n;return u&&l.add(p),y.has(p)||y.add(p),p},cancel:p=>{n.delete(p),l.delete(p)},process:p=>{if(i=p,s){a=!0;return}s=!0,[r,n]=[n,r],r.forEach(o),r.clear(),s=!1,a&&(a=!1,c.process(p))}};return c}const fC=40;function V0(e,t){let r=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=ma.reduce((g,w)=>(g[w]=dC(a),g),{}),{setup:i,read:o,resolveKeyframes:c,preUpdate:p,update:u,preRender:m,render:_,postRender:y}=l,v=()=>{const g=on.useManualTiming?s.timestamp:performance.now();r=!1,on.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(g-s.timestamp,fC),1)),s.timestamp=g,s.isProcessing=!0,i.process(s),o.process(s),c.process(s),p.process(s),u.process(s),m.process(s),_.process(s),y.process(s),s.isProcessing=!1,r&&t&&(n=!1,e(v))},h=()=>{r=!0,n=!0,s.isProcessing||e(v)};return{schedule:ma.reduce((g,w)=>{const b=l[w];return g[w]=(x,C=!1,S=!1)=>(r||h(),b.schedule(x,C,S)),g},{}),cancel:g=>{for(let w=0;w<ma.length;w++)l[ma[w]].cancel(g)},state:s,steps:l}}const{schedule:Ze,cancel:Pn,state:Mt,steps:Oc}=V0(typeof requestAnimationFrame<"u"?requestAnimationFrame:vr,!0);let $a;function pC(){$a=void 0}const Vt={now:()=>($a===void 0&&Vt.set(Mt.isProcessing||on.useManualTiming?Mt.timestamp:performance.now()),$a),set:e=>{$a=e,queueMicrotask(pC)}},K0=e=>t=>typeof t=="string"&&t.startsWith(e),G0=K0("--"),mC=K0("var(--"),sf=e=>mC(e)?gC.test(e.split("/*")[0].trim()):!1,gC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function dm(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const us={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},bo={...us,transform:e=>Hr(0,1,e)},ga={...us,default:1},Xs=e=>Math.round(e*1e5)/1e5,of=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vC(e){return e==null}const _C=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,af=(e,t)=>r=>!!(typeof r=="string"&&_C.test(r)&&r.startsWith(e)||t&&!vC(r)&&Object.prototype.hasOwnProperty.call(r,t)),q0=(e,t,r)=>n=>{if(typeof n!="string")return n;const[s,a,l,i]=n.match(of);return{[e]:parseFloat(s),[t]:parseFloat(a),[r]:parseFloat(l),alpha:i!==void 0?parseFloat(i):1}},yC=e=>Hr(0,255,e),Nc={...us,transform:e=>Math.round(yC(e))},ti={test:af("rgb","red"),parse:q0("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Nc.transform(e)+", "+Nc.transform(t)+", "+Nc.transform(r)+", "+Xs(bo.transform(n))+")"};function wC(e){let t="",r="",n="",s="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),s=e.substring(4,5),t+=t,r+=r,n+=n,s+=s),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}}const uh={test:af("#"),parse:wC,transform:ti.transform},zo=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pn=zo("deg"),$r=zo("%"),ge=zo("px"),SC=zo("vh"),xC=zo("vw"),fm={...$r,parse:e=>$r.parse(e)/100,transform:e=>$r.transform(e*100)},Bi={test:af("hsl","hue"),parse:q0("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+$r.transform(Xs(t))+", "+$r.transform(Xs(r))+", "+Xs(bo.transform(n))+")"},pt={test:e=>ti.test(e)||uh.test(e)||Bi.test(e),parse:e=>ti.test(e)?ti.parse(e):Bi.test(e)?Bi.parse(e):uh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ti.transform(e):Bi.transform(e),getAnimatableNone:e=>{const t=pt.parse(e);return t.alpha=0,pt.transform(t)}},bC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function CC(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(of))==null?void 0:t.length)||0)+(((r=e.match(bC))==null?void 0:r.length)||0)>0}const X0="number",Y0="color",EC="var",kC="var(",pm="${}",LC=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Co(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},s=[];let a=0;const i=t.replace(LC,o=>(pt.test(o)?(n.color.push(a),s.push(Y0),r.push(pt.parse(o))):o.startsWith(kC)?(n.var.push(a),s.push(EC),r.push(o)):(n.number.push(a),s.push(X0),r.push(parseFloat(o))),++a,pm)).split(pm);return{values:r,split:i,indexes:n,types:s}}function J0(e){return Co(e).values}function Q0(e){const{split:t,types:r}=Co(e),n=t.length;return s=>{let a="";for(let l=0;l<n;l++)if(a+=t[l],s[l]!==void 0){const i=r[l];i===X0?a+=Xs(s[l]):i===Y0?a+=pt.transform(s[l]):a+=s[l]}return a}}const RC=e=>typeof e=="number"?0:pt.test(e)?pt.getAnimatableNone(e):e;function TC(e){const t=J0(e);return Q0(e)(t.map(RC))}const In={test:CC,parse:J0,createTransformer:Q0,getAnimatableNone:TC};function jc(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function DC({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let s=0,a=0,l=0;if(!t)s=a=l=r;else{const i=r<.5?r*(1+t):r+t-r*t,o=2*r-i;s=jc(o,i,e+1/3),a=jc(o,i,e),l=jc(o,i,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:n}}function wl(e,t){return r=>r>0?t:e}const it=(e,t,r)=>e+(t-e)*r,Fc=(e,t,r)=>{const n=e*e,s=r*(t*t-n)+n;return s<0?0:Math.sqrt(s)},MC=[uh,ti,Bi],AC=e=>MC.find(t=>t.test(e));function mm(e){const t=AC(e);if(!t)return!1;let r=t.parse(e);return t===Bi&&(r=DC(r)),r}const gm=(e,t)=>{const r=mm(e),n=mm(t);if(!r||!n)return wl(e,t);const s={...r};return a=>(s.red=Fc(r.red,n.red,a),s.green=Fc(r.green,n.green,a),s.blue=Fc(r.blue,n.blue,a),s.alpha=it(r.alpha,n.alpha,a),ti.transform(s))},hh=new Set(["none","hidden"]);function PC(e,t){return hh.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function IC(e,t){return r=>it(e,t,r)}function lf(e){return typeof e=="number"?IC:typeof e=="string"?sf(e)?wl:pt.test(e)?gm:NC:Array.isArray(e)?Z0:typeof e=="object"?pt.test(e)?gm:BC:wl}function Z0(e,t){const r=[...e],n=r.length,s=e.map((a,l)=>lf(a)(a,t[l]));return a=>{for(let l=0;l<n;l++)r[l]=s[l](a);return r}}function BC(e,t){const r={...e,...t},n={};for(const s in r)e[s]!==void 0&&t[s]!==void 0&&(n[s]=lf(e[s])(e[s],t[s]));return s=>{for(const a in n)r[a]=n[a](s);return r}}function OC(e,t){const r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],l=e.indexes[a][n[a]],i=e.values[l]??0;r[s]=i,n[a]++}return r}const NC=(e,t)=>{const r=In.createTransformer(t),n=Co(e),s=Co(t);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?hh.has(e)&&!s.values.length||hh.has(t)&&!n.values.length?PC(e,t):$o(Z0(OC(n,s),s.values),r):wl(e,t)};function ey(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?it(e,t,r):lf(e)(e,t)}const jC=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>Ze.update(t,r),stop:()=>Pn(t),now:()=>Mt.isProcessing?Mt.timestamp:Vt.now()}},ty=(e,t,r=10)=>{let n="";const s=Math.max(Math.round(t/r),2);for(let a=0;a<s;a++)n+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Sl=2e4;function cf(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Sl;)t+=r,n=e.next(t);return t>=Sl?1/0:t}function FC(e,t=100,r){const n=r({...e,keyframes:[0,t]}),s=Math.min(cf(n),Sl);return{type:"keyframes",ease:a=>n.next(s*a).value/t,duration:mr(s)}}const $C=5;function ry(e,t,r){const n=Math.max(t-$C,0);return I0(r-e(n),t-n)}const ct={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},$c=.001;function HC({duration:e=ct.duration,bounce:t=ct.bounce,velocity:r=ct.velocity,mass:n=ct.mass}){let s,a,l=1-t;l=Hr(ct.minDamping,ct.maxDamping,l),e=Hr(ct.minDuration,ct.maxDuration,mr(e)),l<1?(s=c=>{const p=c*l,u=p*e,m=p-r,_=dh(c,l),y=Math.exp(-u);return $c-m/_*y},a=c=>{const u=c*l*e,m=u*r+r,_=Math.pow(l,2)*Math.pow(c,2)*e,y=Math.exp(-u),v=dh(Math.pow(c,2),l);return(-s(c)+$c>0?-1:1)*((m-_)*y)/v}):(s=c=>{const p=Math.exp(-c*e),u=(c-r)*e+1;return-$c+p*u},a=c=>{const p=Math.exp(-c*e),u=(r-c)*(e*e);return p*u});const i=5/e,o=UC(s,a,i);if(e=en(e),isNaN(o))return{stiffness:ct.stiffness,damping:ct.damping,duration:e};{const c=Math.pow(o,2)*n;return{stiffness:c,damping:l*2*Math.sqrt(n*c),duration:e}}}const zC=12;function UC(e,t,r){let n=r;for(let s=1;s<zC;s++)n=n-e(n)/t(n);return n}function dh(e,t){return e*Math.sqrt(1-t*t)}const WC=["duration","bounce"],VC=["stiffness","damping","mass"];function vm(e,t){return t.some(r=>e[r]!==void 0)}function KC(e){let t={velocity:ct.velocity,stiffness:ct.stiffness,damping:ct.damping,mass:ct.mass,isResolvedFromDuration:!1,...e};if(!vm(e,VC)&&vm(e,WC))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),s=n*n,a=2*Hr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ct.mass,stiffness:s,damping:a}}else{const r=HC(e);t={...t,...r,mass:ct.mass},t.isResolvedFromDuration=!0}return t}function xl(e=ct.visualDuration,t=ct.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:s}=r;const a=r.keyframes[0],l=r.keyframes[r.keyframes.length-1],i={done:!1,value:a},{stiffness:o,damping:c,mass:p,duration:u,velocity:m,isResolvedFromDuration:_}=KC({...r,velocity:-mr(r.velocity||0)}),y=m||0,v=c/(2*Math.sqrt(o*p)),h=l-a,f=mr(Math.sqrt(o/p)),d=Math.abs(h)<5;n||(n=d?ct.restSpeed.granular:ct.restSpeed.default),s||(s=d?ct.restDelta.granular:ct.restDelta.default);let g;if(v<1){const b=dh(f,v);g=x=>{const C=Math.exp(-v*f*x);return l-C*((y+v*f*h)/b*Math.sin(b*x)+h*Math.cos(b*x))}}else if(v===1)g=b=>l-Math.exp(-f*b)*(h+(y+f*h)*b);else{const b=f*Math.sqrt(v*v-1);g=x=>{const C=Math.exp(-v*f*x),S=Math.min(b*x,300);return l-C*((y+v*f*h)*Math.sinh(S)+b*h*Math.cosh(S))/b}}const w={calculatedDuration:_&&u||null,next:b=>{const x=g(b);if(_)i.done=b>=u;else{let C=b===0?y:0;v<1&&(C=b===0?en(y):ry(g,b,x));const S=Math.abs(C)<=n,E=Math.abs(l-x)<=s;i.done=S&&E}return i.value=i.done?l:x,i},toString:()=>{const b=Math.min(cf(w),Sl),x=ty(C=>w.next(b*C).value,b,30);return b+"ms "+x},toTransition:()=>{}};return w}xl.applyToOptions=e=>{const t=FC(e,100,xl);return e.ease=t.ease,e.duration=en(t.duration),e.type="keyframes",e};function fh({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:l,min:i,max:o,restDelta:c=.5,restSpeed:p}){const u=e[0],m={done:!1,value:u},_=S=>i!==void 0&&S<i||o!==void 0&&S>o,y=S=>i===void 0?o:o===void 0||Math.abs(i-S)<Math.abs(o-S)?i:o;let v=r*t;const h=u+v,f=l===void 0?h:l(h);f!==h&&(v=f-u);const d=S=>-v*Math.exp(-S/n),g=S=>f+d(S),w=S=>{const E=d(S),L=g(S);m.done=Math.abs(E)<=c,m.value=m.done?f:L};let b,x;const C=S=>{_(m.value)&&(b=S,x=xl({keyframes:[m.value,y(m.value)],velocity:ry(g,S,m.value),damping:s,stiffness:a,restDelta:c,restSpeed:p}))};return C(0),{calculatedDuration:null,next:S=>{let E=!1;return!x&&b===void 0&&(E=!0,w(S),C(S)),b!==void 0&&S>=b?x.next(S-b):(!E&&w(S),m)}}}function GC(e,t,r){const n=[],s=r||on.mix||ey,a=e.length-1;for(let l=0;l<a;l++){let i=s(e[l],e[l+1]);if(t){const o=Array.isArray(t)?t[l]||vr:t;i=$o(o,i)}n.push(i)}return n}function qC(e,t,{clamp:r=!0,ease:n,mixer:s}={}){const a=e.length;if(Zd(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const i=GC(t,n,s),o=i.length,c=p=>{if(l&&p<e[0])return t[0];let u=0;if(o>1)for(;u<e.length-2&&!(p<e[u+1]);u++);const m=xo(e[u],e[u+1],p);return i[u](m)};return r?p=>c(Hr(e[0],e[a-1],p)):c}function XC(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const s=xo(0,t,n);e.push(it(r,1,s))}}function YC(e){const t=[0];return XC(t,e.length-1),t}function JC(e,t){return e.map(r=>r*t)}function QC(e,t){return e.map(()=>t||U0).splice(0,e.length-1)}function Ys({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const s=cC(n)?n.map(hm):hm(n),a={done:!1,value:t[0]},l=JC(r&&r.length===t.length?r:YC(t),e),i=qC(l,t,{ease:Array.isArray(s)?s:QC(t,s)});return{calculatedDuration:e,next:o=>(a.value=i(o),a.done=o>=e,a)}}const ZC=e=>e!==null;function uf(e,{repeat:t,repeatType:r="loop"},n,s=1){const a=e.filter(ZC),i=s<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!i||n===void 0?a[i]:n}const e2={decay:fh,inertia:fh,tween:Ys,keyframes:Ys,spring:xl};function ny(e){typeof e.type=="string"&&(e.type=e2[e.type])}class hf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const t2=e=>e/100;class df extends hf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,s;const{motionValue:r}=this.options;r&&r.updatedAt!==Vt.now()&&this.tick(Vt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(n=this.options).onStop)==null||s.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ny(t);const{type:r=Ys,repeat:n=0,repeatDelay:s=0,repeatType:a,velocity:l=0}=t;let{keyframes:i}=t;const o=r||Ys;o!==Ys&&typeof i[0]!="number"&&(this.mixKeyframes=$o(t2,ey(i[0],i[1])),i=[0,100]);const c=o({...t,keyframes:i});a==="mirror"&&(this.mirroredGenerator=o({...t,keyframes:[...i].reverse(),velocity:-l})),c.calculatedDuration===null&&(c.calculatedDuration=cf(c));const{calculatedDuration:p}=c;this.calculatedDuration=p,this.resolvedDuration=p+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:s,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:i,calculatedDuration:o}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:p,repeat:u,repeatType:m,repeatDelay:_,type:y,onUpdate:v,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const f=this.currentTime-c*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?f<0:f>s;this.currentTime=Math.max(f,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let g=this.currentTime,w=n;if(u){const S=Math.min(this.currentTime,s)/i;let E=Math.floor(S),L=S%1;!L&&S>=1&&(L=1),L===1&&E--,E=Math.min(E,u+1),!!(E%2)&&(m==="reverse"?(L=1-L,_&&(L-=_/i)):m==="mirror"&&(w=l)),g=Hr(0,1,L)*i}const b=d?{done:!1,value:p[0]}:w.next(g);a&&(b.value=a(b.value));let{done:x}=b;!d&&o!==null&&(x=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return C&&y!==fh&&(b.value=uf(p,this.options,h,this.speed)),v&&v(b.value),C&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return mr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mr(t)}get time(){return mr(this.currentTime)}set time(t){var r;t=en(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Vt.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=mr(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=jC,startTime:r}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(a=(s=this.options).onPlay)==null||a.call(s);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Vt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function r2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ri=e=>e*180/Math.PI,ph=e=>{const t=ri(Math.atan2(e[1],e[0]));return mh(t)},n2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ph,rotateZ:ph,skewX:e=>ri(Math.atan(e[1])),skewY:e=>ri(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},mh=e=>(e=e%360,e<0&&(e+=360),e),_m=ph,ym=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),wm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),i2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ym,scaleY:wm,scale:e=>(ym(e)+wm(e))/2,rotateX:e=>mh(ri(Math.atan2(e[6],e[5]))),rotateY:e=>mh(ri(Math.atan2(-e[2],e[0]))),rotateZ:_m,rotate:_m,skewX:e=>ri(Math.atan(e[4])),skewY:e=>ri(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gh(e){return e.includes("scale")?1:0}function vh(e,t){if(!e||e==="none")return gh(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(r)n=i2,s=r;else{const i=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=n2,s=i}if(!s)return gh(t);const a=n[t],l=s[1].split(",").map(o2);return typeof a=="function"?a(l):l[a]}const s2=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return vh(r,t)};function o2(e){return parseFloat(e.trim())}const hs=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ds=new Set(hs),Sm=e=>e===us||e===ge,a2=new Set(["x","y","z"]),l2=hs.filter(e=>!a2.has(e));function c2(e){const t=[];return l2.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const xn={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>vh(t,"x"),y:(e,{transform:t})=>vh(t,"y")};xn.translateX=xn.x;xn.translateY=xn.y;const ai=new Set;let _h=!1,yh=!1,wh=!1;function iy(){if(yh){const e=Array.from(ai).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const s=c2(n);s.length&&(r.set(n,s),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const s=r.get(n);s&&s.forEach(([a,l])=>{var i;(i=n.getValue(a))==null||i.set(l)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}yh=!1,_h=!1,ai.forEach(e=>e.complete(wh)),ai.clear()}function sy(){ai.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yh=!0)})}function u2(){wh=!0,sy(),iy(),wh=!1}class ff{constructor(t,r,n,s,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=s,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(ai.add(this),_h||(_h=!0,Ze.read(sy),Ze.resolveKeyframes(iy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const i=n.readValue(r,l);i!=null&&(t[0]=i)}t[0]===void 0&&(t[0]=l),s&&a===void 0&&s.set(t[0])}r2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ai.delete(this)}cancel(){this.state==="scheduled"&&(ai.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const h2=e=>e.startsWith("--");function d2(e,t,r){h2(t)?e.style.setProperty(t,r):e.style[t]=r}const f2=ef(()=>window.ScrollTimeline!==void 0),p2={};function m2(e,t){const r=ef(e);return()=>p2[t]??r()}const oy=m2(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Os=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,xm={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Os([0,.65,.55,1]),circOut:Os([.55,0,1,.45]),backIn:Os([.31,.01,.66,-.59]),backOut:Os([.33,1.53,.69,.99])};function ay(e,t){if(e)return typeof e=="function"?oy()?ty(e,t):"ease-out":W0(e)?Os(e):Array.isArray(e)?e.map(r=>ay(r,t)||xm.easeOut):xm[e]}function g2(e,t,r,{delay:n=0,duration:s=300,repeat:a=0,repeatType:l="loop",ease:i="easeOut",times:o}={},c=void 0){const p={[t]:r};o&&(p.offset=o);const u=ay(i,s);Array.isArray(u)&&(p.easing=u);const m={delay:n,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(p,m)}function ly(e){return typeof e=="function"&&"applyToOptions"in e}function v2({type:e,...t}){return ly(e)&&oy()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class _2 extends hf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:s,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:i,onComplete:o}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,Zd(typeof t.type!="string");const c=v2(t);this.animation=g2(r,n,s,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=uf(s,this.options,i,this.speed);this.updateMotionValue?this.updateMotionValue(p):d2(r,n,p),this.animation.cancel()}o==null||o(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return mr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+mr(t)}get time(){return mr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=en(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&f2()?(this.animation.timeline=t,vr):r(this)}}const cy={anticipate:$0,backInOut:F0,circInOut:z0};function y2(e){return e in cy}function w2(e){typeof e.ease=="string"&&y2(e.ease)&&(e.ease=cy[e.ease])}const Hc=10;class S2 extends _2{constructor(t){w2(t),ny(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:s,element:a,...l}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const i=new df({...l,autoplay:!1}),o=Math.max(Hc,Vt.now()-this.startTime),c=Hr(0,Hc,o-Hc);r.setWithVelocity(i.sample(Math.max(0,o-c)).value,i.sample(o).value,c),i.stop()}}const bm=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(In.test(e)||e==="0")&&!e.startsWith("url("));function x2(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function b2(e,t,r,n){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=bm(s,t),i=bm(a,t);return!l||!i?!1:x2(e)||(r==="spring"||ly(r))&&n}function Sh(e){e.duration=0,e.type="keyframes"}const C2=new Set(["opacity","clipPath","filter","transform"]),E2=ef(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function k2(e){var p;const{motionValue:t,name:r,repeatDelay:n,repeatType:s,damping:a,type:l}=e;if(!(((p=t==null?void 0:t.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:o,transformTemplate:c}=t.owner.getProps();return E2()&&r&&C2.has(r)&&(r!=="transform"||!c)&&!o&&!n&&s!=="mirror"&&a!==0&&l!=="inertia"}const L2=40;class R2 extends hf{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:l="loop",keyframes:i,name:o,motionValue:c,element:p,...u}){var y;super(),this.stop=()=>{var v,h;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Vt.now();const m={autoplay:t,delay:r,type:n,repeat:s,repeatDelay:a,repeatType:l,name:o,motionValue:c,element:p,...u},_=(p==null?void 0:p.KeyframeResolver)||ff;this.keyframeResolver=new _(i,(v,h,f)=>this.onKeyframesResolved(v,h,m,!f),o,c,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,r,n,s){this.keyframeResolver=void 0;const{name:a,type:l,velocity:i,delay:o,isHandoff:c,onUpdate:p}=n;this.resolvedAt=Vt.now(),b2(t,a,l,i)||((on.instantAnimations||!o)&&(p==null||p(uf(t,n,r))),t[0]=t[t.length-1],Sh(n),n.repeat=0);const m={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>L2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},_=!c&&k2(m)?new S2({...m,element:m.motionValue.owner.current}):new df(m);_.finished.then(()=>this.notifyFinished()).catch(vr),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),u2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const T2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function D2(e){const t=T2.exec(e);if(!t)return[,];const[,r,n,s]=t;return[`--${r??n}`,s]}function uy(e,t,r=1){const[n,s]=D2(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const l=a.trim();return M0(l)?parseFloat(l):l}return sf(s)?uy(s,t,r+1):s}function pf(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const hy=new Set(["width","height","top","left","right","bottom",...hs]),M2={test:e=>e==="auto",parse:e=>e},dy=e=>t=>t.test(e),fy=[us,ge,$r,pn,xC,SC,M2],Cm=e=>fy.find(dy(e));function A2(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||P0(e):!0}const P2=new Set(["brightness","contrast","saturate","opacity"]);function I2(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(of)||[];if(!n)return e;const s=r.replace(n,"");let a=P2.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+s+")"}const B2=/\b([a-z-]*)\(.*?\)/gu,xh={...In,getAnimatableNone:e=>{const t=e.match(B2);return t?t.map(I2).join(" "):e}},Em={...us,transform:Math.round},O2={rotate:pn,rotateX:pn,rotateY:pn,rotateZ:pn,scale:ga,scaleX:ga,scaleY:ga,scaleZ:ga,skew:pn,skewX:pn,skewY:pn,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:bo,originX:fm,originY:fm,originZ:ge},mf={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,radius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,inset:ge,insetBlock:ge,insetBlockStart:ge,insetBlockEnd:ge,insetInline:ge,insetInlineStart:ge,insetInlineEnd:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,paddingBlock:ge,paddingBlockStart:ge,paddingBlockEnd:ge,paddingInline:ge,paddingInlineStart:ge,paddingInlineEnd:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,marginBlock:ge,marginBlockStart:ge,marginBlockEnd:ge,marginInline:ge,marginInlineStart:ge,marginInlineEnd:ge,backgroundPositionX:ge,backgroundPositionY:ge,...O2,zIndex:Em,fillOpacity:bo,strokeOpacity:bo,numOctaves:Em},N2={...mf,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:xh,WebkitFilter:xh},py=e=>N2[e];function my(e,t){let r=py(e);return r!==xh&&(r=In),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const j2=new Set(["auto","none","0"]);function F2(e,t,r){let n=0,s;for(;n<e.length&&!s;){const a=e[n];typeof a=="string"&&!j2.has(a)&&Co(a).values.length&&(s=e[n]),n++}if(s&&r)for(const a of t)e[a]=my(r,s)}class $2 extends ff{constructor(t,r,n,s,a){super(t,r,n,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let u=t[p];if(typeof u=="string"&&(u=u.trim(),sf(u))){const m=uy(u,r.current);m!==void 0&&(t[p]=m),p===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!hy.has(n)||t.length!==2)return;const[s,a]=t,l=Cm(s),i=Cm(a),o=dm(s),c=dm(a);if(o!==c&&xn[n]){this.needsMeasurement=!0;return}if(l!==i)if(Sm(l)&&Sm(i))for(let p=0;p<t.length;p++){const u=t[p];typeof u=="string"&&(t[p]=parseFloat(u))}else xn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let s=0;s<t.length;s++)(t[s]===null||A2(t[s]))&&n.push(s);n.length&&F2(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const s=r[r.length-1];s!==void 0&&t.getValue(n,s).jump(s,!1)}measureEndState(){var i;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(r);s&&s.jump(this.measuredOrigin,!1);const a=n.length-1,l=n[a];n[a]=xn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(i=this.removedTransforms)!=null&&i.length&&this.removedTransforms.forEach(([o,c])=>{t.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function H2(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const s=(r==null?void 0:r[e])??n.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}const gy=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function vy(e){return A0(e)&&"offsetHeight"in e}const km=30,z2=e=>!isNaN(parseFloat(e));class U2{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const s=Vt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Vt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=z2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new tf);const n=this.events[t].add(r);return t==="change"?()=>{n(),Ze.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Vt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>km)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,km);return I0(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ss(e,t){return new U2(e,t)}const{schedule:gf}=V0(queueMicrotask,!1),xr={x:!1,y:!1};function _y(){return xr.x||xr.y}function W2(e){return e==="x"||e==="y"?xr[e]?null:(xr[e]=!0,()=>{xr[e]=!1}):xr.x||xr.y?null:(xr.x=xr.y=!0,()=>{xr.x=xr.y=!1})}function yy(e,t){const r=H2(e),n=new AbortController,s={passive:!0,...t,signal:n.signal};return[r,s,()=>n.abort()]}function Lm(e){return!(e.pointerType==="touch"||_y())}function V2(e,t,r={}){const[n,s,a]=yy(e,r),l=i=>{if(!Lm(i))return;const{target:o}=i,c=t(o,i);if(typeof c!="function"||!o)return;const p=u=>{Lm(u)&&(c(u),o.removeEventListener("pointerleave",p))};o.addEventListener("pointerleave",p,s)};return n.forEach(i=>{i.addEventListener("pointerenter",l,s)}),a}const wy=(e,t)=>t?e===t?!0:wy(e,t.parentElement):!1,vf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,K2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Sy(e){return K2.has(e.tagName)||e.isContentEditable===!0}const Ha=new WeakSet;function Rm(e){return t=>{t.key==="Enter"&&e(t)}}function zc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const G2=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=Rm(()=>{if(Ha.has(r))return;zc(r,"down");const s=Rm(()=>{zc(r,"up")}),a=()=>zc(r,"cancel");r.addEventListener("keyup",s,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function Tm(e){return vf(e)&&!_y()}function q2(e,t,r={}){const[n,s,a]=yy(e,r),l=i=>{const o=i.currentTarget;if(!Tm(i))return;Ha.add(o);const c=t(o,i),p=(_,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",m),Ha.has(o)&&Ha.delete(o),Tm(_)&&typeof c=="function"&&c(_,{success:y})},u=_=>{p(_,o===window||o===document||r.useGlobalTarget||wy(o,_.target))},m=_=>{p(_,!1)};window.addEventListener("pointerup",u,s),window.addEventListener("pointercancel",m,s)};return n.forEach(i=>{(r.useGlobalTarget?window:i).addEventListener("pointerdown",l,s),vy(i)&&(i.addEventListener("focus",c=>G2(c,s)),!Sy(i)&&!i.hasAttribute("tabindex")&&(i.tabIndex=0))}),a}function xy(e){return A0(e)&&"ownerSVGElement"in e}function X2(e){return xy(e)&&e.tagName==="svg"}const $t=e=>!!(e&&e.getVelocity),Y2=[...fy,pt,In],J2=e=>Y2.find(dy(e)),_f=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Dm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Q2(...e){return t=>{let r=!1;const n=e.map(s=>{const a=Dm(s,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():Dm(e[s],null)}}}}function Z2(...e){return k.useCallback(Q2(...e),e)}class e5 extends k.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,s=vy(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=s-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function t5({children:e,isPresent:t,anchorX:r,root:n}){var p;const s=k.useId(),a=k.useRef(null),l=k.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:i}=k.useContext(_f),o=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),c=Z2(a,o);return k.useInsertionEffect(()=>{const{width:u,height:m,top:_,left:y,right:v}=l.current;if(t||!a.current||!u||!m)return;const h=r==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=s;const f=document.createElement("style");i&&(f.nonce=i);const d=n??document.head;return d.appendChild(f),f.sheet&&f.sheet.insertRule(`
41
+ [data-motion-pop-id="${s}"] {
42
+ position: absolute !important;
43
+ width: ${u}px !important;
44
+ height: ${m}px !important;
45
+ ${h}px !important;
46
+ top: ${_}px !important;
47
+ }
48
+ `),()=>{d.contains(f)&&d.removeChild(f)}},[t]),D.jsx(e5,{isPresent:t,childRef:a,sizeRef:l,children:k.cloneElement(e,{ref:c})})}const r5=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:s,presenceAffectsLayout:a,mode:l,anchorX:i,root:o})=>{const c=Xd(n5),p=k.useId();let u=!0,m=k.useMemo(()=>(u=!1,{id:p,initial:t,isPresent:r,custom:s,onExitComplete:_=>{c.set(_,!0);for(const y of c.values())if(!y)return;n&&n()},register:_=>(c.set(_,!1),()=>c.delete(_))}),[r,c,n]);return a&&u&&(m={...m}),k.useMemo(()=>{c.forEach((_,y)=>c.set(y,!1))},[r]),k.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),l==="popLayout"&&(e=D.jsx(t5,{isPresent:r,anchorX:i,root:o,children:e})),D.jsx(ec.Provider,{value:m,children:e})};function n5(){return new Map}function by(e=!0){const t=k.useContext(ec);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:s}=t,a=k.useId();k.useEffect(()=>{if(e)return s(a)},[e]);const l=k.useCallback(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,l]:[!0]}const va=e=>e.key||"";function Mm(e){const t=[];return k.Children.forEach(e,r=>{k.isValidElement(r)&&t.push(r)}),t}const i5=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:i="left",root:o})=>{const[c,p]=by(l),u=k.useMemo(()=>Mm(e),[e]),m=l&&!c?[]:u.map(va),_=k.useRef(!0),y=k.useRef(u),v=Xd(()=>new Map),h=k.useRef(new Set),[f,d]=k.useState(u),[g,w]=k.useState(u);D0(()=>{_.current=!1,y.current=u;for(let C=0;C<g.length;C++){const S=va(g[C]);m.includes(S)?(v.delete(S),h.current.delete(S)):v.get(S)!==!0&&v.set(S,!1)}},[g,m.length,m.join("-")]);const b=[];if(u!==f){let C=[...u];for(let S=0;S<g.length;S++){const E=g[S],L=va(E);m.includes(L)||(C.splice(S,0,E),b.push(E))}return a==="wait"&&b.length&&(C=b),w(Mm(C)),d(u),null}const{forceRender:x}=k.useContext(qd);return D.jsx(D.Fragment,{children:g.map(C=>{const S=va(C),E=l&&!c?!1:u===g||m.includes(S),L=()=>{if(h.current.has(S))return;if(h.current.add(S),v.has(S))v.set(S,!0);else return;let A=!0;v.forEach(M=>{M||(A=!1)}),A&&(x==null||x(),w(y.current),l&&(p==null||p()),n&&n())};return D.jsx(r5,{isPresent:E,initial:!_.current||r?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:o,onExitComplete:E?void 0:L,anchorX:i,children:C},S)})})},Cy=k.createContext({strict:!1}),Am={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},os={};for(const e in Am)os[e]={isEnabled:t=>Am[e].some(r=>!!t[r])};function s5(e){for(const t in e)os[t]={...os[t],...e[t]}}const o5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function bl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||o5.has(e)}let Ey=e=>!bl(e);function a5(e){typeof e=="function"&&(Ey=t=>t.startsWith("on")?!bl(t):e(t))}try{a5(require("@emotion/is-prop-valid").default)}catch{}function l5(e,t,r){const n={};for(const s in e)s==="values"&&typeof e.values=="object"||(Ey(s)||r===!0&&bl(s)||!t&&!bl(s)||e.draggable&&s.startsWith("onDrag"))&&(n[s]=e[s]);return n}const tc=k.createContext({});function rc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Eo(e){return typeof e=="string"||Array.isArray(e)}const yf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],wf=["initial",...yf];function nc(e){return rc(e.animate)||wf.some(t=>Eo(e[t]))}function ky(e){return!!(nc(e)||e.variants)}function c5(e,t){if(nc(e)){const{initial:r,animate:n}=e;return{initial:r===!1||Eo(r)?r:void 0,animate:Eo(n)?n:void 0}}return e.inherit!==!1?t:{}}function u5(e){const{initial:t,animate:r}=c5(e,k.useContext(tc));return k.useMemo(()=>({initial:t,animate:r}),[Pm(t),Pm(r)])}function Pm(e){return Array.isArray(e)?e.join(" "):e}function Im(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rs={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ge.test(e))e=parseFloat(e);else return e;const r=Im(e,t.target.x),n=Im(e,t.target.y);return`${r}% ${n}%`}},h5={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,s=In.parse(e);if(s.length>5)return n;const a=In.createTransformer(e),l=typeof s[0]!="number"?1:0,i=r.x.scale*t.x,o=r.y.scale*t.y;s[0+l]/=i,s[1+l]/=o;const c=it(i,o,.5);return typeof s[2+l]=="number"&&(s[2+l]/=c),typeof s[3+l]=="number"&&(s[3+l]/=c),a(s)}},bh={borderRadius:{...Rs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rs,borderTopRightRadius:Rs,borderBottomLeftRadius:Rs,borderBottomRightRadius:Rs,boxShadow:h5};function Ly(e,{layout:t,layoutId:r}){return ds.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!bh[e]||e==="opacity")}const d5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},f5=hs.length;function p5(e,t,r){let n="",s=!0;for(let a=0;a<f5;a++){const l=hs[a],i=e[l];if(i===void 0)continue;let o=!0;if(typeof i=="number"?o=i===(l.startsWith("scale")?1:0):o=parseFloat(i)===0,!o||r){const c=gy(i,mf[l]);if(!o){s=!1;const p=d5[l]||l;n+=`${p}(${c}) `}r&&(t[l]=c)}}return n=n.trim(),r?n=r(t,s?"":n):s&&(n="none"),n}function Sf(e,t,r){const{style:n,vars:s,transformOrigin:a}=e;let l=!1,i=!1;for(const o in t){const c=t[o];if(ds.has(o)){l=!0;continue}else if(G0(o)){s[o]=c;continue}else{const p=gy(c,mf[o]);o.startsWith("origin")?(i=!0,a[o]=p):n[o]=p}}if(t.transform||(l||r?n.transform=p5(t,e.transform,r):n.transform&&(n.transform="none")),i){const{originX:o="50%",originY:c="50%",originZ:p=0}=a;n.transformOrigin=`${o} ${c} ${p}`}}const xf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ry(e,t,r){for(const n in t)!$t(t[n])&&!Ly(n,r)&&(e[n]=t[n])}function m5({transformTemplate:e},t){return k.useMemo(()=>{const r=xf();return Sf(r,t,e),Object.assign({},r.vars,r.style)},[t])}function g5(e,t){const r=e.style||{},n={};return Ry(n,r,e),Object.assign(n,m5(e,t)),n}function v5(e,t){const r={},n=g5(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const _5={offset:"stroke-dashoffset",array:"stroke-dasharray"},y5={offset:"strokeDashoffset",array:"strokeDasharray"};function w5(e,t,r=1,n=0,s=!0){e.pathLength=1;const a=s?_5:y5;e[a.offset]=ge.transform(-n);const l=ge.transform(t),i=ge.transform(r);e[a.array]=`${l} ${i}`}const S5=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ty(e,{attrX:t,attrY:r,attrScale:n,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...i},o,c,p){if(Sf(e,i,c),o){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:m}=e;u.transform&&(m.transform=u.transform,delete u.transform),(m.transform||u.transformOrigin)&&(m.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),m.transform&&(m.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete u.transformBox);for(const _ of S5)u[_]!==void 0&&(m[_]=u[_],delete u[_]);t!==void 0&&(u.x=t),r!==void 0&&(u.y=r),n!==void 0&&(u.scale=n),s!==void 0&&w5(u,s,a,l,!1)}const Dy=()=>({...xf(),attrs:{}}),My=e=>typeof e=="string"&&e.toLowerCase()==="svg";function x5(e,t,r,n){const s=k.useMemo(()=>{const a=Dy();return Ty(a,t,My(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};Ry(a,e.style,e),s.style={...a,...s.style}}return s}const b5=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function bf(e){return typeof e!="string"||e.includes("-")?!1:!!(b5.indexOf(e)>-1||/[A-Z]/u.test(e))}function C5(e,t,r,{latestValues:n},s,a=!1,l){const o=(l??bf(e)?x5:v5)(t,n,s,e),c=l5(t,typeof e=="string",a),p=e!==k.Fragment?{...c,...o,ref:r}:{},{children:u}=t,m=k.useMemo(()=>$t(u)?u.get():u,[u]);return k.createElement(e,{...p,children:m})}function Bm(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function Cf(e,t,r,n){if(typeof t=="function"){const[s,a]=Bm(n);t=t(r!==void 0?r:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=Bm(n);t=t(r!==void 0?r:e.custom,s,a)}return t}function za(e){return $t(e)?e.get():e}function E5({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,s){return{latestValues:k5(r,n,s,e),renderState:t()}}function k5(e,t,r,n){const s={},a=n(e,{});for(const m in a)s[m]=za(a[m]);let{initial:l,animate:i}=e;const o=nc(e),c=ky(e);t&&c&&!o&&e.inherit!==!1&&(l===void 0&&(l=t.initial),i===void 0&&(i=t.animate));let p=r?r.initial===!1:!1;p=p||l===!1;const u=p?i:l;if(u&&typeof u!="boolean"&&!rc(u)){const m=Array.isArray(u)?u:[u];for(let _=0;_<m.length;_++){const y=Cf(e,m[_]);if(y){const{transitionEnd:v,transition:h,...f}=y;for(const d in f){let g=f[d];if(Array.isArray(g)){const w=p?g.length-1:0;g=g[w]}g!==null&&(s[d]=g)}for(const d in v)s[d]=v[d]}}}return s}const Ay=e=>(t,r)=>{const n=k.useContext(tc),s=k.useContext(ec),a=()=>E5(e,t,n,s);return r?a():Xd(a)};function Ef(e,t,r){var a;const{style:n}=e,s={};for(const l in n)($t(n[l])||t.style&&$t(t.style[l])||Ly(l,e)||((a=r==null?void 0:r.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(s[l]=n[l]);return s}const L5=Ay({scrapeMotionValuesFromProps:Ef,createRenderState:xf});function Py(e,t,r){const n=Ef(e,t,r);for(const s in e)if($t(e[s])||$t(t[s])){const a=hs.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[a]=e[s]}return n}const R5=Ay({scrapeMotionValuesFromProps:Py,createRenderState:Dy}),T5=Symbol.for("motionComponentSymbol");function D5(e,t,r){const n=k.useRef(r);k.useInsertionEffect(()=>{n.current=r});const s=k.useRef(null);return k.useCallback(a=>{var i;a&&((i=e.onMount)==null||i.call(e,a)),t&&(a?t.mount(a):t.unmount());const l=n.current;if(typeof l=="function")if(a){const o=l(a);typeof o=="function"&&(s.current=o)}else s.current?(s.current(),s.current=null):l(a);else l&&(l.current=a)},[t])}const kf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),M5="framerAppearId",Iy="data-"+kf(M5),By=k.createContext({});function Ns(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function A5(e,t,r,n,s,a){var h,f;const{visualElement:l}=k.useContext(tc),i=k.useContext(Cy),o=k.useContext(ec),c=k.useContext(_f).reducedMotion,p=k.useRef(null);n=n||i.renderer,!p.current&&n&&(p.current=n(e,{visualState:t,parent:l,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:c,isSVG:a}));const u=p.current,m=k.useContext(By);u&&!u.projection&&s&&(u.type==="html"||u.type==="svg")&&P5(p.current,r,s,m);const _=k.useRef(!1);k.useInsertionEffect(()=>{u&&_.current&&u.update(r,o)});const y=r[Iy],v=k.useRef(!!y&&!((h=window.MotionHandoffIsComplete)!=null&&h.call(window,y))&&((f=window.MotionHasOptimisedAnimation)==null?void 0:f.call(window,y)));return D0(()=>{u&&(_.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),v.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!v.current&&u.animationState&&u.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var d;(d=window.MotionHandoffMarkAsComplete)==null||d.call(window,y)}),v.current=!1),u.enteringChildren=void 0)}),u}function P5(e,t,r,n){const{layoutId:s,layout:a,drag:l,dragConstraints:i,layoutScroll:o,layoutRoot:c,layoutCrossfade:p}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:Oy(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!l||i&&Ns(i),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:p,layoutScroll:o,layoutRoot:c})}function Oy(e){if(e)return e.options.allowProjection!==!1?e.projection:Oy(e.parent)}function Uc(e,{forwardMotionProps:t=!1,type:r}={},n,s){n&&s5(n);const a=r?r==="svg":bf(e),l=a?R5:L5;function i(c,p){let u;const m={...k.useContext(_f),...c,layoutId:I5(c)},{isStatic:_}=m,y=u5(c),v=l(c,_);if(!_&&Yd){B5();const h=O5(m);u=h.MeasureLayout,y.visualElement=A5(e,v,m,s,h.ProjectionNode,a)}return D.jsxs(tc.Provider,{value:y,children:[u&&y.visualElement?D.jsx(u,{visualElement:y.visualElement,...m}):null,C5(e,c,D5(v,y.visualElement,p),v,_,t,a)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=k.forwardRef(i);return o[T5]=e,o}function I5({layoutId:e}){const t=k.useContext(qd).id;return t&&e!==void 0?t+"-"+e:e}function B5(e,t){k.useContext(Cy).strict}function O5(e){const{drag:t,layout:r}=os;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function N5(e,t){if(typeof Proxy>"u")return Uc;const r=new Map,n=(a,l)=>Uc(a,l,e,t),s=(a,l)=>n(a,l);return new Proxy(s,{get:(a,l)=>l==="create"?n:(r.has(l)||r.set(l,Uc(l,void 0,e,t)),r.get(l))})}function Ny({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function j5({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function F5(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Wc(e){return e===void 0||e===1}function Ch({scale:e,scaleX:t,scaleY:r}){return!Wc(e)||!Wc(t)||!Wc(r)}function Jn(e){return Ch(e)||jy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function jy(e){return Om(e.x)||Om(e.y)}function Om(e){return e&&e!=="0%"}function Cl(e,t,r){const n=e-r,s=t*n;return r+s}function Nm(e,t,r,n,s){return s!==void 0&&(e=Cl(e,s,n)),Cl(e,r,n)+t}function Eh(e,t=0,r=1,n,s){e.min=Nm(e.min,t,r,n,s),e.max=Nm(e.max,t,r,n,s)}function Fy(e,{x:t,y:r}){Eh(e.x,t.translate,t.scale,t.originPoint),Eh(e.y,r.translate,r.scale,r.originPoint)}const jm=.999999999999,Fm=1.0000000000001;function $5(e,t,r,n=!1){const s=r.length;if(!s)return;t.x=t.y=1;let a,l;for(let i=0;i<s;i++){a=r[i],l=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&o.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Ni(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,Fy(e,l)),n&&Jn(a.latestValues)&&Ni(e,a.latestValues))}t.x<Fm&&t.x>jm&&(t.x=1),t.y<Fm&&t.y>jm&&(t.y=1)}function Oi(e,t){e.min=e.min+t,e.max=e.max+t}function $m(e,t,r,n,s=.5){const a=it(e.min,e.max,s);Eh(e,t,r,a,n)}function Ni(e,t){$m(e.x,t.x,t.scaleX,t.scale,t.originX),$m(e.y,t.y,t.scaleY,t.scale,t.originY)}function $y(e,t){return Ny(F5(e.getBoundingClientRect(),t))}function H5(e,t,r){const n=$y(e,r),{scroll:s}=t;return s&&(Oi(n.x,s.offset.x),Oi(n.y,s.offset.y)),n}const Hm=()=>({translate:0,scale:1,origin:0,originPoint:0}),ji=()=>({x:Hm(),y:Hm()}),zm=()=>({min:0,max:0}),_t=()=>({x:zm(),y:zm()}),El={current:null},Lf={current:!1};function Hy(){if(Lf.current=!0,!!Yd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>El.current=e.matches;e.addEventListener("change",t),t()}else El.current=!1}const z5=new WeakMap;function U5(e,t,r){for(const n in t){const s=t[n],a=r[n];if($t(s))e.addValue(n,s);else if($t(a))e.addValue(n,ss(s,{owner:e}));else if(a!==s)if(e.hasValue(n)){const l=e.getValue(n);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(n);e.addValue(n,ss(l!==void 0?l:s,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const Um=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class W5{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:a,visualState:l},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ff,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Vt.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Ze.render(this.render,!1,!0))};const{latestValues:o,renderState:c}=l;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=i,this.blockInitialAnimation=!!a,this.isControllingVariants=nc(r),this.isVariantNode=ky(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:p,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const m in u){const _=u[m];o[m]!==void 0&&$t(_)&&_.set(o[m])}}mount(t){var r;this.current=t,z5.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Lf.current||Hy(),this.shouldReduceMotion=El.current),(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Pn(this.notifyUpdate),Pn(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=ds.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=r.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Ze.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in os){const r=os[t];if(!r)continue;const{isEnabled:n,Feature:s}=r;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_t()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<Um.length;n++){const s=Um[n];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,l=t[a];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=U5(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=ss(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(M0(n)||P0(n))?n=parseFloat(n):!J2(n)&&In.test(r)&&(n=my(t,r)),this.setBaseTarget(t,$t(n)?n.get():n)),$t(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var a;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const l=Cf(this.props,r,(a=this.presenceContext)==null?void 0:a.custom);l&&(n=l[t])}if(r&&n!==void 0)return n;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!$t(s)?s:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new tf),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){gf.render(this.render)}}class zy extends W5{constructor(){super(...arguments),this.KeyframeResolver=$2}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;$t(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Uy(e,{style:t,vars:r},n,s){const a=e.style;let l;for(l in t)a[l]=t[l];s==null||s.applyProjectionStyles(a,n);for(l in r)a.setProperty(l,r[l])}function V5(e){return window.getComputedStyle(e)}class K5 extends zy{constructor(){super(...arguments),this.type="html",this.renderInstance=Uy}readValueFromInstance(t,r){var n;if(ds.has(r))return(n=this.projection)!=null&&n.isProjecting?gh(r):s2(t,r);{const s=V5(t),a=(G0(r)?s.getPropertyValue(r):s[r])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:r}){return $y(t,r)}build(t,r,n){Sf(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return Ef(t,r,n)}}const Wy=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function G5(e,t,r,n){Uy(e,t,void 0,n);for(const s in t.attrs)e.setAttribute(Wy.has(s)?s:kf(s),t.attrs[s])}class q5 extends zy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(ds.has(r)){const n=py(r);return n&&n.default||0}return r=Wy.has(r)?r:kf(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Py(t,r,n)}build(t,r,n){Ty(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,s){G5(t,r,n,s)}mount(t){this.isSVGTag=My(t.tagName),super.mount(t)}}const X5=(e,t)=>t.isSVG??bf(e)?new q5(t):new K5(t,{allowProjection:e!==k.Fragment});function qi(e,t,r){const n=e.getProps();return Cf(n,t,r!==void 0?r:n.custom,e)}const kh=e=>Array.isArray(e);function Y5(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,ss(r))}function J5(e){return kh(e)?e[e.length-1]||0:e}function Q5(e,t){const r=qi(e,t);let{transitionEnd:n={},transition:s={},...a}=r||{};a={...a,...n};for(const l in a){const i=J5(a[l]);Y5(e,l,i)}}function Z5(e){return!!($t(e)&&e.add)}function Lh(e,t){const r=e.getValue("willChange");if(Z5(r))return r.add(t);if(!r&&on.WillChange){const n=new on.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Vy(e){return e.props[Iy]}const eE=e=>e!==null;function tE(e,{repeat:t,repeatType:r="loop"},n){const s=e.filter(eE),a=t&&r!=="loop"&&t%2===1?0:s.length-1;return s[a]}const rE={type:"spring",stiffness:500,damping:25,restSpeed:10},nE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iE={type:"keyframes",duration:.8},sE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oE=(e,{keyframes:t})=>t.length>2?iE:ds.has(e)?e.startsWith("scale")?nE(t[1]):rE:sE;function aE({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:s,repeat:a,repeatType:l,repeatDelay:i,from:o,elapsed:c,...p}){return!!Object.keys(p).length}const Rf=(e,t,r,n={},s,a)=>l=>{const i=pf(n,e)||{},o=i.delay||n.delay||0;let{elapsed:c=0}=n;c=c-en(o);const p={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-c,onUpdate:m=>{t.set(m),i.onUpdate&&i.onUpdate(m)},onComplete:()=>{l(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:a?void 0:s};aE(i)||Object.assign(p,oE(e,p)),p.duration&&(p.duration=en(p.duration)),p.repeatDelay&&(p.repeatDelay=en(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let u=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Sh(p),p.delay===0&&(u=!0)),(on.instantAnimations||on.skipAnimations)&&(u=!0,Sh(p),p.delay=0),p.allowFlatten=!i.type&&!i.ease,u&&!a&&t.get()!==void 0){const m=tE(p.keyframes,i);if(m!==void 0){Ze.update(()=>{p.onUpdate(m),p.onComplete()});return}}return i.isSync?new df(p):new R2(p)};function lE({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function Ky(e,t,{delay:r=0,transitionOverride:n,type:s}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:l,...i}=t;n&&(a=n);const o=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const p in i){const u=e.getValue(p,e.latestValues[p]??null),m=i[p];if(m===void 0||c&&lE(c,p))continue;const _={delay:r,...pf(a||{},p)},y=u.get();if(y!==void 0&&!u.isAnimating&&!Array.isArray(m)&&m===y&&!_.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const f=Vy(e);if(f){const d=window.MotionHandoffAnimation(f,p,Ze);d!==null&&(_.startTime=d,v=!0)}}Lh(e,p),u.start(Rf(p,u,m,e.shouldReduceMotion&&hy.has(p)?{type:!1}:_,e,v));const h=u.animation;h&&o.push(h)}return l&&Promise.all(o).then(()=>{Ze.update(()=>{l&&Q5(e,l)})}),o}function Gy(e,t,r,n=0,s=1){const a=Array.from(e).sort((c,p)=>c.sortNodePosition(p)).indexOf(t),l=e.size,i=(l-1)*n;return typeof r=="function"?r(a,l):s===1?a*n:i-a*n}function Rh(e,t,r={}){var o;const n=qi(e,t,r.type==="exit"?(o=e.presenceContext)==null?void 0:o.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(s=r.transitionOverride);const a=n?()=>Promise.all(Ky(e,n,r)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:p=0,staggerChildren:u,staggerDirection:m}=s;return cE(e,t,c,p,u,m,r)}:()=>Promise.resolve(),{when:i}=s;if(i){const[c,p]=i==="beforeChildren"?[a,l]:[l,a];return c().then(()=>p())}else return Promise.all([a(),l(r.delay)])}function cE(e,t,r=0,n=0,s=0,a=1,l){const i=[];for(const o of e.variantChildren)o.notify("AnimationStart",t),i.push(Rh(o,t,{...l,delay:r+(typeof n=="function"?0:n)+Gy(e.variantChildren,o,n,s,a)}).then(()=>o.notify("AnimationComplete",t)));return Promise.all(i)}function uE(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const s=t.map(a=>Rh(e,a,r));n=Promise.all(s)}else if(typeof t=="string")n=Rh(e,t,r);else{const s=typeof t=="function"?qi(e,t,r.custom):t;n=Promise.all(Ky(e,s,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function qy(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const hE=wf.length;function Xy(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?Xy(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<hE;r++){const n=wf[r],s=e.props[n];(Eo(s)||s===!1)&&(t[n]=s)}return t}const dE=[...yf].reverse(),fE=yf.length;function pE(e){return t=>Promise.all(t.map(({animation:r,options:n})=>uE(e,r,n)))}function mE(e){let t=pE(e),r=Wm(),n=!0;const s=o=>(c,p)=>{var m;const u=qi(e,p,o==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(u){const{transition:_,transitionEnd:y,...v}=u;c={...c,...v,...y}}return c};function a(o){t=o(e)}function l(o){const{props:c}=e,p=Xy(e.parent)||{},u=[],m=new Set;let _={},y=1/0;for(let h=0;h<fE;h++){const f=dE[h],d=r[f],g=c[f]!==void 0?c[f]:p[f],w=Eo(g),b=f===o?d.isActive:null;b===!1&&(y=h);let x=g===p[f]&&g!==c[f]&&w;if(x&&n&&e.manuallyAnimateOnMount&&(x=!1),d.protectedKeys={..._},!d.isActive&&b===null||!g&&!d.prevProp||rc(g)||typeof g=="boolean")continue;const C=gE(d.prevProp,g);let S=C||f===o&&d.isActive&&!x&&w||h>y&&w,E=!1;const L=Array.isArray(g)?g:[g];let A=L.reduce(s(f),{});b===!1&&(A={});const{prevResolvedValues:M={}}=d,T={...M,...A},B=$=>{S=!0,m.has($)&&(E=!0,m.delete($)),d.needsAnimating[$]=!0;const O=e.getValue($);O&&(O.liveStyle=!1)};for(const $ in T){const O=A[$],R=M[$];if(_.hasOwnProperty($))continue;let P=!1;kh(O)&&kh(R)?P=!qy(O,R):P=O!==R,P?O!=null?B($):m.add($):O!==void 0&&m.has($)?B($):d.protectedKeys[$]=!0}d.prevProp=g,d.prevResolvedValues=A,d.isActive&&(_={..._,...A}),n&&e.blockInitialAnimation&&(S=!1);const H=x&&C;S&&(!H||E)&&u.push(...L.map($=>{const O={type:f};if(typeof $=="string"&&n&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,P=qi(R,$);if(R.enteringChildren&&P){const{delayChildren:N}=P.transition||{};O.delay=Gy(R.enteringChildren,e,N)}}return{animation:$,options:O}}))}if(m.size){const h={};if(typeof c.initial!="boolean"){const f=qi(e,Array.isArray(c.initial)?c.initial[0]:c.initial);f&&f.transition&&(h.transition=f.transition)}m.forEach(f=>{const d=e.getBaseTarget(f),g=e.getValue(f);g&&(g.liveStyle=!0),h[f]=d??null}),u.push({animation:h})}let v=!!u.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),n=!1,v?t(u):Promise.resolve()}function i(o,c){var u;if(r[o].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(m=>{var _;return(_=m.animationState)==null?void 0:_.setActive(o,c)}),r[o].isActive=c;const p=l(o);for(const m in r)r[m].protectedKeys={};return p}return{animateChanges:l,setActive:i,setAnimateFunction:a,getState:()=>r,reset:()=>{r=Wm()}}}function gE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!qy(t,e):!1}function zn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Wm(){return{animate:zn(!0),whileInView:zn(),whileHover:zn(),whileTap:zn(),whileDrag:zn(),whileFocus:zn(),exit:zn()}}class jn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class vE extends jn{constructor(t){super(t),t.animationState||(t.animationState=mE(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let _E=0;class yE extends jn{constructor(){super(...arguments),this.id=_E++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);r&&!t&&s.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const wE={animation:{Feature:vE},exit:{Feature:yE}};function ko(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Uo(e){return{point:{x:e.pageX,y:e.pageY}}}const SE=e=>t=>vf(t)&&e(t,Uo(t));function Js(e,t,r,n){return ko(e,t,SE(r),n)}const Yy=1e-4,xE=1-Yy,bE=1+Yy,Jy=.01,CE=0-Jy,EE=0+Jy;function Kt(e){return e.max-e.min}function kE(e,t,r){return Math.abs(e-t)<=r}function Vm(e,t,r,n=.5){e.origin=n,e.originPoint=it(t.min,t.max,e.origin),e.scale=Kt(r)/Kt(t),e.translate=it(r.min,r.max,e.origin)-e.originPoint,(e.scale>=xE&&e.scale<=bE||isNaN(e.scale))&&(e.scale=1),(e.translate>=CE&&e.translate<=EE||isNaN(e.translate))&&(e.translate=0)}function Qs(e,t,r,n){Vm(e.x,t.x,r.x,n?n.originX:void 0),Vm(e.y,t.y,r.y,n?n.originY:void 0)}function Km(e,t,r){e.min=r.min+t.min,e.max=e.min+Kt(t)}function LE(e,t,r){Km(e.x,t.x,r.x),Km(e.y,t.y,r.y)}function Gm(e,t,r){e.min=t.min-r.min,e.max=e.min+Kt(t)}function kl(e,t,r){Gm(e.x,t.x,r.x),Gm(e.y,t.y,r.y)}function ur(e){return[e("x"),e("y")]}const Qy=({current:e})=>e?e.ownerDocument.defaultView:null,qm=(e,t)=>Math.abs(e-t);function RE(e,t){const r=qm(e.x,t.x),n=qm(e.y,t.y);return Math.sqrt(r**2+n**2)}const Xm=new Set(["auto","scroll"]);class Zy{constructor(t,r,{transformPagePoint:n,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=Kc(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,v=RE(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!v)return;const{point:h}=_,{timestamp:f}=Mt;this.history.push({...h,timestamp:f});const{onStart:d,onMove:g}=this.handlers;y||(d&&d(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,_)},this.handlePointerMove=(_,y)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=Vc(y,this.transformPagePoint),Ze.update(this.updatePoint,!0)},this.handlePointerUp=(_,y)=>{this.end();const{onEnd:v,onSessionEnd:h,resumeAnimation:f}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&f&&f(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Kc(_.type==="pointercancel"?this.lastMoveEventInfo:Vc(y,this.transformPagePoint),this.history);this.startEvent&&v&&v(_,d),h&&h(_,d)},!vf(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=l,this.contextWindow=s||window;const o=Uo(t),c=Vc(o,this.transformPagePoint),{point:p}=c,{timestamp:u}=Mt;this.history=[{...p,timestamp:u}];const{onSessionStart:m}=r;m&&m(t,Kc(c,this.history)),this.removeListeners=$o(Js(this.contextWindow,"pointermove",this.handlePointerMove),Js(this.contextWindow,"pointerup",this.handlePointerUp),Js(this.contextWindow,"pointercancel",this.handlePointerUp)),i&&this.startScrollTracking(i)}startScrollTracking(t){let r=t.parentElement;for(;r;){const n=getComputedStyle(r);(Xm.has(n.overflowX)||Xm.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const n=t===window,s=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:s.x-r.x,y:s.y-r.y};a.x===0&&a.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,s),Ze.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Pn(this.updatePoint)}}function Vc(e,t){return t?{point:t(e.point)}:e}function Ym(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Kc({point:e},t){return{point:e,delta:Ym(e,e1(t)),offset:Ym(e,TE(t)),velocity:DE(t,.1)}}function TE(e){return e[0]}function e1(e){return e[e.length-1]}function DE(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const s=e1(e);for(;r>=0&&(n=e[r],!(s.timestamp-n.timestamp>en(t)));)r--;if(!n)return{x:0,y:0};const a=mr(s.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const l={x:(s.x-n.x)/a,y:(s.y-n.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function ME(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?it(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?it(r,e,n.max):Math.min(e,r)),e}function Jm(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function AE(e,{top:t,left:r,bottom:n,right:s}){return{x:Jm(e.x,r,s),y:Jm(e.y,t,n)}}function Qm(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function PE(e,t){return{x:Qm(e.x,t.x),y:Qm(e.y,t.y)}}function IE(e,t){let r=.5;const n=Kt(e),s=Kt(t);return s>n?r=xo(t.min,t.max-n,e.min):n>s&&(r=xo(e.min,e.max-s,t.min)),Hr(0,1,r)}function BE(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const Th=.35;function OE(e=Th){return e===!1?e=0:e===!0&&(e=Th),{x:Zm(e,"left","right"),y:Zm(e,"top","bottom")}}function Zm(e,t,r){return{min:eg(e,t),max:eg(e,r)}}function eg(e,t){return typeof e=="number"?e:e[t]||0}const NE=new WeakMap;class jE{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_t(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=u=>{r?(this.stopAnimation(),this.snapToCursor(Uo(u).point)):this.pauseAnimation()},l=(u,m)=>{this.stopAnimation();const{drag:_,dragPropagation:y,onDragStart:v}=this.getProps();if(_&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=W2(_),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ur(f=>{let d=this.getAxisMotionValue(f).get()||0;if($r.test(d)){const{projection:g}=this.visualElement;if(g&&g.layout){const w=g.layout.layoutBox[f];w&&(d=Kt(w)*(parseFloat(d)/100))}}this.originPoint[f]=d}),v&&Ze.postRender(()=>v(u,m)),Lh(this.visualElement,"transform");const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},i=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m;const{dragPropagation:_,dragDirectionLock:y,onDirectionLock:v,onDrag:h}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:f}=m;if(y&&this.currentDirection===null){this.currentDirection=FE(f),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",m.point,f),this.updateAxis("y",m.point,f),this.visualElement.render(),h&&h(u,m)},o=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m,this.stop(u,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>ur(u=>{var m;return this.getAnimationState(u)==="paused"&&((m=this.getAxisMotionValue(u).animation)==null?void 0:m.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new Zy(t,{onSessionStart:a,onStart:l,onMove:i,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:n,contextWindow:Qy(this.visualElement),element:this.visualElement.current})}stop(t,r){const n=t||this.latestPointerEvent,s=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!n)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:i}=this.getProps();i&&Ze.postRender(()=>i(n,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:s}=this.getProps();if(!n||!_a(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(l=ME(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&Ns(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=AE(n.layoutBox,t):this.constraints=!1,this.elastic=OE(r),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&ur(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=BE(n.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Ns(t))return!1;const n=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=H5(n,s.root,this.visualElement.getTransformPagePoint());let l=PE(s.layout.layoutBox,a);if(r){const i=r(j5(l));this.hasMutatedConstraints=!!i,i&&(l=Ny(i))}return l}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:s,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:i}=this.getProps(),o=this.constraints||{},c=ur(p=>{if(!_a(p,r,this.currentDirection))return;let u=o&&o[p]||{};l&&(u={min:0,max:0});const m=s?200:1e6,_=s?40:1e7,y={type:"inertia",velocity:n?t[p]:0,bounceStiffness:m,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...a,...u};return this.startAxisValueAnimation(p,y)});return Promise.all(c).then(i)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return Lh(this.visualElement,t),n.start(Rf(t,n,0,r,this.visualElement,!1))}stopAnimation(){ur(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ur(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),s=n[r];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ur(r=>{const{drag:n}=this.getProps();if(!_a(r,n,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(r);if(s&&s.layout){const{min:l,max:i}=s.layout.layoutBox[r],o=a.get()||0;a.set(t[r]-it(l,i,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Ns(r)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ur(l=>{const i=this.getAxisMotionValue(l);if(i&&this.constraints!==!1){const o=i.get();s[l]=IE({min:o,max:o},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ur(l=>{if(!_a(l,t,null))return;const i=this.getAxisMotionValue(l),{min:o,max:c}=this.constraints[l];i.set(it(o,c,s[l]))})}addListeners(){if(!this.visualElement.current)return;NE.set(this.visualElement,this);const t=this.visualElement.current,r=Js(t,"pointerdown",o=>{const{drag:c,dragListener:p=!0}=this.getProps();c&&p&&!Sy(o.target)&&this.start(o)}),n=()=>{const{dragConstraints:o}=this.getProps();Ns(o)&&o.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,a=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Ze.read(n);const l=ko(window,"resize",()=>this.scalePositionWithinConstraints()),i=s.addEventListener("didUpdate",({delta:o,hasLayoutChanged:c})=>{this.isDragging&&c&&(ur(p=>{const u=this.getAxisMotionValue(p);u&&(this.originPoint[p]+=o[p].translate,u.set(u.get()+o[p].translate))}),this.visualElement.render())});return()=>{l(),r(),a(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:l=Th,dragMomentum:i=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:s,dragConstraints:a,dragElastic:l,dragMomentum:i}}}function _a(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function FE(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class $E extends jn{constructor(t){super(t),this.removeGroupControls=vr,this.removeListeners=vr,this.controls=new jE(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const tg=e=>(t,r)=>{e&&Ze.postRender(()=>e(t,r))};class HE extends jn{constructor(){super(...arguments),this.removePointerDownListener=vr}onPointerDown(t){this.session=new Zy(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qy(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:tg(t),onStart:tg(r),onMove:n,onEnd:(a,l)=>{delete this.session,s&&Ze.postRender(()=>s(a,l))}}}mount(){this.removePointerDownListener=Js(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ua={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Gc=!1;class zE extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:s}=this.props,{projection:a}=t;a&&(r.group&&r.group.add(a),n&&n.register&&s&&n.register(a),Gc&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Ua.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:s,isPresent:a}=this.props,{projection:l}=n;return l&&(l.isPresent=a,Gc=!0,s||t.layoutDependency!==r||r===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||Ze.postRender(()=>{const i=l.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),gf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:s}=t;Gc=!0,s&&(s.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function t1(e){const[t,r]=by(),n=k.useContext(qd);return D.jsx(zE,{...e,layoutGroup:n,switchLayoutGroup:k.useContext(By),isPresent:t,safeToRemove:r})}function UE(e,t,r){const n=$t(e)?e:ss(e);return n.start(Rf("",n,t,r)),n.animation}const WE=(e,t)=>e.depth-t.depth;class VE{constructor(){this.children=[],this.isDirty=!1}add(t){Jd(this.children,t),this.isDirty=!0}remove(t){Qd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(WE),this.isDirty=!1,this.children.forEach(t)}}function KE(e,t){const r=Vt.now(),n=({timestamp:s})=>{const a=s-r;a>=t&&(Pn(n),e(a-t))};return Ze.setup(n,!0),()=>Pn(n)}const r1=["TopLeft","TopRight","BottomLeft","BottomRight"],GE=r1.length,rg=e=>typeof e=="string"?parseFloat(e):e,ng=e=>typeof e=="number"||ge.test(e);function qE(e,t,r,n,s,a){s?(e.opacity=it(0,r.opacity??1,XE(n)),e.opacityExit=it(t.opacity??1,0,YE(n))):a&&(e.opacity=it(t.opacity??1,r.opacity??1,n));for(let l=0;l<GE;l++){const i=`border${r1[l]}Radius`;let o=ig(t,i),c=ig(r,i);if(o===void 0&&c===void 0)continue;o||(o=0),c||(c=0),o===0||c===0||ng(o)===ng(c)?(e[i]=Math.max(it(rg(o),rg(c),n),0),($r.test(c)||$r.test(o))&&(e[i]+="%")):e[i]=c}(t.rotate||r.rotate)&&(e.rotate=it(t.rotate||0,r.rotate||0,n))}function ig(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const XE=n1(0,.5,H0),YE=n1(.5,.95,vr);function n1(e,t,r){return n=>n<e?0:n>t?1:r(xo(e,t,n))}function sg(e,t){e.min=t.min,e.max=t.max}function Sr(e,t){sg(e.x,t.x),sg(e.y,t.y)}function og(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ag(e,t,r,n,s){return e-=t,e=Cl(e,1/r,n),s!==void 0&&(e=Cl(e,1/s,n)),e}function JE(e,t=0,r=1,n=.5,s,a=e,l=e){if($r.test(t)&&(t=parseFloat(t),t=it(l.min,l.max,t/100)-l.min),typeof t!="number")return;let i=it(a.min,a.max,n);e===a&&(i-=t),e.min=ag(e.min,t,r,i,s),e.max=ag(e.max,t,r,i,s)}function lg(e,t,[r,n,s],a,l){JE(e,t[r],t[n],t[s],t.scale,a,l)}const QE=["x","scaleX","originX"],ZE=["y","scaleY","originY"];function cg(e,t,r,n){lg(e.x,t,QE,r?r.x:void 0,n?n.x:void 0),lg(e.y,t,ZE,r?r.y:void 0,n?n.y:void 0)}function ug(e){return e.translate===0&&e.scale===1}function i1(e){return ug(e.x)&&ug(e.y)}function hg(e,t){return e.min===t.min&&e.max===t.max}function ek(e,t){return hg(e.x,t.x)&&hg(e.y,t.y)}function dg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function s1(e,t){return dg(e.x,t.x)&&dg(e.y,t.y)}function fg(e){return Kt(e.x)/Kt(e.y)}function pg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class tk{constructor(){this.members=[]}add(t){Jd(this.members,t),t.scheduleRender()}remove(t){if(Qd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(s=>t===s);if(r===0)return!1;let n;for(let s=r;s>=0;s--){const a=this.members[s];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function rk(e,t,r){let n="";const s=e.x.translate/t.x,a=e.y.translate/t.y,l=(r==null?void 0:r.z)||0;if((s||a||l)&&(n=`translate3d(${s}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:p,rotateX:u,rotateY:m,skewX:_,skewY:y}=r;c&&(n=`perspective(${c}px) ${n}`),p&&(n+=`rotate(${p}deg) `),u&&(n+=`rotateX(${u}deg) `),m&&(n+=`rotateY(${m}deg) `),_&&(n+=`skewX(${_}deg) `),y&&(n+=`skewY(${y}deg) `)}const i=e.x.scale*t.x,o=e.y.scale*t.y;return(i!==1||o!==1)&&(n+=`scale(${i}, ${o})`),n||"none"}const qc=["","X","Y","Z"],nk=1e3;let ik=0;function Xc(e,t,r,n){const{latestValues:s}=t;s[e]&&(r[e]=s[e],t.setStaticValue(e,0),n&&(n[e]=0))}function o1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=Vy(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Ze,!(s||a))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&o1(n)}function a1({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(l={},i=t==null?void 0:t()){this.id=ik++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ak),this.nodes.forEach(hk),this.nodes.forEach(dk),this.nodes.forEach(lk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let o=0;o<this.path.length;o++)this.path[o].shouldResetTransform=!0;this.root===this&&(this.nodes=new VE)}addEventListener(l,i){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new tf),this.eventHandlers.get(l).add(i)}notifyListeners(l,...i){const o=this.eventHandlers.get(l);o&&o.notify(...i)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=xy(l)&&!X2(l),this.instance=l;const{layoutId:i,layout:o,visualElement:c}=this.options;if(c&&!c.current&&c.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||i)&&(this.isLayoutDirty=!0),e){let p,u=0;const m=()=>this.root.updateBlockedByResize=!1;Ze.read(()=>{u=window.innerWidth}),e(l,()=>{const _=window.innerWidth;_!==u&&(u=_,this.root.updateBlockedByResize=!0,p&&p(),p=KE(m,250),Ua.hasAnimatedSinceResize&&(Ua.hasAnimatedSinceResize=!1,this.nodes.forEach(vg)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&c&&(i||o)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:u,hasRelativeLayoutChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||vk,{onLayoutAnimationStart:v,onLayoutAnimationComplete:h}=c.getProps(),f=!this.targetLayout||!s1(this.targetLayout,_),d=!u&&m;if(this.options.layoutRoot||this.resumeFrom||d||u&&(f||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...pf(y,"layout"),onPlay:v,onComplete:h};(c.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(p,d)}else u||vg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Pn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fk),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&o1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const u=this.path[p];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:i,layout:o}=this.options;if(i===void 0&&!o)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(mg);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(gg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(uk),this.nodes.forEach(sk),this.nodes.forEach(ok)):this.nodes.forEach(gg),this.clearAllSnapshots();const i=Vt.now();Mt.delta=Hr(0,1e3/60,i-Mt.timestamp),Mt.timestamp=i,Mt.isProcessing=!0,Oc.update.process(Mt),Oc.preRender.process(Mt),Oc.render.process(Mt),Mt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,gf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ck),this.sharedNodes.forEach(pk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ze.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ze.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Kt(this.snapshot.measuredBox.x)&&!Kt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let o=0;o<this.path.length;o++)this.path[o].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=_t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(i=!1),i&&this.instance){const o=n(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:o,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:o}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!i1(this.projectionDelta),o=this.getTransformTemplate(),c=o?o(this.latestValues,""):void 0,p=c!==this.prevTransformTemplateValue;l&&this.instance&&(i||Jn(this.latestValues)||p)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const i=this.measurePageBox();let o=this.removeElementScroll(i);return l&&(o=this.removeTransform(o)),_k(o),{animationId:this.root.animationId,measuredBox:i,layoutBox:o,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:l}=this.options;if(!l)return _t();const i=l.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(yk))){const{scroll:p}=this.root;p&&(Oi(i.x,p.offset.x),Oi(i.y,p.offset.y))}return i}removeElementScroll(l){var o;const i=_t();if(Sr(i,l),(o=this.scroll)!=null&&o.wasRoot)return i;for(let c=0;c<this.path.length;c++){const p=this.path[c],{scroll:u,options:m}=p;p!==this.root&&u&&m.layoutScroll&&(u.wasRoot&&Sr(i,l),Oi(i.x,u.offset.x),Oi(i.y,u.offset.y))}return i}applyTransform(l,i=!1){const o=_t();Sr(o,l);for(let c=0;c<this.path.length;c++){const p=this.path[c];!i&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Ni(o,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),Jn(p.latestValues)&&Ni(o,p.latestValues)}return Jn(this.latestValues)&&Ni(o,this.latestValues),o}removeTransform(l){const i=_t();Sr(i,l);for(let o=0;o<this.path.length;o++){const c=this.path[o];if(!c.instance||!Jn(c.latestValues))continue;Ch(c.latestValues)&&c.updateSnapshot();const p=_t(),u=c.measurePageBox();Sr(p,u),cg(i,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,p)}return Jn(this.latestValues)&&cg(i,this.latestValues),i}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Mt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var _;const i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);const o=!!this.resumingFrom||this!==i;if(!(l||o&&this.isSharedProjectionDirty||this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:u}=this.options;if(!this.layout||!(p||u))return;this.resolvedRelativeTargetAt=Mt.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),LE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Sr(this.target,this.layout.layoutBox),Fy(this.target,this.targetDelta)):Sr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ch(this.parent.latestValues)||jy(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,i,o){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),kl(this.relativeTargetOrigin,i,o),Sr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const l=this.getLead(),i=!!this.resumingFrom||this!==l;let o=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(o=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(o=!1),this.resolvedRelativeTargetAt===Mt.timestamp&&(o=!1),o)return;const{layout:c,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||p))return;Sr(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,m=this.treeScale.y;$5(this.layoutCorrected,this.treeScale,this.path,i),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=_t());const{target:_}=l;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(og(this.prevProjectionDelta.x,this.projectionDelta.x),og(this.prevProjectionDelta.y,this.projectionDelta.y)),Qs(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==m||!pg(this.projectionDelta.x,this.prevProjectionDelta.x)||!pg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var i;if((i=this.options.visualElement)==null||i.scheduleRender(),l){const o=this.getStack();o&&o.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ji(),this.projectionDelta=ji(),this.projectionDeltaWithTransform=ji()}setAnimationOrigin(l,i=!1){const o=this.snapshot,c=o?o.latestValues:{},p={...this.latestValues},u=ji();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;const m=_t(),_=o?o.source:void 0,y=this.layout?this.layout.source:void 0,v=_!==y,h=this.getStack(),f=!h||h.members.length<=1,d=!!(v&&!f&&this.options.crossfade===!0&&!this.path.some(gk));this.animationProgress=0;let g;this.mixTargetDelta=w=>{const b=w/1e3;_g(u.x,l.x,b),_g(u.y,l.y,b),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kl(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mk(this.relativeTarget,this.relativeTargetOrigin,m,b),g&&ek(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=_t()),Sr(g,this.relativeTarget)),v&&(this.animationValues=p,qE(p,c,this.latestValues,b,d,f)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var i,o,c;this.notifyListeners("animationStart"),(i=this.currentAnimation)==null||i.stop(),(c=(o=this.resumingFrom)==null?void 0:o.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Pn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ze.update(()=>{Ua.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ss(0)),this.currentAnimation=UE(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),l.onUpdate&&l.onUpdate(p)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(nk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:i,target:o,layout:c,latestValues:p}=l;if(!(!i||!o||!c)){if(this!==l&&this.layout&&c&&l1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){o=this.target||_t();const u=Kt(this.layout.layoutBox.x);o.x.min=l.target.x.min,o.x.max=o.x.min+u;const m=Kt(this.layout.layoutBox.y);o.y.min=l.target.y.min,o.y.max=o.y.min+m}Sr(i,o),Ni(i,p),Qs(this.projectionDeltaWithTransform,this.layoutCorrected,i,p)}}registerSharedNode(l,i){this.sharedNodes.has(l)||this.sharedNodes.set(l,new tk),this.sharedNodes.get(l).add(i);const c=i.options.initialPromotionConfig;i.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(i):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var i;const{layoutId:l}=this.options;return l?((i=this.getStack())==null?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:l}=this.options;return l?(i=this.getStack())==null?void 0:i.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:i,preserveFollowOpacity:o}={}){const c=this.getStack();c&&c.promote(this,o),l&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let i=!1;const{latestValues:o}=l;if((o.z||o.rotate||o.rotateX||o.rotateY||o.rotateZ||o.skewX||o.skewY)&&(i=!0),!i)return;const c={};o.z&&Xc("z",l,c,this.animationValues);for(let p=0;p<qc.length;p++)Xc(`rotate${qc[p]}`,l,c,this.animationValues),Xc(`skew${qc[p]}`,l,c,this.animationValues);l.render();for(const p in c)l.setStaticValue(p,c[p]),this.animationValues&&(this.animationValues[p]=c[p]);l.scheduleRender()}applyProjectionStyles(l,i){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const o=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=za(i==null?void 0:i.pointerEvents)||"",l.transform=o?o(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=za(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Jn(this.latestValues)&&(l.transform=o?o({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=c.animationValues||c.latestValues;this.applyTransformsToTarget();let u=rk(this.projectionDeltaWithTransform,this.treeScale,p);o&&(u=o(p,u)),l.transform=u;const{x:m,y:_}=this.projectionDelta;l.transformOrigin=`${m.origin*100}% ${_.origin*100}% 0`,c.animationValues?l.opacity=c===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=c===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const y in bh){if(p[y]===void 0)continue;const{correct:v,applyTo:h,isCSSVariable:f}=bh[y],d=u==="none"?p[y]:v(p[y],c);if(h){const g=h.length;for(let w=0;w<g;w++)l[h[w]]=d}else f?this.options.visualElement.renderState.vars[y]=d:l[y]=d}this.options.layoutId&&(l.pointerEvents=c===this?za(i==null?void 0:i.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var i;return(i=l.currentAnimation)==null?void 0:i.stop()}),this.root.nodes.forEach(mg),this.root.sharedNodes.clear()}}}function sk(e){e.updateLayout()}function ok(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=e.layout,{animationType:a}=e.options,l=t.source!==e.layout.source;a==="size"?ur(u=>{const m=l?t.measuredBox[u]:t.layoutBox[u],_=Kt(m);m.min=n[u].min,m.max=m.min+_}):l1(a,t.layoutBox,n)&&ur(u=>{const m=l?t.measuredBox[u]:t.layoutBox[u],_=Kt(n[u]);m.max=m.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+_)});const i=ji();Qs(i,n,t.layoutBox);const o=ji();l?Qs(o,e.applyTransform(s,!0),t.measuredBox):Qs(o,n,t.layoutBox);const c=!i1(i);let p=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:m,layout:_}=u;if(m&&_){const y=_t();kl(y,t.layoutBox,m.layoutBox);const v=_t();kl(v,n,_.layoutBox),s1(y,v)||(p=!0),u.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:o,layoutDelta:i,hasLayoutChanged:c,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function ak(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function lk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ck(e){e.clearSnapshot()}function mg(e){e.clearMeasurements()}function gg(e){e.isLayoutDirty=!1}function uk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function vg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hk(e){e.resolveTargetDelta()}function dk(e){e.calcProjection()}function fk(e){e.resetSkewAndRotation()}function pk(e){e.removeLeadSnapshot()}function _g(e,t,r){e.translate=it(t.translate,0,r),e.scale=it(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function yg(e,t,r,n){e.min=it(t.min,r.min,n),e.max=it(t.max,r.max,n)}function mk(e,t,r,n){yg(e.x,t.x,r.x,n),yg(e.y,t.y,r.y,n)}function gk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vk={duration:.45,ease:[.4,0,.1,1]},wg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Sg=wg("applewebkit/")&&!wg("chrome/")?Math.round:vr;function xg(e){e.min=Sg(e.min),e.max=Sg(e.max)}function _k(e){xg(e.x),xg(e.y)}function l1(e,t,r){return e==="position"||e==="preserve-aspect"&&!kE(fg(t),fg(r),.2)}function yk(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const wk=a1({attachResizeListener:(e,t)=>ko(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Yc={current:void 0},c1=a1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yc.current){const e=new wk({});e.mount(window),e.setOptions({layoutScroll:!0}),Yc.current=e}return Yc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Sk={pan:{Feature:HE},drag:{Feature:$E,ProjectionNode:c1,MeasureLayout:t1}};function bg(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const s="onHover"+r,a=n[s];a&&Ze.postRender(()=>a(t,Uo(t)))}class xk extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=V2(t,(r,n)=>(bg(this.node,n,"Start"),s=>bg(this.node,s,"End"))))}unmount(){}}class bk extends jn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=$o(ko(this.node.current,"focus",()=>this.onFocus()),ko(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Cg(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const s="onTap"+(r==="End"?"":r),a=n[s];a&&Ze.postRender(()=>a(t,Uo(t)))}class Ck extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=q2(t,(r,n)=>(Cg(this.node,n,"Start"),(s,{success:a})=>Cg(this.node,s,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Dh=new WeakMap,Jc=new WeakMap,Ek=e=>{const t=Dh.get(e.target);t&&t(e)},kk=e=>{e.forEach(Ek)};function Lk({root:e,...t}){const r=e||document;Jc.has(r)||Jc.set(r,{});const n=Jc.get(r),s=JSON.stringify(t);return n[s]||(n[s]=new IntersectionObserver(kk,{root:e,...t})),n[s]}function Rk(e,t,r){const n=Lk(t);return Dh.set(e,r),n.observe(e),()=>{Dh.delete(e),n.unobserve(e)}}const Tk={some:0,all:1};class Dk extends jn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:s="some",once:a}=t,l={root:r?r.current:void 0,rootMargin:n,threshold:typeof s=="number"?s:Tk[s]},i=o=>{const{isIntersecting:c}=o;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:p,onViewportLeave:u}=this.node.getProps(),m=c?p:u;m&&m(o)};return Rk(this.node.current,l,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Mk(t,r))&&this.startObserver()}unmount(){}}function Mk({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const Ak={inView:{Feature:Dk},tap:{Feature:Ck},focus:{Feature:bk},hover:{Feature:xk}},Pk={layout:{ProjectionNode:c1,MeasureLayout:t1}},Ik={...wE,...Ak,...Sk,...Pk},Mh=N5(Ik,X5);function u1(){!Lf.current&&Hy();const[e]=k.useState(El.current);return e}function Bk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const ic=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function fs(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Tf(e){return"nodeType"in e}function tr(e){var t,r;return e?fs(e)?e:Tf(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Df(e){const{Document:t}=tr(e);return e instanceof t}function Wo(e){return fs(e)?!1:e instanceof tr(e).HTMLElement}function h1(e){return e instanceof tr(e).SVGElement}function ps(e){return e?fs(e)?e.document:Tf(e)?Df(e)?e:Wo(e)||h1(e)?e.ownerDocument:document:document:document}const zr=ic?k.useLayoutEffect:k.useEffect;function Mf(e){const t=k.useRef(e);return zr(()=>{t.current=e}),k.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function Ok(){const e=k.useRef(null),t=k.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=k.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Lo(e,t){t===void 0&&(t=[e]);const r=k.useRef(e);return zr(()=>{r.current!==e&&(r.current=e)},t),r}function Vo(e,t){const r=k.useRef();return k.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Ll(e){const t=Mf(e),r=k.useRef(null),n=k.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function Ah(e){const t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}let Qc={};function Ko(e,t){return k.useMemo(()=>{if(t)return t;const r=Qc[e]==null?0:Qc[e]+1;return Qc[e]=r,e+"-"+r},[e,t])}function d1(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((a,l)=>{const i=Object.entries(l);for(const[o,c]of i){const p=a[o];p!=null&&(a[o]=p+e*c)}return a},{...t})}}const Xi=d1(1),Rl=d1(-1);function Nk(e){return"clientX"in e&&"clientY"in e}function Af(e){if(!e)return!1;const{KeyboardEvent:t}=tr(e.target);return t&&e instanceof t}function jk(e){if(!e)return!1;const{TouchEvent:t}=tr(e.target);return t&&e instanceof t}function Ph(e){if(jk(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Nk(e)?{x:e.clientX,y:e.clientY}:null}const Ro=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Ro.Translate.toString(e),Ro.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Eg="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fk(e){return e.matches(Eg)?e:e.querySelector(Eg)}const $k={display:"none"};function Hk(e){let{id:t,value:r}=e;return mt.createElement("div",{id:t,style:$k},r)}function zk(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return mt.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function Uk(){const[e,t]=k.useState("");return{announce:k.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const f1=k.createContext(null);function Wk(e){const t=k.useContext(f1);k.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Vk(){const[e]=k.useState(()=>new Set),t=k.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[k.useCallback(n=>{let{type:s,event:a}=n;e.forEach(l=>{var i;return(i=l[s])==null?void 0:i.call(l,a)})},[e]),t]}const Kk={draggable:`
49
+ To pick up a draggable item, press the space bar.
50
+ While dragging, use the arrow keys to move the item.
51
+ Press space again to drop the item in its new position, or press escape to cancel.
52
+ `},Gk={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function qk(e){let{announcements:t=Gk,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=Kk}=e;const{announce:a,announcement:l}=Uk(),i=Ko("DndLiveRegion"),[o,c]=k.useState(!1);if(k.useEffect(()=>{c(!0)},[]),Wk(k.useMemo(()=>({onDragStart(u){let{active:m}=u;a(t.onDragStart({active:m}))},onDragMove(u){let{active:m,over:_}=u;t.onDragMove&&a(t.onDragMove({active:m,over:_}))},onDragOver(u){let{active:m,over:_}=u;a(t.onDragOver({active:m,over:_}))},onDragEnd(u){let{active:m,over:_}=u;a(t.onDragEnd({active:m,over:_}))},onDragCancel(u){let{active:m,over:_}=u;a(t.onDragCancel({active:m,over:_}))}}),[a,t])),!o)return null;const p=mt.createElement(mt.Fragment,null,mt.createElement(Hk,{id:n,value:s.draggable}),mt.createElement(zk,{id:i,announcement:l}));return r?Nr.createPortal(p,r):p}var wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wt||(wt={}));function Tl(){}function Xk(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Yk(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return k.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Mr=Object.freeze({x:0,y:0});function Jk(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Qk(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Zk(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function eL(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function kg(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const tL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=kg(t,t.left,t.top),a=[];for(const l of n){const{id:i}=l,o=r.get(i);if(o){const c=Jk(kg(o),s);a.push({id:i,data:{droppableContainer:l,value:c}})}}return a.sort(Qk)};function rL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=s-n,i=a-r;if(n<s&&r<a){const o=t.width*t.height,c=e.width*e.height,p=l*i,u=p/(o+c-p);return Number(u.toFixed(4))}return 0}const nL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const a of n){const{id:l}=a,i=r.get(l);if(i){const o=rL(i,t);o>0&&s.push({id:l,data:{droppableContainer:a,value:o}})}}return s.sort(Zk)};function iL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function p1(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Mr}function sL(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];return s.reduce((l,i)=>({...l,top:l.top+e*i.y,bottom:l.bottom+e*i.y,left:l.left+e*i.x,right:l.right+e*i.x}),{...r})}}const oL=sL(1);function aL(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function lL(e,t,r){const n=aL(t);if(!n)return e;const{scaleX:s,scaleY:a,x:l,y:i}=n,o=e.left-l-(1-s)*parseFloat(r),c=e.top-i-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),p=s?e.width/s:e.width,u=a?e.height/a:e.height;return{width:p,height:u,top:c,right:o+p,bottom:c+u,left:o}}const cL={ignoreTransform:!1};function ms(e,t){t===void 0&&(t=cL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:p}=tr(e).getComputedStyle(e);c&&(r=lL(r,c,p))}const{top:n,left:s,width:a,height:l,bottom:i,right:o}=r;return{top:n,left:s,width:a,height:l,bottom:i,right:o}}function Lg(e){return ms(e,{ignoreTransform:!0})}function uL(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function hL(e,t){return t===void 0&&(t=tr(e).getComputedStyle(e)),t.position==="fixed"}function dL(e,t){t===void 0&&(t=tr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const a=t[s];return typeof a=="string"?r.test(a):!1})}function Pf(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(Df(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Wo(s)||h1(s)||r.includes(s))return r;const a=tr(e).getComputedStyle(s);return s!==e&&dL(s,a)&&r.push(s),hL(s,a)?r:n(s.parentNode)}return e?n(e):r}function m1(e){const[t]=Pf(e,1);return t??null}function Zc(e){return!ic||!e?null:fs(e)?e:Tf(e)?Df(e)||e===ps(e).scrollingElement?window:Wo(e)?e:null:null}function g1(e){return fs(e)?e.scrollX:e.scrollLeft}function v1(e){return fs(e)?e.scrollY:e.scrollTop}function Ih(e){return{x:g1(e),y:v1(e)}}var bt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(bt||(bt={}));function _1(e){return!ic||!e?!1:e===document.scrollingElement}function y1(e){const t={x:0,y:0},r=_1(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:s,isLeft:a,isBottom:l,isRight:i,maxScroll:n,minScroll:t}}const fL={x:.2,y:.2};function pL(e,t,r,n,s){let{top:a,left:l,right:i,bottom:o}=r;n===void 0&&(n=10),s===void 0&&(s=fL);const{isTop:c,isBottom:p,isLeft:u,isRight:m}=y1(e),_={x:0,y:0},y={x:0,y:0},v={height:t.height*s.y,width:t.width*s.x};return!c&&a<=t.top+v.height?(_.y=bt.Backward,y.y=n*Math.abs((t.top+v.height-a)/v.height)):!p&&o>=t.bottom-v.height&&(_.y=bt.Forward,y.y=n*Math.abs((t.bottom-v.height-o)/v.height)),!m&&i>=t.right-v.width?(_.x=bt.Forward,y.x=n*Math.abs((t.right-v.width-i)/v.width)):!u&&l<=t.left+v.width&&(_.x=bt.Backward,y.x=n*Math.abs((t.left+v.width-l)/v.width)),{direction:_,speed:y}}function mL(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function w1(e){return e.reduce((t,r)=>Xi(t,Ih(r)),Mr)}function gL(e){return e.reduce((t,r)=>t+g1(r),0)}function vL(e){return e.reduce((t,r)=>t+v1(r),0)}function _L(e,t){if(t===void 0&&(t=ms),!e)return;const{top:r,left:n,bottom:s,right:a}=t(e);m1(e)&&(s<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const yL=[["x",["left","right"],gL],["y",["top","bottom"],vL]];class If{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Pf(r),s=w1(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,i]of yL)for(const o of l)Object.defineProperty(this,o,{get:()=>{const c=i(n),p=s[a]-c;return this.rect[o]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Zs{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function wL(e){const{EventTarget:t}=tr(e);return e instanceof t?e:ps(e)}function eu(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var hr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(hr||(hr={}));function Rg(e){e.preventDefault()}function SL(e){e.stopPropagation()}var We;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(We||(We={}));const S1={start:[We.Space,We.Enter],cancel:[We.Esc],end:[We.Space,We.Enter,We.Tab]},xL=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case We.Right:return{...r,x:r.x+25};case We.Left:return{...r,x:r.x-25};case We.Down:return{...r,y:r.y+25};case We.Up:return{...r,y:r.y-25}}};class x1{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Zs(ps(r)),this.windowListeners=new Zs(tr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(hr.Resize,this.handleCancel),this.windowListeners.add(hr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(hr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&_L(n),r(Mr)}handleKeyDown(t){if(Af(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:a=S1,coordinateGetter:l=xL,scrollBehavior:i="smooth"}=s,{code:o}=t;if(a.end.includes(o)){this.handleEnd(t);return}if(a.cancel.includes(o)){this.handleCancel(t);return}const{collisionRect:c}=n.current,p=c?{x:c.left,y:c.top}:Mr;this.referenceCoordinates||(this.referenceCoordinates=p);const u=l(t,{active:r,context:n.current,currentCoordinates:p});if(u){const m=Rl(u,p),_={x:0,y:0},{scrollableAncestors:y}=n.current;for(const v of y){const h=t.code,{isTop:f,isRight:d,isLeft:g,isBottom:w,maxScroll:b,minScroll:x}=y1(v),C=mL(v),S={x:Math.min(h===We.Right?C.right-C.width/2:C.right,Math.max(h===We.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(h===We.Down?C.bottom-C.height/2:C.bottom,Math.max(h===We.Down?C.top:C.top+C.height/2,u.y))},E=h===We.Right&&!d||h===We.Left&&!g,L=h===We.Down&&!w||h===We.Up&&!f;if(E&&S.x!==u.x){const A=v.scrollLeft+m.x,M=h===We.Right&&A<=b.x||h===We.Left&&A>=x.x;if(M&&!m.y){v.scrollTo({left:A,behavior:i});return}M?_.x=v.scrollLeft-A:_.x=h===We.Right?v.scrollLeft-b.x:v.scrollLeft-x.x,_.x&&v.scrollBy({left:-_.x,behavior:i});break}else if(L&&S.y!==u.y){const A=v.scrollTop+m.y,M=h===We.Down&&A<=b.y||h===We.Up&&A>=x.y;if(M&&!m.x){v.scrollTo({top:A,behavior:i});return}M?_.y=v.scrollTop-A:_.y=h===We.Down?v.scrollTop-b.y:v.scrollTop-x.y,_.y&&v.scrollBy({top:-_.y,behavior:i});break}}this.handleMove(t,Xi(Rl(u,this.referenceCoordinates),_))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}x1.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=S1,onActivation:s}=t,{active:a}=r;const{code:l}=e.nativeEvent;if(n.start.includes(l)){const i=a.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function Tg(e){return!!(e&&"distance"in e)}function Dg(e){return!!(e&&"delay"in e)}class Bf{constructor(t,r,n){var s;n===void 0&&(n=wL(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:l}=a;this.props=t,this.events=r,this.document=ps(l),this.documentListeners=new Zs(this.document),this.listeners=new Zs(n),this.windowListeners=new Zs(tr(l)),this.initialCoordinates=(s=Ph(a))!=null?s:Mr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(hr.Resize,this.handleCancel),this.windowListeners.add(hr.DragStart,Rg),this.windowListeners.add(hr.VisibilityChange,this.handleCancel),this.windowListeners.add(hr.ContextMenu,Rg),this.documentListeners.add(hr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Dg(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Tg(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(hr.Click,SL,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(hr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:a}=this,{onMove:l,options:{activationConstraint:i}}=a;if(!s)return;const o=(r=Ph(t))!=null?r:Mr,c=Rl(s,o);if(!n&&i){if(Tg(i)){if(i.tolerance!=null&&eu(c,i.tolerance))return this.handleCancel();if(eu(c,i.distance))return this.handleStart()}if(Dg(i)&&eu(c,i.tolerance))return this.handleCancel();this.handlePending(i,c);return}t.cancelable&&t.preventDefault(),l(o)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===We.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const bL={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Of extends Bf{constructor(t){const{event:r}=t,n=ps(r.target);super(t,bL,n)}}Of.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const CL={move:{name:"mousemove"},end:{name:"mouseup"}};var Bh;(function(e){e[e.RightClick=2]="RightClick"})(Bh||(Bh={}));class EL extends Bf{constructor(t){super(t,CL,ps(t.event.target))}}EL.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Bh.RightClick?!1:(n==null||n({event:r}),!0)}}];const tu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class kL extends Bf{constructor(t){super(t,tu)}static setup(){return window.addEventListener(tu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(tu.move.name,t)};function t(){}}}kL.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var eo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(eo||(eo={}));var Dl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dl||(Dl={}));function LL(e){let{acceleration:t,activator:r=eo.Pointer,canScroll:n,draggingRect:s,enabled:a,interval:l=5,order:i=Dl.TreeOrder,pointerCoordinates:o,scrollableAncestors:c,scrollableAncestorRects:p,delta:u,threshold:m}=e;const _=TL({delta:u,disabled:!a}),[y,v]=Ok(),h=k.useRef({x:0,y:0}),f=k.useRef({x:0,y:0}),d=k.useMemo(()=>{switch(r){case eo.Pointer:return o?{top:o.y,bottom:o.y,left:o.x,right:o.x}:null;case eo.DraggableRect:return s}},[r,s,o]),g=k.useRef(null),w=k.useCallback(()=>{const x=g.current;if(!x)return;const C=h.current.x*f.current.x,S=h.current.y*f.current.y;x.scrollBy(C,S)},[]),b=k.useMemo(()=>i===Dl.TreeOrder?[...c].reverse():c,[i,c]);k.useEffect(()=>{if(!a||!c.length||!d){v();return}for(const x of b){if((n==null?void 0:n(x))===!1)continue;const C=c.indexOf(x),S=p[C];if(!S)continue;const{direction:E,speed:L}=pL(x,S,d,t,m);for(const A of["x","y"])_[A][E[A]]||(L[A]=0,E[A]=0);if(L.x>0||L.y>0){v(),g.current=x,y(w,l),h.current=L,f.current=E;return}}h.current={x:0,y:0},f.current={x:0,y:0},v()},[t,w,n,v,a,l,JSON.stringify(d),JSON.stringify(_),y,c,b,p,JSON.stringify(m)])}const RL={x:{[bt.Backward]:!1,[bt.Forward]:!1},y:{[bt.Backward]:!1,[bt.Forward]:!1}};function TL(e){let{delta:t,disabled:r}=e;const n=Ah(t);return Vo(s=>{if(r||!n||!s)return RL;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[bt.Backward]:s.x[bt.Backward]||a.x===-1,[bt.Forward]:s.x[bt.Forward]||a.x===1},y:{[bt.Backward]:s.y[bt.Backward]||a.y===-1,[bt.Forward]:s.y[bt.Forward]||a.y===1}}},[r,t,n])}function DL(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Vo(s=>{var a;return t==null?null:(a=n??s)!=null?a:null},[n,t])}function ML(e,t){return k.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,a=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,n)}));return[...r,...a]},[]),[e,t])}var To;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(To||(To={}));var Oh;(function(e){e.Optimized="optimized"})(Oh||(Oh={}));const Mg=new Map;function AL(e,t){let{dragging:r,dependencies:n,config:s}=t;const[a,l]=k.useState(null),{frequency:i,measure:o,strategy:c}=s,p=k.useRef(e),u=h(),m=Lo(u),_=k.useCallback(function(f){f===void 0&&(f=[]),!m.current&&l(d=>d===null?f:d.concat(f.filter(g=>!d.includes(g))))},[m]),y=k.useRef(null),v=Vo(f=>{if(u&&!r)return Mg;if(!f||f===Mg||p.current!==e||a!=null){const d=new Map;for(let g of e){if(!g)continue;if(a&&a.length>0&&!a.includes(g.id)&&g.rect.current){d.set(g.id,g.rect.current);continue}const w=g.node.current,b=w?new If(o(w),w):null;g.rect.current=b,b&&d.set(g.id,b)}return d}return f},[e,a,r,u,o]);return k.useEffect(()=>{p.current=e},[e]),k.useEffect(()=>{u||_()},[r,u]),k.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),k.useEffect(()=>{u||typeof i!="number"||y.current!==null||(y.current=setTimeout(()=>{_(),y.current=null},i))},[i,u,_,...n]),{droppableRects:v,measureDroppableContainers:_,measuringScheduled:a!=null};function h(){switch(c){case To.Always:return!1;case To.BeforeDragging:return r;default:return!r}}}function b1(e,t){return Vo(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function PL(e,t){return b1(e,t)}function IL(e){let{callback:t,disabled:r}=e;const n=Mf(t),s=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return k.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function sc(e){let{callback:t,disabled:r}=e;const n=Mf(t),s=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return k.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function BL(e){return new If(ms(e),e)}function Ag(e,t,r){t===void 0&&(t=BL);const[n,s]=k.useState(null);function a(){s(o=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=o??r)!=null?c:null}const p=t(e);return JSON.stringify(o)===JSON.stringify(p)?o:p})}const l=IL({callback(o){if(e)for(const c of o){const{type:p,target:u}=c;if(p==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),i=sc({callback:a});return zr(()=>{a(),e?(i==null||i.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(i==null||i.disconnect(),l==null||l.disconnect())},[e]),n}function OL(e){const t=b1(e);return p1(e,t)}const Pg=[];function NL(e){const t=k.useRef(e),r=Vo(n=>e?n&&n!==Pg&&e&&t.current&&e.parentNode===t.current.parentNode?n:Pf(e):Pg,[e]);return k.useEffect(()=>{t.current=e},[e]),r}function jL(e){const[t,r]=k.useState(null),n=k.useRef(e),s=k.useCallback(a=>{const l=Zc(a.target);l&&r(i=>i?(i.set(l,Ih(l)),new Map(i)):null)},[]);return k.useEffect(()=>{const a=n.current;if(e!==a){l(a);const i=e.map(o=>{const c=Zc(o);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,Ih(c)]):null}).filter(o=>o!=null);r(i.length?new Map(i):null),n.current=e}return()=>{l(e),l(a)};function l(i){i.forEach(o=>{const c=Zc(o);c==null||c.removeEventListener("scroll",s)})}},[s,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>Xi(a,l),Mr):w1(e):Mr,[e,t])}function Ig(e,t){t===void 0&&(t=[]);const r=k.useRef(null);return k.useEffect(()=>{r.current=null},t),k.useEffect(()=>{const n=e!==Mr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Rl(e,r.current):Mr}function FL(e){k.useEffect(()=>{if(!ic)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function $L(e,t){return k.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:a}=n;return r[s]=l=>{a(l,t)},r},{}),[e,t])}function C1(e){return k.useMemo(()=>e?uL(e):null,[e])}const Bg=[];function HL(e,t){t===void 0&&(t=ms);const[r]=e,n=C1(r?tr(r):null),[s,a]=k.useState(Bg);function l(){a(()=>e.length?e.map(o=>_1(o)?n:new If(t(o),o)):Bg)}const i=sc({callback:l});return zr(()=>{i==null||i.disconnect(),l(),e.forEach(o=>i==null?void 0:i.observe(o))},[e]),s}function zL(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wo(t)?t:e}function UL(e){let{measure:t}=e;const[r,n]=k.useState(null),s=k.useCallback(c=>{for(const{target:p}of c)if(Wo(p)){n(u=>{const m=t(p);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),a=sc({callback:s}),l=k.useCallback(c=>{const p=zL(c);a==null||a.disconnect(),p&&(a==null||a.observe(p)),n(p?t(p):null)},[t,a]),[i,o]=Ll(l);return k.useMemo(()=>({nodeRef:i,rect:r,setRef:o}),[r,i,o])}const WL=[{sensor:Of,options:{}},{sensor:x1,options:{}}],VL={current:{}},Wa={draggable:{measure:Lg},droppable:{measure:Lg,strategy:To.WhileDragging,frequency:Oh.Optimized},dragOverlay:{measure:ms}};class to extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const KL={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new to,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Tl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Wa,measureDroppableContainers:Tl,windowRect:null,measuringScheduled:!1},GL={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Tl,draggableNodes:new Map,over:null,measureDroppableContainers:Tl},oc=k.createContext(GL),E1=k.createContext(KL);function qL(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new to}}}function XL(e,t){switch(t.type){case wt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case wt.DragEnd:case wt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wt.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new to(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case wt.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const l=new to(e.droppable.containers);return l.set(r,{...a,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case wt.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const a=new to(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function YL(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=k.useContext(oc),a=Ah(n),l=Ah(r==null?void 0:r.id);return k.useEffect(()=>{if(!t&&!n&&a&&l!=null){if(!Af(a)||document.activeElement===a.target)return;const i=s.get(l);if(!i)return;const{activatorNode:o,node:c}=i;if(!o.current&&!c.current)return;requestAnimationFrame(()=>{for(const p of[o.current,c.current]){if(!p)continue;const u=Fk(p);if(u){u.focus();break}}})}},[n,t,s,l,a]),null}function JL(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,a)=>a({transform:s,...n}),r):r}function QL(e){return k.useMemo(()=>({draggable:{...Wa.draggable,...e==null?void 0:e.draggable},droppable:{...Wa.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Wa.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ZL(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const a=k.useRef(!1),{x:l,y:i}=typeof s=="boolean"?{x:s,y:s}:s;zr(()=>{if(!l&&!i||!t){a.current=!1;return}if(a.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const p=r(c),u=p1(p,n);if(l||(u.x=0),i||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const m=m1(c);m&&m.scrollBy({top:u.y,left:u.x})}},[t,l,i,n,r])}const k1=k.createContext({...Mr,scaleX:1,scaleY:1});var vn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(vn||(vn={}));const eR=k.memo(function(t){var r,n,s,a;let{id:l,accessibility:i,autoScroll:o=!0,children:c,sensors:p=WL,collisionDetection:u=nL,measuring:m,modifiers:_,...y}=t;const v=k.useReducer(XL,void 0,qL),[h,f]=v,[d,g]=Vk(),[w,b]=k.useState(vn.Uninitialized),x=w===vn.Initialized,{draggable:{active:C,nodes:S,translate:E},droppable:{containers:L}}=h,A=C!=null?S.get(C):null,M=k.useRef({initial:null,translated:null}),T=k.useMemo(()=>{var Me;return C!=null?{id:C,data:(Me=A==null?void 0:A.data)!=null?Me:VL,rect:M}:null},[C,A]),B=k.useRef(null),[H,j]=k.useState(null),[$,O]=k.useState(null),R=Lo(y,Object.values(y)),P=Ko("DndDescribedBy",l),N=k.useMemo(()=>L.getEnabled(),[L]),F=QL(m),{droppableRects:V,measureDroppableContainers:q,measuringScheduled:Q}=AL(N,{dragging:x,dependencies:[E.x,E.y],config:F.droppable}),Z=DL(S,C),z=k.useMemo(()=>$?Ph($):null,[$]),I=He(),K=PL(Z,F.draggable.measure);ZL({activeNode:C!=null?S.get(C):null,config:I.layoutShiftCompensation,initialRect:K,measure:F.draggable.measure});const U=Ag(Z,F.draggable.measure,K),J=Ag(Z?Z.parentElement:null),G=k.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ae=L.getNodeFor((r=G.current.over)==null?void 0:r.id),le=UL({measure:F.dragOverlay.measure}),me=(n=le.nodeRef.current)!=null?n:Z,ke=x?(s=le.rect)!=null?s:U:null,X=!!(le.nodeRef.current&&le.rect),ee=OL(X?null:U),Ae=C1(me?tr(me):null),de=NL(x?ae??Z:null),he=HL(de),ce=JL(_,{transform:{x:E.x-ee.x,y:E.y-ee.y,scaleX:1,scaleY:1},activatorEvent:$,active:T,activeNodeRect:U,containerNodeRect:J,draggingNodeRect:ke,over:G.current.over,overlayNodeRect:le.rect,scrollableAncestors:de,scrollableAncestorRects:he,windowRect:Ae}),te=z?Xi(z,E):null,pe=jL(de),ie=Ig(pe),oe=Ig(pe,[U]),Le=Xi(ce,ie),be=ke?oL(ke,ce):null,Re=T&&be?u({active:T,collisionRect:be,droppableRects:V,droppableContainers:N,pointerCoordinates:te}):null,De=eL(Re,"id"),[ne,fe]=k.useState(null),Ie=X?ce:Xi(ce,oe),W=iL(Ie,(a=ne==null?void 0:ne.rect)!=null?a:null,U),re=k.useRef(null),ve=k.useCallback((Me,Pe)=>{let{sensor:Ge,options:Fe}=Pe;if(B.current==null)return;const Se=S.get(B.current);if(!Se)return;const Ce=Me.nativeEvent,$e=new Ge({active:B.current,activeNode:Se,event:Ce,options:Fe,context:G,onAbort(Ue){if(!S.get(Ue))return;const{onDragAbort:at}=R.current,dt={id:Ue};at==null||at(dt),d({type:"onDragAbort",event:dt})},onPending(Ue,rt,at,dt){if(!S.get(Ue))return;const{onDragPending:Ar}=R.current,zt={id:Ue,constraint:rt,initialCoordinates:at,offset:dt};Ar==null||Ar(zt),d({type:"onDragPending",event:zt})},onStart(Ue){const rt=B.current;if(rt==null)return;const at=S.get(rt);if(!at)return;const{onDragStart:dt}=R.current,Rt={activatorEvent:Ce,active:{id:rt,data:at.data,rect:M}};Nr.unstable_batchedUpdates(()=>{dt==null||dt(Rt),b(vn.Initializing),f({type:wt.DragStart,initialCoordinates:Ue,active:rt}),d({type:"onDragStart",event:Rt}),j(re.current),O(Ce)})},onMove(Ue){f({type:wt.DragMove,coordinates:Ue})},onEnd:Ke(wt.DragEnd),onCancel:Ke(wt.DragCancel)});re.current=$e;function Ke(Ue){return async function(){const{active:at,collisions:dt,over:Rt,scrollAdjustedTranslate:Ar}=G.current;let zt=null;if(at&&Ar){const{cancelDrop:Pr}=R.current;zt={activatorEvent:Ce,active:at,collisions:dt,delta:Ar,over:Rt},Ue===wt.DragEnd&&typeof Pr=="function"&&await Promise.resolve(Pr(zt))&&(Ue=wt.DragCancel)}B.current=null,Nr.unstable_batchedUpdates(()=>{f({type:Ue}),b(vn.Uninitialized),fe(null),j(null),O(null),re.current=null;const Pr=Ue===wt.DragEnd?"onDragEnd":"onDragCancel";if(zt){const ln=R.current[Pr];ln==null||ln(zt),d({type:Pr,event:zt})}})}}},[S]),Te=k.useCallback((Me,Pe)=>(Ge,Fe)=>{const Se=Ge.nativeEvent,Ce=S.get(Fe);if(B.current!==null||!Ce||Se.dndKit||Se.defaultPrevented)return;const $e={active:Ce};Me(Ge,Pe.options,$e)===!0&&(Se.dndKit={capturedBy:Pe.sensor},B.current=Fe,ve(Ge,Pe))},[S,ve]),xe=ML(p,Te);FL(p),zr(()=>{U&&w===vn.Initializing&&b(vn.Initialized)},[U,w]),k.useEffect(()=>{const{onDragMove:Me}=R.current,{active:Pe,activatorEvent:Ge,collisions:Fe,over:Se}=G.current;if(!Pe||!Ge)return;const Ce={active:Pe,activatorEvent:Ge,collisions:Fe,delta:{x:Le.x,y:Le.y},over:Se};Nr.unstable_batchedUpdates(()=>{Me==null||Me(Ce),d({type:"onDragMove",event:Ce})})},[Le.x,Le.y]),k.useEffect(()=>{const{active:Me,activatorEvent:Pe,collisions:Ge,droppableContainers:Fe,scrollAdjustedTranslate:Se}=G.current;if(!Me||B.current==null||!Pe||!Se)return;const{onDragOver:Ce}=R.current,$e=Fe.get(De),Ke=$e&&$e.rect.current?{id:$e.id,rect:$e.rect.current,data:$e.data,disabled:$e.disabled}:null,Ue={active:Me,activatorEvent:Pe,collisions:Ge,delta:{x:Se.x,y:Se.y},over:Ke};Nr.unstable_batchedUpdates(()=>{fe(Ke),Ce==null||Ce(Ue),d({type:"onDragOver",event:Ue})})},[De]),zr(()=>{G.current={activatorEvent:$,active:T,activeNode:Z,collisionRect:be,collisions:Re,droppableRects:V,draggableNodes:S,draggingNode:me,draggingNodeRect:ke,droppableContainers:L,over:ne,scrollableAncestors:de,scrollAdjustedTranslate:Le},M.current={initial:ke,translated:be}},[T,Z,Re,be,S,me,ke,V,L,ne,de,Le]),LL({...I,delta:E,draggingRect:be,pointerCoordinates:te,scrollableAncestors:de,scrollableAncestorRects:he});const Be=k.useMemo(()=>({active:T,activeNode:Z,activeNodeRect:U,activatorEvent:$,collisions:Re,containerNodeRect:J,dragOverlay:le,draggableNodes:S,droppableContainers:L,droppableRects:V,over:ne,measureDroppableContainers:q,scrollableAncestors:de,scrollableAncestorRects:he,measuringConfiguration:F,measuringScheduled:Q,windowRect:Ae}),[T,Z,U,$,Re,J,le,S,L,V,ne,q,de,he,F,Q,Ae]),je=k.useMemo(()=>({activatorEvent:$,activators:xe,active:T,activeNodeRect:U,ariaDescribedById:{draggable:P},dispatch:f,draggableNodes:S,over:ne,measureDroppableContainers:q}),[$,xe,T,U,f,P,S,ne,q]);return mt.createElement(f1.Provider,{value:g},mt.createElement(oc.Provider,{value:je},mt.createElement(E1.Provider,{value:Be},mt.createElement(k1.Provider,{value:W},c)),mt.createElement(YL,{disabled:(i==null?void 0:i.restoreFocus)===!1})),mt.createElement(qk,{...i,hiddenTextDescribedById:P}));function He(){const Me=(H==null?void 0:H.autoScrollEnabled)===!1,Pe=typeof o=="object"?o.enabled===!1:o===!1,Ge=x&&!Me&&!Pe;return typeof o=="object"?{...o,enabled:Ge}:{enabled:Ge}}}),tR=k.createContext(null),Og="button",rR="Draggable";function nR(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const a=Ko(rR),{activators:l,activatorEvent:i,active:o,activeNodeRect:c,ariaDescribedById:p,draggableNodes:u,over:m}=k.useContext(oc),{role:_=Og,roleDescription:y="draggable",tabIndex:v=0}=s??{},h=(o==null?void 0:o.id)===t,f=k.useContext(h?k1:tR),[d,g]=Ll(),[w,b]=Ll(),x=$L(l,t),C=Lo(r);zr(()=>(u.set(t,{id:t,key:a,node:d,activatorNode:w,data:C}),()=>{const E=u.get(t);E&&E.key===a&&u.delete(t)}),[u,t]);const S=k.useMemo(()=>({role:_,tabIndex:v,"aria-disabled":n,"aria-pressed":h&&_===Og?!0:void 0,"aria-roledescription":y,"aria-describedby":p.draggable}),[n,_,v,h,y,p.draggable]);return{active:o,activatorEvent:i,activeNodeRect:c,attributes:S,isDragging:h,listeners:n?void 0:x,node:d,over:m,setNodeRef:g,setActivatorNodeRef:b,transform:f}}function iR(){return k.useContext(E1)}const sR="Droppable",oR={timeout:25};function aR(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const a=Ko(sR),{active:l,dispatch:i,over:o,measureDroppableContainers:c}=k.useContext(oc),p=k.useRef({disabled:r}),u=k.useRef(!1),m=k.useRef(null),_=k.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:h}={...oR,...s},f=Lo(v??n),d=k.useCallback(()=>{if(!u.current){u.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{c(Array.isArray(f.current)?f.current:[f.current]),_.current=null},h)},[h]),g=sc({callback:d,disabled:y||!l}),w=k.useCallback((S,E)=>{g&&(E&&(g.unobserve(E),u.current=!1),S&&g.observe(S))},[g]),[b,x]=Ll(w),C=Lo(t);return k.useEffect(()=>{!g||!b.current||(g.disconnect(),u.current=!1,g.observe(b.current))},[b,g]),k.useEffect(()=>(i({type:wt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:m,data:C}}),()=>i({type:wt.UnregisterDroppable,key:a,id:n})),[n]),k.useEffect(()=>{r!==p.current.disabled&&(i({type:wt.SetDroppableDisabled,id:n,key:a,disabled:r}),p.current.disabled=r)},[n,a,r,i]),{active:l,rect:m,isOver:(o==null?void 0:o.id)===n,node:b,over:o,setNodeRef:x}}function L1(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function lR(e,t){return e.reduce((r,n,s)=>{const a=t.get(n);return a&&(r[s]=a),r},Array(e.length))}function ya(e){return e!==null&&e>=0}function cR(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function uR(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const R1=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const a=L1(t,n,r),l=t[s],i=a[s];return!i||!l?null:{x:i.left-l.left,y:i.top-l.top,scaleX:i.width/l.width,scaleY:i.height/l.height}},wa={scaleX:1,scaleY:1},hR=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:a,overIndex:l}=e;const i=(t=a[r])!=null?t:n;if(!i)return null;if(s===r){const c=a[l];return c?{x:0,y:r<l?c.top+c.height-(i.top+i.height):c.top-i.top,...wa}:null}const o=dR(a,s,r);return s>r&&s<=l?{x:0,y:-i.height-o,...wa}:s<r&&s>=l?{x:0,y:i.height+o,...wa}:{x:0,y:0,...wa}};function dR(e,t,r){const n=e[t],s=e[t-1],a=e[t+1];return n?r<t?s?n.top-(s.top+s.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const T1="Sortable",D1=mt.createContext({activeIndex:-1,containerId:T1,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:R1,disabled:{draggable:!1,droppable:!1}});function fR(e){let{children:t,id:r,items:n,strategy:s=R1,disabled:a=!1}=e;const{active:l,dragOverlay:i,droppableRects:o,over:c,measureDroppableContainers:p}=iR(),u=Ko(T1,r),m=i.rect!==null,_=k.useMemo(()=>n.map(x=>typeof x=="object"&&"id"in x?x.id:x),[n]),y=l!=null,v=l?_.indexOf(l.id):-1,h=c?_.indexOf(c.id):-1,f=k.useRef(_),d=!cR(_,f.current),g=h!==-1&&v===-1||d,w=uR(a);zr(()=>{d&&y&&p(_)},[d,_,y,p]),k.useEffect(()=>{f.current=_},[_]);const b=k.useMemo(()=>({activeIndex:v,containerId:u,disabled:w,disableTransforms:g,items:_,overIndex:h,useDragOverlay:m,sortedRects:lR(_,o),strategy:s}),[v,u,w.draggable,w.droppable,g,_,h,o,m,s]);return mt.createElement(D1.Provider,{value:b},t)}const pR=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return L1(r,n,s).indexOf(t)},mR=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:a,newIndex:l,previousItems:i,previousContainerId:o,transition:c}=e;return!c||!n||i!==a&&s===l?!1:r?!0:l!==s&&t===o},gR={duration:200,easing:"ease"},M1="transform",vR=Ro.Transition.toString({property:M1,duration:0,easing:"linear"}),_R={roleDescription:"sortable"};function yR(e){let{disabled:t,index:r,node:n,rect:s}=e;const[a,l]=k.useState(null),i=k.useRef(r);return zr(()=>{if(!t&&r!==i.current&&n.current){const o=s.current;if(o){const c=ms(n.current,{ignoreTransform:!0}),p={x:o.left-c.left,y:o.top-c.top,scaleX:o.width/c.width,scaleY:o.height/c.height};(p.x||p.y)&&l(p)}}r!==i.current&&(i.current=r)},[t,r,n,s]),k.useEffect(()=>{a&&l(null)},[a]),a}function wR(e){let{animateLayoutChanges:t=mR,attributes:r,disabled:n,data:s,getNewIndex:a=pR,id:l,strategy:i,resizeObserverConfig:o,transition:c=gR}=e;const{items:p,containerId:u,activeIndex:m,disabled:_,disableTransforms:y,sortedRects:v,overIndex:h,useDragOverlay:f,strategy:d}=k.useContext(D1),g=SR(n,_),w=p.indexOf(l),b=k.useMemo(()=>({sortable:{containerId:u,index:w,items:p},...s}),[u,s,w,p]),x=k.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:C,node:S,isOver:E,setNodeRef:L}=aR({id:l,data:b,disabled:g.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...o}}),{active:A,activatorEvent:M,activeNodeRect:T,attributes:B,setNodeRef:H,listeners:j,isDragging:$,over:O,setActivatorNodeRef:R,transform:P}=nR({id:l,data:b,attributes:{..._R,...r},disabled:g.draggable}),N=Bk(L,H),F=!!A,V=F&&!y&&ya(m)&&ya(h),q=!f&&$,Q=q&&V?P:null,z=V?Q??(i??d)({rects:v,activeNodeRect:T,activeIndex:m,overIndex:h,index:w}):null,I=ya(m)&&ya(h)?a({id:l,items:p,activeIndex:m,overIndex:h}):w,K=A==null?void 0:A.id,U=k.useRef({activeId:K,items:p,newIndex:I,containerId:u}),J=p!==U.current.items,G=t({active:A,containerId:u,isDragging:$,isSorting:F,id:l,index:w,items:p,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:c,wasDragging:U.current.activeId!=null}),ae=yR({disabled:!G,index:w,node:S,rect:C});return k.useEffect(()=>{F&&U.current.newIndex!==I&&(U.current.newIndex=I),u!==U.current.containerId&&(U.current.containerId=u),p!==U.current.items&&(U.current.items=p)},[F,I,u,p]),k.useEffect(()=>{if(K===U.current.activeId)return;if(K!=null&&U.current.activeId==null){U.current.activeId=K;return}const me=setTimeout(()=>{U.current.activeId=K},50);return()=>clearTimeout(me)},[K]),{active:A,activeIndex:m,attributes:B,data:b,rect:C,index:w,newIndex:I,items:p,isOver:E,isSorting:F,isDragging:$,listeners:j,node:S,overIndex:h,over:O,setNodeRef:N,setActivatorNodeRef:R,setDroppableNodeRef:L,setDraggableNodeRef:H,transform:ae??z,transition:le()};function le(){if(ae||J&&U.current.newIndex===w)return vR;if(!(q&&!Af(M)||!c)&&(F||G))return Ro.Transition.toString({...c,property:M1})}}function SR(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}We.Down,We.Right,We.Up,We.Left;const Sa={permission:0,waiting:1,working:2,unknown:3};function ro(e){var r;const t=(r=e.agentSessionId)==null?void 0:r.trim();return t&&t.length>0?t:e.id}const xR={mode:"created",direction:"desc"};function Nf(e,t=xR){const{mode:r,direction:n,manualOrder:s}=t;if(r==="manual"&&s&&s.length>0){const a=new Map(s.map((l,i)=>[l,i]));return[...e].sort((l,i)=>{const o=ro(l),c=ro(i),p=a.get(o)??a.get(l.id)??1/0,u=a.get(c)??a.get(i.id)??1/0;return p===1/0&&u===1/0?Date.parse(i.createdAt)-Date.parse(l.createdAt):p-u})}return[...e].sort((a,l)=>{if(r==="status"){const c=Sa[a.status]??Sa.unknown,p=Sa[l.status]??Sa.unknown;return c!==p?c-p:Date.parse(l.lastActivity)-Date.parse(a.lastActivity)}const i=Date.parse(a.createdAt),o=Date.parse(l.createdAt);return n==="desc"?o-i:i-o})}function bR(e,t){var n,s;const r=new Map;for(const a of e){const l=(n=a.projectPath)==null?void 0:n.trim();if(l){const i=Date.parse(a.lastActivity)||0,o=r.get(l)||0;i>o&&r.set(l,i)}}for(const a of t){const l=(s=a.projectPath)==null?void 0:s.trim();if(l){const i=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;i>o&&r.set(l,i)}}return Array.from(r.keys()).sort((a,l)=>{const i=r.get(a)||0;return(r.get(l)||0)-i})}function CR(e,t){var n,s;const r=new Map;for(const a of e){const l=(n=a.host)==null?void 0:n.trim();if(l){const i=Date.parse(a.lastActivity)||0,o=r.get(l)||0;i>o&&r.set(l,i)}}for(const a of t){const l=(s=a.host)==null?void 0:s.trim();if(l){const i=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;i>o&&r.set(l,i)}}return Array.from(r.keys()).sort((a,l)=>{const i=r.get(a)||0;return(r.get(l)||0)-i})}function jf(e){const t=Date.parse(e);if(Number.isNaN(t))return"";const r=Date.now()-t,n=Math.floor(r/6e4);if(n<1)return"now";if(n<60)return`${n}m`;const s=Math.floor(n/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`}function li(e){const t=e.trim();if(!t)return null;const r=t.replace(/[\\/]+$/,"");if(!r)return null;const n=r.split(/[\\/]/);return n[n.length-1]||null}function ER(e){const t=e.map(i=>{const o=i.trim(),c=o.replace(/[\\/]+$/,""),p=c.split(/[\\/]/).filter(Boolean);return{path:i,parts:p,fallback:c||o||i}}),r=new Map;for(const i of t)r.set(i.path,1);let n=!0;for(;n;){n=!1;const i=new Map;for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,p=o.parts.slice(-c).join("/");i.set(p,(i.get(p)??0)+1)}for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,p=o.parts.slice(-c).join("/");(i.get(p)??0)>1&&c<o.parts.length&&(r.set(o.path,c+1),n=!0)}}const s=new Map,a=new Map;for(const i of t){let o=i.fallback;if(i.parts.length>0){const c=r.get(i.path)??1;o=i.parts.slice(-c).join("/")}s.set(i.path,o),a.set(o,(a.get(o)??0)+1)}const l=new Map;for(const i of t){let o=s.get(i.path)??i.fallback;(a.get(o)??0)>1&&(o=i.fallback),l.set(i.path,o)}return l}function A1(e){const t=e.trim();return!t||t.length<=6?t:`${t.slice(0,3)}…${t.slice(-3)}`}const et=Wd()(Vd((e,t)=>({sessions:[],agentSessions:{active:[],inactive:[]},hostStatuses:[],exitingSessions:new Map,selectedSessionId:null,hasLoaded:!1,connectionStatus:"connecting",connectionError:null,setSessions:r=>{var p;const n=t(),s=n.selectedSessionId,a=n.sessions,l=n.exitingSessions,i=new Set(r.map(u=>u.id)),o=a.filter(u=>!i.has(u.id)&&!l.has(u.id));let c=s;if(s!==null&&!r.some(u=>u.id===s)){const{sessionSortMode:u,sessionSortDirection:m}=ue.getState();c=((p=Nf(r,{mode:u,direction:m})[0])==null?void 0:p.id)??null}if(o.length>0){const u=new Map(l);for(const m of o)u.set(m.id,m);e({sessions:r,hasLoaded:!0,selectedSessionId:c,exitingSessions:u})}else e({sessions:r,hasLoaded:!0,selectedSessionId:c})},setAgentSessions:(r,n)=>e({agentSessions:{active:r,inactive:n}}),setHostStatuses:r=>e({hostStatuses:r}),updateSession:r=>e(n=>({sessions:n.sessions.map(s=>s.id===r.id?r:s)})),setSelectedSessionId:r=>e({selectedSessionId:r}),setConnectionStatus:r=>e({connectionStatus:r}),setConnectionError:r=>e({connectionError:r}),markSessionExiting:r=>{const n=t().sessions.find(s=>s.id===r);if(n){const s=new Map(t().exitingSessions);s.set(r,n),e({exitingSessions:s})}},clearExitingSession:r=>{const n=new Map(t().exitingSessions);n.delete(r),e({exitingSessions:n})}}),{name:"agentboard-session",storage:Zl(()=>Kd),partialize:e=>({selectedSessionId:e.selectedSessionId})}));function Ng(e,t,r=!1){const[n,s]=k.useState(!1),a=k.useRef(e),l=k.useRef(!1);return k.useEffect(()=>{const o=a.current;if(r?e>o:e!==o){l.current=!0;const p=setTimeout(()=>{l.current&&(s(!0),l.current=!1)},t);return a.current=e,()=>clearTimeout(p)}a.current=e},[e,t,r]),[n,()=>s(!1)]}function kR(e,t,r,n){const s=k.useRef(new Map);k.useEffect(()=>{const a=new Set(e.map(l=>l.id));for(const l of t.keys())if(a.has(l)){const i=s.current.get(l);i&&(clearTimeout(i),s.current.delete(l)),r(l)}else if(!s.current.has(l)){const i=setTimeout(()=>{s.current.delete(l),r(l)},n+100);s.current.set(l,i)}},[e,t,r,n]),k.useEffect(()=>()=>{for(const a of s.current.values())clearTimeout(a);s.current.clear()},[])}function LR({className:e}){return D.jsx("svg",{viewBox:"0 0 92.2 92.2",fill:"currentColor",className:e,"aria-label":"Anthropic",children:D.jsx("path",{d:"M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z M24.3,39.3l8.8-22.8l8.8,22.8H24.3z",transform:"translate(0, 13.6)"})})}function RR({className:e}){return D.jsx("svg",{viewBox:"-1 -1 26 26",fill:"currentColor",className:e,"aria-label":"OpenAI",children:D.jsx("path",{d:"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"})})}function TR({className:e}){return D.jsx("svg",{viewBox:"0 0 588.42 568.88",fill:"currentColor",className:e,"aria-label":"Pi",children:D.jsx("path",{d:"M 10.499686,177.03840 L 31.174931,178.56990 C 52.615925,154.32116 61.039171,82.595924 187.38789,96.634671 C 182.79339,403.95560 48.021426,436.37234 56.444675,499.41907 C 59.507674,535.15406 87.840417,557.10556 118.47041,558.38181 C 215.21014,555.06356 210.87089,424.63084 240.99038,95.868921 L 365.80760,95.868921 C 359.17110,211.75239 341.04836,327.63586 339.00636,441.22208 C 340.53786,516.77606 386.48285,557.10556 446.97708,557.61606 C 546.52456,560.93431 577.92030,444.79558 577.92030,395.27709 L 556.47931,395.27710 C 554.43731,436.11709 534.78306,465.47083 492.92207,467.25758 C 378.82535,468.78908 441.61683,266.63113 442.38258,97.400421 L 577.92030,98.166171 L 577.15455,11.636437 C 13.807491,8.9075799 85.312284,-2.1366151 10.499686,177.03840 z"})})}const DR=[["claude",LR],["codex",RR],["pi",TR]];function Ff({agentType:e,command:t,className:r=""}){const n=(e||(t==null?void 0:t.split(" ")[0])||"").toLowerCase();for(const[s,a]of DR)if(n.startsWith(s))return D.jsx(a,{className:r});return D.jsx(Xb,{className:r})}const MR=360;function AR(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t)}function P1(e){return{"--badge-hue":`${AR(e)%MR}`}}function I1({name:e,fullPath:t,className:r=""}){const n=P1(e);return D.jsx("span",{className:`project-badge inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none ${r}`,style:n,title:t,children:e})}const PR=k.memo(function({session:t,showSessionIdPrefix:r,showProjectName:n,showLastUserMessage:s,onResume:a,onPreview:l,onSetPinned:i}){const o=jf(t.lastActivityAt),c=li(t.projectPath),p=t.displayName||c||t.sessionId.slice(0,8),u=n&&!!c,m=s&&!!t.lastUserMessage,_=r?A1(t.sessionId):"",y=k.useRef(null),[v,h]=k.useState(null);k.useEffect(()=>{if(!v)return;const d=w=>{y.current&&!y.current.contains(w.target)&&h(null)},g=w=>{w.key==="Escape"&&h(null)};return document.addEventListener("mousedown",d),document.addEventListener("touchstart",d),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("touchstart",d),document.removeEventListener("keydown",g)}},[v]);const f=d=>{d.preventDefault(),d.stopPropagation(),h({x:d.clientX,y:d.clientY})};return D.jsxs("div",{className:"group relative cursor-pointer px-3 py-2 hover:bg-hover",role:"button",tabIndex:0,title:"Click to preview",onClick:()=>l(t),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l(t))},onContextMenu:f,children:[D.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-muted opacity-0 hover:text-primary group-hover:opacity-100",title:"Resume directly",onClick:d=>{d.stopPropagation(),a(t.sessionId)},children:"▶"}),D.jsxs("div",{className:"flex flex-col gap-0.5 pl-2.5 group-hover:pr-4",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(Ff,{agentType:t.agentType,className:"h-3.5 w-3.5 shrink-0 text-muted"}),D.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:p}),t.lastResumeError&&D.jsx(bb,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Resume failed",title:`Last resume failed: ${t.lastResumeError}`}),t.isPinned&&D.jsx(yl,{className:"h-3 w-3 shrink-0 text-muted","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),_&&D.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:t.sessionId,children:_}),D.jsx("span",{className:"ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted",children:o})]}),(u||m)&&D.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[u&&D.jsx(I1,{name:c,fullPath:t.projectPath}),m&&D.jsxs("span",{className:"truncate text-xs italic text-muted",children:['"',t.lastUserMessage.length>200?t.lastUserMessage.slice(0,200)+"…":t.lastUserMessage,'"']})]})]}),v&&D.jsxs("div",{ref:y,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:v.x,top:v.y},role:"menu",children:[i&&D.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),i(t.sessionId,!t.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[D.jsx(yl,{width:14,height:14}),t.isPinned?"Unpin":"Pin"]}),t.logFilePath&&D.jsxs("button",{onClick:d=>{d.stopPropagation(),navigator.clipboard.writeText(t.logFilePath).catch(()=>{}),h(null)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.logFilePath,children:[D.jsx(R0,{width:14,height:14}),"Copy Log Path"]})]})]})});function IR({name:e,className:t=""}){const r=P1(`host:${e}`);return D.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide ${t}`,style:r,title:e,children:e})}function BR({hosts:e,selectedHosts:t,onSelect:r,statuses:n=[]}){const[s,a]=k.useState(!1),l=k.useId(),i=k.useRef(null),o=k.useMemo(()=>new Set(t),[t]),c=k.useMemo(()=>new Map(n.map(_=>[_.host,_])),[n]),p=k.useMemo(()=>t.length===0?"All Hosts":t.join(", "),[t]),u=k.useMemo(()=>t.length===0?"All Hosts":t.length===1?t[0]:`${t.length} hosts`,[t]);k.useEffect(()=>{if(!s||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const _=v=>{var f;const h=v.target;h&&((f=i.current)!=null&&f.contains(h))||a(!1)},y=v=>{v.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",_),document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_),document.removeEventListener("keydown",y)}},[s]);const m=_=>{const y=new Set(o);y.has(_)?y.delete(_):y.add(_);const v=e.filter(h=>y.has(h));r(v)};return D.jsxs("div",{ref:i,className:"relative",children:[D.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":s,"aria-controls":l,"aria-label":"Filter by host",onClick:()=>a(_=>!_),className:"flex h-6 max-w-[9rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:p,children:[D.jsx("span",{className:"truncate",children:u}),D.jsx(Gd,{className:"h-3 w-3 shrink-0 text-muted"})]}),s&&D.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-48 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[D.jsxs("label",{role:"menuitemcheckbox","aria-checked":t.length===0,className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[D.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),D.jsx("span",{children:"All Hosts"})]}),D.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?D.jsx("div",{className:"px-2 py-1 text-muted",children:"No hosts"}):D.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(_=>{const y=c.get(_),v=y?!y.ok:!1;return D.jsxs("label",{role:"menuitemcheckbox","aria-checked":o.has(_),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y!=null&&y.error?`${_}: ${y.error}`:_,children:[D.jsx("input",{type:"checkbox",checked:o.has(_),onChange:()=>m(_),className:"h-3.5 w-3.5 accent-approval"}),D.jsx("span",{className:"truncate",children:_}),v&&D.jsx("span",{className:"ml-auto text-[10px] uppercase text-danger",children:"offline"})]},_)})})]})]})}function OR({projects:e,selectedProjects:t,onSelect:r,hasHiddenPermissions:n}){const[s,a]=k.useState(!1),l=k.useId(),i=k.useRef(null),o=k.useMemo(()=>ER(e),[e]),c=k.useMemo(()=>new Set(t),[t]),p=n&&t.length>0,u=k.useMemo(()=>t.length===0?"All Projects":t.map(y=>o.get(y)??li(y)??y).join(", "),[o,t]),m=k.useMemo(()=>{if(t.length===0)return"All Projects";if(t.length===1){const y=t[0];return o.get(y)??li(y)??y}return`${t.length} projects`},[o,t]);k.useEffect(()=>{if(!s||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const y=h=>{var d;const f=h.target;f&&((d=i.current)!=null&&d.contains(f))||a(!1)},v=h=>{h.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y,{passive:!0}),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y),document.removeEventListener("keydown",v)}},[s]);const _=y=>{const v=new Set(c);v.has(y)?v.delete(y):v.add(y);const h=e.filter(f=>v.has(f));r(h)};return D.jsxs("div",{ref:i,className:"relative",children:[D.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":s,"aria-controls":l,"aria-label":"Filter by project",onClick:()=>a(y=>!y),className:"flex h-6 max-w-[11rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:u,children:[D.jsx("span",{className:"truncate",children:m}),D.jsx(Gd,{className:"h-3 w-3 shrink-0 text-muted"})]}),s&&D.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-60 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[D.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[D.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),D.jsx("span",{children:"All Projects"})]}),D.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?D.jsx("div",{className:"px-2 py-1 text-muted",children:"No projects"}):D.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(y=>{const v=o.get(y)??li(y)??y;return D.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y,children:[D.jsx("input",{type:"checkbox",checked:c.has(y),onChange:()=>_(y),className:"h-3.5 w-3.5 accent-approval"}),D.jsx("span",{className:"truncate",children:v})]},y)})})]}),p&&D.jsx("button",{type:"button",className:"absolute -right-1 -top-1 h-2 w-2 rounded-full bg-approval pulse-approval ring-2 ring-elevated",title:"Hidden sessions need attention","aria-label":"Clear project filters",onClick:y=>{y.stopPropagation(),r([])},children:D.jsx("span",{className:"sr-only",children:"Clear project filters"})})]})}function NR(e){if(!e.trim())return null;try{const t=JSON.parse(e);let r="",n="other";if(typeof t.message=="string")r=t.message;else if(typeof t.content=="string")r=t.content;else if(t.type==="user"&&typeof t.message=="object"){const s=t.message;r=typeof s.content=="string"?s.content:"",n="user"}else if(t.type==="assistant"&&t.message){const s=t.message;typeof s.content=="string"?r=s.content:Array.isArray(s.content)&&(r=s.content.filter(a=>typeof a=="object"&&a!==null&&"text"in a).map(a=>a.text).join(`
53
+ `)),n="assistant"}if((t.type==="tool_use"||t.event==="tool_use")&&(r=`[Tool: ${t.name??"tool"}]`,n="assistant"),t.type==="result"&&typeof t.result=="string"&&(r=t.result,n="system"),t.payload&&typeof t.payload=="object"){const s=t.payload;typeof s.content=="string"?r=s.content:typeof s.message=="string"&&(r=s.message)}return r.trim()?{type:n,content:r.trim(),raw:e}:null}catch{return{type:"other",content:e.trim(),raw:e}}}function jR({session:e,onClose:t,onResume:r}){const[n,s]=k.useState(!0),[a,l]=k.useState(null),[i,o]=k.useState(null),[c,p]=k.useState(!1),u=k.useRef(null),m=k.useRef(null);k.useEffect(()=>{(async()=>{try{const f=await fetch(`/api/session-preview/${e.sessionId}`);if(!f.ok){const g=await f.json();throw new Error(g.error||"Failed to load preview")}const d=await f.json();o(d)}catch(f){l(f instanceof Error?f.message:"Failed to load preview")}finally{s(!1)}})()},[e.sessionId]),k.useEffect(()=>{u.current&&i&&(u.current.scrollTop=u.current.scrollHeight)},[i,c]),k.useEffect(()=>{const h=f=>{f.key==="Escape"?(f.stopPropagation(),t()):f.key==="Enter"&&!n&&!a&&(f.preventDefault(),r(e.sessionId))};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,r,e.sessionId,n,a]),k.useEffect(()=>{var h;(h=m.current)==null||h.focus()},[]);const _=e.displayName||li(e.projectPath)||e.sessionId.slice(0,8),y=jf(e.lastActivityAt),v=(i==null?void 0:i.lines.map(NR).filter(h=>h!==null).slice(-30))??[];return D.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"preview-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:h=>{h.target===h.currentTarget&&t()},children:D.jsxs("div",{ref:m,tabIndex:-1,className:"flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated",children:[D.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[D.jsx(Ff,{agentType:e.agentType,className:"h-5 w-5 shrink-0 text-muted"}),D.jsxs("div",{className:"min-w-0 flex-1",children:[D.jsx("h2",{id:"preview-title",className:"truncate text-sm font-semibold text-primary",children:_}),D.jsxs("p",{className:"truncate text-xs text-muted",title:e.projectPath,children:[li(e.projectPath)," · ",y]})]}),D.jsx("button",{type:"button",onClick:()=>p(h=>!h),className:`btn text-xs ${c?"btn-primary":""}`,children:c?"Parsed":"Raw"})]}),D.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto p-4 font-mono text-xs",children:[n&&D.jsx("div",{className:"flex items-center justify-center py-8 text-muted",children:"Loading preview..."}),a&&D.jsx("div",{className:"flex items-center justify-center py-8 text-danger",children:a}),i&&!c&&D.jsx("div",{className:"space-y-2",children:v.length===0?D.jsx("div",{className:"py-8 text-center text-muted",children:"No readable content found. Try raw view."}):v.map((h,f)=>D.jsx("div",{className:`rounded px-2 py-1 ${h.type==="user"?"bg-blue-500/10 text-blue-400":h.type==="assistant"?"bg-emerald-500/10 text-emerald-400":h.type==="system"?"bg-yellow-500/10 text-yellow-400":"text-muted"}`,children:D.jsx("span",{className:"whitespace-pre-wrap break-words",children:h.content.length>500?`${h.content.slice(0,500)}...`:h.content})},f))}),i&&c&&D.jsx("div",{className:"space-y-1",children:i.lines.slice(-50).map((h,f)=>D.jsx("div",{className:"whitespace-pre-wrap break-all text-muted",children:h||" "},f))})]}),D.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-3",children:[D.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),D.jsx("button",{type:"button",onClick:()=>r(e.sessionId),disabled:n||!!a,className:"btn btn-primary",children:"Resume"})]})]})})}const jg={working:"bg-green-500/20 text-green-600",waiting:"bg-zinc-500/20 text-zinc-400",permission:"bg-amber-500/20 text-amber-600",unknown:"bg-zinc-500/20 text-zinc-400"};function FR(){const[,e]=k.useState(0);k.useEffect(()=>{const t=setInterval(()=>e(r=>r+1),3e4);return()=>clearInterval(t)},[])}function B1({sessions:e,inactiveSessions:t=[],selectedSessionId:r,loading:n,error:s,onSelect:a,onRename:l,onResume:i,onKill:o,onDuplicate:c,onSetPinned:p}){FR();const[u,m]=k.useState(null),_=ue(W=>W.inactiveSessionsExpanded),y=ue(W=>W.setInactiveSessionsExpanded),[v,h]=k.useState(null),[f,d]=k.useState(20),g=u1();k.useEffect(()=>{_||d(20)},[_]);const w=200,[b,x]=Ng(e.length,w),[C,S]=Ng(t.length,w,!0),E=k.useRef(new Set(e.map(W=>W.id))),L=k.useRef(new Set(t.map(W=>W.sessionId))),[A,M]=k.useState(new Set);k.useEffect(()=>{var Te;const W=new Set(e.map(xe=>xe.id)),re=new Set(t.map(xe=>xe.sessionId)),ve=new Set;for(const xe of W)E.current.has(xe)||ve.add(xe);for(const xe of e){const Be=(Te=xe.agentSessionId)==null?void 0:Te.trim();Be&&L.current.has(Be)&&!re.has(Be)&&ve.add(xe.id)}E.current=W,L.current=re,ve.size>0&&M(ve)},[e,t]),k.useEffect(()=>{if(A.size===0)return;const W=setTimeout(()=>M(new Set),500);return()=>clearTimeout(W)},[A]);const T=ue(W=>W.shortcutModifier),B=Gi(Fo(T)),H=ue(W=>W.sessionSortMode),j=ue(W=>W.setSessionSortMode),$=ue(W=>W.sessionSortDirection),O=ue(W=>W.manualSessionOrder),R=ue(W=>W.setManualSessionOrder),P=ue(W=>W.showProjectName),N=ue(W=>W.showLastUserMessage),F=ue(W=>W.showSessionIdPrefix),V=ue(W=>W.projectFilters),q=ue(W=>W.setProjectFilters),Q=ue(W=>W.hostFilters),Z=ue(W=>W.setHostFilters),z=et(W=>W.exitingSessions),I=et(W=>W.clearExitingSession),K=et(W=>W.hostStatuses);kR(e,z,I,w),k.useEffect(()=>{if(O.length===0)return;const W=new Set;for(const ve of e)W.add(ro(ve)),W.add(ve.id);for(const ve of t)W.add(ve.sessionId);const re=O.filter(ve=>W.has(ve));re.length!==O.length&&R(re)},[e,t,O,R]);const J=k.useMemo(()=>Nf(e,{mode:H,direction:$,manualOrder:O}),[e,H,$,O]),G=k.useMemo(()=>bR(e,t),[e,t]),ae=k.useMemo(()=>{const W=CR(e,t),re=K.map(xe=>xe.host),ve=new Set,Te=[];for(const xe of re)!xe||ve.has(xe)||(ve.add(xe),Te.push(xe));for(const xe of W)!xe||ve.has(xe)||(ve.add(xe),Te.push(xe));return Te},[e,t,K]),le=k.useMemo(()=>ae.length>1,[ae]),me=k.useMemo(()=>{let W=J;return V.length>0&&(W=W.filter(re=>V.includes(re.projectPath))),Q.length>0&&(W=W.filter(re=>Q.includes(re.host??""))),W},[J,V,Q]),ke=k.useMemo(()=>{const W=V.length===0?"all-projects":V.join("|"),re=Q.length===0?"all-hosts":Q.join("|");return`${W}::${re}`},[V,Q]),X=k.useRef(new Set(me.map(W=>W.id))),[ee,Ae]=k.useState(new Set);k.useEffect(()=>{const W=new Set(me.map(ve=>ve.id)),re=new Set;for(const ve of W)X.current.has(ve)||A.has(ve)||re.add(ve);X.current=W,re.size>0&&Ae(re)},[me,A]),k.useEffect(()=>{if(ee.size===0)return;const W=setTimeout(()=>Ae(new Set),500);return()=>clearTimeout(W)},[ee]);const de=k.useMemo(()=>{let W=t;return V.length>0&&(W=W.filter(re=>V.includes(re.projectPath))),Q.length>0&&(W=W.filter(re=>Q.includes(re.host??""))),W},[t,V,Q]),he=k.useMemo(()=>{if(V.length===0)return 0;const W=new Set(V);return e.filter(re=>!W.has(re.projectPath)&&re.status==="permission").length},[e,V]);k.useEffect(()=>{if(V.length===0||G.length===0)return;const W=new Set(G),re=V.filter(ve=>W.has(ve));re.length!==V.length&&q(re)},[V,G,q]),k.useEffect(()=>{if(Q.length===0||ae.length===0)return;const W=new Set(ae),re=Q.filter(ve=>W.has(ve));re.length!==Q.length&&Z(re)},[Q,ae,Z]);const ce=Yk(Xk(Of,{activationConstraint:{distance:8}})),[te,pe]=k.useState(null),[ie,oe]=k.useState(null),[Le,be]=k.useState(!1),Re=k.useCallback(W=>{pe(W.active.id),be(!0)},[]),De=k.useCallback(W=>{var re;oe((re=W.over)==null?void 0:re.id)},[]),ne=k.useCallback(W=>{const{active:re,over:ve}=W;if(pe(null),oe(null),!ve||re.id===ve.id){setTimeout(()=>be(!1),100);return}const Te=me.findIndex(Fe=>Fe.id===re.id),xe=me.findIndex(Fe=>Fe.id===ve.id);if(Te===-1||xe===-1){setTimeout(()=>be(!1),100);return}const Be=me.map(Fe=>ro(Fe)),[je]=Be.splice(Te,1);Be.splice(xe,0,je);const He=J.map(Fe=>ro(Fe)),Me=new Set(Be);let Pe=0;const Ge=He.map(Fe=>{if(!Me.has(Fe))return Fe;const Se=Be[Pe];return Pe+=1,Se});H!=="manual"&&j("manual"),R(Ge),setTimeout(()=>be(!1),100)},[me,J,H,j,R]),fe=k.useCallback(()=>{pe(null),oe(null),setTimeout(()=>be(!1),100)},[]);k.useEffect(()=>{if(!te&&!ie)return;const W=new Set(me.map(ve=>ve.id));let re=!1;te&&!W.has(te)&&(pe(null),re=!0),ie&&!W.has(ie)&&(oe(null),re=!0),re&&be(!1)},[me,te,ie]);const Ie=(W,re)=>{l(W,re),m(null)};return D.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col border-r border-border bg-elevated",children:[s&&D.jsx("div",{className:"shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:s}),D.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[D.jsxs("div",{className:"sticky top-0 z-10 flex h-10 items-center justify-between border-b border-border bg-elevated px-3",children:[D.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted",children:"Sessions"}),D.jsxs("div",{className:"flex items-center gap-4",children:[le&&D.jsx(BR,{hosts:ae,selectedHosts:Q,onSelect:Z,statuses:K}),D.jsx(OR,{projects:G,selectedProjects:V,onSelect:q,hasHiddenPermissions:he>0}),D.jsx(Mh.span,{className:"w-8 text-right text-xs text-muted",animate:b&&!g?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:x,children:me.length})]})]}),n?D.jsx("div",{className:"space-y-1 p-2",children:[0,1,2].map(W=>D.jsx("div",{className:"h-14 animate-pulse rounded bg-surface"},W))}):me.length===0?D.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted",children:"No sessions"}):D.jsx(eR,{sensors:ce,collisionDetection:tL,onDragStart:Re,onDragOver:De,onDragEnd:ne,onDragCancel:fe,children:D.jsx(fR,{items:me.map(W=>W.id),strategy:hR,children:D.jsx("div",{children:D.jsx(i5,{initial:!1,children:me.map((W,re)=>{const ve=A.has(W.id),Te=ee.has(W.id),xe=W.remote===!0,Be=te?me.findIndex(Pe=>Pe.id===te):-1,He=ie===W.id&&te!==W.id?Be>re?"above":"below":null,Me=ve||Te;return D.jsx(O1,{session:W,isNew:Me,exitDuration:w,prefersReducedMotion:g,layoutAnimationsDisabled:Le,isSelected:W.id===r,isEditing:W.id===u,showSessionIdPrefix:F,showProjectName:P,showLastUserMessage:N,showHostInfo:le,dropIndicator:He,onSelect:()=>a(W.id),onStartEdit:()=>m(W.id),onCancelEdit:()=>m(null),onRename:Pe=>Ie(W.id,Pe),onKill:o&&!xe?()=>o(W.id):void 0,onDuplicate:c&&!xe?()=>c(W.id):void 0,onSetPinned:p&&W.agentSessionId?Pe=>p(W.agentSessionId.trim(),Pe):void 0},W.id)})})},ke)})}),de.length>0&&D.jsxs("div",{className:"border-t border-border",children:[D.jsxs("button",{type:"button",onClick:()=>y(!_),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary",children:[D.jsxs("span",{className:"flex items-center gap-2",children:[_?D.jsx(Gd,{className:"h-4 w-4"}):D.jsx(kb,{className:"h-4 w-4"}),"Inactive Sessions"]}),D.jsx(Mh.span,{className:"w-8 text-right text-xs",animate:C&&!g?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:S,children:de.length})]}),_&&D.jsxs("div",{className:"py-1",children:[de.slice(0,f).map(W=>D.jsx(PR,{session:W,showSessionIdPrefix:F,showProjectName:P,showLastUserMessage:N,onResume:re=>i==null?void 0:i(re),onPreview:h,onSetPinned:p},W.sessionId)),de.length>f&&D.jsxs("button",{type:"button",onClick:()=>d(W=>W+20),className:"w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover",children:["Show more (",de.length-f," remaining)"]})]})]})]}),D.jsx("div",{className:"hidden shrink-0 border-t border-border px-3 py-2 md:block",children:D.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted",children:[D.jsxs("span",{children:[B,"[ ] nav"]}),D.jsxs("span",{children:[B,"N new"]}),D.jsxs("span",{children:[B,"X kill"]})]})}),v&&D.jsx(jR,{session:v,onClose:()=>h(null),onResume:W=>{h(null),i==null||i(W)}})]})}const O1=k.forwardRef(function({session:t,isNew:r,exitDuration:n,prefersReducedMotion:s,layoutAnimationsDisabled:a,isSelected:l,isEditing:i,showSessionIdPrefix:o,showProjectName:c,showLastUserMessage:p,showHostInfo:u,dropIndicator:m,onSelect:_,onStartEdit:y,onCancelEdit:v,onRename:h,onKill:f,onDuplicate:d,onSetPinned:g},w){const{attributes:b,listeners:x,setNodeRef:C,transform:S,transition:E,isDragging:L}=wR({id:t.id,animateLayoutChanges:({isSorting:H,wasDragging:j})=>H||j}),A=Ro.Transform.toString(S),T={...!!(s&&A)?{transform:A,transition:E}:{},zIndex:L?10:void 0,opacity:L?.9:void 0},B=k.useCallback(H=>{C(H),typeof w=="function"?w(H):w&&(w.current=H)},[C,w]);return D.jsxs(Mh.div,{ref:B,style:{...T,overflow:"hidden"},className:"relative",layout:!s&&!L&&!a&&!r,transformTemplate:(H,j)=>A?!j||j==="none"?A:`${A} ${j}`:j,initial:s||!r?!1:{opacity:0,scale:.97},animate:s?{opacity:1}:r?{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:s?{opacity:0}:{opacity:0,height:0,scale:.97},transition:s?{duration:0}:{layout:{type:"spring",stiffness:500,damping:35},opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:"easeOut"}},...b,...x,children:[m==="above"&&D.jsx("div",{className:"absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"}),D.jsx($R,{session:t,isSelected:l,isEditing:i,showSessionIdPrefix:o,showProjectName:c,showLastUserMessage:p,showHostInfo:u,isDragging:L,onSelect:_,onStartEdit:y,onCancelEdit:v,onRename:h,onKill:f,onDuplicate:d,onSetPinned:g}),m==="below"&&D.jsx("div",{className:"absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"})]})});O1.displayName="SortableSessionItem";function $R({session:e,isSelected:t,isEditing:r,showSessionIdPrefix:n,showProjectName:s,showLastUserMessage:a,showHostInfo:l,isDragging:i=!1,onSelect:o,onStartEdit:c,onCancelEdit:p,onRename:u,onKill:m,onDuplicate:_,onSetPinned:y}){var Z,z,I,K;const v=jf(e.lastActivity),h=k.useRef(null),f=k.useRef(null),d=((Z=e.agentSessionName)==null?void 0:Z.trim())||((z=e.name)==null?void 0:z.trim())||e.id,[g,w]=k.useState(d),b=k.useRef(null),[x,C]=k.useState(null),S=li(e.projectPath),E=(I=e.host)==null?void 0:I.trim(),L=e.status==="permission",A=(K=e.agentSessionId)==null?void 0:K.trim(),M=n&&A?A1(A):"",T=s&&!!S,B=l&&!!E,H=a&&!!e.lastUserMessage,j=k.useRef(e.status),[$,O]=k.useState(!1);k.useEffect(()=>{const U=j.current,J=e.status;U==="working"&&J==="waiting"?O(!0):j.current=J},[e.status]);const R=()=>{O(!1),j.current=e.status};k.useEffect(()=>{r&&h.current&&(h.current.focus(),h.current.select())},[r]),k.useEffect(()=>{w(d)},[d]);const P=()=>{const U=g.trim();U&&U!==d?u(U):p()},N=U=>{U.key==="Enter"?(U.preventDefault(),P()):U.key==="Escape"&&(U.preventDefault(),w(d),p())},F=k.useRef(null),V=U=>{if(i)return;const J=U.touches[0];F.current={x:J.clientX,y:J.clientY},b.current=setTimeout(()=>{F.current&&C(F.current)},500)},q=()=>{b.current&&(clearTimeout(b.current),b.current=null)};k.useEffect(()=>{if(!x)return;const U=G=>{f.current&&!f.current.contains(G.target)&&C(null)},J=G=>{G.key==="Escape"&&C(null)};return document.addEventListener("mousedown",U),document.addEventListener("touchstart",U),document.addEventListener("keydown",J),()=>{document.removeEventListener("mousedown",U),document.removeEventListener("touchstart",U),document.removeEventListener("keydown",J)}},[x]);const Q=U=>{U.preventDefault(),U.stopPropagation(),C({x:U.clientX,y:U.clientY})};return D.jsxs("div",{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?"selected":""} ${i?"cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated":"cursor-grab"}`,role:"button",tabIndex:0,"data-testid":"session-card","data-session-id":e.id,onClick:i?void 0:o,onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&o()},onContextMenu:Q,onTouchStart:V,onTouchEnd:q,onTouchCancel:q,children:[D.jsxs("div",{className:"flex flex-col gap-0.5 pl-0.5",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(Ff,{agentType:e.agentType,command:e.command,className:"h-3.5 w-3.5 shrink-0 text-muted"}),r?D.jsx("input",{ref:h,type:"text",value:g,onChange:U=>w(U.target.value),onBlur:P,onKeyDown:N,onClick:U=>U.stopPropagation(),className:"min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):D.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:d}),e.isPinned&&D.jsx(yl,{className:"h-3 w-3 shrink-0 text-primary","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),M&&D.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:A,children:M}),L?D.jsx("span",{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${jg[e.status]} pulse-approval`,onAnimationEnd:R,children:D.jsx(Nb,{className:"h-3 w-3","aria-label":"Needs input"})}):D.jsx("span",{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${jg[e.status]}${$?" pulse-complete":""}`,onAnimationEnd:R,children:v})]}),(T||B||H)&&D.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[B&&D.jsx(IR,{name:E}),T&&D.jsx(I1,{name:S,fullPath:e.projectPath}),H&&D.jsxs("span",{className:"line-clamp-2 text-xs italic text-muted",children:['"',e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+"…":e.lastUserMessage,'"']})]})]}),x&&D.jsxs("div",{ref:f,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:x.x,top:x.y},role:"menu",children:[D.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),c()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",children:[D.jsx(L0,{width:14,height:14}),"Rename"]}),_&&D.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),_()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:"Create a copy in a new tmux window",children:[D.jsx(k0,{width:14,height:14}),"Duplicate"]}),y&&D.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),y(!e.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[D.jsx(yl,{width:14,height:14}),e.isPinned?"Unpin":"Pin"]}),e.logFilePath&&D.jsxs("button",{onClick:U=>{U.stopPropagation();const J=e.logFilePath;if(C(null),J){const G=document.createElement("textarea");G.value=J,G.style.position="fixed",G.style.left="-9999px",document.body.appendChild(G),G.focus(),G.select();try{document.execCommand("copy")}catch{navigator.clipboard.writeText(J).catch(()=>{})}document.body.removeChild(G)}},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.logFilePath,children:[D.jsx(R0,{width:14,height:14}),"Copy Log Path"]}),m&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"my-1 border-t border-border"}),D.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),m()},className:"w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2",role:"menuitem",children:[D.jsx(ch,{width:14,height:14}),"Kill Session"]})]})]})]})}var N1={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,i,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var E=d.length-1;E>=0;E--)(x=d[E])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},p=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const u=o(9042),m=o(9924),_=o(844),y=o(4725),v=o(2585),h=o(3656);let f=i.AccessibilityManager=class extends _.Disposable{constructor(d,g,w,b){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=b,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,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 m.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(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
54
+ `))),this.register(this._terminal.onA11yTab(x=>this._handleTab(x))),this.register(this._terminal.onKey(x=>this._handleKey(x.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,_.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let g=0;g<d;g++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
55
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,g){this._liveRegionDebouncer.refresh(d,g,this._terminal.rows)}_renderRows(d,g){const w=this._terminal.buffer,b=w.lines.length.toString();for(let x=d;x<=g;x++){const C=w.lines.get(w.ydisp+x),S=[],E=(C==null?void 0:C.translateToString(!0,void 0,void 0,S))||"",L=(w.ydisp+x+1).toString(),A=this._rowElements[x];A&&(E.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=E,this._rowColumns.set(A,S)),A.setAttribute("aria-posinset",L),A.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,g){const w=d.target,b=this._rowElements[g===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==b)return;let x,C;if(g===0?(x=w,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(x=this._rowElements.shift(),C=w,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),g===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let g={node:d.anchorNode,offset:d.anchorOffset},w={node:d.focusNode,offset:d.focusOffset};if((g.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||g.node===w.node&&g.offset>w.offset)&&([g,w]=[w,g]),g.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(g={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(g.node))return;const b=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(b)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:b,offset:((E=b.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(w.node))return;const x=({node:L,offset:A})=>{const M=L instanceof Text?L.parentNode:L;let T=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const B=this._rowColumns.get(M);if(!B)return console.warn("columns is null. Race condition?"),null;let H=A<B.length?B[A]:B.slice(-1)[0]+1;return H>=this._terminal.cols&&(++T,H=0),{row:T,column:H}},C=x(g),S=x(w);if(C&&S){if(C.row>S.row||C.row===S.row&&C.column>=S.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(S.row-C.row)*this._terminal.cols-C.column+S.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_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 d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=f=c([p(1,v.IInstantiationService),p(2,y.ICoreBrowserService),p(3,y.IRenderService)],f)},3614:(l,i)=>{function o(m){return m.replace(/\r?\n/g,"\r")}function c(m,_){return _?"\x1B[200~"+m+"\x1B[201~":m}function p(m,_,y,v){m=c(m=o(m),y.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(m,!0),_.value=""}function u(m,_,y){const v=y.getBoundingClientRect(),h=m.clientX-v.left-10,f=m.clientY-v.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${h}px`,_.style.top=`${f}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=o,i.bracketTextForPaste=c,i.copyHandler=function(m,_){m.clipboardData&&m.clipboardData.setData("text/plain",_.selectionText),m.preventDefault()},i.handlePasteEvent=function(m,_,y,v){m.stopPropagation(),m.clipboardData&&p(m.clipboardData.getData("text/plain"),_,y,v)},i.paste=p,i.moveTextAreaUnderMouseCursor=u,i.rightClickHandler=function(m,_,y,v,h){u(m,_,y),h&&v.rightClickSelect(m),_.value=v.selectionText,_.select()}},7239:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const c=o(1505);i.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,m){this._css.set(p,u,m)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,m){this._color.set(p,u,m)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let m=!1;return{dispose:()=>{m||(m=!0,o.removeEventListener(c,p,u))}}}},3551:function(l,i,o){var c=this&&this.__decorate||function(f,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(f,d,g,w);else for(var S=f.length-1;S>=0;S--)(b=f[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},p=this&&this.__param||function(f,d){return function(g,w){d(g,w,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const u=o(3656),m=o(8460),_=o(844),y=o(2585),v=o(4725);let h=i.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(f,d,g,w,b){super(),this._element=f,this._mouseService=d,this._renderService=g,this._bufferService=w,this._linkProviderService=b,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(f){this._lastMouseEvent=f;const d=this._positionFromMouseEvent(f,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const g=f.composedPath();for(let w=0;w<g.length;w++){const b=g[w];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_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,d){var w,b;this._activeProviderReplies&&d||((w=this._activeProviderReplies)==null||w.forEach(x=>{x==null||x.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=f.y);let g=!1;for(const[x,C]of this._linkProviderService.linkProviders.entries())d?(b=this._activeProviderReplies)!=null&&b.get(x)&&(g=this._checkLinkProviderResult(x,f,g)):C.provideLinks(f.y,S=>{var L,A;if(this._isMouseOut)return;const E=S==null?void 0:S.map(M=>({link:M}));(L=this._activeProviderReplies)==null||L.set(x,E),g=this._checkLinkProviderResult(x,f,g),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(f.y,this._activeProviderReplies)})}_removeIntersectingLinks(f,d){const g=new Set;for(let w=0;w<d.size;w++){const b=d.get(w);if(b)for(let x=0;x<b.length;x++){const C=b[x],S=C.link.range.start.y<f?0:C.link.range.start.x,E=C.link.range.end.y>f?this._bufferService.cols:C.link.range.end.x;for(let L=S;L<=E;L++){if(g.has(L)){b.splice(x--,1);break}g.add(L)}}}}_checkLinkProviderResult(f,d,g){var x;if(!this._activeProviderReplies)return g;const w=this._activeProviderReplies.get(f);let b=!1;for(let C=0;C<f;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(b=!0);if(!b&&w){const C=w.find(S=>this._linkAtPosition(S.link,d));C&&(g=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!g)for(let C=0;C<this._activeProviderReplies.size;C++){const S=(x=this._activeProviderReplies.get(C))==null?void 0:x.find(E=>this._linkAtPosition(E.link,d));if(S){g=!0,this._handleNewLink(S);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(f){if(!this._currentLink)return;const d=this._positionFromMouseEvent(f,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(f,this._currentLink.link.text)}_clearCurrentLink(f,d){this._currentLink&&this._lastMouseEvent&&(!f||!d||this._currentLink.link.range.start.y>=f&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(f){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(f.link,d)&&(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 g,w;return(w=(g=this._currentLink)==null?void 0:g.state)==null?void 0:w.decorations.pointerCursor},set:g=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",g))}},underline:{get:()=>{var g,w;return(w=(g=this._currentLink)==null?void 0:g.state)==null?void 0:w.decorations.underline},set:g=>{var w,b,x;(w=this._currentLink)!=null&&w.state&&((x=(b=this._currentLink)==null?void 0:b.state)==null?void 0:x.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(f.link,g))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(g=>{if(!this._currentLink)return;const w=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(w,b),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}})))}_linkHover(f,d,g){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&f.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(g,d.text)}_fireUnderlineEvent(f,d){const g=f.range,w=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-w-1,g.end.x,g.end.y-w-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(f,d,g){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&f.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(g,d.text)}_linkAtPosition(f,d){const g=f.range.start.y*this._bufferService.cols+f.range.start.x,w=f.range.end.y*this._bufferService.cols+f.range.end.x,b=d.y*this._bufferService.cols+d.x;return g<=b&&b<=w}_positionFromMouseEvent(f,d,g){const w=g.getCoords(f,d,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(f,d,g,w,b){return{x1:f,y1:d,x2:g,y2:w,cols:this._bufferService.cols,fg:b}}};i.Linkifier=h=c([p(1,v.IMouseService),p(2,v.IRenderService),p(3,y.IBufferService),p(4,v.ILinkProviderService)],h)},9042:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,i,o){var c=this&&this.__decorate||function(v,h,f,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,f,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,f,b):g(h,f))||b);return w>3&&b&&Object.defineProperty(h,f,b),b},p=this&&this.__param||function(v,h){return function(f,d){h(f,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const u=o(511),m=o(2585);let _=i.OscLinkProvider=class{constructor(v,h,f){this._bufferService=v,this._optionsService=h,this._oscLinkService=f}provideLinks(v,h){var E;const f=this._bufferService.buffer.lines.get(v-1);if(!f)return void h(void 0);const d=[],g=this._optionsService.rawOptions.linkHandler,w=new u.CellData,b=f.getTrimmedLength();let x=-1,C=-1,S=!1;for(let L=0;L<b;L++)if(C!==-1||f.hasContent(L)){if(f.loadCell(L,w),w.hasExtendedAttrs()&&w.extended.urlId){if(C===-1){C=L,x=w.extended.urlId;continue}S=w.extended.urlId!==x}else C!==-1&&(S=!0);if(S||C!==-1&&L===b-1){const A=(E=this._oscLinkService.getLinkData(x))==null?void 0:E.uri;if(A){const M={start:{x:C+1,y:v},end:{x:L+(S||L!==b-1?0:1),y:v}};let T=!1;if(!(g!=null&&g.allowNonHttpProtocols))try{const B=new URL(A);["http:","https:"].includes(B.protocol)||(T=!0)}catch{T=!0}T||d.push({text:A,range:M,activate:(B,H)=>g?g.activate(B,H,M):y(0,H),hover:(B,H)=>{var j;return(j=g==null?void 0:g.hover)==null?void 0:j.call(g,B,H,M)},leave:(B,H)=>{var j;return(j=g==null?void 0:g.leave)==null?void 0:j.call(g,B,H,M)}})}S=!1,w.hasExtendedAttrs()&&w.extended.urlId?(C=L,x=w.extended.urlId):(C=-1,x=-1)}}h(d)}};function y(v,h){if(confirm(`Do you want to navigate to ${h}?
56
+
57
+ WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=_=c([p(0,m.IBufferService),p(1,m.IOptionsService),p(2,m.IOscLinkService)],_)},6193:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,p){this._rowCount=p,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const c=o(3614),p=o(3656),u=o(3551),m=o(9042),_=o(3730),y=o(1680),v=o(3107),h=o(5744),f=o(2950),d=o(1296),g=o(428),w=o(4269),b=o(5114),x=o(8934),C=o(3230),S=o(9312),E=o(4725),L=o(6731),A=o(8055),M=o(8969),T=o(8460),B=o(844),H=o(6114),j=o(8437),$=o(2584),O=o(7399),R=o(5941),P=o(9074),N=o(2585),F=o(5435),V=o(4567),q=o(779);class Q extends M.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(z={}){super(z),this.browser=H,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(q.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((I,K)=>this.refresh(I,K))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(I=>this._reportWindowsOptions(I))),this.register(this._inputHandler.onColor(I=>this._handleColorEvent(I))),this.register((0,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(I=>this._afterResize(I.cols,I.rows))),this.register((0,B.toDisposable)(()=>{var I,K;this._customKeyEventHandler=void 0,(K=(I=this.element)==null?void 0:I.parentNode)==null||K.removeChild(this.element)}))}_handleColorEvent(z){if(this._themeService)for(const I of z){let K,U="";switch(I.index){case 256:K="foreground",U="10";break;case 257:K="background",U="11";break;case 258:K="cursor",U="12";break;default:K="ansi",U="4;"+I.index}switch(I.type){case 0:const J=A.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[I.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${U};${(0,R.toRgbString)(J)}${$.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(G=>G.ansi[I.index]=A.channels.toColor(...I.color));else{const G=K;this._themeService.modifyColors(ae=>ae[G]=A.channels.toColor(...I.color))}break;case 2:this._themeService.restoreColor(I.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(z){z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var z;return(z=this.textarea)==null?void 0:z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const z=this.buffer.ybase+this.buffer.y,I=this.buffer.lines.get(z);if(!I)return;const K=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,J=I.getWidth(K),G=this._renderService.dimensions.css.cell.width*J,ae=this.buffer.y*this._renderService.dimensions.css.cell.height,le=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=le+"px",this.textarea.style.top=ae+"px",this.textarea.style.width=G+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",I=>{this.hasSelection()&&(0,c.copyHandler)(I,this._selectionService)}));const z=I=>(0,c.handlePasteEvent)(I,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",z)),H.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",I=>{I.button===2&&(0,c.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",I=>{(0,c.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),H.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",I=>{I.button===1&&(0,c.moveTextAreaUnderMouseCursor)(I,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",z=>this._keyUp(z),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",z=>this._keyDown(z),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",z=>this._keyPress(z),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",z=>this._compositionHelper.compositionupdate(z))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",z=>this._inputEvent(z),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(z){var K;if(!z)throw new Error("Terminal requires a parent element.");if(z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),z.appendChild(this.element);const I=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.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,p.addDisposableDomListener)(this.screenElement,"mousemove",U=>this.updateCursorStyle(U))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),H.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(b.CoreBrowserService,this.textarea,z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.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(x.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const z=this,I=this.element;function K(G){const ae=z._mouseService.getMouseReportCoords(G,z.screenElement);if(!ae)return!1;let le,me;switch(G.overrideType||G.type){case"mousemove":me=32,G.buttons===void 0?(le=3,G.button!==void 0&&(le=G.button<3?G.button:3)):le=1&G.buttons?0:4&G.buttons?1:2&G.buttons?2:3;break;case"mouseup":me=0,le=G.button<3?G.button:3;break;case"mousedown":me=1,le=G.button<3?G.button:3;break;case"wheel":if(z._customWheelEventHandler&&z._customWheelEventHandler(G)===!1||z.viewport.getLinesScrolled(G)===0)return!1;me=G.deltaY<0?0:1,le=4;break;default:return!1}return!(me===void 0||le===void 0||le>4)&&z.coreMouseService.triggerMouseEvent({col:ae.col,row:ae.row,x:ae.x,y:ae.y,button:le,action:me,ctrl:G.ctrlKey,alt:G.altKey,shift:G.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},J={mouseup:G=>(K(G),G.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(G)),wheel:G=>(K(G),this.cancel(G,!0)),mousedrag:G=>{G.buttons&&K(G)},mousemove:G=>{G.buttons||K(G)}};this.register(this.coreMouseService.onProtocolChange(G=>{G?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(G)),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&G?U.mousemove||(I.addEventListener("mousemove",J.mousemove),U.mousemove=J.mousemove):(I.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&G?U.wheel||(I.addEventListener("wheel",J.wheel,{passive:!1}),U.wheel=J.wheel):(I.removeEventListener("wheel",U.wheel),U.wheel=null),2&G?U.mouseup||(U.mouseup=J.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&G?U.mousedrag||(U.mousedrag=J.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(I,"mousedown",G=>{if(G.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(G))return K(G),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(G)})),this.register((0,p.addDisposableDomListener)(I,"wheel",G=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(G)===!1)return!1;if(!this.buffer.hasScrollback){const ae=this.viewport.getLinesScrolled(G);if(ae===0)return;const le=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(G.deltaY<0?"A":"B");let me="";for(let ke=0;ke<Math.abs(ae);ke++)me+=le;return this.coreService.triggerDataEvent(me,!0),this.cancel(G,!0)}return this.viewport.handleWheel(G)?this.cancel(G):void 0}},{passive:!1})),this.register((0,p.addDisposableDomListener)(I,"touchstart",G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(G),this.cancel(G)},{passive:!0})),this.register((0,p.addDisposableDomListener)(I,"touchmove",G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(G)?void 0:this.cancel(G)},{passive:!1}))}refresh(z,I){var K;(K=this._renderService)==null||K.refreshRows(z,I)}updateCursorStyle(z){var I;(I=this._selectionService)!=null&&I.shouldColumnSelect(z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(z,I,K=0){var U;K===1?(super.scrollLines(z,I,K),this.refresh(0,this.rows-1)):(U=this.viewport)==null||U.scrollLines(z)}paste(z){(0,c.paste)(z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(z){this._customKeyEventHandler=z}attachCustomWheelEventHandler(z){this._customWheelEventHandler=z}registerLinkProvider(z){return this._linkProviderService.registerLinkProvider(z)}registerCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const I=this._characterJoinerService.register(z);return this.refresh(0,this.rows-1),I}deregisterCharacterJoiner(z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+z)}registerDecoration(z){return this._decorationService.registerDecoration(z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(z,I,K){this._selectionService.setSelection(z,I,K)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var z;(z=this._selectionService)==null||z.clearSelection()}selectAll(){var z;(z=this._selectionService)==null||z.selectAll()}selectLines(z,I){var K;(K=this._selectionService)==null||K.selectLines(z,I)}_keyDown(z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;const I=this.browser.isMac&&this.options.macOptionIsMeta&&z.altKey;if(!I&&!this._compositionHelper.keydown(z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;I||z.key!=="Dead"&&z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,O.evaluateKeyboardEvent)(z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(z),K.type===3||K.type===2){const U=this.rows-1;return this.scrollLines(K.type===2?-U:U),this.cancel(z,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,z)||(K.cancel&&this.cancel(z,!0),!K.key||!!(z.key&&!z.ctrlKey&&!z.altKey&&!z.metaKey&&z.key.length===1&&z.key.charCodeAt(0)>=65&&z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==$.C0.ETX&&K.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||z.altKey||z.ctrlKey?this.cancel(z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(z,I){const K=z.isMac&&!this.options.macOptionIsMeta&&I.altKey&&!I.ctrlKey&&!I.metaKey||z.isWindows&&I.altKey&&I.ctrlKey&&!I.metaKey||z.isWindows&&I.getModifierState("AltGraph");return I.type==="keypress"?K:K&&(!I.keyCode||I.keyCode>47)}_keyUp(z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1||(function(I){return I.keyCode===16||I.keyCode===17||I.keyCode===18}(z)||this.focus(),this.updateCursorStyle(z),this._keyPressHandled=!1)}_keyPress(z){let I;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(z)===!1)return!1;if(this.cancel(z),z.charCode)I=z.charCode;else if(z.which===null||z.which===void 0)I=z.keyCode;else{if(z.which===0||z.charCode===0)return!1;I=z.which}return!(!I||(z.altKey||z.ctrlKey||z.metaKey)&&!this._isThirdLevelShift(this.browser,z)||(I=String.fromCharCode(I),this._onKey.fire({key:I,domEvent:z}),this._showCursor(),this.coreService.triggerDataEvent(I,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(z){if(z.data&&z.inputType==="insertText"&&(!z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const I=z.data;return this.coreService.triggerDataEvent(I,!0),this.cancel(z),!0}return!1}resize(z,I){z!==this.cols||I!==this.rows?super.resize(z,I):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(z,I){var K,U;(K=this._charSizeService)==null||K.measure(),(U=this.viewport)==null||U.syncScrollArea(!0)}clear(){var z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let I=1;I<this.rows;I++)this.buffer.lines.push(this.buffer.getBlankLine(j.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(z=this.viewport)==null||z.reset(),this.refresh(0,this.rows-1)}}reset(){var I,K;this.options.rows=this.rows,this.options.cols=this.cols;const z=this._customKeyEventHandler;this._setup(),super.reset(),(I=this._selectionService)==null||I.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var z;(z=this._renderService)==null||z.clearTextureAtlas()}_reportFocus(){var z;(z=this.element)!=null&&z.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(z){if(this._renderService)switch(z){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const I=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${K};${I}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),J=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${J};${U}t`)}}cancel(z,I){if(this.options.cancelEvents||I)return z.preventDefault(),z.stopPropagation(),!1}}i.Terminal=Q},9924:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,p){this._rowCount=p,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=u-this._lastRefreshMs,_=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(l,i,o){var c=this&&this.__decorate||function(f,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(f,d,g,w);else for(var S=f.length-1;S>=0;S--)(b=f[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},p=this&&this.__param||function(f,d){return function(g,w){d(g,w,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const u=o(3656),m=o(4725),_=o(8460),y=o(844),v=o(2585);let h=i.Viewport=class extends y.Disposable{constructor(f,d,g,w,b,x,C,S){super(),this._viewportElement=f,this._scrollArea=d,this._bufferService=g,this._optionsService=w,this._charSizeService=b,this._renderService=x,this._coreBrowserService=C,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(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 d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,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 d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,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,d){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&g<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const d=this._getPixelsScrolled(f);return d!==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+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,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 d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(f,d){var S;let g,w="";const b=[],x=d??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let E=f;E<x;E++){const L=C.get(E);if(!L)continue;const A=(S=C.get(E+1))==null?void 0:S.isWrapped;if(w+=L.translateToString(!A),!A||E===C.length-1){const M=document.createElement("div");M.textContent=w,b.push(M),w.length>0&&(g=M),w=""}}return{bufferElements:b,cursorElement:g}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(f,d){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&d.altKey||g==="ctrl"&&d.ctrlKey||g==="shift"&&d.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 d=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}};i.Viewport=h=c([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,m.ICharSizeService),p(5,m.IRenderService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],h)},3107:function(l,i,o){var c=this&&this.__decorate||function(v,h,f,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,f,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,f,b):g(h,f))||b);return w>3&&b&&Object.defineProperty(h,f,b),b},p=this&&this.__param||function(v,h){return function(f,d){h(f,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const u=o(4725),m=o(844),_=o(2585);let y=i.BufferDecorationRenderer=class extends m.Disposable{constructor(v,h,f,d,g){super(),this._screenElement=v,this._bufferService=h,this._coreBrowserService=f,this._decorationService=d,this._renderService=g,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(w=>this._removeDecoration(w))),this.register((0,m.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var d;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((d=v==null?void 0:v.options)==null?void 0:d.layer)==="top"),h.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=v.options.x??0;return f&&f>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(v,h),h}_refreshStyle(v){const h=v.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let f=this._decorationElements.get(v);f||(f=this._createElement(v),v.element=f,this._decorationElements.set(v,f),this._container.appendChild(f),v.onDispose(()=>{this._decorationElements.delete(v),f.remove()})),f.style.top=h*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(f)}}_refreshXPosition(v,h=v.element){if(!h)return;const f=v.options.x??0;(v.options.anchor||"left")==="right"?h.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=f?f*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var h;(h=this._decorationElements.get(v))==null||h.remove(),this._decorationElements.delete(v),v.dispose()}};i.BufferDecorationRenderer=y=c([p(1,_.IBufferService),p(2,u.ICoreBrowserService),p(3,_.IDecorationService),p(4,u.IRenderService)],y)},5871:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,p){return c>=o.startBufferLine-this._linePadding[p||"full"]&&c<=o.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(l,i,o){var c=this&&this.__decorate||function(g,w,b,x){var C,S=arguments.length,E=S<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,w,b,x);else for(var L=g.length-1;L>=0;L--)(C=g[L])&&(E=(S<3?C(E):S>3?C(w,b,E):C(w,b))||E);return S>3&&E&&Object.defineProperty(w,b,E),E},p=this&&this.__param||function(g,w){return function(b,x){w(b,x,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const u=o(5871),m=o(4725),_=o(844),y=o(2585),v={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let d=i.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,w,b,x,C,S,E){var A;super(),this._viewportElement=g,this._screenElement=w,this._bufferService=b,this._decorationService=x,this._renderService=C,this._optionsService=S,this._coreBrowserService=E,this._colorZoneStore=new u.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(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)(()=>{var M;(M=this._canvas)==null||M.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const g=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=g,h.center=w,h.right=g,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=h.left,f.right=h.left+h.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowserService.dpr);v.left=w,v.center=w,v.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const w of g)w.position!=="full"&&this._renderColorZone(w);for(const w of g)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(f[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-v[g.position||"full"]/2),h[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[g.position||"full"]))}_queueRefresh(g,w){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};i.OverviewRulerRenderer=d=c([p(2,y.IBufferService),p(3,y.IDecorationService),p(4,m.IRenderService),p(5,y.IOptionsService),p(6,m.ICoreBrowserService)],d)},2950:function(l,i,o){var c=this&&this.__decorate||function(v,h,f,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,f,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,f,b):g(h,f))||b);return w>3&&b&&Object.defineProperty(h,f,b),b},p=this&&this.__param||function(v,h){return function(f,d){h(f,d,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const u=o(4725),m=o(2585),_=o(2584);let y=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,h,f,d,g,w){this._textarea=v,this._compositionView=h,this._bufferService=f,this._optionsService=d,this._coreService=g,this._renderService=w,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,f=h.replace(v,"");this._dataAlreadySent=f,h.length>v.length?this._coreService.triggerDataEvent(f,!0):h.length<v.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):h.length===v.length&&h!==v&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=d+"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 w=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(w.width,1)+"px",this._textarea.style.height=Math.max(w.height,1)+"px",this._textarea.style.lineHeight=w.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};i.CompositionHelper=y=c([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,m.ICoreService),p(5,u.IRenderService)],y)},9806:(l,i)=>{function o(c,p,u){const m=u.getBoundingClientRect(),_=c.getComputedStyle(u),y=parseInt(_.getPropertyValue("padding-left")),v=parseInt(_.getPropertyValue("padding-top"));return[p.clientX-m.left-y,p.clientY-m.top-v]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=o,i.getCoords=function(c,p,u,m,_,y,v,h,f){if(!y)return;const d=o(c,p,u);return d?(d[0]=Math.ceil((d[0]+(f?v/2:0))/v),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),m+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),_),d):void 0}},9504:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const c=o(2584);function p(h,f,d,g){const w=h-u(h,d),b=f-u(f,d),x=Math.abs(w-b)-function(C,S,E){let L=0;const A=C-u(C,E),M=S-u(S,E);for(let T=0;T<Math.abs(A-M);T++){const B=m(C,S)==="A"?-1:1,H=E.buffer.lines.get(A+B*T);H!=null&&H.isWrapped&&L++}return L}(h,f,d);return v(x,y(m(h,f),g))}function u(h,f){let d=0,g=f.buffer.lines.get(h),w=g==null?void 0:g.isWrapped;for(;w&&h>=0&&h<f.rows;)d++,g=f.buffer.lines.get(--h),w=g==null?void 0:g.isWrapped;return d}function m(h,f){return h>f?"A":"B"}function _(h,f,d,g,w,b){let x=h,C=f,S="";for(;x!==d||C!==g;)x+=w?1:-1,w&&x>b.cols-1?(S+=b.buffer.translateBufferLineToString(C,!1,h,x),x=0,h=0,C++):!w&&x<0&&(S+=b.buffer.translateBufferLineToString(C,!1,0,h+1),x=b.cols-1,h=x,C--);return S+b.buffer.translateBufferLineToString(C,!1,h,x)}function y(h,f){const d=f?"O":"[";return c.C0.ESC+d+h}function v(h,f){h=Math.floor(h);let d="";for(let g=0;g<h;g++)d+=f;return d}i.moveToCellSequence=function(h,f,d,g){const w=d.buffer.x,b=d.buffer.y;if(!d.buffer.hasScrollback)return function(S,E,L,A,M,T){return p(E,A,M,T).length===0?"":v(_(S,E,S,E-u(E,M),!1,M).length,y("D",T))}(w,b,0,f,d,g)+p(b,f,d,g)+function(S,E,L,A,M,T){let B;B=p(E,A,M,T).length>0?A-u(A,M):E;const H=A,j=function($,O,R,P,N,F){let V;return V=p(R,P,N,F).length>0?P-u(P,N):O,$<R&&V<=P||$>=R&&V<P?"C":"D"}(S,E,L,A,M,T);return v(_(S,B,L,H,j==="C",M).length,y(j,T))}(w,b,h,f,d,g);let x;if(b===f)return x=w>h?"D":"C",v(Math.abs(w-h),y(x,g));x=b>f?"D":"C";const C=Math.abs(b-f);return v(function(S,E){return E.cols-S}(b>f?h:w,d)+(C-1)*d.cols+1+((b>f?w:h)-1),y(x,g))}},1296:function(l,i,o){var c=this&&this.__decorate||function(T,B,H,j){var $,O=arguments.length,R=O<3?B:j===null?j=Object.getOwnPropertyDescriptor(B,H):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(T,B,H,j);else for(var P=T.length-1;P>=0;P--)($=T[P])&&(R=(O<3?$(R):O>3?$(B,H,R):$(B,H))||R);return O>3&&R&&Object.defineProperty(B,H,R),R},p=this&&this.__param||function(T,B){return function(H,j){B(H,j,T)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const u=o(3787),m=o(2550),_=o(2223),y=o(6171),v=o(6052),h=o(4725),f=o(8055),d=o(8460),g=o(844),w=o(2585),b="xterm-dom-renderer-owner-",x="xterm-rows",C="xterm-fg-",S="xterm-bg-",E="xterm-focus",L="xterm-selection";let A=1,M=i.DomRenderer=class extends g.Disposable{constructor(T,B,H,j,$,O,R,P,N,F,V,q,Q){super(),this._terminal=T,this._document=B,this._element=H,this._screenElement=j,this._viewportElement=$,this._helperContainer=O,this._linkifier2=R,this._charSizeService=N,this._optionsService=F,this._bufferService=V,this._coreBrowserService=q,this._themeService=Q,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(x),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Z=>this._injectCss(Z))),this._injectCss(this._themeService.colors),this._rowFactory=P.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Z=>this._handleLinkHover(Z))),this.register(this._linkifier2.onHideLinkUnderline(Z=>this._handleLinkLeave(Z))),this.register((0,g.toDisposable)(()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.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 T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const H of this._rowElements)H.style.width=`${this.dimensions.css.canvas.width}px`,H.style.height=`${this.dimensions.css.cell.height}px`,H.style.lineHeight=`${this.dimensions.css.cell.height}px`,H.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${x} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${x} .xterm-dim { color: ${f.color.multiplyOpacity(T.foreground,.5).css};}`,B+=`${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 H=`blink_underline_${this._terminalClass}`,j=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;B+=`@keyframes ${H} { 50% { border-bottom-style: hidden; }}`,B+=`@keyframes ${j} { 50% { box-shadow: none; }}`,B+=`@keyframes ${$} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,B+=`${this._terminalSelector} .${x}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${x}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${x}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[O,R]of T.ansi.entries())B+=`${this._terminalSelector} .${C}${O} { color: ${R.css}; }${this._terminalSelector} .${C}${O}.xterm-dim { color: ${f.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${S}${O} { background-color: ${R.css}; }`;B+=`${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(T.background).css}; }${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${S}${_.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,B){for(let H=this._rowElements.length;H<=B;H++){const j=this._document.createElement("div");this._rowContainer.appendChild(j),this._rowElements.push(j)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,B){this._refreshRowElements(T,B),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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,B,H){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,B,H),this.renderRows(0,this._bufferService.rows-1),!T||!B)return;this._selectionRenderModel.update(this._terminal,T,B,H);const j=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,O=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(O>=this._bufferService.rows||R<0)return;const P=this._document.createDocumentFragment();if(H){const N=T[0]>B[0];P.appendChild(this._createSelectionElement(O,N?B[0]:T[0],N?T[0]:B[0],R-O+1))}else{const N=j===O?T[0]:0,F=O===$?B[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(O,N,F));const V=R-O-1;if(P.appendChild(this._createSelectionElement(O+1,0,this._bufferService.cols,V)),O!==R){const q=$===R?B[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(R,0,q))}}this._selectionContainer.appendChild(P)}_createSelectionElement(T,B,H,j=1){const $=this._document.createElement("div"),O=B*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(H-B);return O+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-O),$.style.height=j*this.dimensions.css.cell.height+"px",$.style.top=T*this.dimensions.css.cell.height+"px",$.style.left=`${O}px`,$.style.width=`${R}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const T of this._rowElements)T.replaceChildren()}renderRows(T,B){const H=this._bufferService.buffer,j=H.ybase+H.y,$=Math.min(H.x,this._bufferService.cols-1),O=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=T;N<=B;N++){const F=N+H.ydisp,V=this._rowElements[N],q=H.lines.get(F);if(!V||!q)break;V.replaceChildren(...this._rowFactory.createRow(q,F,F===j,R,P,$,O,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,B,H,j,$,O){H<0&&(T=0),j<0&&(B=0);const R=this._bufferService.rows-1;H=Math.max(Math.min(H,R),0),j=Math.max(Math.min(j,R),0),$=Math.min($,this._bufferService.cols);const P=this._bufferService.buffer,N=P.ybase+P.y,F=Math.min(P.x,$-1),V=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,Q=this._optionsService.rawOptions.cursorInactiveStyle;for(let Z=H;Z<=j;++Z){const z=Z+P.ydisp,I=this._rowElements[Z],K=P.lines.get(z);if(!I||!K)break;I.replaceChildren(...this._rowFactory.createRow(K,z,z===N,q,Q,F,V,this.dimensions.css.cell.width,this._widthCache,O?Z===H?T:0:-1,O?(Z===j?B:$)-1:-1))}}};i.DomRenderer=M=c([p(7,w.IInstantiationService),p(8,h.ICharSizeService),p(9,w.IOptionsService),p(10,w.IBufferService),p(11,h.ICoreBrowserService),p(12,h.IThemeService)],M)},3787:function(l,i,o){var c=this&&this.__decorate||function(x,C,S,E){var L,A=arguments.length,M=A<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,C,S,E);else for(var T=x.length-1;T>=0;T--)(L=x[T])&&(M=(A<3?L(M):A>3?L(C,S,M):L(C,S))||M);return A>3&&M&&Object.defineProperty(C,S,M),M},p=this&&this.__param||function(x,C){return function(S,E){C(S,E,x)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const u=o(2223),m=o(643),_=o(511),y=o(2585),v=o(8055),h=o(4725),f=o(4269),d=o(6171),g=o(3734);let w=i.DomRendererRowFactory=class{constructor(x,C,S,E,L,A,M){this._document=x,this._characterJoinerService=C,this._optionsService=S,this._coreBrowserService=E,this._coreService=L,this._decorationService=A,this._themeService=M,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,C,S){this._selectionStart=x,this._selectionEnd=C,this._columnSelectMode=S}createRow(x,C,S,E,L,A,M,T,B,H,j){const $=[],O=this._characterJoinerService.getJoinedCharacters(C),R=this._themeService.colors;let P,N=x.getNoBgTrimmedLength();S&&N<A+1&&(N=A+1);let F=0,V="",q=0,Q=0,Z=0,z=!1,I=0,K=!1,U=0;const J=[],G=H!==-1&&j!==-1;for(let ae=0;ae<N;ae++){x.loadCell(ae,this._workCell);let le=this._workCell.getWidth();if(le===0)continue;let me=!1,ke=ae,X=this._workCell;if(O.length>0&&ae===O[0][0]){me=!0;const fe=O.shift();X=new f.JoinedCellData(this._workCell,x.translateToString(!0,fe[0],fe[1]),fe[1]-fe[0]),ke=fe[1]-1,le=X.getWidth()}const ee=this._isCellInSelection(ae,C),Ae=S&&ae===A,de=G&&ae>=H&&ae<=j;let he=!1;this._decorationService.forEachDecorationAtCell(ae,C,void 0,fe=>{he=!0});let ce=X.getChars()||m.WHITESPACE_CELL_CHAR;if(ce===" "&&(X.isUnderline()||X.isOverline())&&(ce=" "),U=le*T-B.get(ce,X.isBold(),X.isItalic()),P){if(F&&(ee&&K||!ee&&!K&&X.bg===q)&&(ee&&K&&R.selectionForeground||X.fg===Q)&&X.extended.ext===Z&&de===z&&U===I&&!Ae&&!me&&!he){X.isInvisible()?V+=m.WHITESPACE_CELL_CHAR:V+=ce,F++;continue}F&&(P.textContent=V),P=this._document.createElement("span"),F=0,V=""}else P=this._document.createElement("span");if(q=X.bg,Q=X.fg,Z=X.extended.ext,z=de,I=U,K=ee,me&&A>=ae&&A<=ke&&(A=ae),!this._coreService.isCursorHidden&&Ae&&this._coreService.isCursorInitialized){if(J.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&J.push("xterm-cursor-blink"),J.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":J.push("xterm-cursor-outline");break;case"block":J.push("xterm-cursor-block");break;case"bar":J.push("xterm-cursor-bar");break;case"underline":J.push("xterm-cursor-underline")}}if(X.isBold()&&J.push("xterm-bold"),X.isItalic()&&J.push("xterm-italic"),X.isDim()&&J.push("xterm-dim"),V=X.isInvisible()?m.WHITESPACE_CELL_CHAR:X.getChars()||m.WHITESPACE_CELL_CHAR,X.isUnderline()&&(J.push(`xterm-underline-${X.extended.underlineStyle}`),V===" "&&(V=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let fe=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&fe<8&&(fe+=8),P.style.textDecorationColor=R.ansi[fe].css}X.isOverline()&&(J.push("xterm-overline"),V===" "&&(V=" ")),X.isStrikethrough()&&J.push("xterm-strikethrough"),de&&(P.style.textDecoration="underline");let te=X.getFgColor(),pe=X.getFgColorMode(),ie=X.getBgColor(),oe=X.getBgColorMode();const Le=!!X.isInverse();if(Le){const fe=te;te=ie,ie=fe;const Ie=pe;pe=oe,oe=Ie}let be,Re,De,ne=!1;switch(this._decorationService.forEachDecorationAtCell(ae,C,void 0,fe=>{fe.options.layer!=="top"&&ne||(fe.backgroundColorRGB&&(oe=50331648,ie=fe.backgroundColorRGB.rgba>>8&16777215,be=fe.backgroundColorRGB),fe.foregroundColorRGB&&(pe=50331648,te=fe.foregroundColorRGB.rgba>>8&16777215,Re=fe.foregroundColorRGB),ne=fe.options.layer==="top")}),!ne&&ee&&(be=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,ie=be.rgba>>8&16777215,oe=50331648,ne=!0,R.selectionForeground&&(pe=50331648,te=R.selectionForeground.rgba>>8&16777215,Re=R.selectionForeground)),ne&&J.push("xterm-decoration-top"),oe){case 16777216:case 33554432:De=R.ansi[ie],J.push(`xterm-bg-${ie}`);break;case 50331648:De=v.channels.toColor(ie>>16,ie>>8&255,255&ie),this._addStyle(P,`background-color:#${b((ie>>>0).toString(16),"0",6)}`);break;default:Le?(De=R.foreground,J.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):De=R.background}switch(be||X.isDim()&&(be=v.color.multiplyOpacity(De,.5)),pe){case 16777216:case 33554432:X.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(P,De,R.ansi[te],X,be,void 0)||J.push(`xterm-fg-${te}`);break;case 50331648:const fe=v.channels.toColor(te>>16&255,te>>8&255,255&te);this._applyMinimumContrast(P,De,fe,X,be,Re)||this._addStyle(P,`color:#${b(te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,De,R.foreground,X,be,Re)||Le&&J.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}J.length&&(P.className=J.join(" "),J.length=0),Ae||me||he?P.textContent=V:F++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),$.push(P),ae=ke}return P&&F&&(P.textContent=V),$}_applyMinimumContrast(x,C,S,E,L,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const M=this._getContrastCache(E);let T;if(L||A||(T=M.getColor(C.rgba,S.rgba)),T===void 0){const B=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);T=v.color.ensureContrastRatio(L||C,A||S,B),M.setColor((L||C).rgba,(A||S).rgba,T??null)}return!!T&&(this._addStyle(x,`color:${T.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,C){x.setAttribute("style",`${x.getAttribute("style")||""}${C};`)}_isCellInSelection(x,C){const S=this._selectionStart,E=this._selectionEnd;return!(!S||!E)&&(this._columnSelectMode?S[0]<=E[0]?x>=S[0]&&C>=S[1]&&x<E[0]&&C<=E[1]:x<S[0]&&C>=S[1]&&x>=E[0]&&C<=E[1]:C>S[1]&&C<E[1]||S[1]===E[1]&&C===S[1]&&x>=S[0]&&x<E[0]||S[1]<E[1]&&C===E[1]&&x<E[0]||S[1]<E[1]&&C===S[1]&&x>=S[0])}};function b(x,C,S){for(;x.length<S;)x=C+x;return x}i.DomRendererRowFactory=w=c([p(1,h.ICharacterJoinerService),p(2,y.IOptionsService),p(3,h.ICoreBrowserService),p(4,y.ICoreService),p(5,y.IDecorationService),p(6,h.IThemeService)],w)},2550:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 p=o.createElement("span");p.classList.add("xterm-char-measure-element");const u=o.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const m=o.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const _=o.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[p,u,m,_],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(m),this._container.appendChild(_),c.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(o,c,p,u){o===this._font&&c===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=o,this._fontSize=c,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(o,c,p){let u=0;if(!c&&!p&&o.length===1&&(u=o.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const y=this._measure(o,0);return y>0&&(this._flat[u]=y),y}let m=o;c&&(m+="B"),p&&(m+="I");let _=this._holey.get(m);if(_===void 0){let y=0;c&&(y|=1),p&&(y|=2),_=this._measure(o,y),_>0&&this._holey.set(m,_)}return _}_measure(o,c){const p=this._measureElements[c];return p.textContent=o.repeat(32),p.offsetWidth/32}}},2223:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,i)=>{function o(p){return 57508<=p&&p<=57558}function c(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},i.isPowerlineGlyph=o,i.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},i.isEmoji=c,i.allowRescaling=function(p,u,m,_){return u===1&&m>Math.ceil(1.5*_)&&p!==void 0&&p>255&&!c(p)&&!o(p)&&!function(y){return 57344<=y&&y<=63743}(p)},i.treatGlyphAsBackgroundColor=function(p){return o(p)||function(u){return 9472<=u&&u<=9631}(p)},i.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}}}},i.computeNextVariantOffset=function(p,u,m=0){return(p-(2*Math.round(u)-m))%(2*Math.round(u))}},6052:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class o{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(p,u,m,_=!1){if(this.selectionStart=u,this.selectionEnd=m,!u||!m||u[0]===m[0]&&u[1]===m[1])return void this.clear();const y=p.buffers.active.ydisp,v=u[1]-y,h=m[1]-y,f=Math.max(v,0),d=Math.min(h,p.rows-1);f>=p.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=m[0])}isCellSelected(p,u,m){return!!this.hasSelection&&(m-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&m>=this.viewportCappedStartRow&&u<this.endCol&&m<=this.viewportCappedEndRow:u<this.startCol&&m>=this.viewportCappedStartRow&&u>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol)}}i.createSelectionRenderModel=function(){return new o}},456:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,i,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var E=d.length-1;E>=0;E--)(x=d[E])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},p=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const u=o(2585),m=o(8460),_=o(844);let y=i.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,g,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new f(this._optionsService))}catch{this._measureStrategy=this.register(new h(d,g,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};i.CharSizeService=y=c([p(2,u.IOptionsService)],y);class v extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(g,w){g!==void 0&&g>0&&w!==void 0&&w>0&&(this._result.width=g,this._result.height=w)}}class h extends v{constructor(g,w,b){super(),this._document=g,this._parentElement=w,this._optionsService=b,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 v{constructor(g){super(),this._optionsService=g,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const w=this._ctx.measureText("W");if(!("width"in w&&"fontBoundingBoxAscent"in w&&"fontBoundingBoxDescent"in w))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const g=this._ctx.measureText("W");return this._validateAndSet(g.width,g.fontBoundingBoxAscent+g.fontBoundingBoxDescent),this._result}}},4269:function(l,i,o){var c=this&&this.__decorate||function(f,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(f,d,g,w);else for(var S=f.length-1;S>=0;S--)(b=f[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},p=this&&this.__param||function(f,d){return function(g,w){d(g,w,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const u=o(3734),m=o(643),_=o(511),y=o(2585);class v extends u.AttributeData{constructor(d,g,w){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=g,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=v;let h=i.CharacterJoinerService=class j1{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(d){const g={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(g),g.id}deregister(d){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===d)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(d);if(!g||g.length===0)return[];const w=[],b=g.translateToString(!0);let x=0,C=0,S=0,E=g.getFg(0),L=g.getBg(0);for(let A=0;A<g.getTrimmedLength();A++)if(g.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==L){if(A-x>1){const M=this._getJoinedRanges(b,S,C,g,x);for(let T=0;T<M.length;T++)w.push(M[T])}x=A,S=C,E=this._workCell.fg,L=this._workCell.bg}C+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const A=this._getJoinedRanges(b,S,C,g,x);for(let M=0;M<A.length;M++)w.push(A[M])}return w}_getJoinedRanges(d,g,w,b,x){const C=d.substring(g,w);let S=[];try{S=this._characterJoiners[0].handler(C)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const L=this._characterJoiners[E].handler(C);for(let A=0;A<L.length;A++)j1._mergeRanges(S,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(S,b,x),S}_stringRangesToCellRanges(d,g,w){let b=0,x=!1,C=0,S=d[b];if(S){for(let E=w;E<this._bufferService.cols;E++){const L=g.getWidth(E),A=g.getString(E).length||m.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!x&&S[0]<=C&&(S[0]=E,x=!0),S[1]<=C){if(S[1]=E,S=d[++b],!S)break;S[0]<=C?(S[0]=E,x=!0):x=!1}C+=A}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(d,g){let w=!1;for(let b=0;b<d.length;b++){const x=d[b];if(w){if(g[1]<=x[0])return d[b-1][1]=g[1],d;if(g[1]<=x[1])return d[b-1][1]=Math.max(g[1],x[1]),d.splice(b,1),d;d.splice(b,1),b--}else{if(g[1]<=x[0])return d.splice(b,0,g),d;if(g[1]<=x[1])return x[0]=Math.min(g[0],x[0]),d;g[0]<x[1]&&(x[0]=Math.min(g[0],x[0]),w=!0)}}return w?d[d.length-1][1]=g[1]:d.push(g),d}};i.CharacterJoinerService=h=c([p(0,y.IBufferService)],h)},5114:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const c=o(844),p=o(8460),u=o(3656);class m extends c.Disposable{constructor(v,h,f){super(),this._textarea=v,this._window=h,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(d=>this._screenDprMonitor.setWindow(d))),this.register((0,p.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(v){this._window!==v&&(this._window=v,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}}i.CoreBrowserService=m;class _ extends c.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const c=o(844);class p extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const _=this.linkProviders.indexOf(m);_!==-1&&this.linkProviders.splice(_,1)}}}}i.LinkProviderService=p},8934:function(l,i,o){var c=this&&this.__decorate||function(y,v,h,f){var d,g=arguments.length,w=g<3?v:f===null?f=Object.getOwnPropertyDescriptor(v,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,v,h,f);else for(var b=y.length-1;b>=0;b--)(d=y[b])&&(w=(g<3?d(w):g>3?d(v,h,w):d(v,h))||w);return g>3&&w&&Object.defineProperty(v,h,w),w},p=this&&this.__param||function(y,v){return function(h,f){v(h,f,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const u=o(4725),m=o(9806);let _=i.MouseService=class{constructor(y,v){this._renderService=y,this._charSizeService=v}getCoords(y,v,h,f,d){return(0,m.getCoords)(window,y,v,h,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(y,v){const h=(0,m.getCoordsRelativeToElement)(window,y,v);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};i.MouseService=_=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],_)},3230:function(l,i,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var E=d.length-1;E>=0;E--)(x=d[E])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},p=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const u=o(6193),m=o(4725),_=o(8460),y=o(844),v=o(7226),h=o(2585);let f=i.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,g,w,b,x,C,S,E){super(),this._rowCount=d,this._charSizeService=b,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((L,A)=>this._renderRows(L,A),S),this.register(this._renderDebouncer),this.register(S.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(C.onResize(()=>this._fullRefresh())),this.register(C.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()})),this.register(w.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(x.onDecorationRegistered(()=>this._fullRefresh())),this.register(x.onDecorationRemoved(()=>this._fullRefresh())),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()})),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(C.buffer.y,C.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(S.window,g),this.register(S.onWindowChange(L=>this._registerIntersectionObserver(L,g)))}_registerIntersectionObserver(d,g){if("IntersectionObserver"in d){const w=new d.IntersectionObserver(b=>this._handleIntersectionChange(b[b.length-1]),{threshold:0});w.observe(g),this._observerDisposable.value=(0,y.toDisposable)(()=>w.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,g,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,g,this._rowCount))}_renderRows(d,g){this._renderer.value&&(d=Math.min(d,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(d,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:g}),this._onRender.fire({start:d,end:g}),this._isNextRenderRedrawOnly=!0)}resize(d,g){this._rowCount=g,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(g=>this.refreshRows(g.start,g.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,g;this._renderer.value&&((g=(d=this._renderer.value).clearTextureAtlas)==null||g.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(d,g)}):this._renderer.value.handleResize(d,g),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,g,w){var b;this._selectionState.start=d,this._selectionState.end=g,this._selectionState.columnSelectMode=w,(b=this._renderer.value)==null||b.handleSelectionChanged(d,g,w)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};i.RenderService=f=c([p(2,h.IOptionsService),p(3,m.ICharSizeService),p(4,h.IDecorationService),p(5,h.IBufferService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],f)},9312:function(l,i,o){var c=this&&this.__decorate||function(S,E,L,A){var M,T=arguments.length,B=T<3?E:A===null?A=Object.getOwnPropertyDescriptor(E,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(S,E,L,A);else for(var H=S.length-1;H>=0;H--)(M=S[H])&&(B=(T<3?M(B):T>3?M(E,L,B):M(E,L))||B);return T>3&&B&&Object.defineProperty(E,L,B),B},p=this&&this.__param||function(S,E){return function(L,A){E(L,A,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const u=o(9806),m=o(9504),_=o(456),y=o(4725),v=o(8460),h=o(844),f=o(6114),d=o(4841),g=o(511),w=o(2585),b=" ",x=new RegExp(b,"g");let C=i.SelectionService=class extends h.Disposable{constructor(S,E,L,A,M,T,B,H,j){super(),this._element=S,this._screenElement=E,this._linkifier=L,this._bufferService=A,this._coreService=M,this._mouseService=T,this._optionsService=B,this._renderService=H,this._coreBrowserService=j,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim($=>this._handleTrim($)),this.register(this._bufferService.buffers.onBufferActivate($=>this._handleBufferActivate($))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!S||!E||S[0]===E[0]&&S[1]===E[1])}get selectionText(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!S||!E)return"";const L=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(S[0]===E[0])return"";const M=S[0]<E[0]?S[0]:E[0],T=S[0]<E[0]?E[0]:S[0];for(let B=S[1];B<=E[1];B++){const H=L.translateBufferLineToString(B,!0,M,T);A.push(H)}}else{const M=S[1]===E[1]?E[0]:void 0;A.push(L.translateBufferLineToString(S[1],!0,S[0],M));for(let T=S[1]+1;T<=E[1]-1;T++){const B=L.lines.get(T),H=L.translateBufferLineToString(T,!0);B!=null&&B.isWrapped?A[A.length-1]+=H:A.push(H)}if(S[1]!==E[1]){const T=L.lines.get(E[1]),B=L.translateBufferLineToString(E[1],!0,0,E[0]);T&&T.isWrapped?A[A.length-1]+=B:A.push(B)}}return A.map(M=>M.replace(x," ")).join(f.isWindows?`\r
58
+ `:`
59
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),f.isLinux&&S&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(S){const E=this._getMouseBufferCoords(S),L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(L&&A&&E)&&this._areCoordsInSelection(E,L,A)}isCellInSelection(S,E){const L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!L||!A)&&this._areCoordsInSelection([S,E],L,A)}_areCoordsInSelection(S,E,L){return S[1]>E[1]&&S[1]<L[1]||E[1]===L[1]&&S[1]===E[1]&&S[0]>=E[0]&&S[0]<L[0]||E[1]<L[1]&&S[1]===L[1]&&S[0]<L[0]||E[1]<L[1]&&S[1]===E[1]&&S[0]>=E[0]}_selectWordAtCursor(S,E){var M,T;const L=(T=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:T.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(S);return!!A&&(this._selectWordAt(A,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,E){this._model.clearSelection(),S=Math.max(S,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const E=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(S){let E=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=L?0:(E>L&&(E-=L),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(S){return f.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const E=this._getMouseBufferCoords(S);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(S){return S.altKey&&!(f.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const A=L.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const E=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const A=(0,m.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,L=!(!S||!E||S[0]===E[0]&&S[1]===E[1]);L?S&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,E,L)):this._oldHasSelection&&this._fireOnSelectionChange(S,E,L)}_fireOnSelectionChange(S,E,L){this._oldSelectionStart=S,this._oldSelectionEnd=E,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(S,E){let L=E;for(let A=0;E>=A;A++){const M=S.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:M>1&&E!==A&&(L+=M-1)}return L}setSelection(S,E,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,E],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,E,L=!0,A=!0){if(S[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,T=M.lines.get(S[1]);if(!T)return;const B=M.translateBufferLineToString(S[1],!1);let H=this._convertViewportColToCharacterIndex(T,S[0]),j=H;const $=S[0]-H;let O=0,R=0,P=0,N=0;if(B.charAt(H)===" "){for(;H>0&&B.charAt(H-1)===" ";)H--;for(;j<B.length&&B.charAt(j+1)===" ";)j++}else{let q=S[0],Q=S[0];T.getWidth(q)===0&&(O++,q--),T.getWidth(Q)===2&&(R++,Q++);const Z=T.getString(Q).length;for(Z>1&&(N+=Z-1,j+=Z-1);q>0&&H>0&&!this._isCharWordSeparator(T.loadCell(q-1,this._workCell));){T.loadCell(q-1,this._workCell);const z=this._workCell.getChars().length;this._workCell.getWidth()===0?(O++,q--):z>1&&(P+=z-1,H-=z-1),H--,q--}for(;Q<T.length&&j+1<B.length&&!this._isCharWordSeparator(T.loadCell(Q+1,this._workCell));){T.loadCell(Q+1,this._workCell);const z=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,Q++):z>1&&(N+=z-1,j+=z-1),j++,Q++}}j++;let F=H+$-O+P,V=Math.min(this._bufferService.cols,j-H+O+R-P-N);if(E||B.slice(H,j).trim()!==""){if(L&&F===0&&T.getCodePoint(0)!==32){const q=M.lines.get(S[1]-1);if(q&&T.isWrapped&&q.getCodePoint(this._bufferService.cols-1)!==32){const Q=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(Q){const Z=this._bufferService.cols-Q.start;F-=Z,V+=Z}}}if(A&&F+V===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const q=M.lines.get(S[1]+1);if(q!=null&&q.isWrapped&&q.getCodePoint(0)!==32){const Q=this._getWordAt([0,S[1]+1],!1,!1,!0);Q&&(V+=Q.length)}}return{start:F,length:V}}}_selectWordAt(S,E){const L=this._getWordAt(S,E);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[L.start,S[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(S){const E=this._getWordAt(S,!0);if(E){let L=S[1];for(;E.start<0;)E.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,L]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const E=this._bufferService.buffer.getWrappedRangeForLine(S),L={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols)}};i.SelectionService=C=c([p(3,w.IBufferService),p(4,w.ICoreService),p(5,y.IMouseService),p(6,w.IOptionsService),p(7,y.IRenderService),p(8,y.ICoreBrowserService)],C)},4725:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const c=o(8343);i.ICharSizeService=(0,c.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),i.IMouseService=(0,c.createDecorator)("MouseService"),i.IRenderService=(0,c.createDecorator)("RenderService"),i.ISelectionService=(0,c.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,c.createDecorator)("ThemeService"),i.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,i,o){var c=this&&this.__decorate||function(C,S,E,L){var A,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(C,S,E,L);else for(var B=C.length-1;B>=0;B--)(A=C[B])&&(T=(M<3?A(T):M>3?A(S,E,T):A(S,E))||T);return M>3&&T&&Object.defineProperty(S,E,T),T},p=this&&this.__param||function(C,S){return function(E,L){S(E,L,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const u=o(7239),m=o(8055),_=o(8460),y=o(844),v=o(2585),h=m.css.toColor("#ffffff"),f=m.css.toColor("#000000"),d=m.css.toColor("#ffffff"),g=m.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let E=0;E<216;E++){const L=S[E/36%6|0],A=S[E/6%6|0],M=S[E%6];C.push({css:m.channels.toCss(L,A,M),rgba:m.channels.toRgba(L,A,M)})}for(let E=0;E<24;E++){const L=8+10*E;C.push({css:m.channels.toCss(L,L,L),rgba:m.channels.toRgba(L,L,L)})}return C})());let b=i.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:f,cursor:d,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:m.color.blend(f,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:m.color.blend(f,w),ansi:i.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(C={}){const S=this._colors;if(S.foreground=x(C.foreground,h),S.background=x(C.background,f),S.cursor=x(C.cursor,d),S.cursorAccent=x(C.cursorAccent,g),S.selectionBackgroundTransparent=x(C.selectionBackground,w),S.selectionBackgroundOpaque=m.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=x(C.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=m.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=C.selectionForeground?x(C.selectionForeground,m.NULL_COLOR):void 0,S.selectionForeground===m.NULL_COLOR&&(S.selectionForeground=void 0),m.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=m.color.opacity(S.selectionBackgroundTransparent,.3)),m.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=m.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=i.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=x(C.black,i.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=x(C.red,i.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=x(C.green,i.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=x(C.yellow,i.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=x(C.blue,i.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=x(C.magenta,i.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=x(C.cyan,i.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=x(C.white,i.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=x(C.brightBlack,i.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=x(C.brightRed,i.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=x(C.brightGreen,i.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=x(C.brightYellow,i.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=x(C.brightBlue,i.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=x(C.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=x(C.brightCyan,i.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=x(C.brightWhite,i.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const E=Math.min(S.ansi.length-16,C.extendedAnsi.length);for(let L=0;L<E;L++)S.ansi[L+16]=x(C.extendedAnsi[L],i.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(C){C(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 x(C,S){if(C!==void 0)try{return m.css.toColor(C)}catch{}return S}i.ThemeService=b=c([p(0,v.IOptionsService)],b)},6349:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const c=o(8460),p=o(844);class u extends p.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const y=new Array(_);for(let v=0;v<Math.min(_,this.length);v++)y[v]=this._array[this._getCyclicIndex(v)];this._array=y,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let y=this._length;y<_;y++)this._array[y]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,y){this._array[this._getCyclicIndex(_)]=y}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,y,...v){if(y){for(let h=_;h<this._length-y;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+y)];this._length-=y,this.onDeleteEmitter.fire({index:_,amount:y})}for(let h=this._length-1;h>=_;h--)this._array[this._getCyclicIndex(h+v.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<v.length;h++)this._array[this._getCyclicIndex(_+h)]=v[h];if(v.length&&this.onInsertEmitter.fire({index:_,amount:v.length}),this._length+v.length>this._maxLength){const h=this._length+v.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=v.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,y,v){if(!(y<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let f=y-1;f>=0;f--)this.set(_+f+v,this.get(_+f));const h=_+y+v-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<y;h++)this.set(_+h+v,this.get(_+h))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}i.CircularList=u},1439:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function o(c,p=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const m in c)u[m]=p<=1?c[m]:c[m]&&o(c[m],p-1);return u}},8055:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let o=0,c=0,p=0,u=0;var m,_,y,v,h;function f(g){const w=g.toString(16);return w.length<2?"0"+w:w}function d(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,b,x,C){return C!==void 0?`#${f(w)}${f(b)}${f(x)}${f(C)}`:`#${f(w)}${f(b)}${f(x)}`},g.toRgba=function(w,b,x,C=255){return(w<<24|b<<16|x<<8|C)>>>0},g.toColor=function(w,b,x,C){return{css:g.toCss(w,b,x,C),rgba:g.toRgba(w,b,x,C)}}}(m||(i.channels=m={})),function(g){function w(b,x){return u=Math.round(255*x),[o,c,p]=h.toChannels(b.rgba),{css:m.toCss(o,c,p,u),rgba:m.toRgba(o,c,p,u)}}g.blend=function(b,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const C=x.rgba>>24&255,S=x.rgba>>16&255,E=x.rgba>>8&255,L=b.rgba>>24&255,A=b.rgba>>16&255,M=b.rgba>>8&255;return o=L+Math.round((C-L)*u),c=A+Math.round((S-A)*u),p=M+Math.round((E-M)*u),{css:m.toCss(o,c,p),rgba:m.toRgba(o,c,p)}},g.isOpaque=function(b){return(255&b.rgba)==255},g.ensureContrastRatio=function(b,x,C){const S=h.ensureContrastRatio(b.rgba,x.rgba,C);if(S)return m.toColor(S>>24&255,S>>16&255,S>>8&255)},g.opaque=function(b){const x=(255|b.rgba)>>>0;return[o,c,p]=h.toChannels(x),{css:m.toCss(o,c,p),rgba:x}},g.opacity=w,g.multiplyOpacity=function(b,x){return u=255&b.rgba,w(b,u*x/255)},g.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(_||(i.color=_={})),function(g){let w,b;try{const x=document.createElement("canvas");x.width=1,x.height=1;const C=x.getContext("2d",{willReadFrequently:!0});C&&(w=C,w.globalCompositeOperation="copy",b=w.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),p=parseInt(x.slice(3,4).repeat(2),16),m.toColor(o,c,p);case 5:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),p=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),m.toColor(o,c,p,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const C=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),p=parseInt(C[3]),u=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),m.toColor(o,c,p,u);if(!w||!b)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=b,w.fillStyle=x,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[o,c,p,u]=w.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(o,c,p,u),css:x}}}(y||(i.css=y={})),function(g){function w(b,x,C){const S=b/255,E=x/255,L=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(b){return w(b>>16&255,b>>8&255,255&b)},g.relativeLuminance2=w}(v||(i.rgb=v={})),function(g){function w(x,C,S){const E=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,T=C>>16&255,B=C>>8&255,H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));for(;H<S&&(M>0||T>0||B>0);)M-=Math.max(0,Math.ceil(.1*M)),T-=Math.max(0,Math.ceil(.1*T)),B-=Math.max(0,Math.ceil(.1*B)),H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));return(M<<24|T<<16|B<<8|255)>>>0}function b(x,C,S){const E=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,T=C>>16&255,B=C>>8&255,H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));for(;H<S&&(M<255||T<255||B<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),T=Math.min(255,T+Math.ceil(.1*(255-T))),B=Math.min(255,B+Math.ceil(.1*(255-B))),H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));return(M<<24|T<<16|B<<8|255)>>>0}g.blend=function(x,C){if(u=(255&C)/255,u===1)return C;const S=C>>24&255,E=C>>16&255,L=C>>8&255,A=x>>24&255,M=x>>16&255,T=x>>8&255;return o=A+Math.round((S-A)*u),c=M+Math.round((E-M)*u),p=T+Math.round((L-T)*u),m.toRgba(o,c,p)},g.ensureContrastRatio=function(x,C,S){const E=v.relativeLuminance(x>>8),L=v.relativeLuminance(C>>8);if(d(E,L)<S){if(L<E){const T=w(x,C,S),B=d(E,v.relativeLuminance(T>>8));if(B<S){const H=b(x,C,S);return B>d(E,v.relativeLuminance(H>>8))?T:H}return T}const A=b(x,C,S),M=d(E,v.relativeLuminance(A>>8));if(M<S){const T=w(x,C,S);return M>d(E,v.relativeLuminance(T>>8))?A:T}return A}},g.reduceLuminance=w,g.increaseLuminance=b,g.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(h||(i.rgba=h={})),i.toPaddedHex=f,i.contrastRatio=d},8969:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const c=o(844),p=o(2585),u=o(4348),m=o(7866),_=o(744),y=o(7302),v=o(6975),h=o(8460),f=o(1753),d=o(1480),g=o(7994),w=o(9282),b=o(5435),x=o(5981),C=o(2660);let S=!1;class E extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(A=>{var M;(M=this._onScrollApi)==null||M.fire(A.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(A){for(const M in A)this.optionsService.options[M]=A[M]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(A)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(M=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new x.WriteBuffer((M,T)=>this._inputHandler.parse(M,T))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,M){this._writeBuffer.write(A,M)}writeSync(A,M){this._logService.logLevel<=p.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(A,M)}input(A,M=!0){this.coreService.triggerDataEvent(A,M)}resize(A,M){isNaN(A)||isNaN(M)||(A=Math.max(A,_.MINIMUM_COLS),M=Math.max(M,_.MINIMUM_ROWS),this._bufferService.resize(A,M))}scroll(A,M=!1){this._bufferService.scroll(A,M)}scrollLines(A,M,T){this._bufferService.scrollLines(A,M,T)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const M=A-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(A,M){return this._inputHandler.registerEscHandler(A,M)}registerDcsHandler(A,M){return this._inputHandler.registerDcsHandler(A,M)}registerCsiHandler(A,M){return this._inputHandler.registerCsiHandler(A,M)}registerOscHandler(A,M){return this._inputHandler.registerOscHandler(A,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?A=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const M of A)M.dispose()})}}}i.CoreTerminal=E},8460:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(o,c){return o(p=>c.fire(p))},i.runAndSubscribe=function(o,c){return c(void 0),o(p=>c(p))}},5435:function(l,i,o){var c=this&&this.__decorate||function(O,R,P,N){var F,V=arguments.length,q=V<3?R:N===null?N=Object.getOwnPropertyDescriptor(R,P):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(O,R,P,N);else for(var Q=O.length-1;Q>=0;Q--)(F=O[Q])&&(q=(V<3?F(q):V>3?F(R,P,q):F(R,P))||q);return V>3&&q&&Object.defineProperty(R,P,q),q},p=this&&this.__param||function(O,R){return function(P,N){R(P,N,O)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const u=o(2584),m=o(7116),_=o(2015),y=o(844),v=o(482),h=o(8437),f=o(8460),d=o(643),g=o(511),w=o(3734),b=o(2585),x=o(1480),C=o(6242),S=o(6351),E=o(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function M(O,R){if(O>24)return R.setWinLines||!1;switch(O){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var T;(function(O){O[O.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",O[O.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(i.WindowsOptionsReportType=T={}));let B=0;class H extends y.Disposable{getAttrData(){return this._curAttrData}constructor(R,P,N,F,V,q,Q,Z,z=new _.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=P,this._coreService=N,this._logService=F,this._optionsService=V,this._oscLinkService=q,this._coreMouseService=Q,this._unicodeService=Z,this._parser=z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.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 j(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(I=>this._activeBuffer=I.activeBuffer)),this._parser.setCsiHandlerFallback((I,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(I),params:K.toArray()})}),this._parser.setEscHandlerFallback(I=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(I)})}),this._parser.setExecuteHandlerFallback(I=>{this._logService.debug("Unknown EXECUTE code: ",{code:I})}),this._parser.setOscHandlerFallback((I,K,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:I,action:K,data:U})}),this._parser.setDcsHandlerFallback((I,K,U)=>{K==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(I),action:K,payload:U})}),this._parser.setPrintHandler((I,K,U)=>this.print(I,K,U)),this._parser.registerCsiHandler({final:"@"},I=>this.insertChars(I)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},I=>this.scrollLeft(I)),this._parser.registerCsiHandler({final:"A"},I=>this.cursorUp(I)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},I=>this.scrollRight(I)),this._parser.registerCsiHandler({final:"B"},I=>this.cursorDown(I)),this._parser.registerCsiHandler({final:"C"},I=>this.cursorForward(I)),this._parser.registerCsiHandler({final:"D"},I=>this.cursorBackward(I)),this._parser.registerCsiHandler({final:"E"},I=>this.cursorNextLine(I)),this._parser.registerCsiHandler({final:"F"},I=>this.cursorPrecedingLine(I)),this._parser.registerCsiHandler({final:"G"},I=>this.cursorCharAbsolute(I)),this._parser.registerCsiHandler({final:"H"},I=>this.cursorPosition(I)),this._parser.registerCsiHandler({final:"I"},I=>this.cursorForwardTab(I)),this._parser.registerCsiHandler({final:"J"},I=>this.eraseInDisplay(I,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},I=>this.eraseInDisplay(I,!0)),this._parser.registerCsiHandler({final:"K"},I=>this.eraseInLine(I,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},I=>this.eraseInLine(I,!0)),this._parser.registerCsiHandler({final:"L"},I=>this.insertLines(I)),this._parser.registerCsiHandler({final:"M"},I=>this.deleteLines(I)),this._parser.registerCsiHandler({final:"P"},I=>this.deleteChars(I)),this._parser.registerCsiHandler({final:"S"},I=>this.scrollUp(I)),this._parser.registerCsiHandler({final:"T"},I=>this.scrollDown(I)),this._parser.registerCsiHandler({final:"X"},I=>this.eraseChars(I)),this._parser.registerCsiHandler({final:"Z"},I=>this.cursorBackwardTab(I)),this._parser.registerCsiHandler({final:"`"},I=>this.charPosAbsolute(I)),this._parser.registerCsiHandler({final:"a"},I=>this.hPositionRelative(I)),this._parser.registerCsiHandler({final:"b"},I=>this.repeatPrecedingCharacter(I)),this._parser.registerCsiHandler({final:"c"},I=>this.sendDeviceAttributesPrimary(I)),this._parser.registerCsiHandler({prefix:">",final:"c"},I=>this.sendDeviceAttributesSecondary(I)),this._parser.registerCsiHandler({final:"d"},I=>this.linePosAbsolute(I)),this._parser.registerCsiHandler({final:"e"},I=>this.vPositionRelative(I)),this._parser.registerCsiHandler({final:"f"},I=>this.hVPosition(I)),this._parser.registerCsiHandler({final:"g"},I=>this.tabClear(I)),this._parser.registerCsiHandler({final:"h"},I=>this.setMode(I)),this._parser.registerCsiHandler({prefix:"?",final:"h"},I=>this.setModePrivate(I)),this._parser.registerCsiHandler({final:"l"},I=>this.resetMode(I)),this._parser.registerCsiHandler({prefix:"?",final:"l"},I=>this.resetModePrivate(I)),this._parser.registerCsiHandler({final:"m"},I=>this.charAttributes(I)),this._parser.registerCsiHandler({final:"n"},I=>this.deviceStatus(I)),this._parser.registerCsiHandler({prefix:"?",final:"n"},I=>this.deviceStatusPrivate(I)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},I=>this.softReset(I)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},I=>this.setCursorStyle(I)),this._parser.registerCsiHandler({final:"r"},I=>this.setScrollRegion(I)),this._parser.registerCsiHandler({final:"s"},I=>this.saveCursor(I)),this._parser.registerCsiHandler({final:"t"},I=>this.windowOptions(I)),this._parser.registerCsiHandler({final:"u"},I=>this.restoreCursor(I)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},I=>this.insertColumns(I)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},I=>this.deleteColumns(I)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},I=>this.selectProtected(I)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},I=>this.requestMode(I,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},I=>this.requestMode(I,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(I=>(this.setTitle(I),this.setIconName(I),!0))),this._parser.registerOscHandler(1,new C.OscHandler(I=>this.setIconName(I))),this._parser.registerOscHandler(2,new C.OscHandler(I=>this.setTitle(I))),this._parser.registerOscHandler(4,new C.OscHandler(I=>this.setOrReportIndexedColor(I))),this._parser.registerOscHandler(8,new C.OscHandler(I=>this.setHyperlink(I))),this._parser.registerOscHandler(10,new C.OscHandler(I=>this.setOrReportFgColor(I))),this._parser.registerOscHandler(11,new C.OscHandler(I=>this.setOrReportBgColor(I))),this._parser.registerOscHandler(12,new C.OscHandler(I=>this.setOrReportCursorColor(I))),this._parser.registerOscHandler(104,new C.OscHandler(I=>this.restoreIndexedColor(I))),this._parser.registerOscHandler(110,new C.OscHandler(I=>this.restoreFgColor(I))),this._parser.registerOscHandler(111,new C.OscHandler(I=>this.restoreBgColor(I))),this._parser.registerOscHandler(112,new C.OscHandler(I=>this.restoreCursorColor(I))),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 I in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:I},()=>this.selectCharset("("+I)),this._parser.registerEscHandler({intermediates:")",final:I},()=>this.selectCharset(")"+I)),this._parser.registerEscHandler({intermediates:"*",final:I},()=>this.selectCharset("*"+I)),this._parser.registerEscHandler({intermediates:"+",final:I},()=>this.selectCharset("+"+I)),this._parser.registerEscHandler({intermediates:"-",final:I},()=>this.selectCharset("-"+I)),this._parser.registerEscHandler({intermediates:".",final:I},()=>this.selectCharset("."+I)),this._parser.registerEscHandler({intermediates:"/",final:I},()=>this.selectCharset("/"+I));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(I=>(this._logService.error("Parsing error: ",I),I)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler((I,K)=>this.requestStatusString(I,K)))}_preserveStack(R,P,N,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=N,this._parseStack.position=F}_logSlowResolvingAsync(R){this._logService.logLevel<=b.LogLevelEnum.WARN&&Promise.race([R,new Promise((P,N)=>setTimeout(()=>N("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,P){let N,F=this._activeBuffer.x,V=this._activeBuffer.y,q=0;const Q=this._parseStack.paused;if(Q){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(N),N;F=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>A&&(q=this._parseStack.position+A)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,I=>String.fromCharCode(I)).join("")}"`),typeof R=="string"?R.split("").map(I=>I.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(R.length,A))),Q||this._dirtyRowTracker.clearRange(),R.length>A)for(let I=q;I<R.length;I+=A){const K=I+A<R.length?I+A:R.length,U=typeof R=="string"?this._stringDecoder.decode(R.substring(I,K),this._parseBuffer):this._utf8Decoder.decode(R.subarray(I,K),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,U))return this._preserveStack(F,V,U,I),this._logSlowResolvingAsync(N),N}else if(!Q){const I=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,I))return this._preserveStack(F,V,I,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===F&&this._activeBuffer.y===V||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(z,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(R,P,N){let F,V;const q=this._charsetService.charset,Q=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,z=this._coreService.decPrivateModes.wraparound,I=this._coreService.modes.insertMode,K=this._curAttrData;let U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-P>0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let J=this._parser.precedingJoinState;for(let G=P;G<N;++G){if(F=R[G],F<127&&q){const ke=q[String.fromCharCode(F)];ke&&(F=ke.charCodeAt(0))}const ae=this._unicodeService.charProperties(F,J);V=x.UnicodeService.extractWidth(ae);const le=x.UnicodeService.extractShouldJoin(ae),me=le?x.UnicodeService.extractWidth(J):0;if(J=ae,Q&&this._onA11yChar.fire((0,v.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-me>Z){if(z){const ke=U;let X=this._activeBuffer.x-me;for(this._activeBuffer.x=me,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),U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),me>0&&U instanceof h.BufferLine&&U.copyCellsFrom(ke,X,0,me,!1);X<Z;)ke.setCellFromCodepoint(X++,0,1,K)}else if(this._activeBuffer.x=Z-1,V===2)continue}if(le&&this._activeBuffer.x){const ke=U.getWidth(this._activeBuffer.x-1)?1:2;U.addCodepointToCell(this._activeBuffer.x-ke,F,V);for(let X=V-me;--X>=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(I&&(U.insertCells(this._activeBuffer.x,V-me,this._activeBuffer.getNullCell(K)),U.getWidth(Z-1)===2&&U.setCellFromCodepoint(Z-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,K)),U.setCellFromCodepoint(this._activeBuffer.x++,F,V,K),V>0)for(;--V;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=J,this._activeBuffer.x<Z&&N-P>0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,P){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,P):this._parser.registerCsiHandler(R,N=>!M(N.params[0],this._optionsService.rawOptions.windowOptions)||P(N))}registerDcsHandler(R,P){return this._parser.registerDcsHandler(R,new S.DcsHandler(P))}registerEscHandler(R,P){return this._parser.registerEscHandler(R,P)}registerOscHandler(R,P){return this._parser.registerOscHandler(R,new C.OscHandler(P))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(R,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=R,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+P)}cursorUp(R){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const P=R.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const P=R.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,P,N,F=!1,V=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);q.replaceCells(P,N,this._activeBuffer.getNullCell(this._eraseAttrData()),V),F&&(q.isWrapped=!1)}_resetBufferLine(R,P=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),N.isWrapped=!1)}eraseInDisplay(R,P=!1){let N;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);N<this._bufferService.rows;N++)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(R,P=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;P--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;P--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);F.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);F.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);F.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);F.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const P=this._parser.precedingJoinState;if(!P)return!0;const N=R.params[0]||1,F=x.UnicodeService.extractWidth(P),V=this._activeBuffer.x-F,q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),Q=new Uint32Array(q.length*N);let Z=0;for(let I=0;I<q.length;){const K=q.codePointAt(I)||0;Q[Z++]=K,I+=K>65535?2:1}let z=Z;for(let I=1;I<N;++I)Q.copyWithin(z,0,Z),z+=Z;return this.print(Q,0,z),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[P]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,P){const N=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:V}=this._coreMouseService,q=this._coreService,{buffers:Q,cols:Z}=this._bufferService,{active:z,alt:I}=Q,K=this._optionsService.rawOptions,U=le=>le?1:2,J=R.params[0];return G=J,ae=P?J===2?4:J===4?U(q.modes.insertMode):J===12?3:J===20?U(K.convertEol):0:J===1?U(N.applicationCursorKeys):J===3?K.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:J===6?U(N.origin):J===7?U(N.wraparound):J===8?3:J===9?U(F==="X10"):J===12?U(K.cursorBlink):J===25?U(!q.isCursorHidden):J===45?U(N.reverseWraparound):J===66?U(N.applicationKeypad):J===67?4:J===1e3?U(F==="VT200"):J===1002?U(F==="DRAG"):J===1003?U(F==="ANY"):J===1004?U(N.sendFocus):J===1005?4:J===1006?U(V==="SGR"):J===1015?4:J===1016?U(V==="SGR_PIXELS"):J===1048?1:J===47||J===1047||J===1049?U(z===I):J===2004?U(N.bracketedPasteMode):0,q.triggerDataEvent(`${u.C0.ESC}[${P?"":"?"}${G};${ae}$y`),!0;var G,ae}_updateAttrColor(R,P,N,F,V){return P===2?(R|=50331648,R&=-16777216,R|=w.AttributeData.fromColorRGB([N,F,V])):P===5&&(R&=-50331904,R|=33554432|255&N),R}_extractColor(R,P,N){const F=[0,0,-1,0,0,0];let V=0,q=0;do{if(F[q+V]=R.params[P+q],R.hasSubParams(P+q)){const Q=R.getSubParams(P+q);let Z=0;do F[1]===5&&(V=1),F[q+Z+1+V]=Q[Z];while(++Z<Q.length&&Z+q+1+V<F.length);break}if(F[1]===5&&q+V>=2||F[1]===2&&q+V>=5)break;F[1]&&(V=1)}while(++q+P<R.length&&q+V<F.length);for(let Q=2;Q<F.length;++Q)F[Q]===-1&&(F[Q]=0);switch(F[0]){case 38:N.fg=this._updateAttrColor(N.fg,F[1],F[3],F[4],F[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,F[1],F[3],F[4],F[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,F[1],F[3],F[4],F[5])}return q}_processUnderline(R,P){P.extended=P.extended.clone(),(!~R||R>5)&&(R=1),P.extended.underlineStyle=R,P.fg|=268435456,R===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(R){R.fg=h.DEFAULT_ATTR_DATA.fg,R.bg=h.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=R.length;let N;const F=this._curAttrData;for(let V=0;V<P;V++)N=R.params[V],N>=30&&N<=37?(F.fg&=-50331904,F.fg|=16777216|N-30):N>=40&&N<=47?(F.bg&=-50331904,F.bg|=16777216|N-40):N>=90&&N<=97?(F.fg&=-50331904,F.fg|=16777224|N-90):N>=100&&N<=107?(F.bg&=-50331904,F.bg|=16777224|N-100):N===0?this._processSGR0(F):N===1?F.fg|=134217728:N===3?F.bg|=67108864:N===4?(F.fg|=268435456,this._processUnderline(R.hasSubParams(V)?R.getSubParams(V)[0]:1,F)):N===5?F.fg|=536870912:N===7?F.fg|=67108864:N===8?F.fg|=1073741824:N===9?F.fg|=2147483648:N===2?F.bg|=134217728:N===21?this._processUnderline(2,F):N===22?(F.fg&=-134217729,F.bg&=-134217729):N===23?F.bg&=-67108865:N===24?(F.fg&=-268435457,this._processUnderline(0,F)):N===25?F.fg&=-536870913:N===27?F.fg&=-67108865:N===28?F.fg&=-1073741825:N===29?F.fg&=2147483647:N===39?(F.fg&=-67108864,F.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):N===49?(F.bg&=-67108864,F.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?V+=this._extractColor(R,V,F):N===53?F.bg|=1073741824:N===55?F.bg&=-1073741825:N===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):N===100?(F.fg&=-67108864,F.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${P};${N}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const P=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${P};${N}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const P=R.params[0]||1;switch(P){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const N=P%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(R){const P=R.params[0]||1;let N;return(R.length<2||(N=R.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(R){if(!M(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:P!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(R){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const P=[],N=R.split(";");for(;N.length>1;){const F=N.shift(),V=N.shift();if(/^\d+$/.exec(F)){const q=parseInt(F);if($(q))if(V==="?")P.push({type:0,index:q});else{const Q=(0,E.parseColor)(V);Q&&P.push({type:1,index:q,color:Q})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(R){const P=R.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(R,P){this._getCurrentLinkId()&&this._finishHyperlink();const N=R.split(":");let F;const V=N.findIndex(q=>q.startsWith("id="));return V!==-1&&(F=N[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,P){const N=R.split(";");for(let F=0;F<N.length&&!(P>=this._specialColors.length);++F,++P)if(N[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const V=(0,E.parseColor)(N[F]);V&&this._onColor.fire([{type:1,index:this._specialColors[P],color:V}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const P=[],N=R.split(";");for(let F=0;F<N.length;++F)if(/^\d+$/.exec(N[F])){const V=parseInt(N[F]);$(V)&&P.push({type:2,index:V})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(L[R[0]],m.CHARSETS[R[1]]||m.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new g.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const N=this._activeBuffer.ybase+this._activeBuffer.y+P,F=this._activeBuffer.lines.get(N);F&&(F.fill(R),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,P){const N=this._bufferService.buffer,F=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${V}${u.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,P){this._dirtyRowTracker.markRangeDirty(R,P)}}i.InputHandler=H;let j=class{constructor(O){this._bufferService=O,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(O){O<this.start?this.start=O:O>this.end&&(this.end=O)}markRangeDirty(O,R){O>R&&(B=O,O=R,R=B),O<this.start&&(this.start=O),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(O){return 0<=O&&O<256}j=c([p(0,b.IBufferService)],j)},844:(l,i)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=o,i.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(p,u,m){this._data[p]||(this._data[p]={}),this._data[p][u]=m}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}i.TwoKeyMap=o,i.FourKeyMap=class{constructor(){this._data=new o}set(c,p,u,m,_){this._data.get(c,p)||this._data.set(c,p,new o),this._data.get(c,p).set(u,m,_)}get(c,p,u,m){var _;return(_=this._data.get(c,p))==null?void 0:_.get(u,m)}clear(){this._data.clear()}}},6114:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const o=i.isNode?"node":navigator.userAgent,c=i.isNode?"node":navigator.platform;i.isFirefox=o.includes("Firefox"),i.isLegacyEdge=o.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(o),i.getSafariVersion=function(){if(!i.isSafari)return 0;const p=o.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),i.isIpad=c==="iPad",i.isIphone=c==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),i.isLinux=c.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(o)},6106:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let o=0;i.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const p=this._getKey(c);if(p===void 0||(o=this._search(p),o===-1)||this._getKey(this._array[o])!==p)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===p);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,p){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do p(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let p=0,u=this._array.length-1;for(;u>=p;){let m=p+u>>1;const _=this._getKey(this._array[m]);if(_>c)u=m-1;else{if(!(_<c)){for(;m>0&&this._getKey(this._array[m-1])===c;)m--;return m}p=m+1}}return p}}},7226:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const c=o(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let y=0,v=0,h=_.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),v=Math.max(y,v),f=_.timeRemaining(),1.5*v>f)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=f}this.clear()}}class u extends p{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const y=Date.now()+_;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}i.PriorityTaskQueue=u,i.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:u,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const c=o(643);i.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),m=u==null?void 0:u.get(p.cols-1),_=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);_&&m&&(_.isWrapped=m[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&m[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}i.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,m=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=m}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=c},9092:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const c=o(6349),p=o(7226),u=o(3734),m=o(8437),_=o(4634),y=o(511),v=o(643),h=o(4863),f=o(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(d,g,w){this._hasScrollback=d,this._optionsService=g,this._bufferService=w,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,g){return new m.BufferLine(this._bufferService.cols,this.getNullCell(d),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const g=d+this._optionsService.rawOptions.scrollback;return g>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:g}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=m.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,g){const w=this.getNullCell(m.DEFAULT_ATTR_DATA);let b=0;const x=this._getCorrectBufferLength(g);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<d)for(let S=0;S<this.lines.length;S++)b+=+this.lines.get(S).resize(d,w);let C=0;if(this._rows<g)for(let S=this._rows;S<g;S++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(d,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(d,w)));else for(let S=this._rows;S>g;S--)this.lines.length>g+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const S=this.lines.length-x;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=x}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,g-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(d,g),this._cols>d))for(let C=0;C<this.lines.length;C++)b+=+this.lines.get(C).resize(d,w);this._cols=d,this._rows=g,this._memoryCleanupQueue.clear(),b>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,g){this._cols!==d&&(d>this._cols?this._reflowLarger(d,g):this._reflowSmaller(d,g))}_reflowLarger(d,g){const w=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(w.length>0){const b=(0,_.reflowLargerCreateNewLayout)(this.lines,w);(0,_.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(d,g,b.countRemoved)}}_reflowLargerAdjustViewport(d,g,w){const b=this.getNullCell(m.DEFAULT_ATTR_DATA);let x=w;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new m.BufferLine(d,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(d,g){const w=this.getNullCell(m.DEFAULT_ATTR_DATA),b=[];let x=0;for(let C=this.lines.length-1;C>=0;C--){let S=this.lines.get(C);if(!S||!S.isWrapped&&S.getTrimmedLength()<=d)continue;const E=[S];for(;S.isWrapped&&C>0;)S=this.lines.get(--C),E.unshift(S);const L=this.ybase+this.y;if(L>=C&&L<C+E.length)continue;const A=E[E.length-1].getTrimmedLength(),M=(0,_.reflowSmallerGetNewLineLengths)(E,this._cols,d),T=M.length-E.length;let B;B=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const H=[];for(let N=0;N<T;N++){const F=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);H.push(F)}H.length>0&&(b.push({start:C+E.length+x,newLines:H}),x+=H.length),E.push(...H);let j=M.length-1,$=M[j];$===0&&(j--,$=M[j]);let O=E.length-T-1,R=A;for(;O>=0;){const N=Math.min(R,$);if(E[j]===void 0)break;if(E[j].copyCellsFrom(E[O],R-N,$-N,N,!0),$-=N,$===0&&(j--,$=M[j]),R-=N,R===0){O--;const F=Math.max(O,0);R=(0,_.getWrappedLineTrimmedLength)(E,F,this._cols)}}for(let N=0;N<E.length;N++)M[N]<d&&E[N].setCell(M[N],w);let P=T-B;for(;P-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+g-1)}if(b.length>0){const C=[],S=[];for(let j=0;j<this.lines.length;j++)S.push(this.lines.get(j));const E=this.lines.length;let L=E-1,A=0,M=b[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let T=0;for(let j=Math.min(this.lines.maxLength-1,E+x-1);j>=0;j--)if(M&&M.start>L+T){for(let $=M.newLines.length-1;$>=0;$--)this.lines.set(j--,M.newLines[$]);j++,C.push({index:L+1,amount:M.newLines.length}),T+=M.newLines.length,M=b[++A]}else this.lines.set(j,S[L--]);let B=0;for(let j=C.length-1;j>=0;j--)C[j].index+=B,this.lines.onInsertEmitter.fire(C[j]),B+=C[j].amount;const H=Math.max(0,E+x-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(d,g,w=0,b){const x=this.lines.get(d);return x?x.translateToString(g,w,b):""}getWrappedRangeForLine(d){let g=d,w=d;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:g,last:w}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===d&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const g=new h.Marker(d);return this.markers.push(g),g.register(this.lines.onTrim(w=>{g.line-=w,g.line<0&&g.dispose()})),g.register(this.lines.onInsert(w=>{g.line>=w.index&&(g.line+=w.amount)})),g.register(this.lines.onDelete(w=>{g.line>=w.index&&g.line<w.index+w.amount&&g.dispose(),g.line>w.index&&(g.line-=w.amount)})),g.register(g.onDispose(()=>this._removeMarker(g))),g}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const c=o(3734),p=o(511),u=o(643),m=o(482);i.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class y{constructor(h,f,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const g=f||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let w=0;w<h;++w)this.setCell(w,g);this.length=h}get(h){const f=this._data[3*h+0],d=2097151&f;return[this._data[3*h+1],2097152&f?this._combined[h]:d?(0,m.stringFromCodePoint)(d):"",f>>22,2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):d]}set(h,f){this._data[3*h+1]=f[u.CHAR_DATA_ATTR_INDEX],f[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=f[1],this._data[3*h+0]=2097152|h|f[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&f}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h]:2097151&f?(0,m.stringFromCodePoint)(2097151&f):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,f){return _=3*h,f.content=this._data[_+0],f.fg=this._data[_+1],f.bg=this._data[_+2],2097152&f.content&&(f.combinedData=this._combined[h]),268435456&f.bg&&(f.extended=this._extendedAttrs[h]),f}setCell(h,f){2097152&f.content&&(this._combined[h]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[h]=f.extended),this._data[3*h+0]=f.content,this._data[3*h+1]=f.fg,this._data[3*h+2]=f.bg}setCellFromCodepoint(h,f,d,g){268435456&g.bg&&(this._extendedAttrs[h]=g.extended),this._data[3*h+0]=f|d<<22,this._data[3*h+1]=g.fg,this._data[3*h+2]=g.bg}addCodepointToCell(h,f,d){let g=this._data[3*h+0];2097152&g?this._combined[h]+=(0,m.stringFromCodePoint)(f):2097151&g?(this._combined[h]=(0,m.stringFromCodePoint)(2097151&g)+(0,m.stringFromCodePoint)(f),g&=-2097152,g|=2097152):g=f|4194304,d&&(g&=-12582913,g|=d<<22),this._data[3*h+0]=g}insertCells(h,f,d){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length-h){const g=new p.CellData;for(let w=this.length-h-f-1;w>=0;--w)this.setCell(h+f+w,this.loadCell(h+w,g));for(let w=0;w<f;++w)this.setCell(h+w,d)}else for(let g=h;g<this.length;++g)this.setCell(g,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(h,f,d){if(h%=this.length,f<this.length-h){const g=new p.CellData;for(let w=0;w<this.length-h-f;++w)this.setCell(h+w,this.loadCell(h+f+w,g));for(let w=this.length-f;w<this.length;++w)this.setCell(w,d)}else for(let g=h;g<this.length;++g)this.setCell(g,d);h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodepoint(h,0,1,d)}replaceCells(h,f,d,g=!1){if(g)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.isProtected(h)||this.setCell(h,d),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.setCell(h++,d)}resize(h,f){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const g=new Uint32Array(d);g.set(this._data),this._data=g}for(let g=this.length;g<h;++g)this.setCell(g,f)}else{this._data=this._data.subarray(0,d);const g=Object.keys(this._combined);for(let b=0;b<g.length;b++){const x=parseInt(g[b],10);x>=h&&delete this._combined[x]}const w=Object.keys(this._extendedAttrs);for(let b=0;b<w.length;b++){const x=parseInt(w[b],10);x>=h&&delete this._extendedAttrs[x]}}return this.length=h,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,f=!1){if(f)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,h);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const f in h._combined)this._combined[f]=h._combined[f];this._extendedAttrs={};for(const f in h._extendedAttrs)this._extendedAttrs[f]=h._extendedAttrs[f];this.isWrapped=h.isWrapped}clone(){const h=new y(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const f in this._combined)h._combined[f]=this._combined[f];for(const f in this._extendedAttrs)h._extendedAttrs[f]=this._extendedAttrs[f];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,f,d,g,w){const b=h._data;if(w)for(let C=g-1;C>=0;C--){for(let S=0;S<3;S++)this._data[3*(d+C)+S]=b[3*(f+C)+S];268435456&b[3*(f+C)+2]&&(this._extendedAttrs[d+C]=h._extendedAttrs[f+C])}else for(let C=0;C<g;C++){for(let S=0;S<3;S++)this._data[3*(d+C)+S]=b[3*(f+C)+S];268435456&b[3*(f+C)+2]&&(this._extendedAttrs[d+C]=h._extendedAttrs[f+C])}const x=Object.keys(h._combined);for(let C=0;C<x.length;C++){const S=parseInt(x[C],10);S>=f&&(this._combined[S-f+d]=h._combined[S])}}translateToString(h,f,d,g){f=f??0,d=d??this.length,h&&(d=Math.min(d,this.getTrimmedLength())),g&&(g.length=0);let w="";for(;f<d;){const b=this._data[3*f+0],x=2097151&b,C=2097152&b?this._combined[f]:x?(0,m.stringFromCodePoint)(x):u.WHITESPACE_CELL_CHAR;if(w+=C,g)for(let S=0;S<C.length;++S)g.push(f);f+=b>>22||1}return g&&g.push(f),w}}i.BufferLine=y},4841:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(l,i)=>{function o(c,p,u){if(p===c.length-1)return c[p].getTrimmedLength();const m=!c[p].hasContent(u-1)&&c[p].getWidth(u-1)===1,_=c[p+1].getWidth(0)===2;return m&&_?u-1:u}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(c,p,u,m,_){const y=[];for(let v=0;v<c.length-1;v++){let h=v,f=c.get(++h);if(!f.isWrapped)continue;const d=[c.get(v)];for(;h<c.length&&f.isWrapped;)d.push(f),f=c.get(++h);if(m>=v&&m<h){v+=d.length-1;continue}let g=0,w=o(d,g,p),b=1,x=0;for(;b<d.length;){const S=o(d,b,p),E=S-x,L=u-w,A=Math.min(E,L);d[g].copyCellsFrom(d[b],x,w,A,!1),w+=A,w===u&&(g++,w=0),x+=A,x===S&&(b++,x=0),w===0&&g!==0&&d[g-1].getWidth(u-1)===2&&(d[g].copyCellsFrom(d[g-1],u-1,w++,1,!1),d[g-1].setCell(u-1,_))}d[g].replaceCells(w,u,_);let C=0;for(let S=d.length-1;S>0&&(S>g||d[S].getTrimmedLength()===0);S--)C++;C>0&&(y.push(v+d.length-C),y.push(C)),v+=d.length-1}return y},i.reflowLargerCreateNewLayout=function(c,p){const u=[];let m=0,_=p[m],y=0;for(let v=0;v<c.length;v++)if(_===v){const h=p[++m];c.onDeleteEmitter.fire({index:v-y,amount:h}),v+=h-1,y+=h,_=p[++m]}else u.push(v);return{layout:u,countRemoved:y}},i.reflowLargerApplyNewLayout=function(c,p){const u=[];for(let m=0;m<p.length;m++)u.push(c.get(p[m]));for(let m=0;m<u.length;m++)c.set(m,u[m]);c.length=p.length},i.reflowSmallerGetNewLineLengths=function(c,p,u){const m=[],_=c.map((f,d)=>o(c,d,p)).reduce((f,d)=>f+d);let y=0,v=0,h=0;for(;h<_;){if(_-h<u){m.push(_-h);break}y+=u;const f=o(c,v,p);y>f&&(y-=f,v++);const d=c[v].getWidth(y-1)===2;d&&y--;const g=d?u-1:u;m.push(g),h+=g}return m},i.getWrappedLineTrimmedLength=o},5295:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const c=o(8460),p=o(844),u=o(9092);class m extends p.Disposable{constructor(y,v){super(),this._optionsService=y,this._bufferService=v,this._onBufferActivate=this.register(new c.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,v){this._normal.resize(y,v),this._alt.resize(y,v),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}i.BufferSet=m},511:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const c=o(482),p=o(643),u=o(3734);class m extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new m;return v.setFromCharData(y),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){const h=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=m},643:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const c=o(8460),p=o(844);class u{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}i.Marker=u,u._nextId=1},7116:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,i)=>{var o,c,p;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
60
+ `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(o||(i.C0=o={})),function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"}(c||(i.C1=c={})),function(u){u.ST=`${o.ESC}\\`}(p||(i.C1_ESCAPED=p={}))},7399:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const c=o(2584),p={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:["'",'"']};i.evaluateKeyboardEvent=function(u,m,_,y){const v={type:0,cancel:!1,key:void 0},h=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?v.key=m?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?v.key=m?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?v.key=m?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(v.key=m?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:v.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(v.key=c.C0.ESC+v.key);break;case 9:if(u.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,u.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(_?"b":"[1;5D"))):v.key=m?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(_?"f":"[1;5C"))):v.key=m?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"A",_||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=m?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"B",_||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=m?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=h?c.C0.ESC+"[3;"+(h+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=h?c.C0.ESC+"[1;"+(h+1)+"H":m?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=h?c.C0.ESC+"[1;"+(h+1)+"F":m?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?v.type=2:u.ctrlKey?v.key=c.C0.ESC+"[5;"+(h+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?v.type=3:u.ctrlKey?v.key=c.C0.ESC+"[6;"+(h+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=h?c.C0.ESC+"[1;"+(h+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=h?c.C0.ESC+"[1;"+(h+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=h?c.C0.ESC+"[1;"+(h+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=h?c.C0.ESC+"[1;"+(h+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=h?c.C0.ESC+"[15;"+(h+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=h?c.C0.ESC+"[17;"+(h+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=h?c.C0.ESC+"[18;"+(h+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=h?c.C0.ESC+"[19;"+(h+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=h?c.C0.ESC+"[20;"+(h+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=h?c.C0.ESC+"[21;"+(h+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=h?c.C0.ESC+"[23;"+(h+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=h?c.C0.ESC+"[24;"+(h+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(_&&!y||!u.altKey||u.metaKey)!_||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?v.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(v.key=c.C0.US),u.key==="@"&&(v.key=c.C0.NUL)):u.keyCode===65&&(v.type=1);else{const f=p[u.keyCode],d=f==null?void 0:f[u.shiftKey?1:0];if(d)v.key=c.C0.ESC+d;else if(u.keyCode>=65&&u.keyCode<=90){const g=u.ctrlKey?u.keyCode-64:u.keyCode+32;let w=String.fromCharCode(g);u.shiftKey&&(w=w.toUpperCase()),v.key=c.C0.ESC+w}else if(u.keyCode===32)v.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let g=u.code.slice(3,4);u.shiftKey||(g=g.toLowerCase()),v.key=c.C0.ESC+g,v.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?v.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?v.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?v.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?v.key=c.C0.DEL:u.keyCode===219?v.key=c.C0.ESC:u.keyCode===220?v.key=c.C0.FS:u.keyCode===221&&(v.key=c.C0.GS)}return v}},482:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},i.utf32ToString=function(o,c=0,p=o.length){let u="";for(let m=c;m<p;++m){let _=o[m];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const p=o.length;if(!p)return 0;let u=0,m=0;if(this._interim){const _=o.charCodeAt(m++);56320<=_&&_<=57343?c[u++]=1024*(this._interim-55296)+_-56320+65536:(c[u++]=this._interim,c[u++]=_),this._interim=0}for(let _=m;_<p;++_){const y=o.charCodeAt(_);if(55296<=y&&y<=56319){if(++_>=p)return this._interim=y,u;const v=o.charCodeAt(_);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const p=o.length;if(!p)return 0;let u,m,_,y,v=0,h=0,f=0;if(this.interim[0]){let w=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let x,C=0;for(;(x=63&this.interim[++C])&&C<4;)b<<=6,b|=x;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=S-C;for(;f<E;){if(f>=p)return 0;if(x=o[f++],(192&x)!=128){f--,w=!0;break}this.interim[C++]=x,b<<=6,b|=63&x}w||(S===2?b<128?f--:c[v++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(c[v++]=b):b<65536||b>1114111||(c[v++]=b)),this.interim.fill(0)}const d=p-4;let g=f;for(;g<p;){for(;!(!(g<d)||128&(u=o[g])||128&(m=o[g+1])||128&(_=o[g+2])||128&(y=o[g+3]));)c[v++]=u,c[v++]=m,c[v++]=_,c[v++]=y,g+=4;if(u=o[g++],u<128)c[v++]=u;else if((224&u)==192){if(g>=p)return this.interim[0]=u,v;if(m=o[g++],(192&m)!=128){g--;continue}if(h=(31&u)<<6|63&m,h<128){g--;continue}c[v++]=h}else if((240&u)==224){if(g>=p)return this.interim[0]=u,v;if(m=o[g++],(192&m)!=128){g--;continue}if(g>=p)return this.interim[0]=u,this.interim[1]=m,v;if(_=o[g++],(192&_)!=128){g--;continue}if(h=(15&u)<<12|(63&m)<<6|63&_,h<2048||h>=55296&&h<=57343||h===65279)continue;c[v++]=h}else if((248&u)==240){if(g>=p)return this.interim[0]=u,v;if(m=o[g++],(192&m)!=128){g--;continue}if(g>=p)return this.interim[0]=u,this.interim[1]=m,v;if(_=o[g++],(192&_)!=128){g--;continue}if(g>=p)return this.interim[0]=u,this.interim[1]=m,this.interim[2]=_,v;if(y=o[g++],(192&y)!=128){g--;continue}if(h=(7&u)<<18|(63&m)<<12|(63&_)<<6|63&y,h<65536||h>1114111)continue;c[v++]=h}}return v}}},225:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const c=o(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;i.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let _=0;_<p.length;++_)m.fill(0,p[_][0],p[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?m[_]:function(y,v){let h,f=0,d=v.length-1;if(y<v[0][0]||y>v[d][1])return!1;for(;d>=f;)if(h=f+d>>1,y>v[h][1])f=h+1;else{if(!(y<v[h][0]))return!0;d=h-1}return!1}(_,u)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,y){let v=this.wcwidth(_),h=v===0&&y!==0;if(h){const f=c.UnicodeService.extractWidth(y);f===0?h=!1:f>v&&(v=f)}return c.UnicodeService.createPropertyValue(0,v,h)}}},5981:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const c=o(8460),p=o(844);class u extends p.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,y){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(y)}_innerWrite(_=0,y=!0){const v=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],f=this._action(h,y);if(f){const g=w=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,w)):this._innerWrite(v,w);return void f.catch(w=>(queueMicrotask(()=>{throw w}),Promise.resolve(!1))).then(g)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-v>=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()}}i.WriteBuffer=u},5941:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const o=/^([\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})$/,c=/^[\da-f]+$/;function p(u,m){const _=u.toString(16),y=_.length<2?"0"+_:_;switch(m){case 4:return _[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}i.parseColor=function(u){if(!u)return;let m=u.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const _=o.exec(m);if(_){const y=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/y*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/y*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/y*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),c.exec(m)&&[3,6,9,12].includes(m.length))){const _=m.length/3,y=[0,0,0];for(let v=0;v<3;++v){const h=parseInt(m.slice(_*v,_*v+_),16);y[v]=_===1?h<<4:_===2?h:_===3?h>>4:h>>8}return y}},i.toRgbString=function(u,m=16){const[_,y,v]=u;return`rgb:${p(_,m)}/${p(y,m)}/${p(v,m)}`}},5770:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const c=o(482),p=o(8742),u=o(5770),m=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(y,v){this._handlers[y]===void 0&&(this._handlers[y]=[]);const h=this._handlers[y];return h.push(v),{dispose:()=>{const f=h.indexOf(v);f!==-1&&h.splice(f,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(y,v){if(this.reset(),this._ident=y,this._active=this._handlers[y]||m,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(y,v,h){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(y,v,h);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(y,v,h))}unhook(y,v=!0){if(this._active.length){let h=!1,f=this._active.length-1,d=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,h=v,d=this._stack.fallThrough,this._stack.paused=!1),!d&&h===!1){for(;f>=0&&(h=this._active[f].unhook(y),h!==!0);f--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,h;f--}for(;f>=0;f--)if(h=this._active[f].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",y);this._active=m,this._ident=0}};const _=new p.Params;_.addParam(0),i.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=_,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():_,this._data="",this._hitLimit=!1}put(y,v,h){this._hitLimit||(this._data+=(0,c.utf32ToString)(y,v,h),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let v=!1;if(this._hitLimit)v=!1;else if(y&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(h=>(this._params=_,this._data="",this._hitLimit=!1,h));return this._params=_,this._data="",this._hitLimit=!1,v}}},2015:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const c=o(844),p=o(8742),u=o(6242),m=o(6351);class _{constructor(f){this.table=new Uint8Array(f)}setDefault(f,d){this.table.fill(f<<4|d)}add(f,d,g,w){this.table[d<<8|f]=g<<4|w}addMany(f,d,g,w){for(let b=0;b<f.length;b++)this.table[d<<8|f[b]]=g<<4|w}}i.TransitionTable=_;const y=160;i.VT500_TRANSITION_TABLE=function(){const h=new _(4095),f=Array.apply(null,Array(256)).map((C,S)=>S),d=(C,S)=>f.slice(C,S),g=d(32,127),w=d(0,24);w.push(25),w.push.apply(w,d(28,32));const b=d(0,14);let x;for(x in h.setDefault(1,0),h.addMany(g,0,2,0),b)h.addMany([24,26,153,154],x,3,0),h.addMany(d(128,144),x,3,0),h.addMany(d(144,152),x,3,0),h.add(156,x,0,0),h.add(27,x,11,1),h.add(157,x,4,8),h.addMany([152,158,159],x,0,7),h.add(155,x,11,3),h.add(144,x,11,9);return h.addMany(w,0,3,0),h.addMany(w,1,3,1),h.add(127,1,0,1),h.addMany(w,8,0,8),h.addMany(w,3,3,3),h.add(127,3,0,3),h.addMany(w,4,3,4),h.add(127,4,0,4),h.addMany(w,6,3,6),h.addMany(w,5,3,5),h.add(127,5,0,5),h.addMany(w,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(g,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(d(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(g,7,0,7),h.addMany(w,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(d(64,127),3,7,0),h.addMany(d(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(d(48,60),4,8,4),h.addMany(d(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(d(32,64),6,0,6),h.add(127,6,0,6),h.addMany(d(64,127),6,0,0),h.addMany(d(32,48),3,9,5),h.addMany(d(32,48),5,9,5),h.addMany(d(48,64),5,0,6),h.addMany(d(64,127),5,7,0),h.addMany(d(32,48),4,9,5),h.addMany(d(32,48),1,9,2),h.addMany(d(32,48),2,9,2),h.addMany(d(48,127),2,10,0),h.addMany(d(48,80),1,10,0),h.addMany(d(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(d(96,127),1,10,0),h.add(80,1,11,9),h.addMany(w,9,0,9),h.add(127,9,0,9),h.addMany(d(28,32),9,0,9),h.addMany(d(32,48),9,9,12),h.addMany(d(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(w,11,0,11),h.addMany(d(32,128),11,0,11),h.addMany(d(28,32),11,0,11),h.addMany(w,10,0,10),h.add(127,10,0,10),h.addMany(d(28,32),10,0,10),h.addMany(d(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(d(32,48),10,9,12),h.addMany(w,12,0,12),h.add(127,12,0,12),h.addMany(d(28,32),12,0,12),h.addMany(d(32,48),12,9,12),h.addMany(d(48,64),12,0,11),h.addMany(d(64,127),12,12,13),h.addMany(d(64,127),10,12,13),h.addMany(d(64,127),9,12,13),h.addMany(w,13,13,13),h.addMany(g,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(y,0,2,0),h.add(y,8,5,8),h.add(y,6,0,6),h.add(y,11,0,11),h.add(y,13,13,13),h}();class v extends c.Disposable{constructor(f=i.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 p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,g,w)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,g)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,d=[64,126]){let g=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(g=f.prefix.charCodeAt(0),g&&60>g||g>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 b=0;b<f.intermediates.length;++b){const x=f.intermediates.charCodeAt(b);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");g<<=8,g|=x}}if(f.final.length!==1)throw new Error("final must be a single byte");const w=f.final.charCodeAt(0);if(d[0]>w||w>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return g<<=8,g|=w,g}identToString(f){const d=[];for(;f;)d.push(String.fromCharCode(255&f)),f>>=8;return d.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,d){const g=this._identifier(f,[48,126]);this._escHandlers[g]===void 0&&(this._escHandlers[g]=[]);const w=this._escHandlers[g];return w.push(d),{dispose:()=>{const b=w.indexOf(d);b!==-1&&w.splice(b,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,d){this._executeHandlers[f.charCodeAt(0)]=d}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,d){const g=this._identifier(f);this._csiHandlers[g]===void 0&&(this._csiHandlers[g]=[]);const w=this._csiHandlers[g];return w.push(d),{dispose:()=>{const b=w.indexOf(d);b!==-1&&w.splice(b,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,d){return this._dcsParser.registerHandler(this._identifier(f),d)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,d){return this._oscParser.registerHandler(f,d)}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,d,g,w,b){this._parseStack.state=f,this._parseStack.handlers=d,this._parseStack.handlerPos=g,this._parseStack.transition=w,this._parseStack.chunkPos=b}parse(f,d,g){let w,b=0,x=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(g===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(g===!1&&E>-1){for(;E>=0&&(w=S[E](this._params),w!==!0);E--)if(w instanceof Promise)return this._parseStack.handlerPos=E,w}this._parseStack.handlers=[];break;case 4:if(g===!1&&E>-1){for(;E>=0&&(w=S[E](),w!==!0);E--)if(w instanceof Promise)return this._parseStack.handlerPos=E,w}this._parseStack.handlers=[];break;case 6:if(b=f[this._parseStack.chunkPos],w=this._dcsParser.unhook(b!==24&&b!==26,g),w)return w;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(b=f[this._parseStack.chunkPos],w=this._oscParser.end(b!==24&&b!==26,g),w)return w;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let S=C;S<d;++S){switch(b=f[S],x=this._transitions.table[this.currentState<<8|(b<160?b:y)],x>>4){case 2:for(let T=S+1;;++T){if(T>=d||(b=f[T])<32||b>126&&b<y){this._printHandler(f,S,T),S=T-1;break}if(++T>=d||(b=f[T])<32||b>126&&b<y){this._printHandler(f,S,T),S=T-1;break}if(++T>=d||(b=f[T])<32||b>126&&b<y){this._printHandler(f,S,T),S=T-1;break}if(++T>=d||(b=f[T])<32||b>126&&b<y){this._printHandler(f,S,T),S=T-1;break}}break;case 3:this._executeHandlers[b]?this._executeHandlers[b]():this._executeHandlerFb(b),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:b,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|b];let L=E?E.length-1:-1;for(;L>=0&&(w=E[L](this._params),w!==!0);L--)if(w instanceof Promise)return this._preserveStack(3,E,L,x,S),w;L<0&&this._csiHandlerFb(this._collect<<8|b,this._params),this.precedingJoinState=0;break;case 8:do switch(b){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(b-48)}while(++S<d&&(b=f[S])>47&&b<60);S--;break;case 9:this._collect<<=8,this._collect|=b;break;case 10:const A=this._escHandlers[this._collect<<8|b];let M=A?A.length-1:-1;for(;M>=0&&(w=A[M](),w!==!0);M--)if(w instanceof Promise)return this._preserveStack(4,A,M,x,S),w;M<0&&this._escHandlerFb(this._collect<<8|b),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|b,this._params);break;case 13:for(let T=S+1;;++T)if(T>=d||(b=f[T])===24||b===26||b===27||b>127&&b<y){this._dcsParser.put(f,S,T),S=T-1;break}break;case 14:if(w=this._dcsParser.unhook(b!==24&&b!==26),w)return this._preserveStack(6,[],0,x,S),w;b===27&&(x|=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 T=S+1;;T++)if(T>=d||(b=f[T])<32||b>127&&b<y){this._oscParser.put(f,S,T),S=T-1;break}break;case 6:if(w=this._oscParser.end(b!==24&&b!==26),w)return this._preserveStack(5,[],0,x,S),w;b===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}i.EscapeSequenceParser=v},6242:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const c=o(5770),p=o(482),u=[];i.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,_){this._handlers[m]===void 0&&(this._handlers[m]=[]);const y=this._handlers[m];return y.push(_),{dispose:()=>{const v=y.indexOf(_);v!==-1&&y.splice(v,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,_,y){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(m,_,y);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(m,_,y))}start(){this.reset(),this._state=1}put(m,_,y){if(this._state!==3){if(this._state===1)for(;_<y;){const v=m[_++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&y-_>0&&this._put(m,_,y)}}end(m,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,v=this._active.length-1,h=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,y=_,h=this._stack.fallThrough,this._stack.paused=!1),!h&&y===!1){for(;v>=0&&(y=this._active[v].end(m),y!==!0);v--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,y;v--}for(;v>=0;v--)if(y=this._active[v].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",m);this._active=u,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,_,y){this._hitLimit||(this._data+=(0,p.utf32ToString)(m,_,y),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let _=!1;if(this._hitLimit)_=!1;else if(m&&(_=this._handler(this._data),_ instanceof Promise))return _.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,_}}},8742:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const o=2147483647;class c{static fromArray(u){const m=new c;if(!u.length)return m;for(let _=Array.isArray(u[0])?1:0;_<u.length;++_){const y=u[_];if(Array.isArray(y))for(let v=0;v<y.length;++v)m.addSubParam(y[v]);else m.addParam(y)}return m}constructor(u=32,m=32){if(this.maxLength=u,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let m=0;m<this.length;++m){u.push(this.params[m]);const _=this._subParamsIdx[m]>>8,y=255&this._subParamsIdx[m];y-_>0&&u.push(Array.prototype.slice.call(this._subParams,_,y))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>o?o:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>o?o:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const m=this._subParamsIdx[u]>>8,_=255&this._subParamsIdx[u];return _-m>0?this._subParams.subarray(m,_):null}getSubParamsAll(){const u={};for(let m=0;m<this.length;++m){const _=this._subParamsIdx[m]>>8,y=255&this._subParamsIdx[m];y-_>0&&(u[m]=this._subParams.slice(_,y))}return u}addDigit(u){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,y=_[m-1];_[m-1]=~y?Math.min(10*y+u,o):u}}i.Params=c},5741:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const p={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(p),c.dispose=()=>this._wrappedAddonDispose(p),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===o){c=p;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const c=o(3785),p=o(511);i.BufferApiView=class{constructor(u,m){this._buffer=u,this.type=m}init(u){return this._buffer=u,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(u){const m=this._buffer.lines.get(u);if(m)return new c.BufferLineApiView(m)}getNullCell(){return new p.CellData}}},3785:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const c=o(511);i.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new c.CellData)}translateToString(p,u,m){return this._line.translateToString(p,u,m)}}},8285:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const c=o(8771),p=o(8460),u=o(844);class m extends u.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}i.BufferNamespaceApi=m},7975:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,p=>c(p.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(p,u)=>c(p,u.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(l,i,o){var c=this&&this.__decorate||function(h,f,d,g){var w,b=arguments.length,x=b<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,f,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(f,d,x):w(f,d))||x);return b>3&&x&&Object.defineProperty(f,d,x),x},p=this&&this.__param||function(h,f){return function(d,g){f(d,g,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const u=o(8460),m=o(844),_=o(5295),y=o(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let v=i.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(h,this))}resize(h,f){this.cols=h,this.rows=f,this.buffers.resize(h,f),this._onResize.fire({cols:h,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,f=!1){const d=this.buffer;let g;g=this._cachedBlankLine,g&&g.length===this.cols&&g.getFg(0)===h.fg&&g.getBg(0)===h.bg||(g=d.getBlankLine(h,f),this._cachedBlankLine=g),g.isWrapped=f;const w=d.ybase+d.scrollTop,b=d.ybase+d.scrollBottom;if(d.scrollTop===0){const x=d.lines.isFull;b===d.lines.length-1?x?d.lines.recycle().copyFrom(g):d.lines.push(g.clone()):d.lines.splice(b+1,0,g.clone()),x?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const x=b-w+1;d.lines.shiftElements(w+1,x-1,-1),d.lines.set(b,g.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(h,f,d){const g=this.buffer;if(h<0){if(g.ydisp===0)return;this.isUserScrolling=!0}else h+g.ydisp>=g.ybase&&(this.isUserScrolling=!1);const w=g.ydisp;g.ydisp=Math.max(Math.min(g.ydisp+h,g.ybase),0),w!==g.ydisp&&(f||this._onScroll.fire(g.ydisp))}};i.BufferService=v=c([p(0,y.IOptionsService)],v)},7994:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(l,i,o){var c=this&&this.__decorate||function(g,w,b,x){var C,S=arguments.length,E=S<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,w,b,x);else for(var L=g.length-1;L>=0;L--)(C=g[L])&&(E=(S<3?C(E):S>3?C(w,b,E):C(w,b))||E);return S>3&&E&&Object.defineProperty(w,b,E),E},p=this&&this.__param||function(g,w){return function(b,x){w(b,x,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const u=o(2585),m=o(8460),_=o(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:g=>g.button!==4&&g.action===1&&(g.ctrl=!1,g.alt=!1,g.shift=!1,!0)},VT200:{events:19,restrict:g=>g.action!==32},DRAG:{events:23,restrict:g=>g.action!==32||g.button!==3},ANY:{events:31,restrict:g=>!0}};function v(g,w){let b=(g.ctrl?16:0)|(g.shift?4:0)|(g.alt?8:0);return g.button===4?(b|=64,b|=g.action):(b|=3&g.button,4&g.button&&(b|=64),8&g.button&&(b|=128),g.action===32?b|=32:g.action!==0||w||(b|=3)),b}const h=String.fromCharCode,f={DEFAULT:g=>{const w=[v(g,!1)+32,g.col+32,g.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${h(w[0])}${h(w[1])}${h(w[2])}`},SGR:g=>{const w=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${v(g,!0)};${g.col};${g.row}${w}`},SGR_PIXELS:g=>{const w=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${v(g,!0)};${g.x};${g.y}${w}`}};let d=i.CoreMouseService=class extends _.Disposable{constructor(g,w){super(),this._bufferService=g,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const b of Object.keys(y))this.addProtocol(b,y[b]);for(const b of Object.keys(f))this.addEncoding(b,f[b]);this.reset()}addProtocol(g,w){this._protocols[g]=w}addEncoding(g,w){this._encodings[g]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(g){if(!this._protocols[g])throw new Error(`unknown protocol "${g}"`);this._activeProtocol=g,this._onProtocolChange.fire(this._protocols[g].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(g){if(!this._encodings[g])throw new Error(`unknown encoding "${g}"`);this._activeEncoding=g}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(g){if(g.col<0||g.col>=this._bufferService.cols||g.row<0||g.row>=this._bufferService.rows||g.button===4&&g.action===32||g.button===3&&g.action!==32||g.button!==4&&(g.action===2||g.action===3)||(g.col++,g.row++,g.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,g,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(g))return!1;const w=this._encodings[this._activeEncoding](g);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=g,!0}explainEvents(g){return{down:!!(1&g),up:!!(2&g),drag:!!(4&g),move:!!(8&g),wheel:!!(16&g)}}_equalEvents(g,w,b){if(b){if(g.x!==w.x||g.y!==w.y)return!1}else if(g.col!==w.col||g.row!==w.row)return!1;return g.button===w.button&&g.action===w.action&&g.ctrl===w.ctrl&&g.alt===w.alt&&g.shift===w.shift}};i.CoreMouseService=d=c([p(0,u.IBufferService),p(1,u.ICoreService)],d)},6975:function(l,i,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var E=d.length-1;E>=0;E--)(x=d[E])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},p=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const u=o(1439),m=o(8460),_=o(844),y=o(2585),v=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=i.CoreService=class extends _.Disposable{constructor(d,g,w){super(),this._bufferService=d,this._logService=g,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(h)}reset(){this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(h)}triggerDataEvent(d,g=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;g&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),g&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,()=>d.split("").map(b=>b.charCodeAt(0))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,()=>d.split("").map(g=>g.charCodeAt(0))),this._onBinary.fire(d))}};i.CoreService=f=c([p(0,y.IBufferService),p(1,y.ILogService),p(2,y.IOptionsService)],f)},9074:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const c=o(8055),p=o(8460),u=o(844),m=o(6106);let _=0,y=0;class v extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(d=>d==null?void 0:d.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(d){if(d.marker.isDisposed)return;const g=new h(d);if(g){const w=g.marker.onDispose(()=>g.dispose());g.onDispose(()=>{g&&(this._decorations.delete(g)&&this._onDecorationRemoved.fire(g),w.dispose())}),this._decorations.insert(g),this._onDecorationRegistered.fire(g)}return g}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,g,w){let b=0,x=0;for(const C of this._decorations.getKeyIterator(g))b=C.options.x??0,x=b+(C.options.width??1),d>=b&&d<x&&(!w||(C.options.layer??"bottom")===w)&&(yield C)}forEachDecorationAtCell(d,g,w,b){this._decorations.forEachByKey(g,x=>{_=x.options.x??0,y=_+(x.options.width??1),d>=_&&d<y&&(!w||(x.options.layer??"bottom")===w)&&b(x)})}}i.DecorationService=v;class h extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const c=o(2585),p=o(8343);class u{constructor(..._){this._entries=new Map;for(const[y,v]of _)this.set(y,v)}set(_,y){const v=this._entries.get(_);return this._entries.set(_,y),v}forEach(_){for(const[y,v]of this._entries.entries())_(y,v)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}i.ServiceCollection=u,i.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(m,_){this._services.set(m,_)}getService(m){return this._services.get(m)}createInstance(m,..._){const y=(0,p.getServiceDependencies)(m).sort((f,d)=>f.index-d.index),v=[];for(const f of y){const d=this._services.get(f.id);if(!d)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${f.id}.`);v.push(d)}const h=y.length>0?y[0].index:_.length;if(_.length!==h)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${h+1} conflicts with ${_.length} static arguments`);return new m(..._,...v)}}},7866:function(l,i,o){var c=this&&this.__decorate||function(h,f,d,g){var w,b=arguments.length,x=b<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,f,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(f,d,x):w(f,d))||x);return b>3&&x&&Object.defineProperty(f,d,x),x},p=this&&this.__param||function(h,f){return function(d,g){f(d,g,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const u=o(844),m=o(2585),_={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let y,v=i.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};i.LogService=v=c([p(0,m.IOptionsService)],v),i.setTraceLogger=function(h){y=h},i.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const g=d.value;d.value=function(...w){if(y.logLevel!==m.LogLevelEnum.TRACE)return g.apply(this,w);y.trace(`GlyphRenderer#${g.name}(${w.map(x=>JSON.stringify(x)).join(", ")})`);const b=g.apply(this,w);return y.trace(`GlyphRenderer#${g.name} return`,b),b}}},7302:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const c=o(8460),p=o(844),u=o(6114);i.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:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends p.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h={...i.DEFAULT_OPTIONS};for(const f in v)if(f in h)try{const d=v[f];h[f]=this._sanitizeAndValidateOption(f,d)}catch(d){console.error(d)}this.rawOptions=h,this.options={...h},this._setupOptions(),this.register((0,p.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,h){return this.onOptionChange(f=>{f===v&&h(this.rawOptions[v])})}onMultipleOptionChange(v,h){return this.onOptionChange(f=>{v.indexOf(f)!==-1&&h()})}_setupOptions(){const v=f=>{if(!(f in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},h=(f,d)=>{if(!(f in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);d=this._sanitizeAndValidateOption(f,d),this.rawOptions[f]!==d&&(this.rawOptions[f]=d,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const d={get:v.bind(this,f),set:h.bind(this,f)};Object.defineProperty(this.options,f,d)}}_sanitizeAndValidateOption(v,h){switch(v){case"cursorStyle":if(h||(h=i.DEFAULT_OPTIONS[v]),!function(f){return f==="block"||f==="underline"||f==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${v}`);break;case"wordSeparator":h||(h=i.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=m.includes(h)?h:i.DEFAULT_OPTIONS[v];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${v} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${v} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}i.OptionsService=_},2660:function(l,i,o){var c=this&&this.__decorate||function(_,y,v,h){var f,d=arguments.length,g=d<3?y:h===null?h=Object.getOwnPropertyDescriptor(y,v):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(_,y,v,h);else for(var w=_.length-1;w>=0;w--)(f=_[w])&&(g=(d<3?f(g):d>3?f(y,v,g):f(y,v))||g);return d>3&&g&&Object.defineProperty(y,v,g),g},p=this&&this.__param||function(_,y){return function(v,h){y(v,h,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const u=o(2585);let m=i.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const y=this._bufferService.buffer;if(_.id===void 0){const w=y.addMarker(y.ybase+y.y),b={data:_,id:this._nextId++,lines:[w]};return w.onDispose(()=>this._removeMarkerFromLink(b,w)),this._dataByLinkId.set(b.id,b),b.id}const v=_,h=this._getEntryIdKey(v),f=this._entriesWithId.get(h);if(f)return this.addLineToLink(f.id,y.ybase+y.y),f.id;const d=y.addMarker(y.ybase+y.y),g={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(g,d)),this._entriesWithId.set(g.key,g),this._dataByLinkId.set(g.id,g),g.id}addLineToLink(_,y){const v=this._dataByLinkId.get(_);if(v&&v.lines.every(h=>h.line!==y)){const h=this._bufferService.buffer.addMarker(y);v.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(v,h))}}getLinkData(_){var y;return(y=this._dataByLinkId.get(_))==null?void 0:y.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,y){const v=_.lines.indexOf(y);v!==-1&&(_.lines.splice(v,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};i.OscLinkService=m=c([p(0,u.IBufferService)],m)},8343:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const o="di$target",c="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(p){return p[c]||[]},i.createDecorator=function(p){if(i.serviceRegistry.has(p))return i.serviceRegistry.get(p);const u=function(m,_,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,h,f){h[o]===h?h[c].push({id:v,index:f}):(h[c]=[{id:v,index:f}],h[o]=h)})(u,m,y)};return u.toString=()=>p,i.serviceRegistry.set(p,u),u}},2585:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const c=o(8343);var p;i.IBufferService=(0,c.createDecorator)("BufferService"),i.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),i.ICoreService=(0,c.createDecorator)("CoreService"),i.ICharsetService=(0,c.createDecorator)("CharsetService"),i.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(i.LogLevelEnum=p={})),i.ILogService=(0,c.createDecorator)("LogService"),i.IOptionsService=(0,c.createDecorator)("OptionsService"),i.IOscLinkService=(0,c.createDecorator)("OscLinkService"),i.IUnicodeService=(0,c.createDecorator)("UnicodeService"),i.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const c=o(8460),p=o(225);class u{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,y,v=!1){return(16777215&_)<<3|(3&y)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new p.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let y=0,v=0;const h=_.length;for(let f=0;f<h;++f){let d=_.charCodeAt(f);if(55296<=d&&d<=56319){if(++f>=h)return y+this.wcwidth(d);const b=_.charCodeAt(f);56320<=b&&b<=57343?d=1024*(d-55296)+b-56320+65536:y+=this.wcwidth(b)}const g=this.charProperties(d,v);let w=u.extractWidth(g);u.extractShouldJoin(g)&&(w-=u.extractWidth(v)),y+=w,v=g}return y}charProperties(_,y){return this._activeProvider.charProperties(_,y)}}i.UnicodeService=u}},n={};function s(l){var i=n[l];if(i!==void 0)return i.exports;var o=n[l]={exports:{}};return r[l].call(o.exports,o,o.exports,s),o.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const i=s(9042),o=s(3236),c=s(844),p=s(5741),u=s(8285),m=s(7975),_=s(7090),y=["cols","rows"];class v extends c.Disposable{constructor(f){super(),this._core=this.register(new o.Terminal(f)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const d=w=>this._core.options[w],g=(w,b)=>{this._checkReadonlyOptions(w),this._core.options[w]=b};for(const w in this._core.options){const b={get:d.bind(this,w),set:g.bind(this,w)};Object.defineProperty(this._publicOptions,w,b)}}_checkReadonlyOptions(f){if(y.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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const d in f)this._publicOptions[d]=f[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(f,d=!0){this._core.input(f,d)}resize(f,d){this._verifyIntegers(f,d),this._core.resize(f,d)}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,d,g){this._verifyIntegers(f,d,g),this._core.select(f,d,g)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,d){this._verifyIntegers(f,d),this._core.selectLines(f,d)}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,d){this._core.write(f,d)}writeln(f,d){this._core.write(f),this._core.write(`\r
61
+ `,d)}paste(f){this._core.paste(f)}refresh(f,d){this._verifyIntegers(f,d),this._core.refresh(f,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return i}_verifyIntegers(...f){for(const d of f)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const d of f)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}l.Terminal=v})(),a})())})(N1);var HR=N1.exports;/**
62
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
63
+ * @license MIT
64
+ *
65
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
66
+ * @license MIT
67
+ *
68
+ * Originally forked from (with the author's permission):
69
+ * Fabrice Bellard's javascript vt100 for jslinux:
70
+ * http://bellard.org/jslinux/
71
+ * Copyright (c) 2011 Fabrice Bellard
72
+ */var zR=2,UR=1,WR=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let r=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(r._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let r=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(n.getPropertyValue("height")),a=Math.max(0,parseInt(n.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),i={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},o=i.top+i.bottom,c=i.right+i.left,p=s-o,u=a-c-r;return{cols:Math.max(zR,Math.floor(u/t.css.cell.width)),rows:Math.max(UR,Math.floor(p/t.css.cell.height))}}},F1={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={965:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GlyphRenderer=void 0;const c=o(374),p=o(509),u=o(855),m=o(859),_=o(381),y=11,v=y*Float32Array.BYTES_PER_ELEMENT;let h,f=0,d=0,g=0;class w extends m.Disposable{constructor(x,C,S,E){super(),this._terminal=x,this._gl=C,this._dimensions=S,this._optionsService=E,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;p.TextureAtlas.maxAtlasPages===void 0&&(p.TextureAtlas.maxAtlasPages=Math.min(32,(0,c.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),p.TextureAtlas.maxTextureSize=(0,c.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,c.throwIfFalsy)((0,_.createProgram)(L,`#version 300 es
73
+ layout (location = 0) in vec2 a_unitquad;
74
+ layout (location = 1) in vec2 a_cellpos;
75
+ layout (location = 2) in vec2 a_offset;
76
+ layout (location = 3) in vec2 a_size;
77
+ layout (location = 4) in float a_texpage;
78
+ layout (location = 5) in vec2 a_texcoord;
79
+ layout (location = 6) in vec2 a_texsize;
80
+
81
+ uniform mat4 u_projection;
82
+ uniform vec2 u_resolution;
83
+
84
+ out vec2 v_texcoord;
85
+ flat out int v_texpage;
86
+
87
+ void main() {
88
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
89
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
90
+ v_texpage = int(a_texpage);
91
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
92
+ }`,function(j){let $="";for(let O=1;O<j;O++)$+=` else if (v_texpage == ${O}) { outColor = texture(u_texture[${O}], v_texcoord); }`;return`#version 300 es
93
+ precision lowp float;
94
+
95
+ in vec2 v_texcoord;
96
+ flat in int v_texpage;
97
+
98
+ uniform sampler2D u_texture[${j}];
99
+
100
+ out vec4 outColor;
101
+
102
+ void main() {
103
+ if (v_texpage == 0) {
104
+ outColor = texture(u_texture[0], v_texcoord);
105
+ } ${$}
106
+ }`}(p.TextureAtlas.maxAtlasPages))),this.register((0,m.toDisposable)(()=>L.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,c.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,c.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const A=new Float32Array([0,0,1,0,0,1,1,1]),M=L.createBuffer();this.register((0,m.toDisposable)(()=>L.deleteBuffer(M))),L.bindBuffer(L.ARRAY_BUFFER,M),L.bufferData(L.ARRAY_BUFFER,A,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const T=new Uint8Array([0,1,2,3]),B=L.createBuffer();this.register((0,m.toDisposable)(()=>L.deleteBuffer(B))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,B),L.bufferData(L.ELEMENT_ARRAY_BUFFER,T,L.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(L.createBuffer()),this.register((0,m.toDisposable)(()=>L.deleteBuffer(this._attributesBuffer))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,v,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,v,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,v,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,v,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,v,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,v,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const H=new Int32Array(p.TextureAtlas.maxAtlasPages);for(let j=0;j<p.TextureAtlas.maxAtlasPages;j++)H[j]=j;L.uniform1iv(this._textureLocation,H),L.uniformMatrix4fv(this._projectionLocation,!1,_.PROJECTION_MATRIX),this._atlasTextures=[];for(let j=0;j<p.TextureAtlas.maxAtlasPages;j++){const $=new _.GLTexture((0,c.throwIfFalsy)(L.createTexture()));this.register((0,m.toDisposable)(()=>L.deleteTexture($.texture))),L.activeTexture(L.TEXTURE0+j),L.bindTexture(L.TEXTURE_2D,$.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[j]=$}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(x,C,S,E,L,A,M,T,B){this._updateCell(this._vertices.attributes,x,C,S,E,L,A,M,T,B)}_updateCell(x,C,S,E,L,A,M,T,B,H){f=(S*this._terminal.cols+C)*y,E!==u.NULL_CELL_CODE&&E!==void 0?this._atlas&&(h=T&&T.length>1?this._atlas.getRasterizedGlyphCombinedChar(T,L,A,M,!1):this._atlas.getRasterizedGlyph(E,L,A,M,!1),d=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==H&&h.offset.x>d?(g=h.offset.x-d,x[f]=-(h.offset.x-g)+this._dimensions.device.char.left,x[f+1]=-h.offset.y+this._dimensions.device.char.top,x[f+2]=(h.size.x-g)/this._dimensions.device.canvas.width,x[f+3]=h.size.y/this._dimensions.device.canvas.height,x[f+4]=h.texturePage,x[f+5]=h.texturePositionClipSpace.x+g/this._atlas.pages[h.texturePage].canvas.width,x[f+6]=h.texturePositionClipSpace.y,x[f+7]=h.sizeClipSpace.x-g/this._atlas.pages[h.texturePage].canvas.width,x[f+8]=h.sizeClipSpace.y):(x[f]=-h.offset.x+this._dimensions.device.char.left,x[f+1]=-h.offset.y+this._dimensions.device.char.top,x[f+2]=h.size.x/this._dimensions.device.canvas.width,x[f+3]=h.size.y/this._dimensions.device.canvas.height,x[f+4]=h.texturePage,x[f+5]=h.texturePositionClipSpace.x,x[f+6]=h.texturePositionClipSpace.y,x[f+7]=h.sizeClipSpace.x,x[f+8]=h.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,c.allowRescaling)(E,B,h.size.x,this._dimensions.device.cell.width)&&(x[f+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):x.fill(0,f,f+y-1-2)}clear(){const x=this._terminal,C=x.cols*x.rows*y;this._vertices.count!==C?this._vertices.attributes=new Float32Array(C):this._vertices.attributes.fill(0);let S=0;for(;S<this._vertices.attributesBuffers.length;S++)this._vertices.count!==C?this._vertices.attributesBuffers[S]=new Float32Array(C):this._vertices.attributesBuffers[S].fill(0);this._vertices.count=C,S=0;for(let E=0;E<x.rows;E++)for(let L=0;L<x.cols;L++)this._vertices.attributes[S+9]=L/x.cols,this._vertices.attributes[S+10]=E/x.rows,S+=y}handleResize(){const x=this._gl;x.useProgram(this._program),x.viewport(0,0,x.canvas.width,x.canvas.height),x.uniform2f(this._resolutionLocation,x.canvas.width,x.canvas.height),this.clear()}render(x){if(!this._atlas)return;const C=this._gl;C.useProgram(this._program),C.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const S=this._vertices.attributesBuffers[this._activeBuffer];let E=0;for(let L=0;L<x.lineLengths.length;L++){const A=L*this._terminal.cols*y,M=this._vertices.attributes.subarray(A,A+x.lineLengths[L]*y);S.set(M,E),E+=M.length}C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.bufferData(C.ARRAY_BUFFER,S.subarray(0,E),C.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(C,this._atlas,L);C.drawElementsInstanced(C.TRIANGLE_STRIP,4,C.UNSIGNED_BYTE,0,E/y)}setAtlas(x){this._atlas=x;for(const C of this._atlasTextures)C.version=-1}_bindAtlasPageTexture(x,C,S){x.activeTexture(x.TEXTURE0+S),x.bindTexture(x.TEXTURE_2D,this._atlasTextures[S].texture),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,C.pages[S].canvas),x.generateMipmap(x.TEXTURE_2D),this._atlasTextures[S].version=C.pages[S].version}setDimensions(x){this._dimensions=x}}i.GlyphRenderer=w},742:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RectangleRenderer=void 0;const c=o(374),p=o(859),u=o(310),m=o(381),_=8*Float32Array.BYTES_PER_ELEMENT;class y{constructor(){this.attributes=new Float32Array(160),this.count=0}}let v=0,h=0,f=0,d=0,g=0,w=0,b=0;class x extends p.Disposable{constructor(S,E,L,A){super(),this._terminal=S,this._gl=E,this._dimensions=L,this._themeService=A,this._vertices=new y,this._verticesCursor=new y;const M=this._gl;this._program=(0,c.throwIfFalsy)((0,m.createProgram)(M,`#version 300 es
107
+ layout (location = 0) in vec2 a_position;
108
+ layout (location = 1) in vec2 a_size;
109
+ layout (location = 2) in vec4 a_color;
110
+ layout (location = 3) in vec2 a_unitquad;
111
+
112
+ uniform mat4 u_projection;
113
+
114
+ out vec4 v_color;
115
+
116
+ void main() {
117
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
118
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
119
+ v_color = a_color;
120
+ }`,`#version 300 es
121
+ precision lowp float;
122
+
123
+ in vec4 v_color;
124
+
125
+ out vec4 outColor;
126
+
127
+ void main() {
128
+ outColor = v_color;
129
+ }`)),this.register((0,p.toDisposable)(()=>M.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const T=new Float32Array([0,0,1,0,0,1,1,1]),B=M.createBuffer();this.register((0,p.toDisposable)(()=>M.deleteBuffer(B))),M.bindBuffer(M.ARRAY_BUFFER,B),M.bufferData(M.ARRAY_BUFFER,T,M.STATIC_DRAW),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const H=new Uint8Array([0,1,2,3]),j=M.createBuffer();this.register((0,p.toDisposable)(()=>M.deleteBuffer(j))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,j),M.bufferData(M.ELEMENT_ARRAY_BUFFER,H,M.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(M.createBuffer()),this.register((0,p.toDisposable)(()=>M.deleteBuffer(this._attributesBuffer))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,M.FLOAT,!1,_,0),M.vertexAttribDivisor(0,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,_,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,4,M.FLOAT,!1,_,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(2,1),this._updateCachedColors(A.colors),this.register(this._themeService.onChangeColors($=>{this._updateCachedColors($),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(S){const E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),E.uniformMatrix4fv(this._projectionLocation,!1,m.PROJECTION_MATRIX),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,S.attributes,E.DYNAMIC_DRAW),E.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,S.count)}handleResize(){this._updateViewportRectangle()}setDimensions(S){this._dimensions=S}_updateCachedColors(S){this._bgFloat=this._colorToFloat32Array(S.background),this._cursorFloat=this._colorToFloat32Array(S.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(S){const E=this._terminal,L=this._vertices;let A,M,T,B,H,j,$,O,R,P,N,F=1;for(A=0;A<E.rows;A++){for(T=-1,B=0,H=0,j=!1,M=0;M<E.cols;M++)$=(A*E.cols+M)*u.RENDER_MODEL_INDICIES_PER_CELL,O=S.cells[$+u.RENDER_MODEL_BG_OFFSET],R=S.cells[$+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&R),(O!==B||R!==H&&(j||P))&&((B!==0||j&&H!==0)&&(N=8*F++,this._updateRectangle(L,N,H,B,T,M,A)),T=M,B=O,H=R,j=P);(B!==0||j&&H!==0)&&(N=8*F++,this._updateRectangle(L,N,H,B,T,E.cols,A))}L.count=F}updateCursor(S){const E=this._verticesCursor,L=S.cursor;if(!L||L.style==="block")return void(E.count=0);let A,M=0;L.style!=="bar"&&L.style!=="outline"||(A=8*M++,this._addRectangleFloat(E.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(A=8*M++,this._addRectangleFloat(E.attributes,A,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(A=8*M++,this._addRectangleFloat(E.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),A=8*M++,this._addRectangleFloat(E.attributes,A,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),E.count=M}_updateRectangle(S,E,L,A,M,T,B){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:v=(16777215&L)<<8;break;default:v=this._themeService.colors.foreground.rgba}else switch(50331648&A){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&A].rgba;break;case 50331648:v=(16777215&A)<<8;break;default:v=this._themeService.colors.background.rgba}S.attributes.length<E+4&&(S.attributes=(0,m.expandFloat32Array)(S.attributes,this._terminal.rows*this._terminal.cols*8)),h=M*this._dimensions.device.cell.width,f=B*this._dimensions.device.cell.height,d=(v>>24&255)/255,g=(v>>16&255)/255,w=(v>>8&255)/255,b=1,this._addRectangle(S.attributes,E,h,f,(T-M)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,d,g,w,b)}_addRectangle(S,E,L,A,M,T,B,H,j,$){S[E]=L/this._dimensions.device.canvas.width,S[E+1]=A/this._dimensions.device.canvas.height,S[E+2]=M/this._dimensions.device.canvas.width,S[E+3]=T/this._dimensions.device.canvas.height,S[E+4]=B,S[E+5]=H,S[E+6]=j,S[E+7]=$}_addRectangleFloat(S,E,L,A,M,T,B){S[E]=L/this._dimensions.device.canvas.width,S[E+1]=A/this._dimensions.device.canvas.height,S[E+2]=M/this._dimensions.device.canvas.width,S[E+3]=T/this._dimensions.device.canvas.height,S[E+4]=B[0],S[E+5]=B[1],S[E+6]=B[2],S[E+7]=B[3]}_colorToFloat32Array(S){return new Float32Array([(S.rgba>>24&255)/255,(S.rgba>>16&255)/255,(S.rgba>>8&255)/255,(255&S.rgba)/255])}}i.RectangleRenderer=x},310:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderModel=i.COMBINED_CHAR_BIT_MASK=i.RENDER_MODEL_EXT_OFFSET=i.RENDER_MODEL_FG_OFFSET=i.RENDER_MODEL_BG_OFFSET=i.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=o(296);i.RENDER_MODEL_INDICIES_PER_CELL=4,i.RENDER_MODEL_BG_OFFSET=1,i.RENDER_MODEL_FG_OFFSET=2,i.RENDER_MODEL_EXT_OFFSET=3,i.COMBINED_CHAR_BIT_MASK=2147483648,i.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(p,u){const m=p*u*i.RENDER_MODEL_INDICIES_PER_CELL;m!==this.cells.length&&(this.cells=new Uint32Array(m),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.JoinedCellData=i.WebglRenderer=void 0;const c=o(820),p=o(274),u=o(627),m=o(457),_=o(56),y=o(374),v=o(345),h=o(859),f=o(147),d=o(782),g=o(855),w=o(965),b=o(742),x=o(310),C=o(733);class S extends h.Disposable{constructor(M,T,B,H,j,$,O,R,P){super(),this._terminal=M,this._characterJoinerService=T,this._charSizeService=B,this._coreBrowserService=H,this._coreService=j,this._decorationService=$,this._optionsService=O,this._themeService=R,this._cursorBlinkStateManager=new h.MutableDisposable,this._charAtlasDisposable=this.register(new h.MutableDisposable),this._observerDisposable=this.register(new h.MutableDisposable),this._model=new x.RenderModel,this._workCell=new d.CellData,this._workCell2=new d.CellData,this._rectangleRenderer=this.register(new h.MutableDisposable),this._glyphRenderer=this.register(new h.MutableDisposable),this._onChangeTextureAtlas=this.register(new v.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new v.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new v.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new v.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new p.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new C.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,O,this._themeService)],this.dimensions=(0,y.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(O.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const N={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",N),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextlost",F=>{console.log("webglcontextlost event received"),F.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(F)},3e3)})),this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextrestored",F=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,u.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(F,V)=>this._setCanvasDevicePixelDimensions(F,V)),this.register(this._coreBrowserService.onWindowChange(F=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._canvas,F,(V,q)=>this._setCanvasDevicePixelDimensions(V,q))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,h.toDisposable)(()=>{var F;for(const V of this._renderLayers)V.dispose();(F=this._canvas.parentElement)==null||F.removeChild(this._canvas),(0,u.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var M;return(M=this._charAtlas)==null?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,T){var B,H,j,$;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const O of this._renderLayers)O.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(B=this._rectangleRenderer.value)==null||B.setDimensions(this.dimensions),(H=this._rectangleRenderer.value)==null||H.handleResize(),(j=this._glyphRenderer.value)==null||j.setDimensions(this.dimensions),($=this._glyphRenderer.value)==null||$.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const T of this._renderLayers)T.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const T of this._renderLayers)T.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,T,B){for(const H of this._renderLayers)H.handleSelectionChanged(this._terminal,M,T,B);this._model.selection.update(this._core,M,T,B),this._requestRedrawViewport()}handleCursorMove(){var M;for(const T of this._renderLayers)T.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new b.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new w.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var T;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const M=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==M&&(this._onChangeTextureAtlas.fire(M.pages[0].canvas),this._charAtlasDisposable.value=(0,h.getDisposeArrayDisposable)([(0,v.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,v.forwardEvent)(M.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=M,this._charAtlas.warmUp(),(T=this._glyphRenderer.value)==null||T.setAtlas(this._charAtlas)}_clearModel(M){var T;this._model.clear(),M&&((T=this._glyphRenderer.value)==null||T.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)==null||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const T of this._renderLayers)T.reset(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,T){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const B of this._renderLayers)B.handleGridChanged(this._terminal,M,T);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,T),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new m.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,T){const B=this._core;let H,j,$,O,R,P,N,F,V,q,Q,Z,z,I,K=this._workCell;M=L(M,B.rows-1,0),T=L(T,B.rows-1,0);const U=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,J=U-B.buffer.ydisp,G=Math.min(this._terminal.buffer.active.cursorX,B.cols-1);let ae=-1;const le=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let me=!1;for(j=M;j<=T;j++)for($=j+B.buffer.ydisp,O=B.buffer.lines.get($),this._model.lineLengths[j]=0,R=this._characterJoinerService.getJoinedCharacters($),z=0;z<B.cols;z++)if(H=this._cellColorResolver.result.bg,O.loadCell(z,K),z===0&&(H=this._cellColorResolver.result.bg),P=!1,N=z,R.length>0&&z===R[0][0]&&(P=!0,F=R.shift(),K=new E(K,O.translateToString(!0,F[0],F[1]),F[1]-F[0]),N=F[1]-1),V=K.getChars(),q=K.getCode(),Z=(j*B.cols+z)*x.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(K,z,$,this.dimensions.device.cell.width),le&&$===U&&(z===G&&(this._model.cursor={x:G,y:J,width:K.getWidth(),style:this._coreBrowserService.isFocused?B.options.cursorStyle||"block":B.options.cursorInactiveStyle,cursorWidth:B.options.cursorWidth,dpr:this._devicePixelRatio},ae=G+K.getWidth()-1),z>=G&&z<=ae&&(this._coreBrowserService.isFocused&&(B.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&B.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),q!==g.NULL_CELL_CODE&&(this._model.lineLengths[j]=z+1),(this._model.cells[Z]!==q||this._model.cells[Z+x.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Z+x.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Z+x.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(me=!0,V.length>1&&(q|=x.COMBINED_CHAR_BIT_MASK),this._model.cells[Z]=q,this._model.cells[Z+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Z+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Z+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,Q=K.getWidth(),this._glyphRenderer.value.updateCell(z,j,q,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,V,Q,H),P))for(K=this._workCell,z++;z<N;z++)I=(j*B.cols+z)*x.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(z,j,g.NULL_CELL_CODE,0,0,0,g.NULL_CELL_CHAR,0,0),this._model.cells[I]=g.NULL_CELL_CODE,this._model.cells[I+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[I+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[I+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;me&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(M,T){this._canvas.width===M&&this._canvas.height===T||(this._canvas.width=M,this._canvas.height=T,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const M=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:M,end:M})}}i.WebglRenderer=S;class E extends f.AttributeData{constructor(M,T,B){super(),this.content=0,this.combinedData="",this.fg=M.fg,this.bg=M.bg,this.combinedData=T,this._width=B}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(M){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(A,M,T=0){return Math.max(Math.min(A,M),T)}i.JoinedCellData=E},381:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GLTexture=i.expandFloat32Array=i.createShader=i.createProgram=i.PROJECTION_MATRIX=void 0;const c=o(374);function p(u,m,_){const y=(0,c.throwIfFalsy)(u.createShader(m));if(u.shaderSource(y,_),u.compileShader(y),u.getShaderParameter(y,u.COMPILE_STATUS))return y;console.error(u.getShaderInfoLog(y)),u.deleteShader(y)}i.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),i.createProgram=function(u,m,_){const y=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(y,(0,c.throwIfFalsy)(p(u,u.VERTEX_SHADER,m))),u.attachShader(y,(0,c.throwIfFalsy)(p(u,u.FRAGMENT_SHADER,_))),u.linkProgram(y),u.getProgramParameter(y,u.LINK_STATUS))return y;console.error(u.getProgramInfoLog(y)),u.deleteProgram(y)},i.createShader=p,i.expandFloat32Array=function(u,m){const _=Math.min(2*u.length,m),y=new Float32Array(_);for(let v=0;v<u.length;v++)y[v]=u[v];return y},i.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BaseRenderLayer=void 0;const c=o(627),p=o(237),u=o(374),m=o(859);class _ extends m.Disposable{constructor(v,h,f,d,g,w,b,x){super(),this._container=h,this._alpha=g,this._coreBrowserService=w,this._optionsService=b,this._themeService=x,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${f}-layer`),this._canvas.style.zIndex=d.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(C=>{this._refreshCharAtlas(v,C),this.reset(v)})),this.register((0,m.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(v){}handleFocus(v){}handleCursorMove(v){}handleGridChanged(v,h,f){}handleSelectionChanged(v,h,f,d=!1){}_setTransparency(v,h){if(h===this._alpha)return;const f=this._canvas;this._alpha=h,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,f),this._refreshCharAtlas(v,this._themeService.colors),this.handleGridChanged(v,0,v.rows-1)}_refreshCharAtlas(v,h){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(v,this._optionsService.rawOptions,h,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(v,h){this._deviceCellWidth=h.device.cell.width,this._deviceCellHeight=h.device.cell.height,this._deviceCharWidth=h.device.char.width,this._deviceCharHeight=h.device.char.height,this._deviceCharLeft=h.device.char.left,this._deviceCharTop=h.device.char.top,this._canvas.width=h.device.canvas.width,this._canvas.height=h.device.canvas.height,this._canvas.style.width=`${h.css.canvas.width}px`,this._canvas.style.height=`${h.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(v,this._themeService.colors)}_fillBottomLineAtCells(v,h,f=1){this._ctx.fillRect(v*this._deviceCellWidth,(h+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,f*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(v,h,f,d){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,h*this._deviceCellHeight,f*this._deviceCellWidth,d*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,h*this._deviceCellHeight,f*this._deviceCellWidth,d*this._deviceCellHeight))}_fillCharTrueColor(v,h,f,d){this._ctx.font=this._getFont(v,!1,!1),this._ctx.textBaseline=p.TEXT_BASELINE,this._clipCell(f,d,h.getWidth()),this._ctx.fillText(h.getChars(),f*this._deviceCellWidth+this._deviceCharLeft,d*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(v,h,f){this._ctx.beginPath(),this._ctx.rect(v*this._deviceCellWidth,h*this._deviceCellHeight,f*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,h,f){return`${f?"italic":""} ${h?v.options.fontWeightBold:v.options.fontWeight} ${v.options.fontSize*this._coreBrowserService.dpr}px ${v.options.fontFamily}`}}i.BaseRenderLayer=_},733:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkRenderLayer=void 0;const c=o(197),p=o(237),u=o(592);class m extends u.BaseRenderLayer{constructor(y,v,h,f,d,g,w){super(h,y,"link",v,!0,d,g,w),this.register(f.onShowLinkUnderline(b=>this._handleShowLinkUnderline(b))),this.register(f.onHideLinkUnderline(b=>this._handleHideLinkUnderline(b)))}resize(y,v){super.resize(y,v),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===p.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,c.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let v=y.y1+1;v<y.y2;v++)this._fillBottomLineAtCells(0,v,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}i.LinkRenderLayer=m},820:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let m=!1;return{dispose:()=>{m||(m=!0,o.removeEventListener(c,p,u))}}}},274:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellColorResolver=void 0;const c=o(855),p=o(160),u=o(374);let m,_=0,y=0,v=!1,h=!1,f=!1,d=0;i.CellColorResolver=class{constructor(g,w,b,x,C,S){this._terminal=g,this._optionService=w,this._selectionRenderModel=b,this._decorationService=x,this._coreBrowserService=C,this._themeService=S,this.result={fg:0,bg:0,ext:0}}resolve(g,w,b,x){if(this.result.bg=g.bg,this.result.fg=g.fg,this.result.ext=268435456&g.bg?g.extended.ext:0,y=0,_=0,h=!1,v=!1,f=!1,m=this._themeService.colors,d=0,g.getCode()!==c.NULL_CELL_CODE&&g.extended.underlineStyle===4){const C=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=w*x%(2*Math.round(C))}if(this._decorationService.forEachDecorationAtCell(w,b,"bottom",C=>{C.backgroundColorRGB&&(y=C.backgroundColorRGB.rgba>>8&16777215,h=!0),C.foregroundColorRGB&&(_=C.foregroundColorRGB.rgba>>8&16777215,v=!0)}),f=this._selectionRenderModel.isCellSelected(this._terminal,w,b),f){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}y=p.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(h=!0,m.selectionForeground&&(_=m.selectionForeground.rgba>>8&16777215,v=!0),(0,u.treatGlyphAsBackgroundColor)(g.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))_=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:_=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:_=(16777215&this.result.fg)<<8|255;break;default:_=this._themeService.colors.foreground.rgba}_=p.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}v=!0}}this._decorationService.forEachDecorationAtCell(w,b,"top",C=>{C.backgroundColorRGB&&(y=C.backgroundColorRGB.rgba>>8&16777215,h=!0),C.foregroundColorRGB&&(_=C.foregroundColorRGB.rgba>>8&16777215,v=!0)}),h&&(y=f?-16777216&g.bg&-134217729|y|50331648:-16777216&g.bg|y|50331648),v&&(_=-16777216&g.fg&-67108865|_|50331648),67108864&this.result.fg&&(h&&!v&&(_=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&m.background.rgba>>8|50331648,v=!0),!h&&v&&(y=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&m.foreground.rgba>>8|50331648,h=!0)),m=void 0,this.result.bg=h?y:this.result.bg,this.result.fg=v?_:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.removeTerminalFromCache=i.acquireTextureAtlas=void 0;const c=o(509),p=o(197),u=[];i.acquireTextureAtlas=function(m,_,y,v,h,f,d,g){const w=(0,p.generateConfig)(v,h,f,d,_,y,g);for(let C=0;C<u.length;C++){const S=u[C],E=S.ownedBy.indexOf(m);if(E>=0){if((0,p.configEquals)(S.config,w))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),u.splice(C,1)):S.ownedBy.splice(E,1);break}}for(let C=0;C<u.length;C++){const S=u[C];if((0,p.configEquals)(S.config,w))return S.ownedBy.push(m),S.atlas}const b=m._core,x={atlas:new c.TextureAtlas(document,w,b.unicodeService),config:w,ownedBy:[m]};return u.push(x),x.atlas},i.removeTerminalFromCache=function(m){for(let _=0;_<u.length;_++){const y=u[_].ownedBy.indexOf(m);if(y!==-1){u[_].ownedBy.length===1?(u[_].atlas.dispose(),u.splice(_,1)):u[_].ownedBy.splice(y,1);break}}}},197:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.is256Color=i.configEquals=i.generateConfig=void 0;const c=o(160);i.generateConfig=function(p,u,m,_,y,v,h){const f={foreground:v.foreground,background:v.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:h,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:p,deviceCellHeight:u,deviceCharWidth:m,deviceCharHeight:_,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:f}},i.configEquals=function(p,u){for(let m=0;m<p.colors.ansi.length;m++)if(p.colors.ansi[m].rgba!==u.colors.ansi[m].rgba)return!1;return p.devicePixelRatio===u.devicePixelRatio&&p.customGlyphs===u.customGlyphs&&p.lineHeight===u.lineHeight&&p.letterSpacing===u.letterSpacing&&p.fontFamily===u.fontFamily&&p.fontSize===u.fontSize&&p.fontWeight===u.fontWeight&&p.fontWeightBold===u.fontWeightBold&&p.allowTransparency===u.allowTransparency&&p.deviceCharWidth===u.deviceCharWidth&&p.deviceCharHeight===u.deviceCharHeight&&p.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&p.minimumContrastRatio===u.minimumContrastRatio&&p.colors.foreground.rgba===u.colors.foreground.rgba&&p.colors.background.rgba===u.colors.background.rgba},i.is256Color=function(p){return(50331648&p)==16777216||(50331648&p)==33554432}},237:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const c=o(399);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CursorBlinkStateManager=void 0,i.CursorBlinkStateManager=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tryDrawCustomChar=i.powerlineDefinitions=i.boxDrawingDefinitions=i.blockElementDefinitions=void 0;const c=o(374);i.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const p={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};i.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"║":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╒":{1:(v,h)=>`M.5,1 L.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╓":{1:(v,h)=>`M${.5-v},1 L${.5-v},.5 L1,.5 M${.5+v},.5 L${.5+v},1`},"╔":{1:(v,h)=>`M1,${.5-h} L${.5-v},${.5-h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1`},"╕":{1:(v,h)=>`M0,${.5-h} L.5,${.5-h} L.5,1 M0,${.5+h} L.5,${.5+h}`},"╖":{1:(v,h)=>`M${.5+v},1 L${.5+v},.5 L0,.5 M${.5-v},.5 L${.5-v},1`},"╗":{1:(v,h)=>`M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M0,${.5-h} L${.5+v},${.5-h} L${.5+v},1`},"╘":{1:(v,h)=>`M.5,0 L.5,${.5+h} L1,${.5+h} M.5,${.5-h} L1,${.5-h}`},"╙":{1:(v,h)=>`M1,.5 L${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╚":{1:(v,h)=>`M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0 M1,${.5+h} L${.5-v},${.5+h} L${.5-v},0`},"╛":{1:(v,h)=>`M0,${.5+h} L.5,${.5+h} L.5,0 M0,${.5-h} L.5,${.5-h}`},"╜":{1:(v,h)=>`M0,.5 L${.5+v},.5 L${.5+v},0 M${.5-v},.5 L${.5-v},0`},"╝":{1:(v,h)=>`M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M0,${.5+h} L${.5+v},${.5+h} L${.5+v},0`},"╞":{1:(v,h)=>`M.5,0 L.5,1 M.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╟":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1 M${.5+v},.5 L1,.5`},"╠":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╡":{1:(v,h)=>`M.5,0 L.5,1 M0,${.5-h} L.5,${.5-h} M0,${.5+h} L.5,${.5+h}`},"╢":{1:(v,h)=>`M0,.5 L${.5-v},.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╣":{1:(v,h)=>`M${.5+v},0 L${.5+v},1 M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0`},"╤":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h} M.5,${.5+h} L.5,1`},"╥":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},1 M${.5+v},.5 L${.5+v},1`},"╦":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1`},"╧":{1:(v,h)=>`M.5,0 L.5,${.5-h} M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╨":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╩":{1:(v,h)=>`M0,${.5+h} L1,${.5+h} M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╪":{1:(v,h)=>`M.5,0 L.5,1 M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╫":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╬":{1:(v,h)=>`M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1 M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(v,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,1,.5`},"╮":{1:(v,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,0,.5`},"╯":{1:(v,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,0,.5`},"╰":{1:(v,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,1,.5`}},i.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},i.powerlineDefinitions[""]=i.powerlineDefinitions[""],i.powerlineDefinitions[""]=i.powerlineDefinitions[""],i.tryDrawCustomChar=function(v,h,f,d,g,w,b,x){const C=i.blockElementDefinitions[h];if(C)return function(A,M,T,B,H,j){for(let $=0;$<M.length;$++){const O=M[$],R=H/8,P=j/8;A.fillRect(T+O.x*R,B+O.y*P,O.w*R,O.h*P)}}(v,C,f,d,g,w),!0;const S=p[h];if(S)return function(A,M,T,B,H,j){let $=u.get(M);$||($=new Map,u.set(M,$));const O=A.fillStyle;if(typeof O!="string")throw new Error(`Unexpected fillStyle type "${O}"`);let R=$.get(O);if(!R){const P=M[0].length,N=M.length,F=A.canvas.ownerDocument.createElement("canvas");F.width=P,F.height=N;const V=(0,c.throwIfFalsy)(F.getContext("2d")),q=new ImageData(P,N);let Q,Z,z,I;if(O.startsWith("#"))Q=parseInt(O.slice(1,3),16),Z=parseInt(O.slice(3,5),16),z=parseInt(O.slice(5,7),16),I=O.length>7&&parseInt(O.slice(7,9),16)||1;else{if(!O.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${O}" when drawing pattern glyph`);[Q,Z,z,I]=O.substring(5,O.length-1).split(",").map(K=>parseFloat(K))}for(let K=0;K<N;K++)for(let U=0;U<P;U++)q.data[4*(K*P+U)]=Q,q.data[4*(K*P+U)+1]=Z,q.data[4*(K*P+U)+2]=z,q.data[4*(K*P+U)+3]=M[K][U]*(255*I);V.putImageData(q,0,0),R=(0,c.throwIfFalsy)(A.createPattern(F,null)),$.set(O,R)}A.fillStyle=R,A.fillRect(T,B,H,j)}(v,S,f,d,g,w),!0;const E=i.boxDrawingDefinitions[h];if(E)return function(A,M,T,B,H,j,$){A.strokeStyle=A.fillStyle;for(const[O,R]of Object.entries(M)){let P;A.beginPath(),A.lineWidth=$*Number.parseInt(O),P=typeof R=="function"?R(.15,.15/j*H):R;for(const N of P.split(" ")){const F=N[0],V=_[F];if(!V){console.error(`Could not find drawing instructions for "${F}"`);continue}const q=N.substring(1).split(",");q[0]&&q[1]&&V(A,y(q,H,j,T,B,!0,$))}A.stroke(),A.closePath()}}(v,E,f,d,g,w,x),!0;const L=i.powerlineDefinitions[h];return!!L&&(function(A,M,T,B,H,j,$,O){const R=new Path2D;R.rect(T,B,H,j),A.clip(R),A.beginPath();const P=$/12;A.lineWidth=O*P;for(const N of M.d.split(" ")){const F=N[0],V=_[F];if(!V){console.error(`Could not find drawing instructions for "${F}"`);continue}const q=N.substring(1).split(",");q[0]&&q[1]&&V(A,y(q,H,j,T,B,!1,O,(M.leftPadding??0)*(P/2),(M.rightPadding??0)*(P/2)))}M.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()}(v,L,f,d,g,w,b,x),!0)};const u=new Map;function m(v,h,f=0){return Math.max(Math.min(v,h),f)}const _={C:(v,h)=>v.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]),L:(v,h)=>v.lineTo(h[0],h[1]),M:(v,h)=>v.moveTo(h[0],h[1])};function y(v,h,f,d,g,w,b,x=0,C=0){const S=v.map(E=>parseFloat(E)||parseInt(E));if(S.length<2)throw new Error("Too few arguments for instruction");for(let E=0;E<S.length;E+=2)S[E]*=h-x*b-C*b,w&&S[E]!==0&&(S[E]=m(Math.round(S[E]+.5)-.5,h,0)),S[E]+=d+x*b;for(let E=1;E<S.length;E+=2)S[E]*=f,w&&S[E]!==0&&(S[E]=m(Math.round(S[E]+.5)-.5,f,0)),S[E]+=g;return S}},56:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.observeDevicePixelDimensions=void 0;const c=o(859);i.observeDevicePixelDimensions=function(p,u,m){let _=new u.ResizeObserver(y=>{const v=y.find(d=>d.target===p);if(!v)return;if(!("devicePixelContentBoxSize"in v))return _==null||_.disconnect(),void(_=void 0);const h=v.devicePixelContentBoxSize[0].inlineSize,f=v.devicePixelContentBoxSize[0].blockSize;h>0&&f>0&&m(h,f)});try{_.observe(p,{box:["device-pixel-content-box"]})}catch{_.disconnect(),_=void 0}return(0,c.toDisposable)(()=>_==null?void 0:_.disconnect())}},374:(l,i)=>{function o(p){return 57508<=p&&p<=57558}function c(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},i.isPowerlineGlyph=o,i.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},i.isEmoji=c,i.allowRescaling=function(p,u,m,_){return u===1&&m>Math.ceil(1.5*_)&&p!==void 0&&p>255&&!c(p)&&!o(p)&&!function(y){return 57344<=y&&y<=63743}(p)},i.treatGlyphAsBackgroundColor=function(p){return o(p)||function(u){return 9472<=u&&u<=9631}(p)},i.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}}}},i.computeNextVariantOffset=function(p,u,m=0){return(p-(2*Math.round(u)-m))%(2*Math.round(u))}},296:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class o{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(p,u,m,_=!1){if(this.selectionStart=u,this.selectionEnd=m,!u||!m||u[0]===m[0]&&u[1]===m[1])return void this.clear();const y=p.buffers.active.ydisp,v=u[1]-y,h=m[1]-y,f=Math.max(v,0),d=Math.min(h,p.rows-1);f>=p.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=m[0])}isCellSelected(p,u,m){return!!this.hasSelection&&(m-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&m>=this.viewportCappedStartRow&&u<this.endCol&&m<=this.viewportCappedEndRow:u<this.startCol&&m>=this.viewportCappedStartRow&&u>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol)}}i.createSelectionRenderModel=function(){return new o}},509:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TextureAtlas=void 0;const c=o(237),p=o(860),u=o(374),m=o(160),_=o(345),y=o(485),v=o(385),h=o(147),f=o(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let g;class w{get pages(){return this._pages}constructor(E,L,A){this._document=E,this._config=L,this._unicodeService=A,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new _.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new _.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=C(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new v.IdleTaskQueue;for(let L=33;L<126;L++)E.enqueue(()=>{if(!this._cacheMap.get(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const A=this._drawToCache(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,A)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w.maxAtlasPages&&this._pages.length>=Math.max(4,w.maxAtlasPages)){const L=this._pages.filter($=>2*$.canvas.width<=(w.maxTextureSize||4096)).sort(($,O)=>O.canvas.width!==$.canvas.width?O.canvas.width-$.canvas.width:O.percentageUsed-$.percentageUsed);let A=-1,M=0;for(let $=0;$<L.length;$++)if(L[$].canvas.width!==M)A=$,M=L[$].canvas.width;else if($-A==3)break;const T=L.slice(A,A+4),B=T.map($=>$.glyphs[0].texturePage).sort(($,O)=>$>O?1:-1),H=this.pages.length-T.length,j=this._mergePages(T,H);j.version++;for(let $=B.length-1;$>=0;$--)this._deletePage(B[$]);this.pages.push(j),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(j.canvas)}const E=new b(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,L){const A=2*E[0].canvas.width,M=new b(this._document,A,E);for(const[T,B]of E.entries()){const H=T*B.canvas.width%A,j=Math.floor(T/2)*B.canvas.height;M.ctx.drawImage(B.canvas,H,j);for(const O of B.glyphs)O.texturePage=L,O.sizeClipSpace.x=O.size.x/A,O.sizeClipSpace.y=O.size.y/A,O.texturePosition.x+=H,O.texturePosition.y+=j,O.texturePositionClipSpace.x=O.texturePosition.x/A,O.texturePositionClipSpace.y=O.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(B.canvas);const $=this._activePages.indexOf(B);$!==-1&&this._activePages.splice($,1)}return M}_deletePage(E){this._pages.splice(E,1);for(let L=E;L<this._pages.length;L++){const A=this._pages[L];for(const M of A.glyphs)M.texturePage--;A.version++}}getRasterizedGlyphCombinedChar(E,L,A,M,T){return this._getFromCacheMap(this._cacheMapCombined,E,L,A,M,T)}getRasterizedGlyph(E,L,A,M,T){return this._getFromCacheMap(this._cacheMap,E,L,A,M,T)}_getFromCacheMap(E,L,A,M,T,B=!1){return g=E.get(L,A,M,T),g||(g=this._drawToCache(L,A,M,T,B),E.set(L,A,M,T,g)),g}_getColorFromAnsiIndex(E){if(E>=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,L,A,M){if(this._config.allowTransparency)return m.NULL_COLOR;let T;switch(E){case 16777216:case 33554432:T=this._getColorFromAnsiIndex(L);break;case 50331648:const B=h.AttributeData.toColorRGB(L);T=m.channels.toColor(B[0],B[1],B[2]);break;default:T=A?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return T}_getForegroundColor(E,L,A,M,T,B,H,j,$,O){const R=this._getMinimumContrastColor(E,L,A,M,T,B,H,$,j,O);if(R)return R;let P;switch(T){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&$&&B<8&&(B+=8),P=this._getColorFromAnsiIndex(B);break;case 50331648:const N=h.AttributeData.toColorRGB(B);P=m.channels.toColor(N[0],N[1],N[2]);break;default:P=H?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=m.color.opaque(P)),j&&(P=m.color.multiplyOpacity(P,c.DIM_OPACITY)),P}_resolveBackgroundRgba(E,L,A){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,L,A,M){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,L,A,M,T,B,H,j,$,O){if(this._config.minimumContrastRatio===1||O)return;const R=this._getContrastCache($),P=R.getColor(E,M);if(P!==void 0)return P||void 0;const N=this._resolveBackgroundRgba(L,A,H),F=this._resolveForegroundRgba(T,B,H,j),V=m.rgba.ensureContrastRatio(N,F,this._config.minimumContrastRatio/($?2:1));if(!V)return void R.setColor(E,M,null);const q=m.channels.toColor(V>>24&255,V>>16&255,V>>8&255);return R.setColor(E,M,q),q}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,L,A,M,T=!1){const B=typeof E=="number"?String.fromCharCode(E):E,H=Math.min(this._config.deviceCellWidth*Math.max(B.length,2)+4,this._textureSize);this._tmpCanvas.width<H&&(this._tmpCanvas.width=H);const j=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<j&&(this._tmpCanvas.height=j),this._tmpCtx.save(),this._workAttributeData.fg=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=M,this._workAttributeData.isInvisible())return d;const $=!!this._workAttributeData.isBold(),O=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),P=!!this._workAttributeData.isItalic(),N=!!this._workAttributeData.isUnderline(),F=!!this._workAttributeData.isStrikethrough(),V=!!this._workAttributeData.isOverline();let q=this._workAttributeData.getFgColor(),Q=this._workAttributeData.getFgColorMode(),Z=this._workAttributeData.getBgColor(),z=this._workAttributeData.getBgColorMode();if(O){const te=q;q=Z,Z=te;const pe=Q;Q=z,z=pe}const I=this._getBackgroundColor(z,Z,O,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=I.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const K=$?this._config.fontWeightBold:this._config.fontWeight,U=P?"italic":"";this._tmpCtx.font=`${U} ${K} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const J=B.length===1&&(0,u.isPowerlineGlyph)(B.charCodeAt(0)),G=B.length===1&&(0,u.isRestrictedPowerlineGlyph)(B.charCodeAt(0)),ae=this._getForegroundColor(L,z,Z,A,Q,q,O,R,$,(0,u.treatGlyphAsBackgroundColor)(B.charCodeAt(0)));this._tmpCtx.fillStyle=ae.css;const le=G?0:4;let me=!1;this._config.customGlyphs!==!1&&(me=(0,p.tryDrawCustomChar)(this._tmpCtx,B,le,le,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ke,X=!J;if(ke=typeof E=="number"?this._unicodeService.wcwidth(E):this._unicodeService.getStringCellWidth(E),N){this._tmpCtx.save();const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),pe=te%2==1?.5:0;if(this._tmpCtx.lineWidth=te,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())X=!1,this._tmpCtx.strokeStyle=`rgb(${h.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{X=!1;let De=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&De<8&&(De+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(De).css}this._tmpCtx.beginPath();const ie=le,oe=Math.ceil(le+this._config.deviceCharHeight)-pe-(T?2*te:0),Le=oe+te,be=oe+2*te;let Re=this._workAttributeData.getUnderlineVariantOffset();for(let De=0;De<ke;De++){this._tmpCtx.save();const ne=ie+De*this._config.deviceCellWidth,fe=ie+(De+1)*this._config.deviceCellWidth,Ie=ne+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(fe,oe),this._tmpCtx.moveTo(ne,be),this._tmpCtx.lineTo(fe,be);break;case 3:const W=te<=1?be:Math.ceil(le+this._config.deviceCharHeight-te/2)-pe,re=te<=1?oe:Math.ceil(le+this._config.deviceCharHeight+te/2)-pe,ve=new Path2D;ve.rect(ne,oe,this._config.deviceCellWidth,be-oe),this._tmpCtx.clip(ve),this._tmpCtx.moveTo(ne-this._config.deviceCellWidth/2,Le),this._tmpCtx.bezierCurveTo(ne-this._config.deviceCellWidth/2,re,ne,re,ne,Le),this._tmpCtx.bezierCurveTo(ne,W,Ie,W,Ie,Le),this._tmpCtx.bezierCurveTo(Ie,re,fe,re,fe,Le),this._tmpCtx.bezierCurveTo(fe,W,fe+this._config.deviceCellWidth/2,W,fe+this._config.deviceCellWidth/2,Le);break;case 4:const Te=Re===0?0:Re>=te?2*te-Re:te-Re;Re>=te||Te===0?(this._tmpCtx.setLineDash([Math.round(te),Math.round(te)]),this._tmpCtx.moveTo(ne+Te,oe),this._tmpCtx.lineTo(fe,oe)):(this._tmpCtx.setLineDash([Math.round(te),Math.round(te)]),this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(ne+Te,oe),this._tmpCtx.moveTo(ne+Te+te,oe),this._tmpCtx.lineTo(fe,oe)),Re=(0,u.computeNextVariantOffset)(fe-ne,te,Re);break;case 5:const xe=.6,Be=.3,je=fe-ne,He=Math.floor(xe*je),Me=Math.floor(Be*je),Pe=je-He-Me;this._tmpCtx.setLineDash([He,Me,Pe]),this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(fe,oe);break;default:this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(fe,oe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!me&&this._config.fontSize>=12&&!this._config.allowTransparency&&B!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const De=this._tmpCtx.measureText(B);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in De&&De.actualBoundingBoxDescent>0){this._tmpCtx.save();const ne=new Path2D;ne.rect(ie,oe-Math.ceil(te/2),this._config.deviceCellWidth*ke,be-oe+Math.ceil(te/2)),this._tmpCtx.clip(ne),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=I.css,this._tmpCtx.strokeText(B,le,le+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(V){const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),pe=te%2==1?.5:0;this._tmpCtx.lineWidth=te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(le,le+pe),this._tmpCtx.lineTo(le+this._config.deviceCharWidth*ke,le+pe),this._tmpCtx.stroke()}if(me||this._tmpCtx.fillText(B,le,le+this._config.deviceCharHeight),B==="_"&&!this._config.allowTransparency){let te=x(this._tmpCtx.getImageData(le,le,this._config.deviceCellWidth,this._config.deviceCellHeight),I,ae,X);if(te)for(let pe=1;pe<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=I.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(B,le,le+this._config.deviceCharHeight-pe),te=x(this._tmpCtx.getImageData(le,le,this._config.deviceCellWidth,this._config.deviceCellHeight),I,ae,X),te);pe++);}if(F){const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),pe=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(le,le+Math.floor(this._config.deviceCharHeight/2)-pe),this._tmpCtx.lineTo(le+this._config.deviceCharWidth*ke,le+Math.floor(this._config.deviceCharHeight/2)-pe),this._tmpCtx.stroke()}this._tmpCtx.restore();const ee=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ae;if(Ae=this._config.allowTransparency?function(te){for(let pe=0;pe<te.data.length;pe+=4)if(te.data[pe+3]>0)return!1;return!0}(ee):x(ee,I,ae,X),Ae)return d;const de=this._findGlyphBoundingBox(ee,this._workBoundingBox,H,G,me,le);let he,ce;for(;;){if(this._activePages.length===0){const te=this._createNewPage();he=te,ce=te.currentRow,ce.height=de.size.y;break}he=this._activePages[this._activePages.length-1],ce=he.currentRow;for(const te of this._activePages)de.size.y<=te.currentRow.height&&(he=te,ce=te.currentRow);for(let te=this._activePages.length-1;te>=0;te--)for(const pe of this._activePages[te].fixedRows)pe.height<=ce.height&&de.size.y<=pe.height&&(he=this._activePages[te],ce=pe);if(ce.y+de.size.y>=he.canvas.height||ce.height>de.size.y+2){let te=!1;if(he.currentRow.y+he.currentRow.height+de.size.y>=he.canvas.height){let pe;for(const ie of this._activePages)if(ie.currentRow.y+ie.currentRow.height+de.size.y<ie.canvas.height){pe=ie;break}if(pe)he=pe;else if(w.maxAtlasPages&&this._pages.length>=w.maxAtlasPages&&ce.y+de.size.y<=he.canvas.height&&ce.height>=de.size.y&&ce.x+de.size.x<=he.canvas.width)te=!0;else{const ie=this._createNewPage();he=ie,ce=ie.currentRow,ce.height=de.size.y,te=!0}}te||(he.currentRow.height>0&&he.fixedRows.push(he.currentRow),ce={x:0,y:he.currentRow.y+he.currentRow.height,height:de.size.y},he.fixedRows.push(ce),he.currentRow={x:0,y:ce.y+ce.height,height:0})}if(ce.x+de.size.x<=he.canvas.width)break;ce===he.currentRow?(ce.x=0,ce.y+=ce.height,ce.height=0):he.fixedRows.splice(he.fixedRows.indexOf(ce),1)}return de.texturePage=this._pages.indexOf(he),de.texturePosition.x=ce.x,de.texturePosition.y=ce.y,de.texturePositionClipSpace.x=ce.x/he.canvas.width,de.texturePositionClipSpace.y=ce.y/he.canvas.height,de.sizeClipSpace.x/=he.canvas.width,de.sizeClipSpace.y/=he.canvas.height,ce.height=Math.max(ce.height,de.size.y),ce.x+=de.size.x,he.ctx.putImageData(ee,de.texturePosition.x-this._workBoundingBox.left,de.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,de.size.x,de.size.y),he.addGlyph(de),he.version++,de}_findGlyphBoundingBox(E,L,A,M,T,B){L.top=0;const H=M?this._config.deviceCellHeight:this._tmpCanvas.height,j=M?this._config.deviceCellWidth:A;let $=!1;for(let O=0;O<H;O++){for(let R=0;R<j;R++){const P=O*this._tmpCanvas.width*4+4*R+3;if(E.data[P]!==0){L.top=O,$=!0;break}}if($)break}L.left=0,$=!1;for(let O=0;O<B+j;O++){for(let R=0;R<H;R++){const P=R*this._tmpCanvas.width*4+4*O+3;if(E.data[P]!==0){L.left=O,$=!0;break}}if($)break}L.right=j,$=!1;for(let O=B+j-1;O>=B;O--){for(let R=0;R<H;R++){const P=R*this._tmpCanvas.width*4+4*O+3;if(E.data[P]!==0){L.right=O,$=!0;break}}if($)break}L.bottom=H,$=!1;for(let O=H-1;O>=0;O--){for(let R=0;R<j;R++){const P=O*this._tmpCanvas.width*4+4*R+3;if(E.data[P]!==0){L.bottom=O,$=!0;break}}if($)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+B+(M||T?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+B+(M||T?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}i.TextureAtlas=w;class b{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(E){this._glyphs.push(E),this._usedPixels+=E.size.x*E.size.y}constructor(E,L,A){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],A)for(const M of A)this._glyphs.push(...M.glyphs),this._usedPixels+=M._usedPixels;this.canvas=C(E,L,L),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function x(S,E,L,A){const M=E.rgba>>>24,T=E.rgba>>>16&255,B=E.rgba>>>8&255,H=L.rgba>>>24,j=L.rgba>>>16&255,$=L.rgba>>>8&255,O=Math.floor((Math.abs(M-H)+Math.abs(T-j)+Math.abs(B-$))/12);let R=!0;for(let P=0;P<S.data.length;P+=4)S.data[P]===M&&S.data[P+1]===T&&S.data[P+2]===B||A&&Math.abs(S.data[P]-M)+Math.abs(S.data[P+1]-T)+Math.abs(S.data[P+2]-B)<O?S.data[P+3]=0:R=!1;return R}function C(S,E,L){const A=S.createElement("canvas");return A.width=E,A.height=L,A}},160:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let o=0,c=0,p=0,u=0;var m,_,y,v,h;function f(g){const w=g.toString(16);return w.length<2?"0"+w:w}function d(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,b,x,C){return C!==void 0?`#${f(w)}${f(b)}${f(x)}${f(C)}`:`#${f(w)}${f(b)}${f(x)}`},g.toRgba=function(w,b,x,C=255){return(w<<24|b<<16|x<<8|C)>>>0},g.toColor=function(w,b,x,C){return{css:g.toCss(w,b,x,C),rgba:g.toRgba(w,b,x,C)}}}(m||(i.channels=m={})),function(g){function w(b,x){return u=Math.round(255*x),[o,c,p]=h.toChannels(b.rgba),{css:m.toCss(o,c,p,u),rgba:m.toRgba(o,c,p,u)}}g.blend=function(b,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const C=x.rgba>>24&255,S=x.rgba>>16&255,E=x.rgba>>8&255,L=b.rgba>>24&255,A=b.rgba>>16&255,M=b.rgba>>8&255;return o=L+Math.round((C-L)*u),c=A+Math.round((S-A)*u),p=M+Math.round((E-M)*u),{css:m.toCss(o,c,p),rgba:m.toRgba(o,c,p)}},g.isOpaque=function(b){return(255&b.rgba)==255},g.ensureContrastRatio=function(b,x,C){const S=h.ensureContrastRatio(b.rgba,x.rgba,C);if(S)return m.toColor(S>>24&255,S>>16&255,S>>8&255)},g.opaque=function(b){const x=(255|b.rgba)>>>0;return[o,c,p]=h.toChannels(x),{css:m.toCss(o,c,p),rgba:x}},g.opacity=w,g.multiplyOpacity=function(b,x){return u=255&b.rgba,w(b,u*x/255)},g.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(_||(i.color=_={})),function(g){let w,b;try{const x=document.createElement("canvas");x.width=1,x.height=1;const C=x.getContext("2d",{willReadFrequently:!0});C&&(w=C,w.globalCompositeOperation="copy",b=w.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),p=parseInt(x.slice(3,4).repeat(2),16),m.toColor(o,c,p);case 5:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),p=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),m.toColor(o,c,p,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const C=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),p=parseInt(C[3]),u=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),m.toColor(o,c,p,u);if(!w||!b)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=b,w.fillStyle=x,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[o,c,p,u]=w.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(o,c,p,u),css:x}}}(y||(i.css=y={})),function(g){function w(b,x,C){const S=b/255,E=x/255,L=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(b){return w(b>>16&255,b>>8&255,255&b)},g.relativeLuminance2=w}(v||(i.rgb=v={})),function(g){function w(x,C,S){const E=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,T=C>>16&255,B=C>>8&255,H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));for(;H<S&&(M>0||T>0||B>0);)M-=Math.max(0,Math.ceil(.1*M)),T-=Math.max(0,Math.ceil(.1*T)),B-=Math.max(0,Math.ceil(.1*B)),H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));return(M<<24|T<<16|B<<8|255)>>>0}function b(x,C,S){const E=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,T=C>>16&255,B=C>>8&255,H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));for(;H<S&&(M<255||T<255||B<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),T=Math.min(255,T+Math.ceil(.1*(255-T))),B=Math.min(255,B+Math.ceil(.1*(255-B))),H=d(v.relativeLuminance2(M,T,B),v.relativeLuminance2(E,L,A));return(M<<24|T<<16|B<<8|255)>>>0}g.blend=function(x,C){if(u=(255&C)/255,u===1)return C;const S=C>>24&255,E=C>>16&255,L=C>>8&255,A=x>>24&255,M=x>>16&255,T=x>>8&255;return o=A+Math.round((S-A)*u),c=M+Math.round((E-M)*u),p=T+Math.round((L-T)*u),m.toRgba(o,c,p)},g.ensureContrastRatio=function(x,C,S){const E=v.relativeLuminance(x>>8),L=v.relativeLuminance(C>>8);if(d(E,L)<S){if(L<E){const T=w(x,C,S),B=d(E,v.relativeLuminance(T>>8));if(B<S){const H=b(x,C,S);return B>d(E,v.relativeLuminance(H>>8))?T:H}return T}const A=b(x,C,S),M=d(E,v.relativeLuminance(A>>8));if(M<S){const T=w(x,C,S);return M>d(E,v.relativeLuminance(T>>8))?A:T}return A}},g.reduceLuminance=w,g.increaseLuminance=b,g.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(h||(i.rgba=h={})),i.toPaddedHex=f,i.contrastRatio=d},345:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(o,c){return o(p=>c.fire(p))},i.runAndSubscribe=function(o,c){return c(void 0),o(p=>c(p))}},859:(l,i)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=o,i.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(p,u,m){this._data[p]||(this._data[p]={}),this._data[p][u]=m}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}i.TwoKeyMap=o,i.FourKeyMap=class{constructor(){this._data=new o}set(c,p,u,m,_){this._data.get(c,p)||this._data.set(c,p,new o),this._data.get(c,p).set(u,m,_)}get(c,p,u,m){var _;return(_=this._data.get(c,p))==null?void 0:_.get(u,m)}clear(){this._data.clear()}}},399:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const o=i.isNode?"node":navigator.userAgent,c=i.isNode?"node":navigator.platform;i.isFirefox=o.includes("Firefox"),i.isLegacyEdge=o.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(o),i.getSafariVersion=function(){if(!i.isSafari)return 0;const p=o.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),i.isIpad=c==="iPad",i.isIphone=c==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),i.isLinux=c.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(o)},385:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const c=o(399);class p{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let y=0,v=0,h=_.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),v=Math.max(y,v),f=_.timeRemaining(),1.5*v>f)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=f}this.clear()}}class u extends p{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const y=Date.now()+_;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}i.PriorityTaskQueue=u,i.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:u,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},147:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}i.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,m=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=m}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=c},782:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const c=o(133),p=o(855),u=o(147);class m extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new m;return v.setFromCharData(y),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){const h=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=m},855:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},133:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},i.utf32ToString=function(o,c=0,p=o.length){let u="";for(let m=c;m<p;++m){let _=o[m];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const p=o.length;if(!p)return 0;let u=0,m=0;if(this._interim){const _=o.charCodeAt(m++);56320<=_&&_<=57343?c[u++]=1024*(this._interim-55296)+_-56320+65536:(c[u++]=this._interim,c[u++]=_),this._interim=0}for(let _=m;_<p;++_){const y=o.charCodeAt(_);if(55296<=y&&y<=56319){if(++_>=p)return this._interim=y,u;const v=o.charCodeAt(_);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const p=o.length;if(!p)return 0;let u,m,_,y,v=0,h=0,f=0;if(this.interim[0]){let w=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let x,C=0;for(;(x=63&this.interim[++C])&&C<4;)b<<=6,b|=x;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=S-C;for(;f<E;){if(f>=p)return 0;if(x=o[f++],(192&x)!=128){f--,w=!0;break}this.interim[C++]=x,b<<=6,b|=63&x}w||(S===2?b<128?f--:c[v++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(c[v++]=b):b<65536||b>1114111||(c[v++]=b)),this.interim.fill(0)}const d=p-4;let g=f;for(;g<p;){for(;!(!(g<d)||128&(u=o[g])||128&(m=o[g+1])||128&(_=o[g+2])||128&(y=o[g+3]));)c[v++]=u,c[v++]=m,c[v++]=_,c[v++]=y,g+=4;if(u=o[g++],u<128)c[v++]=u;else if((224&u)==192){if(g>=p)return this.interim[0]=u,v;if(m=o[g++],(192&m)!=128){g--;continue}if(h=(31&u)<<6|63&m,h<128){g--;continue}c[v++]=h}else if((240&u)==224){if(g>=p)return this.interim[0]=u,v;if(m=o[g++],(192&m)!=128){g--;continue}if(g>=p)return this.interim[0]=u,this.interim[1]=m,v;if(_=o[g++],(192&_)!=128){g--;continue}if(h=(15&u)<<12|(63&m)<<6|63&_,h<2048||h>=55296&&h<=57343||h===65279)continue;c[v++]=h}else if((248&u)==240){if(g>=p)return this.interim[0]=u,v;if(m=o[g++],(192&m)!=128){g--;continue}if(g>=p)return this.interim[0]=u,this.interim[1]=m,v;if(_=o[g++],(192&_)!=128){g--;continue}if(g>=p)return this.interim[0]=u,this.interim[1]=m,this.interim[2]=_,v;if(y=o[g++],(192&y)!=128){g--;continue}if(h=(7&u)<<18|(63&m)<<12|(63&_)<<6|63&y,h<65536||h>1114111)continue;c[v++]=h}}return v}}},776:function(l,i,o){var c=this&&this.__decorate||function(h,f,d,g){var w,b=arguments.length,x=b<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,f,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(f,d,x):w(f,d))||x);return b>3&&x&&Object.defineProperty(f,d,x),x},p=this&&this.__param||function(h,f){return function(d,g){f(d,g,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const u=o(859),m=o(97),_={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let y,v=i.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};i.LogService=v=c([p(0,m.IOptionsService)],v),i.setTraceLogger=function(h){y=h},i.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const g=d.value;d.value=function(...w){if(y.logLevel!==m.LogLevelEnum.TRACE)return g.apply(this,w);y.trace(`GlyphRenderer#${g.name}(${w.map(x=>JSON.stringify(x)).join(", ")})`);const b=g.apply(this,w);return y.trace(`GlyphRenderer#${g.name} return`,b),b}}},726:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const o="di$target",c="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(p){return p[c]||[]},i.createDecorator=function(p){if(i.serviceRegistry.has(p))return i.serviceRegistry.get(p);const u=function(m,_,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,h,f){h[o]===h?h[c].push({id:v,index:f}):(h[c]=[{id:v,index:f}],h[o]=h)})(u,m,y)};return u.toString=()=>p,i.serviceRegistry.set(p,u),u}},97:(l,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const c=o(726);var p;i.IBufferService=(0,c.createDecorator)("BufferService"),i.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),i.ICoreService=(0,c.createDecorator)("CoreService"),i.ICharsetService=(0,c.createDecorator)("CharsetService"),i.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(i.LogLevelEnum=p={})),i.ILogService=(0,c.createDecorator)("LogService"),i.IOptionsService=(0,c.createDecorator)("OptionsService"),i.IOscLinkService=(0,c.createDecorator)("OscLinkService"),i.IUnicodeService=(0,c.createDecorator)("UnicodeService"),i.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function s(l){var i=n[l];if(i!==void 0)return i.exports;var o=n[l]={exports:{}};return r[l].call(o.exports,o,o.exports,s),o.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.WebglAddon=void 0;const i=s(345),o=s(859),c=s(399),p=s(666),u=s(776);class m extends o.Disposable{constructor(y){if(c.isSafari&&(0,c.getSafariVersion)()<16){const v={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",v))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new i.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new i.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new i.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new i.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const v=y._core;if(!y.element)return void this.register(v.onWillOpen(()=>this.activate(y)));this._terminal=y;const h=v.coreService,f=v.optionsService,d=v,g=d._renderService,w=d._characterJoinerService,b=d._charSizeService,x=d._coreBrowserService,C=d._decorationService,S=d._logService,E=d._themeService;(0,u.setTraceLogger)(S),this._renderer=this.register(new p.WebglRenderer(y,w,b,x,h,C,f,E,this._preserveDrawingBuffer)),this.register((0,i.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,i.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,i.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,i.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),g.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(y.cols,y.rows)}))}get textureAtlas(){var y;return(y=this._renderer)==null?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)==null||y.clearTextureAtlas()}}l.WebglAddon=m})(),a})())})(F1);var Fg=F1.exports;/**
130
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
131
+ * @license MIT
132
+ *
133
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
134
+ * @license MIT
135
+ *
136
+ * Originally forked from (with the author's permission):
137
+ * Fabrice Bellard's javascript vt100 for jslinux:
138
+ * http://bellard.org/jslinux/
139
+ * Copyright (c) 2011 Fabrice Bellard
140
+ */var VR=class{constructor(t,r,n,s={}){this._terminal=t,this._regex=r,this._handler=n,this._options=s}provideLinks(t,r){let n=GR.computeLink(t,this._regex,this._terminal,this._handler);r(this._addCallbacks(n))}_addCallbacks(t){return t.map(r=>(r.leave=this._options.leave,r.hover=(n,s)=>{if(this._options.hover){let{range:a}=r;this._options.hover(n,s,a)}},r))}};function KR(e){try{let t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var GR=class Va{static computeLink(t,r,n,s){let a=new RegExp(r.source,(r.flags||"")+"g"),[l,i]=Va._getWindowedLineStrings(t-1,n),o=l.join(""),c,p=[];for(;c=a.exec(o);){let u=c[0];if(!KR(u))continue;let[m,_]=Va._mapStrIdx(n,i,0,c.index),[y,v]=Va._mapStrIdx(n,m,_,u.length);if(m===-1||_===-1||y===-1||v===-1)continue;let h={start:{x:_+1,y:m+1},end:{x:v,y:y+1}};p.push({range:h,text:u,activate:s})}return p}static _getWindowedLineStrings(t,r){let n,s=t,a=t,l=0,i="",o=[];if(n=r.buffer.active.getLine(t)){let c=n.translateToString(!0);if(n.isWrapped&&c[0]!==" "){for(l=0;(n=r.buffer.active.getLine(--s))&&l<2048&&(i=n.translateToString(!0),l+=i.length,o.push(i),!(!n.isWrapped||i.indexOf(" ")!==-1)););o.reverse()}for(o.push(c),l=0;(n=r.buffer.active.getLine(++a))&&n.isWrapped&&l<2048&&(i=n.translateToString(!0),l+=i.length,o.push(i),i.indexOf(" ")===-1););}return[o,s]}static _mapStrIdx(t,r,n,s){let a=t.buffer.active,l=a.getNullCell(),i=n;for(;s;){let o=a.getLine(r);if(!o)return[-1,-1];for(let c=i;c<o.length;++c){o.getCell(c,l);let p=l.getChars();if(l.getWidth()&&(s-=p.length||1,c===o.length-1&&p==="")){let u=a.getLine(r+1);u&&u.isWrapped&&(u.getCell(0,l),l.getWidth()===2&&(s+=1))}if(s<0)return[r,c]}r++,i=0}return[r,i]}},qR=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function XR(e,t){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var YR=class{constructor(e=XR,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,r=t.urlRegex||qR;this._linkProvider=this._terminal.registerLinkProvider(new VR(this._terminal,r,this._handler,t))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};/**
141
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
142
+ * @license MIT
143
+ *
144
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
145
+ * @license MIT
146
+ *
147
+ * Originally forked from (with the author's permission):
148
+ * Fabrice Bellard's javascript vt100 for jslinux:
149
+ * http://bellard.org/jslinux/
150
+ * Copyright (c) 2011 Fabrice Bellard
151
+ */var $1="3.7.8",JR=$1,gs=typeof Buffer=="function",$g=typeof TextDecoder=="function"?new TextDecoder:void 0,Hg=typeof TextEncoder=="function"?new TextEncoder:void 0,QR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",js=Array.prototype.slice.call(QR),xa=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(js),ZR=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,At=String.fromCharCode.bind(String),zg=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),H1=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),z1=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),U1=e=>{let t,r,n,s,a="",l=e.length%3;for(let i=0;i<e.length;){if((r=e.charCodeAt(i++))>255||(n=e.charCodeAt(i++))>255||(s=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|s,a+=js[t>>18&63]+js[t>>12&63]+js[t>>6&63]+js[t&63]}return l?a.slice(0,l-3)+"===".substring(l):a},$f=typeof btoa=="function"?e=>btoa(e):gs?e=>Buffer.from(e,"binary").toString("base64"):U1,Nh=gs?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(At.apply(null,e.subarray(r,r+4096)));return $f(t.join(""))},Ka=(e,t=!1)=>t?H1(Nh(e)):Nh(e),eT=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?At(192|t>>>6)+At(128|t&63):At(224|t>>>12&15)+At(128|t>>>6&63)+At(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return At(240|t>>>18&7)+At(128|t>>>12&63)+At(128|t>>>6&63)+At(128|t&63)}},tT=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,W1=e=>e.replace(tT,eT),Ug=gs?e=>Buffer.from(e,"utf8").toString("base64"):Hg?e=>Nh(Hg.encode(e)):e=>$f(W1(e)),Yi=(e,t=!1)=>t?H1(Ug(e)):Ug(e),Wg=e=>Yi(e,!0),rT=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,nT=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return At((r>>>10)+55296)+At((r&1023)+56320);case 3:return At((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return At((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},V1=e=>e.replace(rT,nT),K1=e=>{if(e=e.replace(/\s+/g,""),!ZR.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,s=[];for(let a=0;a<e.length;)t=xa[e.charAt(a++)]<<18|xa[e.charAt(a++)]<<12|(r=xa[e.charAt(a++)])<<6|(n=xa[e.charAt(a++)]),r===64?s.push(At(t>>16&255)):n===64?s.push(At(t>>16&255,t>>8&255)):s.push(At(t>>16&255,t>>8&255,t&255));return s.join("")},Hf=typeof atob=="function"?e=>atob(z1(e)):gs?e=>Buffer.from(e,"base64").toString("binary"):K1,G1=gs?e=>zg(Buffer.from(e,"base64")):e=>zg(Hf(e).split("").map(t=>t.charCodeAt(0))),q1=e=>G1(X1(e)),iT=gs?e=>Buffer.from(e,"base64").toString("utf8"):$g?e=>$g.decode(G1(e)):e=>V1(Hf(e)),X1=e=>z1(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),jh=e=>iT(X1(e)),sT=e=>{if(typeof e!="string")return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Y1=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),J1=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Y1(r));e("fromBase64",function(){return jh(this)}),e("toBase64",function(t){return Yi(this,t)}),e("toBase64URI",function(){return Yi(this,!0)}),e("toBase64URL",function(){return Yi(this,!0)}),e("toUint8Array",function(){return q1(this)})},Q1=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Y1(r));e("toBase64",function(t){return Ka(this,t)}),e("toBase64URI",function(){return Ka(this,!0)}),e("toBase64URL",function(){return Ka(this,!0)})},oT=()=>{J1(),Q1()},ba={version:$1,VERSION:JR,atob:Hf,atobPolyfill:K1,btoa:$f,btoaPolyfill:U1,fromBase64:jh,toBase64:Yi,encode:Yi,encodeURI:Wg,encodeURL:Wg,utob:W1,btou:V1,decode:jh,isValid:sT,fromUint8Array:Ka,toUint8Array:q1,extendString:J1,extendUint8Array:Q1,extendBuiltins:oT},aT=class{constructor(e=new cT,t=new lT){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,t=>this._setOrReportClipboard(t))}dispose(){var e;return(e=this._disposable)==null?void 0:e.dispose()}_readText(e,t){var n;let r=this._base64.encodeText(t);(n=this._terminal)==null||n.input(`\x1B]52;${e};${r}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(";");if(t.length<2)return!0;let r=t[0],n=t[1];if(n==="?"){let l=this._provider.readText(r);return l instanceof Promise?l.then(i=>(this._readText(r,i),!0)):(this._readText(r,l),!0)}let s="";try{s=this._base64.decodeText(n)}catch{}let a=this._provider.writeText(r,s);return a instanceof Promise?a.then(()=>!0):!0}},lT=class{async readText(t){return t!=="c"?Promise.resolve(""):navigator.clipboard.readText()}async writeText(t,r){return t!=="c"?Promise.resolve():navigator.clipboard.writeText(r)}},cT=class{encodeText(t){return ba.encode(t)}decodeText(t){let r=ba.decode(t);return!ba.isValid(t)||ba.encode(r)!==t?"":r}},Z1={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={345:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(o,c){return o(p=>c.fire(p))},i.runAndSubscribe=function(o,c){return c(void 0),o(p=>c(p))}},859:(l,i)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=o,i.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}}},n={};function s(l){var i=n[l];if(i!==void 0)return i.exports;var o=n[l]={exports:{}};return r[l](o,o.exports,s),o.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.SearchAddon=void 0;const i=s(345),o=s(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class p extends o.Disposable{constructor(m){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new o.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new o.MutableDisposable,this._onDidChangeResults=this.register(new i.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(m==null?void 0:m.highlightLimit)??1e3}activate(m){this._terminal=m,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,o.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var m;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((m=this._lastSearchOptions)!=null&&m.decorations)&&(this._highlightTimeout=setTimeout(()=>{const _=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(_,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(m){this._selectedDecoration.clear(),(0,o.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),m||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(m,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const y=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,_);this._lastSearchOptions=_,_!=null&&_.decorations&&(this._cachedSearchTerm===void 0||m!==this._cachedSearchTerm||y)&&this._highlightAllMatches(m,_);const v=this._findNextAndSelect(m,_);return this._fireResults(_),this._cachedSearchTerm=m,v}_highlightAllMatches(m,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!m||m.length===0)return void this.clearDecorations();_=_||{},this.clearDecorations(!0);const y=[];let v,h=this._find(m,0,0,_);for(;h&&((v==null?void 0:v.row)!==h.row||(v==null?void 0:v.col)!==h.col)&&!(y.length>=this._highlightLimit);)v=h,y.push(v),h=this._find(m,v.col+v.term.length>=this._terminal.cols?v.row+1:v.row,v.col+v.term.length>=this._terminal.cols?0:v.col+1,_);for(const f of y){const d=this._createResultDecoration(f,_.decorations);d&&(this._highlightedLines.add(d.marker.line),this._highlightDecorations.push({decoration:d,match:f,dispose(){d.dispose()}}))}}_find(m,_,y,v){var d;if(!this._terminal||!m||m.length===0)return(d=this._terminal)==null||d.clearSelection(),void this.clearDecorations();if(y>this._terminal.cols)throw new Error(`Invalid col: ${y} to search in terminal of ${this._terminal.cols} cols`);let h;this._initLinesCache();const f={startRow:_,startCol:y};if(h=this._findInLine(m,f,v),!h)for(let g=_+1;g<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=g,f.startCol=0,h=this._findInLine(m,f,v),!h);g++);return h}_findNextAndSelect(m,_){var g;if(!this._terminal||!m||m.length===0)return(g=this._terminal)==null||g.clearSelection(),this.clearDecorations(),!1;const y=this._terminal.getSelectionPosition();this._terminal.clearSelection();let v=0,h=0;y&&(this._cachedSearchTerm===m?(v=y.end.x,h=y.end.y):(v=y.start.x,h=y.start.y)),this._initLinesCache();const f={startRow:h,startCol:v};let d=this._findInLine(m,f,_);if(!d)for(let w=h+1;w<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=w,f.startCol=0,d=this._findInLine(m,f,_),!d);w++);if(!d&&h!==0)for(let w=0;w<h&&(f.startRow=w,f.startCol=0,d=this._findInLine(m,f,_),!d);w++);return!d&&y&&(f.startRow=y.start.y,f.startCol=0,d=this._findInLine(m,f,_)),this._selectResult(d,_==null?void 0:_.decorations,_==null?void 0:_.noScroll)}findPrevious(m,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const y=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,_);this._lastSearchOptions=_,_!=null&&_.decorations&&(this._cachedSearchTerm===void 0||m!==this._cachedSearchTerm||y)&&this._highlightAllMatches(m,_);const v=this._findPreviousAndSelect(m,_);return this._fireResults(_),this._cachedSearchTerm=m,v}_didOptionsChange(m,_){return!!_&&(m.caseSensitive!==_.caseSensitive||m.regex!==_.regex||m.wholeWord!==_.wholeWord)}_fireResults(m){if(m!=null&&m.decorations){let _=-1;if(this._selectedDecoration.value){const y=this._selectedDecoration.value.match;for(let v=0;v<this._highlightDecorations.length;v++){const h=this._highlightDecorations[v].match;if(h.row===y.row&&h.col===y.col&&h.size===y.size){_=v;break}}}this._onDidChangeResults.fire({resultIndex:_,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(m,_){var w;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!m||m.length===0)return(w=this._terminal)==null||w.clearSelection(),this.clearDecorations(),!1;const y=this._terminal.getSelectionPosition();this._terminal.clearSelection();let v=this._terminal.buffer.active.baseY+this._terminal.rows-1,h=this._terminal.cols;const f=!0;this._initLinesCache();const d={startRow:v,startCol:h};let g;if(y&&(d.startRow=v=y.start.y,d.startCol=h=y.start.x,this._cachedSearchTerm!==m&&(g=this._findInLine(m,d,_,!1),g||(d.startRow=v=y.end.y,d.startCol=h=y.end.x))),g||(g=this._findInLine(m,d,_,f)),!g){d.startCol=Math.max(d.startCol,this._terminal.cols);for(let b=v-1;b>=0&&(d.startRow=b,g=this._findInLine(m,d,_,f),!g);b--);}if(!g&&v!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let b=this._terminal.buffer.active.baseY+this._terminal.rows-1;b>=v&&(d.startRow=b,g=this._findInLine(m,d,_,f),!g);b--);return this._selectResult(g,_==null?void 0:_.decorations,_==null?void 0:_.noScroll)}_initLinesCache(){const m=this._terminal;this._linesCache||(this._linesCache=new Array(m.buffer.active.length),this._linesCacheDisposables.value=(0,o.getDisposeArrayDisposable)([m.onLineFeed(()=>this._destroyLinesCache()),m.onCursorMove(()=>this._destroyLinesCache()),m.onResize(()=>this._destroyLinesCache())])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(m,_,y){return(m===0||c.includes(_[m-1]))&&(m+y.length===_.length||c.includes(_[m+y.length]))}_findInLine(m,_,y={},v=!1){var A;const h=this._terminal,f=_.startRow,d=_.startCol,g=h.buffer.active.getLine(f);if(g!=null&&g.isWrapped)return v?void(_.startCol+=h.cols):(_.startRow--,_.startCol+=h.cols,this._findInLine(m,_,y));let w=(A=this._linesCache)==null?void 0:A[f];w||(w=this._translateBufferLineToStringWithWrap(f,!0),this._linesCache&&(this._linesCache[f]=w));const[b,x]=w,C=this._bufferColsToStringOffset(f,d),S=y.caseSensitive?m:m.toLowerCase(),E=y.caseSensitive?b:b.toLowerCase();let L=-1;if(y.regex){const M=RegExp(S,"g");let T;if(v)for(;T=M.exec(E.slice(0,C));)L=M.lastIndex-T[0].length,m=T[0],M.lastIndex-=m.length-1;else T=M.exec(E.slice(C)),T&&T[0].length>0&&(L=C+(M.lastIndex-T[0].length),m=T[0])}else v?C-S.length>=0&&(L=E.lastIndexOf(S,C-S.length)):L=E.indexOf(S,C);if(L>=0){if(y.wholeWord&&!this._isWholeWord(L,E,m))return;let M=0;for(;M<x.length-1&&L>=x[M+1];)M++;let T=M;for(;T<x.length-1&&L+m.length>=x[T+1];)T++;const B=L-x[M],H=L+m.length-x[T],j=this._stringLengthToBufferSize(f+M,B);return{term:m,col:j,row:f+M,size:this._stringLengthToBufferSize(f+T,H)-j+h.cols*(T-M)}}}_stringLengthToBufferSize(m,_){const y=this._terminal.buffer.active.getLine(m);if(!y)return 0;for(let v=0;v<_;v++){const h=y.getCell(v);if(!h)break;const f=h.getChars();f.length>1&&(_-=f.length-1);const d=y.getCell(v+1);d&&d.getWidth()===0&&_++}return _}_bufferColsToStringOffset(m,_){const y=this._terminal;let v=m,h=0,f=y.buffer.active.getLine(v);for(;_>0&&f;){for(let d=0;d<_&&d<y.cols;d++){const g=f.getCell(d);if(!g)break;g.getWidth()&&(h+=g.getCode()===0?1:g.getChars().length)}if(v++,f=y.buffer.active.getLine(v),f&&!f.isWrapped)break;_-=y.cols}return h}_translateBufferLineToStringWithWrap(m,_){var d;const y=this._terminal,v=[],h=[0];let f=y.buffer.active.getLine(m);for(;f;){const g=y.buffer.active.getLine(m+1),w=!!g&&g.isWrapped;let b=f.translateToString(!w&&_);if(w&&g){const x=f.getCell(f.length-1);x&&x.getCode()===0&&x.getWidth()===1&&((d=g.getCell(0))==null?void 0:d.getWidth())===2&&(b=b.slice(0,-1))}if(v.push(b),!w)break;h.push(h[h.length-1]+b.length),m++,f=g}return[v.join(""),h]}_selectResult(m,_,y){const v=this._terminal;if(this._selectedDecoration.clear(),!m)return v.clearSelection(),!1;if(v.select(m.col,m.row,m.size),_){const h=v.registerMarker(-v.buffer.active.baseY-v.buffer.active.cursorY+m.row);if(h){const f=v.registerDecoration({marker:h,x:m.col,width:m.size,backgroundColor:_.activeMatchBackground,layer:"top",overviewRulerOptions:{color:_.activeMatchColorOverviewRuler}});if(f){const d=[];d.push(h),d.push(f.onRender(g=>this._applyStyles(g,_.activeMatchBorder,!0))),d.push(f.onDispose(()=>(0,o.disposeArray)(d))),this._selectedDecoration.value={decoration:f,match:m,dispose(){f.dispose()}}}}}if(!y&&(m.row>=v.buffer.active.viewportY+v.rows||m.row<v.buffer.active.viewportY)){let h=m.row-v.buffer.active.viewportY;h-=Math.floor(v.rows/2),v.scrollLines(h)}return!0}_applyStyles(m,_,y){m.classList.contains("xterm-find-result-decoration")||(m.classList.add("xterm-find-result-decoration"),_&&(m.style.outline=`1px solid ${_}`)),y&&m.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(m,_){const y=this._terminal,v=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+m.row);if(!v)return;const h=y.registerDecoration({marker:v,x:m.col,width:m.size,backgroundColor:_.matchBackground,overviewRulerOptions:this._highlightedLines.has(v.line)?void 0:{color:_.matchOverviewRuler,position:"center"}});if(h){const f=[];f.push(v),f.push(h.onRender(d=>this._applyStyles(d,_.matchBorder,!1))),f.push(h.onDispose(()=>(0,o.disposeArray)(f)))}return h}}l.SearchAddon=p})(),a})())})(Z1);var uT=Z1.exports;/**
152
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
153
+ * @license MIT
154
+ *
155
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
156
+ * @license MIT
157
+ *
158
+ * Originally forked from (with the author's permission):
159
+ * Fabrice Bellard's javascript vt100 for jslinux:
160
+ * http://bellard.org/jslinux/
161
+ * Copyright (c) 2011 Fabrice Bellard
162
+ */var Ct=0,Et=0,kt=0,ut=0,Ft;(e=>{function t(s,a,l,i){return i!==void 0?`#${Un(s)}${Un(a)}${Un(l)}${Un(i)}`:`#${Un(s)}${Un(a)}${Un(l)}`}e.toCss=t;function r(s,a,l,i=255){return(s<<24|a<<16|l<<8|i)>>>0}e.toRgba=r;function n(s,a,l,i){return{css:e.toCss(s,a,l,i),rgba:e.toRgba(s,a,l,i)}}e.toColor=n})(Ft||(Ft={}));var hT;(e=>{function t(o,c){if(ut=(c.rgba&255)/255,ut===1)return{css:c.css,rgba:c.rgba};let p=c.rgba>>24&255,u=c.rgba>>16&255,m=c.rgba>>8&255,_=o.rgba>>24&255,y=o.rgba>>16&255,v=o.rgba>>8&255;Ct=_+Math.round((p-_)*ut),Et=y+Math.round((u-y)*ut),kt=v+Math.round((m-v)*ut);let h=Ft.toCss(Ct,Et,kt),f=Ft.toRgba(Ct,Et,kt);return{css:h,rgba:f}}e.blend=t;function r(o){return(o.rgba&255)===255}e.isOpaque=r;function n(o,c,p){let u=Ga.ensureContrastRatio(o.rgba,c.rgba,p);if(u)return Ft.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=n;function s(o){let c=(o.rgba|255)>>>0;return[Ct,Et,kt]=Ga.toChannels(c),{css:Ft.toCss(Ct,Et,kt),rgba:c}}e.opaque=s;function a(o,c){return ut=Math.round(c*255),[Ct,Et,kt]=Ga.toChannels(o.rgba),{css:Ft.toCss(Ct,Et,kt,ut),rgba:Ft.toRgba(Ct,Et,kt,ut)}}e.opacity=a;function l(o,c){return ut=o.rgba&255,a(o,ut*c/255)}e.multiplyOpacity=l;function i(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}e.toColorRGB=i})(hT||(hT={}));var Tt;(e=>{let t,r;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Ct=parseInt(s.slice(1,2).repeat(2),16),Et=parseInt(s.slice(2,3).repeat(2),16),kt=parseInt(s.slice(3,4).repeat(2),16),Ft.toColor(Ct,Et,kt);case 5:return Ct=parseInt(s.slice(1,2).repeat(2),16),Et=parseInt(s.slice(2,3).repeat(2),16),kt=parseInt(s.slice(3,4).repeat(2),16),ut=parseInt(s.slice(4,5).repeat(2),16),Ft.toColor(Ct,Et,kt,ut);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Ct=parseInt(a[1]),Et=parseInt(a[2]),kt=parseInt(a[3]),ut=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Ft.toColor(Ct,Et,kt,ut);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Ct,Et,kt,ut]=t.getImageData(0,0,1,1).data,ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ft.toRgba(Ct,Et,kt,ut),css:s}}e.toColor=n})(Tt||(Tt={}));var Ut;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,s,a){let l=n/255,i=s/255,o=a/255,c=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4);return c*.2126+p*.7152+u*.0722}e.relativeLuminance2=r})(Ut||(Ut={}));var Ga;(e=>{function t(l,i){if(ut=(i&255)/255,ut===1)return i;let o=i>>24&255,c=i>>16&255,p=i>>8&255,u=l>>24&255,m=l>>16&255,_=l>>8&255;return Ct=u+Math.round((o-u)*ut),Et=m+Math.round((c-m)*ut),kt=_+Math.round((p-_)*ut),Ft.toRgba(Ct,Et,kt)}e.blend=t;function r(l,i,o){let c=Ut.relativeLuminance(l>>8),p=Ut.relativeLuminance(i>>8);if(Vr(c,p)<o){if(p<c){let _=n(l,i,o),y=Vr(c,Ut.relativeLuminance(_>>8));if(y<o){let v=s(l,i,o),h=Vr(c,Ut.relativeLuminance(v>>8));return y>h?_:v}return _}let u=s(l,i,o),m=Vr(c,Ut.relativeLuminance(u>>8));if(m<o){let _=n(l,i,o),y=Vr(c,Ut.relativeLuminance(_>>8));return m>y?u:_}return u}}e.ensureContrastRatio=r;function n(l,i,o){let c=l>>24&255,p=l>>16&255,u=l>>8&255,m=i>>24&255,_=i>>16&255,y=i>>8&255,v=Vr(Ut.relativeLuminance2(m,_,y),Ut.relativeLuminance2(c,p,u));for(;v<o&&(m>0||_>0||y>0);)m-=Math.max(0,Math.ceil(m*.1)),_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),v=Vr(Ut.relativeLuminance2(m,_,y),Ut.relativeLuminance2(c,p,u));return(m<<24|_<<16|y<<8|255)>>>0}e.reduceLuminance=n;function s(l,i,o){let c=l>>24&255,p=l>>16&255,u=l>>8&255,m=i>>24&255,_=i>>16&255,y=i>>8&255,v=Vr(Ut.relativeLuminance2(m,_,y),Ut.relativeLuminance2(c,p,u));for(;v<o&&(m<255||_<255||y<255);)m=Math.min(255,m+Math.ceil((255-m)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),v=Vr(Ut.relativeLuminance2(m,_,y),Ut.relativeLuminance2(c,p,u));return(m<<24|_<<16|y<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Ga||(Ga={}));function Un(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Vr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var dT=Object.freeze((()=>{let e=[Tt.toColor("#2e3436"),Tt.toColor("#cc0000"),Tt.toColor("#4e9a06"),Tt.toColor("#c4a000"),Tt.toColor("#3465a4"),Tt.toColor("#75507b"),Tt.toColor("#06989a"),Tt.toColor("#d3d7cf"),Tt.toColor("#555753"),Tt.toColor("#ef2929"),Tt.toColor("#8ae234"),Tt.toColor("#fce94f"),Tt.toColor("#729fcf"),Tt.toColor("#ad7fa8"),Tt.toColor("#34e2e2"),Tt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],s=t[r/6%6|0],a=t[r%6];e.push({css:Ft.toCss(n,s,a),rgba:Ft.toRgba(n,s,a)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:Ft.toCss(n,n,n),rgba:Ft.toRgba(n,n,n)})}return e})());function Vg(e,t,r){return Math.max(t,Math.min(e,r))}function fT(e){switch(e){case"&":return"&amp;";case"<":return"&lt;"}return e}var ew=class{constructor(e){this._buffer=e}serialize(e,t){let r=this._buffer.getNullCell(),n=this._buffer.getNullCell(),s=r,a=e.start.y,l=e.end.y,i=e.start.x,o=e.end.x;this._beforeSerialize(l-a,a,l);for(let c=a;c<=l;c++){let p=this._buffer.getLine(c);if(p){let u=c===e.start.y?i:0,m=c===e.end.y?o:p.length;for(let _=u;_<m;_++){let y=p.getCell(_,s===r?n:r);if(!y){console.warn(`Can't get cell at row=${c}, col=${_}`);continue}this._nextCell(y,s,c,_),s=y}}this._rowEnd(c,c===l)}return this._afterSerialize(),this._serializeString(t)}_nextCell(e,t,r,n){}_rowEnd(e,t){}_beforeSerialize(e,t,r){}_afterSerialize(){}_serializeString(e){return""}};function tw(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Gr(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function rw(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var pT=class extends ew{constructor(e,t){super(e),this._terminal=t,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,t,r){this._allRows=new Array(e),this._lastContentCursorRow=t,this._lastCursorRow=t,this._firstRow=t}_rowEnd(e,t){var n;this._nullCellCount>0&&!Gr(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!t){e-this._firstRow>=this._terminal.rows&&((n=this._buffer.getLine(this._cursorStyleRow))==null||n.getCell(this._cursorStyleCol,this._backgroundCell));let s=this._buffer.getLine(e),a=this._buffer.getLine(e+1);if(!a.isWrapped)r=`\r
163
+ `,this._lastCursorRow=e+1,this._lastCursorCol=0;else{r="";let l=s.getCell(s.length-1,this._thisRowLastChar),i=s.getCell(s.length-2,this._thisRowLastSecondChar),o=a.getCell(0,this._nextRowFirstChar),c=o.getWidth()>1,p=!1;(o.getChars()&&c?this._nullCellCount<=1:this._nullCellCount<=0)&&((l.getChars()||l.getWidth()===0)&&Gr(l,o)&&(p=!0),c&&(i.getChars()||i.getWidth()===0)&&Gr(l,o)&&Gr(i,o)&&(p=!0)),p||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${s.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${s.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(e,t){let r=[],n=!tw(e,t),s=!Gr(e,t),a=!rw(e,t);if(n||s||a)if(e.isAttributeDefault())t.isAttributeDefault()||r.push(0);else{if(n){let l=e.getFgColor();e.isFgRGB()?r.push(38,2,l>>>16&255,l>>>8&255,l&255):e.isFgPalette()?l>=16?r.push(38,5,l):r.push(l&8?90+(l&7):30+(l&7)):r.push(39)}if(s){let l=e.getBgColor();e.isBgRGB()?r.push(48,2,l>>>16&255,l>>>8&255,l&255):e.isBgPalette()?l>=16?r.push(48,5,l):r.push(l&8?100+(l&7):40+(l&7)):r.push(49)}a&&(e.isInverse()!==t.isInverse()&&r.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&r.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&r.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&r.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&r.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&r.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&r.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&r.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&r.push(e.isStrikethrough()?9:29))}return r}_nextCell(e,t,r,n){if(e.getWidth()===0)return;let s=e.getChars()==="",a=this._diffStyle(e,this._cursorStyle);if(s?!Gr(this._cursorStyle,e):a.length>0){this._nullCellCount>0&&(Gr(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=n,this._currentRow+=`\x1B[${a.join(";")}m`;let l=this._buffer.getLine(r);l!==void 0&&(l.getCell(n,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=n)}s?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(Gr(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=n+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let a=0;a<t;a++)r+=this._allRows[a],a+1<t&&(r+=this._allRowSeparators[a]);if(!e){let a=this._buffer.baseY+this._buffer.cursorY,l=this._buffer.cursorX,i=a!==this._lastCursorRow||l!==this._lastCursorCol,o=c=>{c>0?r+=`\x1B[${c}C`:c<0&&(r+=`\x1B[${-c}D`)};i&&((c=>{c>0?r+=`\x1B[${c}B`:c<0&&(r+=`\x1B[${-c}A`)})(a-this._lastCursorRow),o(l-this._lastCursorCol))}let n=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(n,this._cursorStyle);return s.length>0&&(r+=`\x1B[${s.join(";")}m`),r}},mT=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,t,r){let n=t.length,s=r===void 0?n:Vg(r+e.rows,0,n);return this._serializeBufferByRange(e,t,{start:n-s,end:n-1},!1)}_serializeBufferByRange(e,t,r,n){return new pT(t,e).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:e.cols,y:typeof r.end=="number"?r.end:r.end.line}},n)}_serializeBufferAsHTML(e,t){var i;let r=e.buffer.active,n=new gT(r,e,t),s=t.onlySelection??!1,a=t.range;if(a)return n.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:e.cols,y:(a.endLine,a.endLine)}});if(!s){let o=r.length,c=t.scrollback,p=c===void 0?o:Vg(c+e.rows,0,o);return n.serialize({start:{x:0,y:o-p},end:{x:e.cols,y:o-1}})}let l=(i=this._terminal)==null?void 0:i.getSelectionPosition();return l!==void 0?n.serialize({start:{x:l.start.x,y:l.start.y},end:{x:l.end.x,y:l.end.y}}):""}_serializeModes(e){let t="",r=e.modes;if(r.applicationCursorKeysMode&&(t+="\x1B[?1h"),r.applicationKeypadMode&&(t+="\x1B[?66h"),r.bracketedPasteMode&&(t+="\x1B[?2004h"),r.insertMode&&(t+="\x1B[4h"),r.originMode&&(t+="\x1B[?6h"),r.reverseWraparoundMode&&(t+="\x1B[?45h"),r.sendFocusMode&&(t+="\x1B[?1004h"),r.wraparoundMode===!1&&(t+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":t+="\x1B[?9h";break;case"vt200":t+="\x1B[?1000h";break;case"drag":t+="\x1B[?1002h";break;case"any":t+="\x1B[?1003h";break}return t}serialize(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let t=e!=null&&e.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e==null?void 0:e.scrollback);if(!(e!=null&&e.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);t+=`\x1B[?1049h\x1B[H${r}`}return e!=null&&e.excludeModes||(t+=this._serializeModes(this._terminal)),t}serializeAsHTML(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}},gT=class extends ew{constructor(e,t,r){super(e),this._terminal=t,this._options=r,this._currentRow="",this._htmlContent="",t._core._themeService?this._ansiColors=t._core._themeService.colors.ansi:this._ansiColors=dT}_padStart(e,t,r){return t=t>>0,r=r??" ",e.length>t?e:(t-=e.length,t>r.length&&(r+=r.repeat(t/r.length)),r.slice(0,t)+e)}_beforeSerialize(e,t,r){var l,i;this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=((l=this._terminal.options.theme)==null?void 0:l.foreground)??"#ffffff",s=((i=this._terminal.options.theme)==null?void 0:i.background)??"#000000");let a=[];a.push("color: "+n+";"),a.push("background-color: "+s+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+a.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,t){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,t){let r=t?e.getFgColor():e.getBgColor();if(t?e.isFgRGB():e.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(t?e.isFgPalette():e.isBgPalette())return this._ansiColors[r].css}_diffStyle(e,t){let r=[],n=!tw(e,t),s=!Gr(e,t),a=!rw(e,t);if(n||s||a){let l=this._getHexColor(e,!0);l&&r.push("color: "+l+";");let i=this._getHexColor(e,!1);return i&&r.push("background-color: "+i+";"),e.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&r.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?r.push("text-decoration: overline underline;"):e.isUnderline()?r.push("text-decoration: underline;"):e.isOverline()&&r.push("text-decoration: overline;"),e.isBlink()&&r.push("text-decoration: blink;"),e.isInvisible()&&r.push("visibility: hidden;"),e.isItalic()&&r.push("font-style: italic;"),e.isDim()&&r.push("opacity: 0.5;"),e.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(e,t,r,n){if(e.getWidth()===0)return;let s=e.getChars()==="",a=this._diffStyle(e,t);a&&(this._currentRow+=a.length===0?"</span><span>":"</span><span style='"+a.join(" ")+"'>"),s?this._currentRow+=" ":this._currentRow+=fT(e.getChars())}_serializeString(){return this._htmlContent}};/**
164
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
165
+ * @license MIT
166
+ *
167
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
168
+ * @license MIT
169
+ *
170
+ * Originally forked from (with the author's permission):
171
+ * Fabrice Bellard's javascript vt100 for jslinux:
172
+ * http://bellard.org/jslinux/
173
+ * Copyright (c) 2011 Fabrice Bellard
174
+ */function Kg(e){let t=0;for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);if(n<48||57<n)return-1;t=t*10+n-48}return t}var vT=class{constructor(){this._st=0,this._pr=0}dispose(){var e,t;(e=this._seqHandler)==null||e.dispose(),(t=this._onChange)==null||t.dispose()}activate(e){this._seqHandler=e.parser.registerOscHandler(9,t=>{if(!t.startsWith("4;"))return!1;let r=t.split(";");if(r.length>3)return!0;r.length===2&&r.push("");let n=Kg(r[1]),s=Kg(r[2]);switch(n){case 0:this.progress={state:n,value:0};break;case 1:if(s<0)return!0;this.progress={state:n,value:s};break;case 2:case 4:if(s<0)return!0;this.progress={state:n,value:s||this._pr};break;case 3:this.progress={state:n,value:this._pr};break}return!0}),this._onChange=new e._core._onData.constructor,this.onChange=this._onChange.event}get progress(){return{state:this._st,value:this._pr}}set progress(e){var t;if(e.state<0||e.state>4){console.warn("progress state out of bounds, not applied");return}this._st=e.state,this._pr=Math.min(Math.max(e.value,0),100),(t=this._onChange)==null||t.fire({state:this._st,value:this._pr})}};const _T=/https?:\/\/[^\s"'<>]+|\b(?:localhost|\d{1,3}(?:\.\d{1,3}){3}):\d{1,5}(?:\/[^\s"'<>]*)?\b/,yT=/[.,;:!?]+$/,wT=[["(",")"],["[","]"],["{","}"]],Gg=(e,t)=>e.split(t).length-1;function ru(e){let t=e.trim();if(!t)return t;const r=()=>{t=t.replace(yT,"")};r();let n=!0;for(;n;){n=!1;for(const[s,a]of wT){if(!t.endsWith(a))continue;const l=Gg(t,s);Gg(t,a)>l&&(t=t.slice(0,-1),n=!0)}}return r(),t}const qg=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);class ST{async readText(t){if(t!=="c")return"";try{return await navigator.clipboard.readText()}catch{return""}}async writeText(t,r){if(!(t!=="c"||!(r!=null&&r.trim())))try{await navigator.clipboard.writeText(r)}catch{}}}const xT="︎",bT=new Set(["⏺"]);function CT(e){let t="";for(const r of e)t+=r,bT.has(r)&&(t+=xT);return t}function ET({sessionId:e,tmuxTarget:t,allowAttach:r=!0,sendMessage:n,subscribe:s,theme:a,fontSize:l,lineHeight:i,letterSpacing:o,fontFamily:c,useWebGL:p,onScrollChange:u}){const m=jo(),_=k.useRef(null),y=k.useRef(null),v=k.useRef(null),h=k.useRef(null),f=k.useRef(null),d=k.useRef(null),g=k.useRef(null),w=k.useRef(null),b=k.useRef(null),x=k.useRef(null),C=k.useRef(null),S=k.useRef(null),E=k.useRef(0),L=k.useRef(!1),A=k.useRef(null),M=k.useRef(null),T=k.useRef(null),B=k.useRef(n),H=k.useRef(u),j=k.useRef(p),$="\x1B[?2026h",O="\x1B[?2026l",R=k.useRef(""),P=k.useRef(null),N=k.useRef(null),F=2,V=16;k.useEffect(()=>{B.current=n},[n]),k.useEffect(()=>{H.current=u},[u]);const q=k.useCallback(()=>{const I=y.current;if(!I||!H.current)return;const K=I.buffer.active,U=!L.current&&K.viewportY>=K.baseY;H.current(U)},[]),Q=k.useCallback(I=>{if(L.current===I)return;L.current=I;const K=y.current;K&&I&&K.write("\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l"),q()},[q]),Z=k.useCallback(()=>{const I=M.current;I&&(A.current!==null&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{A.current=null,B.current({type:"tmux-check-copy-mode",sessionId:I})},150))},[]),z=k.useCallback(()=>{const I=y.current,K=v.current;if(!I||!K)return;K.fit();const U=M.current;U&&B.current({type:"terminal-resize",sessionId:U,cols:I.cols,rows:I.rows})},[]);return k.useEffect(()=>{var De;const I=_.current;if(!I||y.current)return;let K=!1;I.innerHTML="";const J=((ne,fe)=>Math.round(ne*fe)/ne)(l,i),G=new HR.Terminal({fontFamily:c,fontSize:l,lineHeight:J,letterSpacing:o,scrollback:0,cursorBlink:!1,cursorStyle:"underline",convertEol:!0,theme:a,screenReaderMode:m,minimumContrastRatio:4.5}),ae=new WR;G.loadAddon(ae),G.loadAddon(new aT(void 0,new ST));const le=new uT.SearchAddon;G.loadAddon(le),g.current=le;const me=new mT;G.loadAddon(me),w.current=me;const ke=new vT;G.loadAddon(ke),b.current=ke;const X=()=>{if(!K){if(j.current)try{const ne=new Fg.WebglAddon;G.loadAddon(ne),h.current=ne}catch{}G.open(I),ae.fit(),ee&&G.element&&G.element.appendChild(ee)}};(De=document.fonts)!=null&&De.ready?document.fonts.ready.then(X).catch(X):X();let ee=null,Ae=null,de=null;typeof document<"u"&&document.createElement&&(ee=document.createElement("div"),ee.className="xterm-hover",ee.style.cssText=`
175
+ position: absolute;
176
+ display: none;
177
+ z-index: 20;
178
+ padding: 4px 8px;
179
+ font-size: 12px;
180
+ border-radius: 4px;
181
+ background: var(--bg-surface);
182
+ border: 1px solid var(--border);
183
+ box-shadow: 0 2px 8px rgba(0,0,0,0.15);
184
+ color: var(--text-primary);
185
+ pointer-events: none;
186
+ max-width: 400px;
187
+ word-break: break-all;
188
+ `,Ae=document.createElement("div"),ee.appendChild(Ae),de=document.createElement("div"),de.style.color="var(--text-muted)",de.style.marginTop="2px",de.style.fontSize="11px",ee.appendChild(de),d.current=ee);const he=(ne,fe)=>{if(!G.element||!ee||!Ae||!de)return;const Ie=ru(fe);if(!Ie)return;const W=G.element.getBoundingClientRect(),re=Ie.length>60?Ie.slice(0,57)+"...":Ie;Ae.textContent=re,de.textContent=`${qg?"⌘":"Ctrl"}+click to open`,ee.style.left=`${ne.clientX-W.left+10}px`,ee.style.top=`${ne.clientY-W.top+10}px`,ee.style.display="block"},ce=()=>{ee&&(ee.style.display="none")};let te=null,pe=!1,ie=null;const oe={activate:(ne,fe)=>{if(!pe&&(ne.metaKey||ne.ctrlKey)){const Ie=ru(fe);if(!Ie)return;window.open(Ie,"_blank","noopener")}},hover:(ne,fe)=>{te=ru(fe)||null,he(ne,fe)},leave:()=>{te=null,ce()}},Le=ne=>{te&&(ne.metaKey||ne.ctrlKey)&&(ne.preventDefault(),ne.stopPropagation(),pe=!0,window.open(te,"_blank","noopener"),ie&&clearTimeout(ie),ie=setTimeout(()=>{pe=!1},100))};I.addEventListener("mousedown",Le,!0),G.options.linkHandler=oe;const be=new YR((ne,fe)=>oe.activate(ne,fe),{urlRegex:_T,hover:(ne,fe)=>oe.hover(ne,fe),leave:()=>oe.leave()});return G.loadAddon(be),f.current=be,G.attachCustomKeyEventHandler(ne=>{var fe;if((ne.ctrlKey||ne.metaKey)&&ne.key.toLowerCase()==="c"&&G.hasSelection()){const Ie=G.getSelection();return Ie!=null&&Ie.trim()&&navigator.clipboard&&navigator.clipboard.writeText(Ie),!1}if(qg&&(ne.metaKey||ne.ctrlKey)&&ne.key.toLowerCase()==="v"&&ne.type==="keydown")return(fe=navigator.clipboard)!=null&&fe.readText?((async()=>{const Ie=M.current;if(Ie){try{const W=await fetch("/api/clipboard-file-path");if(W.ok){const{path:re}=await W.json();if(re){B.current({type:"terminal-input",sessionId:Ie,data:re});return}}}catch{}try{const W=await navigator.clipboard.readText();W&&G.paste(W)}catch{}}})(),!1):!0;if(ne.ctrlKey&&ne.key==="Backspace"&&ne.type==="keydown"){const Ie=M.current;return Ie&&B.current({type:"terminal-input",sessionId:Ie,data:""}),!1}return!0}),G.onData(ne=>{const fe=M.current;if(fe){const Ie=/^\x1b\[(<[\d;]+[Mm]|[\d;]+M|M[\x20-\xff]{3})$/.test(ne);if(L.current&&Ie)return;L.current&&(B.current({type:"tmux-cancel-copy-mode",sessionId:fe}),Q(!1)),B.current({type:"terminal-input",sessionId:fe,data:ne})}}),G.attachCustomWheelEventHandler(ne=>{const fe=M.current;if(!fe)return!0;const Ie=ne.target;if(Ie!=null&&Ie.closest('input, textarea, [contenteditable="true"], .xterm-hover')||G.hasSelection()||ne.shiftKey)return!0;const W=30;E.current+=ne.deltaY;const re=G.cols,ve=G.rows,Te=Math.floor(re/2),xe=Math.floor(ve/2);let Be=!1,je=!1;for(;Math.abs(E.current)>=W;){je=!0;const He=E.current>0;E.current+=He?-W:W;const Me=He?65:64;He||(Be=!0),B.current({type:"terminal-input",sessionId:fe,data:`\x1B[<${Me};${Te};${xe}M`})}return Be&&Q(!0),je&&Z(),!1}),y.current=G,v.current=ae,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!m&&window.devicePixelRatio>1&&setTimeout(()=>{G.refresh(0,G.rows-1)},100),()=>{if(K=!0,ie&&clearTimeout(ie),te=null,I.removeEventListener("mousedown",Le,!0),d.current&&(d.current.remove(),d.current=null),f.current){try{f.current.dispose()}catch{}f.current=null}if(h.current){try{h.current.dispose()}catch{}h.current=null}try{G.dispose()}catch{}I&&(I.innerHTML=""),y.current=null,v.current=null,g.current=null,w.current=null,b.current=null,S.current&&window.clearTimeout(S.current),A.current!==null&&window.clearTimeout(A.current)}},[z]),k.useEffect(()=>{y.current&&(y.current.options.theme=a)},[a]),k.useEffect(()=>{const I=y.current,K=v.current;if(I&&K){I.options.fontFamily=c,I.options.fontSize=l,I.options.lineHeight=Math.round(l*i)/l,I.options.letterSpacing=o,K.fit();const U=M.current;U&&B.current({type:"terminal-resize",sessionId:U,cols:I.cols,rows:I.rows})}},[l,i,o,c]),k.useEffect(()=>{const I=y.current;if(!I)return;const K=j.current;if(j.current=p,K!==p){if(p){if(!h.current)try{const U=new Fg.WebglAddon;I.loadAddon(U),h.current=U}catch{}}else if(h.current){try{h.current.dispose()}catch{}h.current=null}}},[p]),k.useEffect(()=>{const I=y.current;if(!I)return;const K=M.current,U=T.current;if(!r){K&&(n({type:"terminal-detach",sessionId:K}),M.current=null,T.current=null,L.current=!1),I.reset();return}if(K&&K!==e&&(n({type:"terminal-detach",sessionId:K}),M.current=null,T.current=null,L.current=!1),e&&(e!==K||t!==U)){I.reset();const J=v.current;J&&J.fit(),n({type:"terminal-attach",sessionId:e,tmuxTarget:t??void 0,cols:I.cols,rows:I.rows}),M.current=e,T.current=t??null,n({type:"tmux-check-copy-mode",sessionId:e}),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{I.scrollToBottom(),q(),I.focus()},300)}!e&&K&&(M.current=null,T.current=null)},[e,t,r,n,q]),k.useEffect(()=>{const I=()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null),N.current!==null&&(window.clearTimeout(N.current),N.current=null);const J=y.current,G=R.current;!J||!G||(R.current="",J.write($+G+O,()=>{q()}))},K=()=>{P.current!==null&&window.clearTimeout(P.current),P.current=window.setTimeout(I,F),N.current===null&&(N.current=window.setTimeout(I,V))},U=s(J=>{const G=M.current;J.type==="terminal-output"&&G&&J.sessionId===G&&(R.current+=CT(J.data),K()),J.type==="tmux-copy-mode-status"&&G&&J.sessionId===G&&Q(J.inCopyMode)});return()=>{U(),I()}},[s,q,Q]),k.useEffect(()=>{const I=_.current,K=y.current,U=v.current;if(!I||!K||!U)return;const J=()=>{x.current&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>{z()},150)},G=new ResizeObserver(J);return G.observe(I),J(),()=>{G.disconnect(),x.current&&window.clearTimeout(x.current)}},[]),{containerRef:_,terminalRef:y,searchAddonRef:g,serializeAddonRef:w,progressAddonRef:b,inTmuxCopyModeRef:L,setTmuxCopyMode:Q}}function kT(e="(max-width: 767px)"){const[t,r]=k.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return k.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),s=()=>r(n.matches);return s(),typeof n.addEventListener=="function"?(n.addEventListener("change",s),()=>n.removeEventListener("change",s)):(n.addListener(s),()=>n.removeListener(s))},[e]),t}function LT(e,t,r){k.useEffect(()=>{if(!t)return;const n=s=>{e.current&&!e.current.contains(s.target)&&r()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t,r])}function RT(e,t){k.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),t())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t])}function TT({enabled:e,isOpen:t,onOpen:r,edgeThresholdPx:n=30,swipeDistancePx:s=50,swipeRatio:a=1.5}){const l=k.useRef(!1);return k.useEffect(()=>{if(!e)return;let i=0,o=0,c=!1;const p=m=>{if(t)return;const _=m.touches[0];_.clientX<=n?(i=_.clientX,o=_.clientY,c=!0,l.current=!0):c=!1},u=m=>{if(l.current=!1,!c||t)return;const _=m.changedTouches[0],y=_.clientX-i,v=Math.abs(_.clientY-o);y>=s&&y>v*a&&r(),c=!1};return document.addEventListener("touchstart",p,{passive:!0}),document.addEventListener("touchend",u,{passive:!0}),()=>{l.current=!1,document.removeEventListener("touchstart",p),document.removeEventListener("touchend",u)}},[e,t,r,n,s,a]),l}const Ml=Wd()(Vd(e=>({theme:"dark",setTheme:t=>e({theme:t}),toggleTheme:()=>e(t=>({theme:t.theme==="dark"?"light":"dark"}))}),{name:"agentboard-theme",storage:Zl(()=>Kd)})),DT={dark:{background:"#2d2d2d",foreground:"#d4d4d4",cursor:"#3b82f6",cursorAccent:"#2d2d2d",selectionBackground:"rgba(59, 130, 246, 0.35)",selectionForeground:"#ffffff",black:"#808080",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#d4d4d4",brightBlack:"#a0a0a0",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#ffffff"},light:{background:"#fafafa",foreground:"#171717",cursor:"#2563eb",cursorAccent:"#fafafa",selectionBackground:"rgba(37, 99, 235, 0.2)",selectionForeground:"#000000",black:"#171717",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#f5f5f5",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"}},MT={up:"\x1B[A",down:"\x1B[B",left:"\x1B[D",right:"\x1B[C"},AT=150,PT=250,IT=400,Xg=1500,BT=15,Fs=70;function nu(e=10){"vibrate"in navigator&&navigator.vibrate(e)}function OT(e,t){const r=Math.sqrt(e*e+t*t);if(r<BT)return{direction:null,distance:0};const n=Math.atan2(t,e)*(180/Math.PI);let s;return n>=-45&&n<45?s="right":n>=45&&n<135?s="down":n>=-135&&n<-45?s="up":s="left",{direction:s,distance:r}}function NT(e){const t=Fs-20,r=Math.min(e/t,1);return Xg-r*(Xg-IT)}function jT({onSendKey:e,disabled:t=!1,onRefocus:r,isKeyboardVisible:n}){const[s,a]=k.useState(!1),[l,i]=k.useState(null),[o,c]=k.useState({x:0,y:0}),[p,u]=k.useState({x:0,y:0}),m=k.useRef(null),_=k.useRef(null),y=k.useRef(null),v=k.useRef(!1),h=k.useRef(null),f=k.useRef(0),d=k.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),g=k.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),w=k.useCallback(T=>{const B=NT(f.current);y.current=setTimeout(()=>{h.current&&(nu(5),e(T),w(T))},B)},[e]),b=k.useCallback((T,B)=>{if(!T||t)return;const H=MT[T];f.current=B,nu(8),e(H),g(),_.current=setTimeout(()=>{w(H)},PT)},[t,e,g,w]),x=k.useCallback((T,B)=>{const H=T-o.x,j=B-o.y,$=Math.sqrt(H*H+j*j),O=Math.min($,Fs-20),R=$>0?O/$:0;u({x:H*R,y:j*R});const{direction:P,distance:N}=OT(H,j);f.current=N,P!==h.current&&(h.current=P,i(P),g(),P&&b(P,N))},[o,g,b]),C=k.useCallback(()=>{a(!1),i(null),u({x:0,y:0}),g(),h.current=null,v.current&&(r==null||r())},[g,r]),S=k.useCallback(T=>{if(t)return;T.preventDefault(),T.stopPropagation();const B=T.touches[0];v.current=(n==null?void 0:n())??!1,m.current=setTimeout(()=>{nu(15),c({x:B.clientX,y:B.clientY-80}),u({x:0,y:0}),a(!0)},AT)},[t,n]),E=k.useCallback(T=>{if(T.preventDefault(),T.stopPropagation(),!s)return;const B=T.touches[0];x(B.clientX,B.clientY)},[s,x]),L=k.useCallback(T=>{T.preventDefault(),T.stopPropagation(),m.current&&(clearTimeout(m.current),m.current=null),s&&C()},[s,C]),A=k.useCallback(T=>{T.preventDefault(),d(),C()},[d,C]);k.useEffect(()=>()=>{d()},[d]);const M=[{dir:"up",angle:-90,label:"↑"},{dir:"right",angle:0,label:"→"},{dir:"down",angle:90,label:"↓"},{dir:"left",angle:180,label:"←"}];return D.jsxs(D.Fragment,{children:[D.jsx("button",{type:"button","aria-label":"Arrow keys",className:`
189
+ terminal-key
190
+ flex items-center justify-center
191
+ h-11 min-w-[2.75rem] px-2.5
192
+ text-sm font-medium
193
+ bg-surface border border-border rounded-md
194
+ active:bg-hover active:scale-95
195
+ transition-transform duration-75
196
+ select-none
197
+ text-secondary
198
+ ${t?"opacity-50":""}
199
+ ${s?"bg-hover scale-95":""}
200
+ `,style:{touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none"},onTouchStart:S,onTouchMove:E,onTouchEnd:L,onTouchCancel:A,disabled:t,children:D.jsx(Hb,{width:20,height:20})}),s&&D.jsxs("div",{className:"fixed inset-0 z-50",style:{touchAction:"none"},onTouchMove:E,onTouchEnd:L,onTouchCancel:A,children:[D.jsx("div",{className:"absolute inset-0 bg-black/20"}),D.jsxs("div",{className:"absolute",style:{left:o.x,top:o.y,transform:"translate(-50%, -50%)"},children:[D.jsxs("div",{className:"relative rounded-full bg-black/40 backdrop-blur-md border-2 border-white/20",style:{width:Fs*2,height:Fs*2},children:[M.map(({dir:T,angle:B,label:H})=>D.jsx("div",{className:`
201
+ absolute text-2xl font-bold
202
+ transition-all duration-75
203
+ ${l===T?"text-accent scale-125":"text-white/60"}
204
+ `,style:{left:"50%",top:"50%",transform:`
205
+ translate(-50%, -50%)
206
+ rotate(${B}deg)
207
+ translateX(${Fs-25}px)
208
+ rotate(${-B}deg)
209
+ `},children:H},T)),D.jsx("div",{className:`
210
+ absolute w-12 h-12 rounded-full
211
+ bg-white/90 shadow-lg
212
+ border-2 transition-colors duration-75
213
+ ${l?"border-accent bg-accent/20":"border-white/40"}
214
+ `,style:{left:"50%",top:"50%",transform:`translate(calc(-50% + ${p.x}px), calc(-50% + ${p.y}px))`},children:D.jsx("div",{className:"absolute inset-2 rounded-full bg-white/50"})})]}),l&&D.jsx("div",{className:"absolute -bottom-8 left-1/2 -translate-x-1/2 text-white text-sm font-medium bg-black/50 px-3 py-1 rounded-full",children:l.toUpperCase()})]})]})]})}const FT=150,ni=56,ii=48,kr=6,Do=8,$T=20+kr+2,Fh=3*ni+2*kr+2*Do,nw=3*ii+2*kr+2*Do+$T;function iu(e=10){"vibrate"in navigator&&navigator.vibrate(e)}const iw=[["7","8","9"],["4","5","6"],["1","2","3"]];function HT(e,t,r){var y;const n=r.x-Fh/2,s=r.y-nw/2,a=e-n-Do,l=t-s-Do,i=3*ni+2*kr,o=3*ii+2*kr;if(a<0||a>i||l<0||l>o)return null;const c=Math.floor(a/(ni+kr)),p=Math.floor(l/(ii+kr));if(c<0||c>2||p<0||p>2)return null;const u=c*(ni+kr),m=p*(ii+kr);return a>u+ni||l>m+ii?null:((y=iw[p])==null?void 0:y[c])||null}function zT({onSendKey:e,disabled:t=!1,onRefocus:r,isKeyboardVisible:n}){const[s,a]=k.useState(!1),[l,i]=k.useState(null),[o,c]=k.useState({x:0,y:0}),p=k.useRef(null),u=k.useRef(!1),m=k.useRef(!1),_=k.useCallback(()=>{a(!1),i(null),m.current=!1,u.current&&(r==null||r())},[r]),y=k.useCallback(g=>{if(t)return;g.preventDefault(),g.stopPropagation();const w=g.touches[0];u.current=(n==null?void 0:n())??!1,m.current=!1,p.current=setTimeout(()=>{iu(15);const b=10;let x=w.clientX,C=w.clientY-120;x=Math.max(b+Fh/2,Math.min(window.innerWidth-b-Fh/2,x)),C=Math.max(b+nw/2,C),c({x,y:C}),a(!0)},FT)},[t,n]),v=k.useCallback((g,w)=>HT(g,w,o),[o]),h=k.useCallback(g=>{if(g.preventDefault(),g.stopPropagation(),!s)return;const w=g.touches[0],b=v(w.clientX,w.clientY);b!==l&&(i(b),b&&iu(5))},[s,l,v]),f=k.useCallback(g=>{g.preventDefault(),g.stopPropagation(),p.current&&(clearTimeout(p.current),p.current=null),s&&l&&!m.current&&(iu(10),e(l),m.current=!0),_()},[s,l,e,_]),d=k.useCallback(g=>{g.preventDefault(),p.current&&(clearTimeout(p.current),p.current=null),_()},[_]);return k.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]),D.jsxs(D.Fragment,{children:[D.jsx("button",{type:"button",className:`
215
+ terminal-key
216
+ flex items-center justify-center
217
+ h-11 min-w-[2.75rem] px-2.5
218
+ text-sm font-medium
219
+ bg-surface border border-border rounded-md
220
+ active:bg-hover active:scale-95
221
+ transition-transform duration-75
222
+ select-none
223
+ text-secondary
224
+ ${t?"opacity-50":""}
225
+ ${s?"bg-hover scale-95":""}
226
+ `,style:{touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none"},onTouchStart:y,onTouchMove:h,onTouchEnd:f,onTouchCancel:d,disabled:t,children:"123"}),s&&D.jsxs("div",{className:"fixed inset-0 z-50 select-none",style:{touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"},onTouchMove:h,onTouchEnd:f,onTouchCancel:d,children:[D.jsx("div",{className:"absolute inset-0 bg-black/20"}),D.jsx("div",{className:"absolute select-none",style:{left:o.x,top:o.y,transform:"translate(-50%, -50%)",WebkitUserSelect:"none",userSelect:"none"},children:D.jsxs("div",{className:"rounded-2xl bg-black/40 backdrop-blur-md border-2 border-white/20 select-none",style:{padding:Do},children:[D.jsx("div",{className:"grid grid-cols-3 select-none",style:{gap:kr},children:iw.flat().map((g,w)=>g?D.jsx("div",{className:`
227
+ flex items-center justify-center
228
+ rounded-lg text-xl font-bold
229
+ select-none
230
+ transition-all duration-75
231
+ ${l===g?"bg-accent text-white scale-110":"bg-white/90 text-gray-800"}
232
+ `,style:{width:ni,height:ii,WebkitUserSelect:"none",userSelect:"none"},children:g},w):D.jsx("div",{style:{width:ni,height:ii}},w))}),D.jsx("div",{className:"text-center text-white text-sm font-medium select-none h-5",style:{marginTop:kr+2},children:l?`Release to send "${l}"`:" "})]})})]})]})}const UT=D.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:D.jsx("path",{d:"M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14zm-11.59-2L14 13.41 17.59 17 19 15.59 15.41 12 19 8.41 17.59 7 14 10.59 10.41 7 9 8.41 12.59 12 9 15.59z"})}),WT=D.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),D.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]}),VT=D.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",ry:"2"}),D.jsx("line",{x1:"6",y1:"8",x2:"6",y2:"8"}),D.jsx("line",{x1:"10",y1:"8",x2:"10",y2:"8"}),D.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"8"}),D.jsx("line",{x1:"18",y1:"8",x2:"18",y2:"8"}),D.jsx("line",{x1:"6",y1:"12",x2:"6",y2:"12"}),D.jsx("line",{x1:"10",y1:"12",x2:"10",y2:"12"}),D.jsx("line",{x1:"14",y1:"12",x2:"14",y2:"12"}),D.jsx("line",{x1:"18",y1:"12",x2:"18",y2:"12"}),D.jsx("line",{x1:"7",y1:"16",x2:"17",y2:"16"})]}),KT=[{label:"esc",key:"\x1B"}],GT=[{label:UT,key:"",ariaLabel:"Delete word"},{label:D.jsx(Tb,{width:18,height:18}),key:"\r",grow:!0,className:"bg-accent/20 text-accent border-accent/40",ariaLabel:"Enter"}];function Wn(){"vibrate"in navigator&&navigator.vibrate(10)}function su(e,t){if(!t||e.length!==1)return{output:e,consumeCtrl:!1};const r=e.toUpperCase().charCodeAt(0);return r>=65&&r<=90?{output:String.fromCharCode(r-64),consumeCtrl:!0}:{output:e,consumeCtrl:!0}}const qT={working:"bg-working",waiting:"bg-waiting",permission:"bg-approval",unknown:"bg-muted"};function XT({onSendKey:e,disabled:t=!1,sessions:r,currentSessionId:n,onSelectSession:s,hideSessionSwitcher:a=!1,onRefocus:l,isKeyboardVisible:i,onEnterTextMode:o}){const[c,p]=k.useState(!1),[u,m]=k.useState(""),[_,y]=k.useState(!1),[v,h]=k.useState(!1),f=k.useRef(null),d=k.useRef(null),g=k.useRef(0),w=k.useRef(null);k.useEffect(()=>{c&&f.current&&f.current.focus()},[c]),k.useEffect(()=>{const j=w.current;if(!j)return;const $=O=>{t||j.contains(O.target)&&i!=null&&i()&&O.preventDefault()};return j.addEventListener("touchstart",$,{passive:!1,capture:!0}),()=>{j.removeEventListener("touchstart",$,{capture:!0})}},[t,i]),k.useEffect(()=>{if(!v||t||typeof document>"u")return;const j=$=>{const{output:O,consumeCtrl:R}=su($.key,!0);R&&($.preventDefault(),$.stopPropagation(),Wn(),e(O),h(!1))};return document.addEventListener("keydown",j,{capture:!0}),()=>{document.removeEventListener("keydown",j,{capture:!0})}},[v,t,e]),k.useEffect(()=>{if(!c)return;const j=d.current;if(!j)return;const $=async O=>{var P;const R=(P=O.clipboardData)==null?void 0:P.items;if(R){for(const N of R)if(N.type.startsWith("image/")){O.preventDefault();const F=N.getAsFile();if(!F)continue;y(!0);try{const V=new FormData;V.append("image",F,`paste.${N.type.split("/")[1]||"png"}`);const q=await fetch("/api/paste-image",{method:"POST",body:V});if(q.ok){const{path:Q}=await q.json();e(Q),p(!1),m(""),l==null||l()}}finally{y(!1)}return}}};return j.addEventListener("paste",$),()=>j.removeEventListener("paste",$)},[c,e,l]);const b=j=>{if(t)return;const $=(i==null?void 0:i())??!1;Wn();const{output:O,consumeCtrl:R}=su(j,v);R&&h(!1),e(O),$&&(l==null||l())},x=()=>{t||(Wn(),h(!v))},C=j=>{const{output:$,consumeCtrl:O}=su(j,v);O&&h(!1),e($)},S=async()=>{if(t)return;const j=(i==null?void 0:i())??!1;Wn();try{const $=await navigator.clipboard.read();for(const O of $){const R=O.types.find(P=>P.startsWith("image/"));if(R){const P=await O.getType(R),N=new FormData;N.append("image",P,`paste.${R.split("/")[1]||"png"}`);const F=await fetch("/api/paste-image",{method:"POST",body:N});if(F.ok){const{path:V}=await F.json();e(V),j&&(l==null||l());return}}if(O.types.includes("text/plain")){const N=await(await O.getType("text/plain")).text();if(N){e(N),j&&(l==null||l());return}}}}catch{try{const $=await navigator.clipboard.readText();if($){e($),j&&(l==null||l());return}}catch{}}p(!0),m("")},E=()=>{u&&(Wn(),e(u)),p(!1),m(""),l==null||l()},L=()=>{p(!1),m(""),l==null||l()},A=j=>{Wn(),s(j)},M=()=>{t||(Wn(),i!=null&&i()?document.activeElement instanceof HTMLElement&&document.activeElement.blur():o==null||o())},T=r.length>1&&!a,B=j=>$=>{t||($.preventDefault(),$.stopPropagation(),g.current=Date.now(),j())},H=j=>()=>{t||Date.now()-g.current<700||j()};return D.jsxs("div",{ref:w,className:`terminal-controls flex flex-col gap-1.5 px-2 py-2.5 bg-elevated border-t border-border ${jo()?"":"md:hidden"}`,children:[T&&D.jsxs("div",{className:"relative -mx-2",children:[D.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-3 bg-gradient-to-r from-elevated to-transparent z-10 pointer-events-none"}),D.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-3 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none"}),D.jsx("div",{className:"flex items-center gap-1.5 px-3 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory",style:{WebkitOverflowScrolling:"touch"},children:r.map((j,$)=>{const O=j.id===n;return D.jsxs("button",{type:"button",className:`
233
+ terminal-key flex items-center justify-center gap-1.5 shrink-0 snap-start
234
+ h-8 min-w-[3rem] px-2.5 text-xs font-medium rounded-md
235
+ active:scale-95 transition-transform duration-75
236
+ select-none touch-manipulation
237
+ ${O?"bg-accent/20 text-accent border border-accent/40":"bg-surface border border-border text-secondary"}
238
+ `,onClick:()=>A(j.id),children:[D.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${qT[j.status]}`}),D.jsx("span",{className:"truncate",children:$+1})]},j.id)})})]}),D.jsxs("div",{className:"flex items-center gap-1.5",children:[D.jsx("button",{type:"button",className:`
239
+ terminal-key
240
+ flex items-center justify-center
241
+ h-11 min-w-[2.75rem] px-2.5
242
+ text-sm font-medium
243
+ rounded-md
244
+ active:scale-95
245
+ transition-transform duration-75
246
+ select-none touch-manipulation
247
+ ${v?"bg-accent/20 text-accent border border-accent/40":"bg-surface border border-border text-secondary"}
248
+ ${t?"opacity-50":""}
249
+ `,onMouseDown:j=>j.preventDefault(),onTouchStart:B(x),onClick:H(x),disabled:t,children:"ctrl"}),KT.map((j,$)=>D.jsx("button",{type:"button",className:`
250
+ terminal-key
251
+ flex items-center justify-center
252
+ h-11 min-w-[2.75rem] px-2.5
253
+ text-sm font-medium
254
+ bg-surface border border-border rounded-md
255
+ active:bg-hover active:scale-95
256
+ transition-transform duration-75
257
+ select-none touch-manipulation
258
+ ${j.grow?"flex-1":""}
259
+ ${j.className??"text-secondary"}
260
+ ${t?"opacity-50":""}
261
+ `,onMouseDown:O=>O.preventDefault(),onTouchStart:B(()=>b(j.key)),onClick:H(()=>b(j.key)),disabled:t,children:j.label},`left-${$}`)),D.jsx(zT,{onSendKey:C,disabled:t,onRefocus:l,isKeyboardVisible:i}),D.jsx(jT,{onSendKey:C,disabled:t,onRefocus:l,isKeyboardVisible:i}),GT.map((j,$)=>D.jsx("button",{type:"button","aria-label":j.ariaLabel,className:`
262
+ terminal-key
263
+ flex items-center justify-center
264
+ h-11 min-w-[2.75rem] px-2.5
265
+ text-sm font-medium
266
+ bg-surface border border-border rounded-md
267
+ active:bg-hover active:scale-95
268
+ transition-transform duration-75
269
+ select-none touch-manipulation
270
+ ${j.grow?"flex-1":""}
271
+ ${j.className??"text-secondary"}
272
+ ${t?"opacity-50":""}
273
+ `,onMouseDown:O=>O.preventDefault(),onTouchStart:B(()=>b(j.key)),onClick:H(()=>b(j.key)),disabled:t,children:j.label},`right-${$}`)),D.jsx("button",{type:"button","aria-label":"Paste",className:`
274
+ terminal-key
275
+ flex items-center justify-center
276
+ h-11 min-w-[2.75rem] px-2.5
277
+ text-sm font-medium
278
+ bg-surface border border-border rounded-md
279
+ active:bg-hover active:scale-95
280
+ transition-transform duration-75
281
+ select-none touch-manipulation
282
+ text-secondary
283
+ ${t?"opacity-50":""}
284
+ `,onMouseDown:j=>j.preventDefault(),onTouchStart:B(()=>{S()}),onClick:H(()=>{S()}),disabled:t,children:WT}),D.jsx("button",{type:"button","aria-label":"Show keyboard",className:`
285
+ terminal-key
286
+ flex items-center justify-center
287
+ h-11 min-w-[2.75rem] px-2.5
288
+ text-sm font-medium
289
+ bg-surface border border-border rounded-md
290
+ active:bg-hover active:scale-95
291
+ transition-transform duration-75
292
+ select-none touch-manipulation
293
+ text-secondary
294
+ ${t?"opacity-50":""}
295
+ `,onMouseDown:j=>j.preventDefault(),onTouchStart:B(M),onClick:H(M),disabled:t,children:VT})]}),c&&D.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:D.jsxs("div",{ref:d,className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[D.jsx("h3",{className:"text-base font-medium text-primary mb-1 text-balance",children:"Paste"}),D.jsx("p",{className:"text-xs text-muted mb-3 text-pretty",children:"Text or image (long-press → Paste)"}),_?D.jsx("div",{className:"w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary",children:"Uploading image..."}):D.jsx("input",{ref:f,type:"text",value:u,onChange:j=>m(j.target.value),onKeyDown:j=>{j.key==="Enter"?(j.preventDefault(),E()):j.key==="Escape"&&(j.preventDefault(),L())},placeholder:"Paste here...",className:"w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent",style:{fontSize:"16px"}}),D.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[D.jsx("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform",children:"Cancel"}),D.jsx("button",{type:"button",onClick:E,disabled:_,className:"px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50",children:"Send"})]})]})})]})}function YT({isOpen:e,onClose:t,sessions:r,inactiveSessions:n=[],selectedSessionId:s,onSelect:a,onRename:l,onResume:i,onSetPinned:o,onNewSession:c,loading:p,error:u}){const m=u1(),_=k.useRef(null),y=k.useRef(null);k.useEffect(()=>{if(!e)return;const f=d=>{d.key==="Escape"&&(d.preventDefault(),t())};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,t]),k.useEffect(()=>{var f;e?(y.current=document.activeElement,(f=_.current)==null||f.focus()):y.current&&(y.current.focus(),y.current=null)},[e]),k.useEffect(()=>{if(!e)return;const f=_.current;if(!f)return;const d=50,g=1.5;let w=0,b=0;const x=S=>{const E=S.touches[0];w=E.clientX,b=E.clientY},C=S=>{const E=S.changedTouches[0],L=w-E.clientX,A=Math.abs(E.clientY-b);L>=d&&L>A*g&&("vibrate"in navigator&&navigator.vibrate(10),t())};return f.addEventListener("touchstart",x,{passive:!0}),f.addEventListener("touchend",C,{passive:!0}),()=>{f.removeEventListener("touchstart",x),f.removeEventListener("touchend",C)}},[e,t]);const v=f=>{a(f),t()},h=m?{transition:"none"}:void 0;return D.jsxs(D.Fragment,{children:[D.jsx("div",{className:`session-drawer-backdrop ${e?"open":""}`,style:h,onClick:t,"aria-hidden":"true"}),D.jsxs("div",{ref:_,className:`session-drawer ${e?"open":""}`,style:h,role:"dialog","aria-modal":"true","aria-label":"Session list",tabIndex:-1,children:[D.jsx(B1,{sessions:r,inactiveSessions:n,selectedSessionId:s,onSelect:v,onRename:l,onResume:i,onSetPinned:o,loading:p,error:u}),D.jsx("div",{className:"shrink-0 border-t border-border px-2 pt-2",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom, 0.5rem))"},children:D.jsx("button",{onClick:()=>{c(),t()},className:"btn btn-primary w-full py-2 text-sm",children:"New Session"})})]})]})}const JT={working:"Working",waiting:"Waiting",permission:"Needs Input",unknown:"Unknown"},QT={working:"text-working",waiting:"text-waiting",permission:"text-approval",unknown:"text-muted"},ZT={working:"bg-green-500/35 text-white",waiting:"bg-blue-500/35 text-white",permission:"bg-amber-500/35 text-white",unknown:"bg-gray-500/35 text-white"},eD={working:"bg-working text-white",waiting:"bg-waiting text-white",permission:"bg-approval text-white",unknown:"bg-muted text-white"};function Yg(){"vibrate"in navigator&&navigator.vibrate(10)}function tD({session:e,sessions:t,inactiveSessions:r=[],connectionStatus:n,sendMessage:s,subscribe:a,onClose:l,onSelectSession:i,onNewSession:o,onKillSession:c,onRenameSession:p,onResumeSession:u,onSetPinned:m,onOpenSettings:_,loading:y=!1,error:v=null}){const h=Ml(W=>W.theme),f=DT[h],d=ue(W=>W.useWebGL),g=ue(W=>W.fontSize),w=ue(W=>W.lineHeight),b=ue(W=>W.letterSpacing),x=ue(W=>W.fontOption),C=ue(W=>W.customFontFamily),S=yb(x,C),E=ue(W=>W.shortcutModifier),L=Gi(Fo(E)),A=jo(),M=kT(),[T,B]=k.useState(!1),[H,j]=k.useState(!1),[$,O]=k.useState(!1),[R,P]=k.useState(!1),[N,F]=k.useState(!1),[V,q]=k.useState(!1),[Q,Z]=k.useState(""),z=k.useRef(!1),I=k.useRef(null),K=k.useRef(null),U=k.useRef(null),J=k.useRef(null),G=(e==null?void 0:e.remote)===!0,{containerRef:ae,terminalRef:le,inTmuxCopyModeRef:me,setTmuxCopyMode:ke}=ET({sessionId:(e==null?void 0:e.id)??null,tmuxTarget:(e==null?void 0:e.tmuxWindow)??null,allowAttach:!G,sendMessage:s,subscribe:a,theme:f,fontSize:g,lineHeight:w,letterSpacing:b,fontFamily:S,useWebGL:d,onScrollChange:W=>{B(!W)}}),X=k.useCallback(()=>{var W;!e||G||(s({type:"tmux-cancel-copy-mode",sessionId:e.id}),ke(!1),(W=le.current)==null||W.scrollToBottom())},[e,G,s,ke,le]),ee=k.useCallback(()=>{F(!0),Yg()},[]),Ae=TT({enabled:M||A,isOpen:N,onOpen:ee});k.useEffect(()=>{!M&&!A&&N&&F(!1)},[N,M,A]);const de=k.useCallback(()=>P(!1),[]);LT(K,R,de),k.useEffect(()=>{V&&U.current&&(U.current.focus(),U.current.select())},[V]),k.useEffect(()=>{$&&J.current&&J.current.focus()},[$]);const he=k.useCallback(()=>O(!1),[]);RT($,he);const ce=()=>{e&&(c(e.id),O(!1))},te=()=>{e&&(Z(e.agentSessionName||e.name),q(!0),P(!1))},pe=()=>{if(!e)return;const W=Q.trim(),re=e.agentSessionName||e.name;W&&W!==re&&p(e.id,W),q(!1)},ie=W=>{W.key==="Enter"?(W.preventDefault(),pe()):W.key==="Escape"&&(W.preventDefault(),q(!1))};k.useEffect(()=>{if(!A||!e){j(!1);return}const W=ae.current;if(!W)return;const re=Se=>{const Ce=W.querySelector(".xterm-accessibility-tree");if(!Ce)return!1;const $e=Se.anchorNode,Ke=Se.focusNode;return!!$e&&Ce.contains($e)||!!Ke&&Ce.contains(Ke)},ve=()=>{const Se=W.querySelector(".xterm-accessibility"),Ce=W.querySelector(".xterm-accessibility-tree");!Se||!Ce||(Se.style.setProperty("opacity","0"),Ce.style.setProperty("opacity","0"),Se.style.setProperty("-webkit-user-select","none"),Se.style.setProperty("user-select","none"),Ce.style.setProperty("-webkit-user-select","none"),Ce.style.setProperty("user-select","none"),Se.offsetHeight,requestAnimationFrame(()=>{Se.style.removeProperty("opacity"),Ce.style.removeProperty("opacity"),Se.style.removeProperty("-webkit-user-select"),Se.style.removeProperty("user-select"),Ce.style.removeProperty("-webkit-user-select"),Ce.style.removeProperty("user-select")}))},Te=()=>{var Ce;z.current=!1;const Se=window.getSelection();try{Se==null||Se.removeAllRanges()}catch{}(Ce=le.current)==null||Ce.clearSelection(),ve(),j(!1)};I.current=Te;const xe=()=>{const Se=window.getSelection();if(!Se||Se.rangeCount===0||Se.isCollapsed){z.current?Te():j(Ke=>Ke&&!1);return}const Ce=re(Se);if(!Ce&&z.current){Te();return}z.current=Ce;const $e=Ce;j(Ke=>Ke!==$e?$e:Ke)},Be=()=>{const Se=window.getSelection();!Se||Se.isCollapsed||re(Se)&&setTimeout(Te,0)},je=10;let He=null,Me=!1;const Pe=Se=>{if(Se.touches.length===1){const Ce=Se.touches[0];He={x:Ce.clientX,y:Ce.clientY},Me=!1}},Ge=Se=>{if(Me||!He||Se.touches.length!==1)return;const Ce=Se.touches[0],$e=Math.abs(Ce.clientX-He.x),Ke=Math.abs(Ce.clientY-He.y);($e>je||Ke>je)&&(Me=!0)},Fe=Se=>{const Ce=Me;He=null,Me=!1;const $e=window.getSelection();if(!$e||$e.rangeCount===0||$e.isCollapsed){j(!1);return}const Ke=W.querySelector(".xterm-accessibility-tree");if(!Ke)return;if(!re($e)){j(!1);return}if(Ce)return;const Ue=Se.target,rt=Ue?Ke.contains(Ue):!1;let at=!1;if(rt&&Ue)try{at=$e.containsNode(Ue,!0)}catch{at=!1}(!rt||!at)&&setTimeout(Te,0)};return document.addEventListener("selectionchange",xe),document.addEventListener("copy",Be),document.addEventListener("touchstart",Pe,{passive:!0}),document.addEventListener("touchmove",Ge,{passive:!0}),document.addEventListener("touchend",Fe,{passive:!0}),()=>{document.removeEventListener("selectionchange",xe),document.removeEventListener("copy",Be),document.removeEventListener("touchstart",Pe),document.removeEventListener("touchmove",Ge),document.removeEventListener("touchend",Fe),I.current=null,z.current=!1}},[ae,A,e==null?void 0:e.id]),k.useEffect(()=>{var Be;if(!A)return;const W=ae.current;if(!W)return;const re=()=>{const je=le.current,He=W.querySelector(".xterm");if(!je||!He)return;const Me=He.querySelector(".xterm-screen"),Pe=He.querySelector(".xterm-accessibility"),Ge=He.querySelector(".xterm-accessibility-tree");if(!Me||!Pe||!Ge)return;const Fe=He.getBoundingClientRect(),Se=Me.getBoundingClientRect(),Ce=Se.left-Fe.left,$e=Se.top-Fe.top;Object.assign(Pe.style,{left:`${Ce}px`,top:`${$e}px`,right:"auto",bottom:"auto",width:`${Se.width}px`,height:`${Se.height}px`});const Ke=Se.width/je.cols,Ue=Se.height/je.rows,rt=document.createElement("span");rt.textContent="0".repeat(200),rt.style.cssText="position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px",Ge.appendChild(rt);const at=rt.getBoundingClientRect().width/200;rt.remove();const dt=Math.max(-2,Math.min(2,Ke-at));W.style.setProperty("--xterm-font-size",`${je.options.fontSize}px`),W.style.setProperty("--xterm-cell-height",`${Ue}px`),W.style.setProperty("--xterm-a11y-letter-spacing",`${dt}px`)};re();const ve=window.requestAnimationFrame(re),Te=window.setTimeout(re,100),xe=()=>window.requestAnimationFrame(re);return(Be=window.visualViewport)==null||Be.addEventListener("resize",xe),window.addEventListener("orientationchange",xe),()=>{var je;window.cancelAnimationFrame(ve),window.clearTimeout(Te),(je=window.visualViewport)==null||je.removeEventListener("resize",xe),window.removeEventListener("orientationchange",xe)}},[ae,g,A,e==null?void 0:e.id,le]);const oe=k.useRef(H);k.useEffect(()=>{oe.current=H},[H]);const Le=k.useRef(e==null?void 0:e.id);k.useEffect(()=>{Le.current=e==null?void 0:e.id},[e==null?void 0:e.id]);const be=k.useRef(s);k.useEffect(()=>{be.current=s},[s]);const Re=k.useRef(!1);k.useEffect(()=>{const W=ae.current;if(!W||!(e!=null&&e.id)||!M&&!A)return;const re=6,ve=350;let Te={x:0,y:0},xe=0,Be=!1,je=null,He=0,Me=0,Pe=0,Ge=Math.round(g*w),Fe=null;const Se=()=>{const Ye=window.getComputedStyle(W).getPropertyValue("--xterm-cell-height").trim(),lt=Number.parseFloat(Ye);return!Number.isNaN(lt)&&lt>0?lt:Math.round(g*w)},Ce=()=>W.querySelector(".xterm-helper-textarea"),$e=()=>{const Ee=Ce();Ee&&document.activeElement!==Ee&&(Ee.disabled=!0)},Ke=()=>{const Ee=Ce();Ee&&(Ee.disabled=!1)};$e();const Ue=()=>{if(me.current)return;const Ee=Ce();Ee&&(Ee.disabled=!1,Ee.focus())},rt=()=>{Fe!==null&&(cancelAnimationFrame(Fe),Fe=null),Me=0},at=Ee=>{const Ye=Le.current;if(!Ye||Ee===0)return!1;const lt=le.current,Ur=(lt==null?void 0:lt.cols)??80,_i=(lt==null?void 0:lt.rows)??24,yi=Math.floor(Ur/2),Fn=Math.floor(_i/2),$n=Ee>0?65:64,Hn=Math.abs(Ee),cn=Ee<0;for(let Wr=0;Wr<Hn;Wr++)be.current({type:"terminal-input",sessionId:Ye,data:`\x1B[<${$n};${yi};${Fn}M`});return cn&&ke(!0),cn},dt=()=>{je=null,Me=0,Pe=0},Rt=()=>{if(!A)return!1;const Ee=window.getSelection();if(!Ee||Ee.isCollapsed)return!1;const Ye=W.querySelector(".xterm-accessibility-tree");if(!Ye)return!1;const lt=Ee.anchorNode,Ur=Ee.focusNode;return!!lt&&Ye.contains(lt)||!!Ur&&Ye.contains(Ur)},Ar=()=>{var Ee;!A||!z.current||Rt()||(Ee=I.current)==null||Ee.call(I)},zt=Ee=>{if(rt(),Ar(),Ae.current||N){dt();return}if(oe.current){dt();return}if(Ee.touches.length===1){const Ye=Ee.touches[0];Te={x:Ye.clientX,y:Ye.clientY},xe=performance.now(),Be=!1,je=Ye.clientY,He=xe,Me=0,Pe=0,Ge=Se(),Ke()}},Pr=Ee=>{if(Ee.touches.length!==1||je===null)return;if(Ar(),Ae.current||N){dt();return}if(oe.current||Rt()){dt();return}Ee.preventDefault(),Ee.stopPropagation();const Ye=performance.now(),lt=Ee.touches[0],Ur=lt.clientX,_i=lt.clientY,yi=Math.abs(Ur-Te.x),Fn=Math.abs(_i-Te.y);!Be&&(yi>re||Fn>re)&&(Be=!0,$e());const $n=je-_i,Hn=Ye-He;if(je=_i,He=Ye,Hn>0){const ac=$n/Hn;Me=Me*.7+ac*.3}Pe+=$n;const cn=Math.max(6,Ge*.6),Wr=Math.trunc(Pe/cn);Wr!==0&&(at(Wr),Pe-=Wr*cn)},ln=Ee=>{var yi;const Ye=Me,lt=performance.now()-xe;if(dt(),Ae.current||N)return;const Ur=Rt();if(oe.current&&!Ur&&((yi=I.current)==null||yi.call(I)),oe.current||Ur){me.current&&(Re.current=!0);return}if(!Be){if(A&&lt>=ve)return;if(me.current){Ee.preventDefault(),Ee.stopPropagation(),Re.current=!0;return}Ue();return}if(Math.abs(Ye)>.12){let Fn=Ye,$n=performance.now();const Hn=()=>{const cn=performance.now(),Wr=cn-$n;$n=cn;const ac=Fn*Wr;Pe+=ac;const Jf=Math.max(6,Ge*.6),lc=Math.trunc(Pe/Jf);lc!==0&&(at(lc),Pe-=lc*Jf),Fn*=Math.pow(.95,Wr/16.67),Math.abs(Fn)>.02?Fe=requestAnimationFrame(Hn):Fe=null};Fe=requestAnimationFrame(Hn)}},ys=Ee=>{Re.current&&(Ee.preventDefault(),Ee.stopPropagation(),Re.current=!1)},Xo={passive:!0,capture:!0},Yo={passive:!1,capture:!0},Y={passive:!1,capture:!0},Xe={capture:!0};return W.addEventListener("touchstart",zt,Xo),W.addEventListener("touchmove",Pr,Yo),W.addEventListener("touchend",ln,Y),W.addEventListener("mousedown",ys,Xe),()=>{W.removeEventListener("touchstart",zt,Xo),W.removeEventListener("touchmove",Pr,Yo),W.removeEventListener("touchend",ln,Y),W.removeEventListener("mousedown",ys,Xe);const Ee=Ce();Ee&&(Ee.disabled=!1)}},[e==null?void 0:e.id,ae,le,A,M,N,g,w]);const De=k.useCallback(W=>{!e||G||s({type:"terminal-input",sessionId:e.id,data:W})},[e,G,s]),ne=k.useCallback(()=>{const W=ae.current;if(!W)return;const re=W.querySelector(".xterm-helper-textarea");re&&(re.removeAttribute("disabled"),re.focus())},[ae]),fe=k.useCallback(()=>{if(!e||G)return;me.current&&(s({type:"tmux-cancel-copy-mode",sessionId:e.id}),ke(!1));const W=ae.current;if(!W)return;const re=W.querySelector(".xterm-helper-textarea");re&&(re.removeAttribute("disabled"),re.focus())},[e,s,ae,me,ke]),Ie=k.useCallback(()=>{var Be,je;if(typeof document>"u")return!1;const W=ae.current;if(!W)return!1;const re=W.querySelector(".xterm-helper-textarea");if(re&&document.activeElement===re)return!0;const ve=document.activeElement,Te=typeof HTMLInputElement<"u"&&ve instanceof HTMLInputElement,xe=typeof HTMLTextAreaElement<"u"&&ve instanceof HTMLTextAreaElement;return Te||xe||ve&&ve.isContentEditable?!1:!!((je=(Be=document.documentElement)==null?void 0:Be.classList)!=null&&je.contains("keyboard-visible"))},[ae]);return k.useEffect(()=>{if(!A)return;const W=ae.current;if(!W)return;const re=W.querySelector(".xterm-accessibility"),ve=W.querySelector(".xterm-accessibility-tree");if(!re||!ve)return;const Te=()=>{const xe=W.querySelector(".xterm-helper-textarea");(xe?document.activeElement===xe:!1)&&!oe.current?(re.style.pointerEvents="none",ve.style.pointerEvents="none"):(re.style.removeProperty("pointer-events"),ve.style.removeProperty("pointer-events"))};return Te(),document.addEventListener("focusin",Te),document.addEventListener("focusout",Te),()=>{document.removeEventListener("focusin",Te),document.removeEventListener("focusout",Te)}},[ae,A,H]),D.jsxs("section",{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${A?"ios-native-term-selection":""}`,"data-testid":"terminal-panel",children:[D.jsxs("div",{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e?"":"md:hidden"}`,children:[D.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[D.jsx("button",{onClick:()=>F(!0),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0","aria-label":"Open session menu",children:D.jsx(Fb,{width:16,height:16})}),e&&!G&&D.jsx("button",{onClick:()=>O(!0),className:"hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0",title:`Kill session (${L}X)`,"aria-label":"Kill session",children:D.jsx(ch,{width:16,height:16})}),e?D.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[V?D.jsx("input",{ref:U,type:"text",value:Q,onChange:W=>Z(W.target.value),onBlur:pe,onKeyDown:ie,className:"w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):D.jsx("span",{className:"text-sm font-medium text-primary truncate",children:e.agentSessionName||e.name}),D.jsx("span",{className:`text-xs shrink-0 ${QT[e.status]}`,children:JT[e.status]})]}):D.jsx("span",{className:"text-sm font-medium text-primary md:hidden",children:"Sessions"})]}),D.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n!=="connected"&&D.jsx("span",{className:"text-xs text-approval",children:n}),D.jsx("button",{onClick:o,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden",title:`New session (${L}N)`,"aria-label":"New session",children:D.jsx(T0,{width:16,height:16})}),e&&!G&&D.jsx("button",{onClick:()=>O(!0),className:"flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all",title:`Kill session (${L}X)`,"aria-label":"Kill session",children:D.jsx(ch,{width:16,height:16})}),e&&D.jsxs("div",{className:"relative md:hidden",ref:K,children:[D.jsx("button",{onClick:()=>P(!R),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"More options","aria-label":"More options",children:D.jsx(Mb,{width:16,height:16})}),R&&D.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1",children:[!G&&D.jsxs("button",{onClick:te,className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[D.jsx(L0,{width:14,height:14}),"Rename"]}),D.jsxs("button",{onClick:()=>{_(),P(!1)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[D.jsx(Vb,{width:14,height:14}),"Settings"]})]})]})]})]}),e&&t.length>1&&D.jsxs("div",{className:"relative overflow-hidden bg-elevated border-b border-border md:hidden",children:[D.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none"}),D.jsx("div",{className:"flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory",style:{WebkitOverflowScrolling:"touch"},children:t.map((W,re)=>{const ve=W.id===e.id;return D.jsx("button",{type:"button",className:`
296
+ flex items-center justify-center shrink-0 snap-start
297
+ h-8 w-8 text-sm font-extrabold rounded-lg
298
+ active:scale-95 transition-all duration-75
299
+ select-none touch-manipulation
300
+ ${ve?eD[W.status]:ZT[W.status]}
301
+ `,onClick:()=>{Yg(),i(W.id)},children:re+1},W.id)})})]}),D.jsxs("div",{className:"relative flex-1",children:[D.jsx("div",{ref:ae,className:"absolute inset-0"}),!e&&D.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted",children:"Select a session to view terminal"}),e&&G&&D.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center text-sm text-muted",children:"Remote session (read-only). Use SSH to attach on the host."}),T&&e&&!H&&D.jsxs("button",{onClick:X,className:"absolute bottom-8 left-1/2 z-20 flex h-10 px-4 items-center justify-center gap-1.5 rounded-full bg-blue-600/90 text-white shadow-lg hover:bg-blue-600 active:scale-95 transition-all",style:{transform:"translateX(-50%)"},title:"Scroll to bottom","aria-label":"Scroll to bottom",children:[D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:D.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})}),D.jsx("span",{className:"text-sm font-medium",children:"Jump to bottom"})]})]}),e&&D.jsx(XT,{onSendKey:De,disabled:n!=="connected"||G,sessions:t.map(W=>({id:W.id,name:W.name,status:W.status})),currentSessionId:e.id,onSelectSession:i,hideSessionSwitcher:!0,onRefocus:ne,isKeyboardVisible:Ie,onEnterTextMode:fe}),(M||A)&&D.jsx(YT,{isOpen:N,onClose:()=>F(!1),sessions:t,inactiveSessions:r,selectedSessionId:(e==null?void 0:e.id)??null,onSelect:i,onRename:p,onResume:u,onSetPinned:m,onNewSession:o,loading:y,error:v}),$&&e&&D.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:D.jsxs("div",{className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[D.jsx("h3",{className:"text-base font-medium text-primary mb-2 text-balance",children:"Kill Session"}),D.jsxs("p",{className:"text-sm text-secondary mb-4 text-pretty",children:['Kill "',e.agentSessionName||e.name,'"? The process will be terminated. Conversation history is preserved in logs.']}),D.jsxs("div",{className:"flex justify-end gap-2",children:[D.jsx("button",{onClick:()=>O(!1),className:"btn py-1.5 px-3 text-sm",children:"Cancel"}),D.jsx("button",{ref:J,onClick:ce,className:"btn btn-danger py-1.5 px-3 text-sm",children:"Kill Session"})]})]})})]})}function rD({onSelect:e,onCancel:t,initialPath:r}){const[n,s]=k.useState(r||"~"),[a,l]=k.useState(null),[i,o]=k.useState(null),[c,p]=k.useState(!0),[u,m]=k.useState(-1),_=k.useRef(null),y=ue(g=>g.recentPaths),v=k.useCallback(async g=>{var x;(x=_.current)==null||x.abort();const w=new AbortController;_.current=w;const{signal:b}=w;p(!0),o(null),l(null),m(-1),s(g);try{const C=await fetch(`/api/directories?path=${encodeURIComponent(g)}`,{signal:b});if(!C.ok){const E=await C.json();throw new Error(E.message||"Failed to load directory")}const S=await C.json();if(_.current!==w)return;l(S),s(S.path)}catch(C){if(_.current!==w)return;const S=C;(S==null?void 0:S.name)!=="AbortError"&&o((S==null?void 0:S.message)||"Failed to load directory")}finally{_.current===w&&p(!1)}},[]);k.useEffect(()=>(v(r||"~"),()=>{var g;(g=_.current)==null||g.abort()}),[v,r]);const h=(a==null?void 0:a.directories)??[],f=(a==null?void 0:a.path)||n,d=a==null?void 0:a.parent;return k.useEffect(()=>{const g=w=>{if(w.key==="Escape"){w.preventDefault(),t();return}if(!c){if(w.key==="ArrowDown"){w.preventDefault(),m(b=>h.length===0?-1:b<0?0:Math.min(b+1,h.length-1));return}if(w.key==="ArrowUp"){w.preventDefault(),m(b=>h.length===0?-1:b<0?h.length-1:Math.max(b-1,0));return}if(w.key==="Enter"){w.preventDefault();const b=h[u];b?v(b.path):f&&e(f);return}w.key==="Backspace"&&d&&(w.preventDefault(),v(d))}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[h,f,v,u,c,t,e,d]),D.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Directory browser",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4",onClick:g=>{g.target===g.currentTarget&&t()},"data-testid":"directory-browser",children:D.jsxs("div",{className:"w-full max-w-lg border border-border bg-elevated p-4",children:[D.jsxs("div",{className:"flex items-center gap-3 border-b border-border pb-2",children:[D.jsx("button",{type:"button",className:"btn",onClick:()=>{d&&v(d)},disabled:!d||c,children:"Up"}),D.jsx("div",{className:"min-w-0 flex-1 truncate text-xs font-mono text-secondary",title:f,"data-testid":"directory-current-path",children:f})]}),D.jsx("div",{className:"mt-3 max-h-60 overflow-y-auto border border-border bg-surface",children:c?D.jsx("div",{className:"px-3 py-4 text-xs text-muted","data-testid":"directory-loading",children:"Loading directories..."}):i?D.jsxs("div",{className:"px-3 py-4 text-xs","data-testid":"directory-error",children:[D.jsx("p",{className:"text-danger",children:i}),D.jsx("button",{type:"button",className:"btn mt-3",onClick:()=>v(n),children:"Retry"})]}):h.length===0?D.jsx("div",{className:"px-3 py-4 text-xs text-muted","data-testid":"directory-empty",children:"No subdirectories"}):D.jsx("div",{className:"py-1",children:h.map((g,w)=>D.jsxs("button",{type:"button",onClick:()=>v(g.path),onMouseEnter:()=>m(w),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs ${w===u?"bg-hover text-primary":"text-secondary"}`,"data-testid":"directory-entry","data-entry-name":g.name,"data-entry-path":g.path,children:[D.jsx(Bb,{width:14,height:14,className:"shrink-0 text-muted","aria-hidden":"true"}),D.jsx("span",{className:"truncate",children:g.name})]},g.path))})}),a!=null&&a.truncated?D.jsx("p",{className:"mt-2 text-[10px] text-muted",children:"Showing first 200 directories."}):null,D.jsxs("div",{className:"mt-4 border-t border-border pt-3",children:[D.jsx("div",{className:"text-[10px] uppercase tracking-wider text-secondary",children:"Recent"}),y.length===0?D.jsx("p",{className:"mt-2 text-xs text-muted",children:"No recent paths yet."}):D.jsx("div",{className:"mt-2 space-y-1",children:y.map(g=>D.jsx("button",{type:"button",className:"block w-full truncate text-left text-xs text-secondary hover:text-primary",onClick:()=>v(g),title:g,"data-testid":"directory-recent","data-recent-path":g,children:g},g))})]}),D.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[D.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),D.jsx("button",{type:"button",onClick:()=>{f&&e(f)},className:"btn btn-primary",disabled:c||!f,children:"Select"})]})]})})}function nD({isOpen:e,onClose:t,onCreate:r,defaultProjectDir:n,commandPresets:s,defaultPresetId:a,lastProjectPath:l,activeProjectPath:i}){const[o,c]=k.useState(""),[p,u]=k.useState(""),[m,_]=k.useState(null),[y,v]=k.useState(""),[h,f]=k.useState(!1),d=k.useRef(null),g=k.useRef(null),w=k.useRef(null);if(k.useEffect(()=>{if(!e){c(""),u(""),_(null),v(""),f(!1),setTimeout(()=>{if(typeof document>"u"||typeof document.querySelector!="function")return;const T=document.querySelector(".xterm-helper-textarea");T&&(T.removeAttribute("disabled"),T.focus())},300);return}if(typeof document<"u"&&typeof document.querySelector=="function"){const T=document.querySelector(".xterm-helper-textarea");T&&typeof T.setAttribute=="function"&&(typeof T.blur=="function"&&T.blur(),T.setAttribute("disabled","true"))}const A=(i==null?void 0:i.trim())||l||n;c(A),u("");const M=s.find(T=>T.id===a);M?(_(a),v(Bc(M))):s.length>0?(_(s[0].id),v(Bc(s[0]))):(_(null),v("")),setTimeout(()=>{var T;if((T=w.current)==null||T.focus(),g.current){const B=g.current;B.scrollLeft=B.scrollWidth}},50)},[i,s,a,n,e,l]),k.useEffect(()=>{if(!e||typeof window>"u"||typeof window.addEventListener!="function")return;const A=()=>d.current?Array.from(d.current.querySelectorAll('input:not([disabled]), button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]')):[],M=T=>{var B,H,j;if(!h){if(T.key==="Escape"){typeof T.stopPropagation=="function"&&T.stopPropagation(),t();return}if(T.key==="Enter"&&((B=document.activeElement)==null?void 0:B.tagName)!=="INPUT"){T.preventDefault(),typeof T.stopPropagation=="function"&&T.stopPropagation(),(H=d.current)==null||H.requestSubmit();return}if(T.key==="Tab"){T.preventDefault(),typeof T.stopPropagation=="function"&&T.stopPropagation();const $=A();if($.length===0)return;const O=document.activeElement,R=$.indexOf(O);let P;R===-1?P=T.shiftKey?$.length-1:0:T.shiftKey?P=R<=0?$.length-1:R-1:P=R>=$.length-1?0:R+1,(j=$[P])==null||j.focus()}}};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[e,t,h]),!e)return null;const b=A=>{const M=s.find(T=>T.id===A);M&&(_(A),v(Bc(M)))},x=()=>{_(null),v("")},C=m===null,S=A=>{A.preventDefault();const M=o.trim();if(!M)return;const T=y.trim();r(M,p.trim()||void 0,T||void 0),t()},E=[...s.map(A=>({id:A.id,label:A.label,isCustom:!1})),{id:"custom",label:"Custom",isCustom:!0}],L=o.trim()||"~";return D.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"new-session-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:A=>{A.target===A.currentTarget&&t()},children:[D.jsxs("form",{ref:d,onSubmit:S,className:"w-full max-w-md border border-border bg-elevated p-6",children:[D.jsx("h2",{id:"new-session-title",className:"text-sm font-semibold uppercase tracking-wider text-primary text-balance",children:"New Session"}),D.jsxs("div",{className:"mt-4 space-y-4",children:[D.jsxs("div",{children:[D.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Command"}),D.jsx("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Command preset",children:E.map((A,M)=>{const T=A.isCustom?C:m===A.id;return D.jsx("button",{ref:T?w:void 0,type:"button",role:"radio","aria-checked":T,tabIndex:T?0:-1,onClick:()=>{A.isCustom?x():b(A.id)},onKeyDown:B=>{var R;let H=M;if(B.key==="ArrowRight"||B.key==="ArrowDown")B.preventDefault(),H=(M+1)%E.length;else if(B.key==="ArrowLeft"||B.key==="ArrowUp")B.preventDefault(),H=(M-1+E.length)%E.length;else return;const j=E[H];j.isCustom?x():b(j.id);const $=B.currentTarget.parentElement,O=$==null?void 0:$.querySelectorAll('[role="radio"]');(R=O==null?void 0:O[H])==null||R.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${T?"btn-primary":""}`,children:A.label},A.id)})}),D.jsx("input",{value:y,onChange:A=>v(A.target.value),placeholder:"Enter command...",className:"input mt-2 font-mono text-xs"})]}),D.jsxs("div",{children:[D.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Project Path"}),D.jsxs("div",{className:"flex gap-2",children:[D.jsx("input",{ref:g,value:o,onChange:A=>c(A.target.value),placeholder:i||l||n||"/Users/you/code/my-project",className:"input flex-1 text-sm"}),D.jsx("button",{type:"button",className:"btn",onClick:()=>f(!0),children:"Browse"})]})]}),D.jsxs("div",{children:[D.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Display Name"}),D.jsx("input",{value:p,onChange:A=>u(A.target.value),placeholder:"auto-generated",className:"input text-sm placeholder:italic"})]})]}),D.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[D.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),D.jsx("button",{type:"submit",className:"btn btn-primary",children:"Create"})]})]}),h&&D.jsx(rD,{initialPath:L,onSelect:A=>{c(A),f(!1)},onCancel:()=>f(!1)})]})}const ou=1,au=168;function iD({controlled:e,default:t,name:r,state:n="value"}){const{current:s}=k.useRef(e!==void 0),[a,l]=k.useState(t),i=s?e:a,o=k.useCallback(c=>{s||l(c)},[]);return[i,o]}const Jg={};function Go(e,t){const r=k.useRef(Jg);return r.current===Jg&&(r.current=e(t)),r}const lu=wv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],sD=lu&&lu!==k.useLayoutEffect?lu:e=>e();function Nt(e){const t=Go(oD).current;return t.next=e,sD(t.effect),t.trampoline}function oD(){const e={next:void 0,callback:aD,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function aD(){}function $h(e,t,r,n){const s=Go(sw).current;return cD(s,e,t,r,n)&&ow(s,[e,t,r,n]),s.callback}function lD(e){const t=Go(sw).current;return uD(t,e)&&ow(t,e),t.callback}function sw(){return{callback:null,cleanup:null,refs:[]}}function cD(e,t,r,n,s){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==n||e.refs[3]!==s}function uD(e,t){return e.refs.length!==t.length||e.refs.some((r,n)=>r!==t[n])}function ow(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const n=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=a(r);typeof l=="function"&&(n[s]=l);break}case"object":{a.current=r;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=n[s];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const hD=()=>{},or=typeof document<"u"?k.useLayoutEffect:hD,zf={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function gi(e,...t){const r=new URL(`https://base-ui.com/production-error/${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Base UI error #${e}; visit ${r} for the full message.`}const dD=parseInt(k.version,10);function aw(e){return dD>=e}function Qg(e){if(!k.isValidElement(e))return null;const t=e,r=t.props;return(aw(19)?r==null?void 0:r.ref:t.ref)??null}function Hh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function fD(e,t){const r={};for(const n in e){const s=e[n];if(t!=null&&t.hasOwnProperty(n)){const a=t[n](s);a!=null&&Object.assign(r,a);continue}s===!0?r[`data-${n.toLowerCase()}`]="":s&&(r[`data-${n.toLowerCase()}`]=s.toString())}return r}function pD(e,t){return typeof e=="function"?e(t):e}function mD(e,t){return typeof e=="function"?e(t):e}const no={};function Uf(e,t,r,n,s){let a={...zh(e,no)};return t&&(a=qa(a,t)),r&&(a=qa(a,r)),n&&(a=qa(a,n)),a}function gD(e){if(e.length===0)return no;if(e.length===1)return zh(e[0],no);let t={...zh(e[0],no)};for(let r=1;r<e.length;r+=1)t=qa(t,e[r]);return t}function qa(e,t){return lw(t)?t(e):vD(e,t)}function vD(e,t){if(!t)return e;for(const r in t){const n=t[r];switch(r){case"style":{e[r]=Hh(e.style,n);break}case"className":{e[r]=cw(e.className,n);break}default:_D(r,n)?e[r]=yD(e[r],n):e[r]=n}}return e}function _D(e,t){const r=e.charCodeAt(0),n=e.charCodeAt(1),s=e.charCodeAt(2);return r===111&&n===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function lw(e){return typeof e=="function"}function zh(e,t){return lw(e)?e(t):e??no}function yD(e,t){return t?e?r=>{if(wD(r)){const s=r;Uh(s);const a=t(s);return s.baseUIHandlerPrevented||e==null||e(s),a}const n=t(r);return e==null||e(r),n}:t:e}function Uh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function cw(e,t){return t?e?t+" "+e:t:e}function wD(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Lr(){}const Yr=Object.freeze({});function vi(e,t,r={}){const n=t.render,s=SD(t,r);if(r.enabled===!1)return null;const a=r.state??Yr;return xD(e,n,s,a)}function SD(e,t={}){const{className:r,style:n,render:s}=e,{state:a=Yr,ref:l,props:i,stateAttributesMapping:o,enabled:c=!0}=t,p=c?pD(r,a):void 0,u=c?mD(n,a):void 0,m=c?fD(a,o):Yr,_=c?Hh(m,Array.isArray(i)?gD(i):i)??Yr:Yr;return typeof document<"u"&&(c?Array.isArray(l)?_.ref=lD([_.ref,Qg(s),...l]):_.ref=$h(_.ref,Qg(s),l):$h(null,null)),c?(p!==void 0&&(_.className=cw(_.className,p)),u!==void 0&&(_.style=Hh(_.style,u)),_):Yr}function xD(e,t,r,n){if(t){if(typeof t=="function")return t(r,n);const s=Uf(r,t.props);return s.ref=r.ref,k.cloneElement(t,s)}if(e&&typeof e=="string")return bD(e,r);throw new Error(gi(8))}function bD(e,t){return e==="button"?k.createElement("button",{type:"button",...t,key:t.key}):e==="img"?k.createElement("img",{alt:"",...t,key:t.key}):k.createElement(e,t)}const CD={...wv};let Zg=0;function ED(e,t="mui"){const[r,n]=k.useState(e),s=e||r;return k.useEffect(()=>{r==null&&(Zg+=1,n(`${t}-${Zg}`))},[r,t]),s}const ev=CD.useId;function Wf(e,t){if(ev!==void 0){const r=ev();return e??(t?`${t}-${r}`:r)}return ED(e,t)}function uw(e){return Wf(e,"base-ui")}function Vf(){return typeof window<"u"}function Mo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kD(e){return Vf()?e instanceof Element||e instanceof Mo(e).Element:!1}function LD(e){return Vf()?e instanceof HTMLElement||e instanceof Mo(e).HTMLElement:!1}function RD(e){return!Vf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mo(e).ShadowRoot}const TD=k.createContext(void 0);function DD(e=!1){const t=k.useContext(TD);if(t===void 0&&!e)throw new Error(gi(16));return t}function MD(e){const{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:s=0,isNativeButton:a}=e,l=n&&t!==!1,i=n&&t===!1;return{props:k.useMemo(()=>{const c={onKeyDown(p){r&&t&&p.key!=="Tab"&&p.preventDefault()}};return n||(c.tabIndex=s,!a&&r&&(c.tabIndex=t?s:-1)),(a&&(t||l)||!a&&r)&&(c["aria-disabled"]=r),a&&(!t||i)&&(c.disabled=r),c},[n,r,t,l,i,a,s])}}function hw(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:s=!0}=e,a=k.useRef(null),l=DD(!0)!==void 0,i=Nt(()=>{const m=a.current;return!!((m==null?void 0:m.tagName)==="A"&&(m!=null&&m.href))}),{props:o}=MD({focusableWhenDisabled:r,disabled:t,composite:l,tabIndex:n,isNativeButton:s}),c=k.useCallback(()=>{const m=a.current;AD(m)&&l&&t&&o.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,o.disabled,l]);or(c,[c]);const p=k.useCallback((m={})=>{const{onClick:_,onMouseDown:y,onKeyUp:v,onKeyDown:h,onPointerDown:f,...d}=m;return Uf({type:s?"button":void 0,onClick(w){if(t){w.preventDefault();return}_==null||_(w)},onMouseDown(w){t||y==null||y(w)},onKeyDown(w){if(t||(Uh(w),h==null||h(w)),w.baseUIHandlerPrevented)return;const b=w.target===w.currentTarget&&!s&&!i()&&!t,x=w.key==="Enter",C=w.key===" ";b&&((C||x)&&w.preventDefault(),x&&(_==null||_(w)))},onKeyUp(w){t||(Uh(w),v==null||v(w)),!w.baseUIHandlerPrevented&&w.target===w.currentTarget&&!s&&!t&&w.key===" "&&(_==null||_(w))},onPointerDown(w){if(t){w.preventDefault();return}f==null||f(w)}},s?void 0:{role:"button"},o,d)},[t,o,s,i]),u=Nt(m=>{a.current=m,c()});return{getButtonProps:p,buttonRef:u}}function AD(e){return LD(e)&&e.tagName==="BUTTON"}const dw=k.createContext(void 0);function PD(){const e=k.useContext(dw);if(e===void 0)throw new Error(gi(63));return e}let tv=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const ID={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},BD={valid(e){return e===null?null:e?{[tv.valid]:""}:{[tv.invalid]:""}}};let rv=function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const fw={...BD,checked(e){return e?{[rv.checked]:""}:{[rv.unchecked]:""}}};function OD(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const ND=k.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Lr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function pw(){return k.useContext(ND)}const jD=k.createContext({invalid:void 0,name:void 0,validityData:{state:ID,errors:[],error:"",value:"",initialValue:null},setValidityData:Lr,disabled:void 0,touched:!1,setTouched:Lr,dirty:!1,setDirty:Lr,filled:!1,setFilled:Lr,focused:!1,setFocused:Lr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Yr)=>e,getInputValidationProps:(e=Yr)=>e,inputRef:{current:null},commit:async()=>{}}});function Kf(e=!0){const t=k.useContext(jD);if(t.setValidityData===Lr&&!e)throw new Error(gi(28));return t}function FD(e){const{enabled:t=!0,value:r,id:n,name:s,controlRef:a,commit:l}=e,{formRef:i}=pw(),{invalid:o,markedDirtyRef:c,validityData:p,setValidityData:u}=Kf(),m=Nt(e.getValue);or(()=>{if(!t)return;let _=r;_===void 0&&(_=m()),p.initialValue===null&&_!==null&&u(y=>({...y,initialValue:_}))},[t,u,r,p.initialValue,m]),or(()=>{!t||!n||i.current.fields.set(n,{getValue:m,name:s,controlRef:a,validityData:OD(p,o),validate(){let _=r;_===void 0&&(_=m()),c.current=!0,Nr.flushSync(()=>l(_))}})},[l,a,t,i,m,n,o,c,s,p,r]),or(()=>{const _=i.current.fields;return()=>{n&&_.delete(n)}},[i,n])}const $D=k.createContext({controlId:void 0,setControlId:Lr,labelId:void 0,setLabelId:Lr,messageIds:[],setMessageIds:Lr,getDescriptionProps:e=>e});function mw(){return k.useContext($D)}function HD(e={}){const{id:t,implicit:r=!1,controlRef:n}=e,{controlId:s,setControlId:a}=mw(),l=uw(t);return or(()=>{if(!(!r&&!t||a===Lr)){if(r){const i=n==null?void 0:n.current;kD(i)&&i.closest("label")!=null?a(t??null):a(s??l)}else t&&a(t);return()=>{t&&a(void 0)}}},[t,n,s,a,r,l]),s??l}const zD="none";function UD(e,t,r,n){let s=!1,a=!1;const l=Yr;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:r,...l}}function WD(e,t){const r=k.useRef(e),n=Nt(t);or(()=>{r.current!==e&&n(r.current)},[e,n]),or(()=>{r.current=e},[e])}const VD=k.forwardRef(function(t,r){const{checked:n,className:s,defaultChecked:a,id:l,inputRef:i,name:o,nativeButton:c=!1,onCheckedChange:p,readOnly:u=!1,required:m=!1,disabled:_=!1,render:y,uncheckedValue:v,...h}=t,{clearErrors:f}=pw(),{state:d,setTouched:g,setDirty:w,validityData:b,setFilled:x,setFocused:C,shouldValidateOnChange:S,validationMode:E,disabled:L,name:A,validation:M}=Kf(),{labelId:T}=mw(),B=L||_,H=A??o,j=Nt(p),$=k.useRef(null),O=$h($,i,M.inputRef),R=k.useRef(null),P=uw(),N=HD({id:l,implicit:!1,controlRef:R}),[F,V]=iD({controlled:n,default:!!a,name:"Switch",state:"checked"});FD({id:P,commit:M.commit,value:F,controlRef:R,name:H,getValue:()=>F}),or(()=>{$.current&&x($.current.checked)},[$,x]),WD(F,()=>{f(H),w(F!==b.initialValue),x(F),S()?M.commit(F):M.commit(F,!0)});const{getButtonProps:q,buttonRef:Q}=hw({disabled:B,native:c}),Z={id:P,role:"switch","aria-checked":F,"aria-readonly":u||void 0,"aria-labelledby":T,onFocus(){B||C(!0)},onBlur(){const U=$.current;!U||B||(g(!0),C(!1),E==="onBlur"&&M.commit(U.checked))},onClick(U){var J;u||B||(U.preventDefault(),(J=$==null?void 0:$.current)==null||J.click())}},z=k.useMemo(()=>Uf({checked:F,disabled:B,id:N,name:H,required:m,style:zf,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:O,onChange(U){if(U.nativeEvent.defaultPrevented)return;const J=U.target.checked,G=UD(zD,U.nativeEvent);j==null||j(J,G),!G.isCanceled&&V(J)},onFocus(){var U;(U=R.current)==null||U.focus()}},M.getInputValidationProps),[F,B,O,N,H,j,m,V,M]),I=k.useMemo(()=>({...d,checked:F,disabled:B,readOnly:u,required:m}),[d,F,B,u,m]),K=vi("span",t,{state:I,ref:[r,R,Q],props:[Z,M.getValidationProps,h,q],stateAttributesMapping:fw});return D.jsxs(dw.Provider,{value:I,children:[K,!F&&H&&v!==void 0&&D.jsx("input",{type:"hidden",name:H,value:v}),D.jsx("input",{...z})]})}),KD=k.forwardRef(function(t,r){const{render:n,className:s,...a}=t,{state:l}=Kf(),i=PD(),o={...l,...i};return vi("span",t,{state:o,ref:r,stateAttributesMapping:fw,props:a})});function gw(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=gw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function GD(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=gw(e))&&(n&&(n+=" "),n+=t);return n}const qD=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},XD=(e,t)=>({classGroupId:e,validator:t}),vw=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Al="-",nv=[],YD="arbitrary..",JD=e=>{const t=ZD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return QD(l);const i=l.split(Al),o=i[0]===""&&i.length>1?1:0;return _w(i,o,t)},getConflictingClassGroupIds:(l,i)=>{if(i){const o=n[l],c=r[l];return o?c?qD(c,o):o:c||nv}return r[l]||nv}}},_w=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],a=r.nextPart.get(s);if(a){const c=_w(e,t+1,a);if(c)return c}const l=r.validators;if(l===null)return;const i=t===0?e.join(Al):e.slice(t).join(Al),o=l.length;for(let c=0;c<o;c++){const p=l[c];if(p.validator(i))return p.classGroupId}},QD=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?YD+n:void 0})(),ZD=e=>{const{theme:t,classGroups:r}=e;return eM(r,t)},eM=(e,t)=>{const r=vw();for(const n in e){const s=e[n];Gf(s,r,n,t)}return r},Gf=(e,t,r,n)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];tM(l,t,r,n)}},tM=(e,t,r,n)=>{if(typeof e=="string"){rM(e,t,r);return}if(typeof e=="function"){nM(e,t,r,n);return}iM(e,t,r,n)},rM=(e,t,r)=>{const n=e===""?t:yw(t,e);n.classGroupId=r},nM=(e,t,r,n)=>{if(sM(e)){Gf(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(XD(r,e))},iM=(e,t,r,n)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[i,o]=s[l];Gf(o,yw(t,i),r,n)}},yw=(e,t)=>{let r=e;const n=t.split(Al),s=n.length;for(let a=0;a<s;a++){const l=n[a];let i=r.nextPart.get(l);i||(i=vw(),r.nextPart.set(l,i)),r=i}return r},sM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,oM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(a,l)=>{r[a]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let l=r[a];if(l!==void 0)return l;if((l=n[a])!==void 0)return s(a,l),l},set(a,l){a in r?r[a]=l:s(a,l)}}},Wh="!",iv=":",aM=[],sv=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),lM=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const a=[];let l=0,i=0,o=0,c;const p=s.length;for(let v=0;v<p;v++){const h=s[v];if(l===0&&i===0){if(h===iv){a.push(s.slice(o,v)),o=v+1;continue}if(h==="/"){c=v;continue}}h==="["?l++:h==="]"?l--:h==="("?i++:h===")"&&i--}const u=a.length===0?s:s.slice(o);let m=u,_=!1;u.endsWith(Wh)?(m=u.slice(0,-1),_=!0):u.startsWith(Wh)&&(m=u.slice(1),_=!0);const y=c&&c>o?c-o:void 0;return sv(a,_,m,y)};if(t){const s=t+iv,a=n;n=l=>l.startsWith(s)?a(l.slice(s.length)):sv(aM,!1,l,void 0,!0)}if(r){const s=n;n=a=>r({className:a,parseClassName:s})}return n},cM=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let a=0;a<r.length;a++){const l=r[a],i=l[0]==="[",o=t.has(l);i||o?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(l)):s.push(l)}return s.length>0&&(s.sort(),n.push(...s)),n}},uM=e=>({cache:oM(e.cacheSize),parseClassName:lM(e),sortModifiers:cM(e),...JD(e)}),hM=/\s+/,dM=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],i=e.trim().split(hM);let o="";for(let c=i.length-1;c>=0;c-=1){const p=i[c],{isExternal:u,modifiers:m,hasImportantModifier:_,baseClassName:y,maybePostfixModifierPosition:v}=r(p);if(u){o=p+(o.length>0?" "+o:o);continue}let h=!!v,f=n(h?y.substring(0,v):y);if(!f){if(!h){o=p+(o.length>0?" "+o:o);continue}if(f=n(y),!f){o=p+(o.length>0?" "+o:o);continue}h=!1}const d=m.length===0?"":m.length===1?m[0]:a(m).join(":"),g=_?d+Wh:d,w=g+f;if(l.indexOf(w)>-1)continue;l.push(w);const b=s(f,h);for(let x=0;x<b.length;++x){const C=b[x];l.push(g+C)}o=p+(o.length>0?" "+o:o)}return o},fM=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=ww(r))&&(s&&(s+=" "),s+=n);return s},ww=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=ww(e[n]))&&(r&&(r+=" "),r+=t);return r},pM=(e,...t)=>{let r,n,s,a;const l=o=>{const c=t.reduce((p,u)=>u(p),e());return r=uM(c),n=r.cache.get,s=r.cache.set,a=i,i(o)},i=o=>{const c=n(o);if(c)return c;const p=dM(o,r);return s(o,p),p};return a=l,(...o)=>a(fM(...o))},mM=[],vt=e=>{const t=r=>r[e]||mM;return t.isThemeGetter=!0,t},Sw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gM=/^\d+\/\d+$/,vM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_M=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xi=e=>gM.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),hn=e=>!!e&&Number.isInteger(Number(e)),cu=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Kr=e=>vM.test(e),xM=()=>!0,bM=e=>_M.test(e)&&!yM.test(e),bw=()=>!1,CM=e=>wM.test(e),EM=e=>SM.test(e),kM=e=>!ye(e)&&!we(e),LM=e=>vs(e,kw,bw),ye=e=>Sw.test(e),Vn=e=>vs(e,Lw,bM),uu=e=>vs(e,AM,Oe),ov=e=>vs(e,Cw,bw),RM=e=>vs(e,Ew,EM),Ca=e=>vs(e,Rw,CM),we=e=>xw.test(e),Ts=e=>_s(e,Lw),TM=e=>_s(e,PM),av=e=>_s(e,Cw),DM=e=>_s(e,kw),MM=e=>_s(e,Ew),Ea=e=>_s(e,Rw,!0),vs=(e,t,r)=>{const n=Sw.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},_s=(e,t,r=!1)=>{const n=xw.exec(e);return n?n[1]?t(n[1]):r:!1},Cw=e=>e==="position"||e==="percentage",Ew=e=>e==="image"||e==="url",kw=e=>e==="length"||e==="size"||e==="bg-size",Lw=e=>e==="length",AM=e=>e==="number",PM=e=>e==="family-name",Rw=e=>e==="shadow",IM=()=>{const e=vt("color"),t=vt("font"),r=vt("text"),n=vt("font-weight"),s=vt("tracking"),a=vt("leading"),l=vt("breakpoint"),i=vt("container"),o=vt("spacing"),c=vt("radius"),p=vt("shadow"),u=vt("inset-shadow"),m=vt("text-shadow"),_=vt("drop-shadow"),y=vt("blur"),v=vt("perspective"),h=vt("aspect"),f=vt("ease"),d=vt("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...w(),we,ye],x=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],S=()=>[we,ye,o],E=()=>[xi,"full","auto",...S()],L=()=>[hn,"none","subgrid",we,ye],A=()=>["auto",{span:["full",hn,we,ye]},hn,we,ye],M=()=>[hn,"auto",we,ye],T=()=>["auto","min","max","fr",we,ye],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...S()],$=()=>[xi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],O=()=>[e,we,ye],R=()=>[...w(),av,ov,{position:[we,ye]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",DM,LM,{size:[we,ye]}],F=()=>[cu,Ts,Vn],V=()=>["","none","full",c,we,ye],q=()=>["",Oe,Ts,Vn],Q=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[Oe,cu,av,ov],I=()=>["","none",y,we,ye],K=()=>["none",Oe,we,ye],U=()=>["none",Oe,we,ye],J=()=>[Oe,we,ye],G=()=>[xi,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Kr],breakpoint:[Kr],color:[xM],container:[Kr],"drop-shadow":[Kr],ease:["in","out","in-out"],font:[kM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Kr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Kr],shadow:[Kr],spacing:["px",Oe],text:[Kr],"text-shadow":[Kr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xi,ye,we,h]}],container:["container"],columns:[{columns:[Oe,ye,we,i]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[hn,"auto",we,ye]}],basis:[{basis:[xi,"full","auto",i,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,xi,"auto","initial","none",ye]}],grow:[{grow:["",Oe,we,ye]}],shrink:[{shrink:["",Oe,we,ye]}],order:[{order:[hn,"first","last","none",we,ye]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[i,"screen",...$()]}],"min-w":[{"min-w":[i,"screen","none",...$()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",r,Ts,Vn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,we,uu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cu,ye]}],"font-family":[{font:[TM,ye,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,we,ye]}],"line-clamp":[{"line-clamp":[Oe,"none",we,uu]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":["none",we,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",we,Vn]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[Oe,"auto",we,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hn,we,ye],radial:["",we,ye],conic:[hn,we,ye]},MM,RM]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,we,ye]}],"outline-w":[{outline:["",Oe,Ts,Vn]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",p,Ea,Ca]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",u,Ea,Ca]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[Oe,Vn]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",m,Ea,Ca]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[Oe,we,ye]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[we,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,ye]}],filter:[{filter:["","none",we,ye]}],blur:[{blur:I()}],brightness:[{brightness:[Oe,we,ye]}],contrast:[{contrast:[Oe,we,ye]}],"drop-shadow":[{"drop-shadow":["","none",_,Ea,Ca]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",Oe,we,ye]}],"hue-rotate":[{"hue-rotate":[Oe,we,ye]}],invert:[{invert:["",Oe,we,ye]}],saturate:[{saturate:[Oe,we,ye]}],sepia:[{sepia:["",Oe,we,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",we,ye]}],"backdrop-blur":[{"backdrop-blur":I()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,we,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,we,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,we,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,we,ye]}],"backdrop-invert":[{"backdrop-invert":["",Oe,we,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,we,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,we,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,we,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",we,ye]}],ease:[{ease:["linear","initial",f,we,ye]}],delay:[{delay:[Oe,we,ye]}],animate:[{animate:["none",d,we,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,we,ye]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[we,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,ye]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[Oe,Ts,Vn,uu]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},BM=pM(IM);function Pl(...e){return BM(GD(e))}function dn({checked:e,onCheckedChange:t,disabled:r,className:n}){return D.jsx(VD,{checked:e,onCheckedChange:t,disabled:r,className:Pl("group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full transition-colors","bg-border data-[checked]:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base","disabled:cursor-not-allowed disabled:opacity-50",n),children:D.jsx(KD,{className:Pl("pointer-events-none block size-4 rounded-full bg-white shadow-sm transition-transform","translate-x-1 group-data-[checked]:translate-x-5")})})}let Kn=null;const Il={},Tw=500;function Dw(){if(typeof window>"u")return null;if((Kn==null?void 0:Kn.state)==="closed"&&(Kn=null),!Kn){const e=window.AudioContext??window.webkitAudioContext;if(!e)return null;Kn=new e}return Kn}async function Vh(){const e=Dw();e&&e.state==="suspended"&&await e.resume().catch(()=>{})}async function OM(e){e.state==="suspended"&&await e.resume().catch(()=>{})}async function Mw(e){const t=Dw();if(!t||(await OM(t),t.state!=="running"))return;const{frequencies:r,durationMs:n,attackMs:s,peakGain:a,type:l="sine"}=e,i=t.currentTime,o=n/1e3,c=s/1e3,p=t.createGain();p.connect(t.destination);const u=i+o*.7;p.gain.setValueAtTime(0,i),p.gain.linearRampToValueAtTime(a,i+c),p.gain.setValueAtTime(a,u),p.gain.linearRampToValueAtTime(0,i+o);const m=r.map(y=>{const v=t.createOscillator();return v.type=l,v.frequency.setValueAtTime(y,i),v.connect(p),v});for(const y of m)y.start(i),y.stop(i+o);const _=m[m.length-1];_.onended=()=>{for(const y of m)y.disconnect();p.disconnect()}}async function Kh(){const e=Date.now();if(!(e-(Il.permission||0)<Tw)){Il.permission=e;try{await Mw({frequencies:[880],durationMs:150,attackMs:5,peakGain:.15,type:"sine"})}catch{}}}async function Gh(){const e=Date.now();if(!(e-(Il.idle||0)<Tw)){Il.idle=e;try{await Mw({frequencies:[440,550],durationMs:300,attackMs:10,peakGain:.08,type:"sine"})}catch{}}}function NM({isOpen:e,onClose:t}){const r=ue(Y=>Y.defaultProjectDir),n=ue(Y=>Y.setDefaultProjectDir),s=ue(Y=>Y.commandPresets),a=ue(Y=>Y.setCommandPresets),l=ue(Y=>Y.defaultPresetId),i=ue(Y=>Y.setDefaultPresetId),o=ue(Y=>Y.sessionSortMode),c=ue(Y=>Y.setSessionSortMode),p=ue(Y=>Y.sessionSortDirection),u=ue(Y=>Y.setSessionSortDirection),m=ue(Y=>Y.useWebGL),_=ue(Y=>Y.setUseWebGL),y=ue(Y=>Y.fontSize),v=ue(Y=>Y.setFontSize),h=ue(Y=>Y.lineHeight),f=ue(Y=>Y.setLineHeight),d=ue(Y=>Y.letterSpacing),g=ue(Y=>Y.setLetterSpacing),w=ue(Y=>Y.fontOption),b=ue(Y=>Y.setFontOption),x=ue(Y=>Y.customFontFamily),C=ue(Y=>Y.setCustomFontFamily),S=ue(Y=>Y.shortcutModifier),E=ue(Y=>Y.setShortcutModifier),L=ue(Y=>Y.showProjectName),A=ue(Y=>Y.setShowProjectName),M=ue(Y=>Y.showLastUserMessage),T=ue(Y=>Y.setShowLastUserMessage),B=ue(Y=>Y.showSessionIdPrefix),H=ue(Y=>Y.setShowSessionIdPrefix),j=Ml(Y=>Y.theme),$=Ml(Y=>Y.setTheme),O=ue(Y=>Y.soundOnPermission),R=ue(Y=>Y.setSoundOnPermission),P=ue(Y=>Y.soundOnIdle),N=ue(Y=>Y.setSoundOnIdle),[F,V]=k.useState(r),[q,Q]=k.useState(s),[Z,z]=k.useState(l),[I,K]=k.useState(o),[U,J]=k.useState(p),[G,ae]=k.useState(m),[le,me]=k.useState(y),[ke,X]=k.useState(h),[ee,Ae]=k.useState(d),[de,he]=k.useState(w),[ce,te]=k.useState(x),[pe,ie]=k.useState(S),[oe,Le]=k.useState(L),[be,Re]=k.useState(M),[De,ne]=k.useState(B),[fe,Ie]=k.useState(j),[W,re]=k.useState(O),[ve,Te]=k.useState(P),[xe,Be]=k.useState(!0),[je,He]=k.useState(!1),[Me,Pe]=k.useState(24),[Ge,Fe]=k.useState(!1),[Se,Ce]=k.useState(!1),[$e,Ke]=k.useState(""),[Ue,rt]=k.useState(""),[at,dt]=k.useState(""),Rt=k.useRef(null);if(k.useEffect(()=>{if(Rt.current&&(clearTimeout(Rt.current),Rt.current=null),e){if(V(r),Q(s),z(l),K(o),J(p),ae(m),me(y),X(h),Ae(d),he(w),te(x),ie(S),Le(L),Re(M),ne(B),Ie(j),re(O),Te(P),Ce(!1),Ke(""),rt(""),dt(""),fetch("/api/settings/tmux-mouse-mode").then(Y=>Y.json()).then(Y=>Be(Y.enabled)).catch(()=>{}),fetch("/api/settings/inactive-max-age-hours").then(Y=>Y.json()).then(Y=>Pe(Y.hours)).catch(()=>{}),typeof document<"u"){const Y=document.querySelector(".xterm-helper-textarea");Y&&typeof Y.setAttribute=="function"&&(typeof Y.blur=="function"&&Y.blur(),Y.setAttribute("disabled","true"))}}else typeof document<"u"&&(Rt.current=setTimeout(()=>{if(typeof document>"u")return;const Y=document.querySelector(".xterm-helper-textarea");Y&&(Y.removeAttribute("disabled"),Y.focus())},300));return()=>{Rt.current&&(clearTimeout(Rt.current),Rt.current=null)}},[s,l,r,o,p,m,y,h,d,w,x,S,L,M,B,j,O,P,e]),k.useEffect(()=>{if(!e||typeof window>"u"||typeof window.addEventListener!="function")return;const Y=Xe=>{Xe.key==="Escape"&&(typeof Xe.stopPropagation=="function"&&Xe.stopPropagation(),t())};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[e,t]),!e)return null;const Ar=Y=>{Y.preventDefault();const Xe=F.trim(),Ee=G!==m;n(Xe||ah),a(q),i(Z),c(I),u(U),_(G),v(le),f(ke),g(ee),b(de),C(ce),E(pe),A(oe),T(be),H(De),$(fe),R(W),N(ve),t({webglChanged:Ee})},zt=(Y,Xe)=>{Q(Ee=>Ee.map(Ye=>Ye.id===Y?{...Ye,...Xe}:Ye))},Pr=Y=>{var Ye;const Xe=q.find(lt=>lt.id===Y);if(!Xe||Xe.isBuiltIn)return;const Ee=q.filter(lt=>lt.id!==Y);Q(Ee),Y===Z&&z(((Ye=Ee[0])==null?void 0:Ye.id)||"claude")},ln=()=>{if(!$e.trim()||!Ue.trim()||q.length>=Ki)return;const Y={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,label:$e.trim(),command:Ue.trim(),isBuiltIn:!1,agentType:at||void 0};Q([...q,Y]),Ce(!1),Ke(""),rt(""),dt("")},ys=q.length<Ki,Xo=Y=>{He(!0),Be(Y),fetch("/api/settings/tmux-mouse-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:Y})}).catch(()=>Be(!Y)).finally(()=>He(!1))},Yo=Y=>{const Xe=Me;Fe(!0),Pe(Y),fetch("/api/settings/inactive-max-age-hours",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({hours:Y})}).catch(()=>Pe(Xe)).finally(()=>Fe(!1))};return D.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:Y=>{Y.target===Y.currentTarget&&t()},children:D.jsxs("form",{onSubmit:Ar,className:"w-full max-w-lg max-h-[90vh] flex flex-col border border-border bg-elevated",children:[D.jsxs("div",{className:"p-6 pb-0",children:[D.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider text-primary text-balance",children:"Settings"}),D.jsx("p",{className:"mt-2 text-xs text-muted text-pretty",children:"Configure default directory, command presets, and display options."})]}),D.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4",children:D.jsxs("div",{className:"mt-5 space-y-4",children:[D.jsxs("div",{children:[D.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Default Project Directory"}),D.jsx("input",{value:F,onChange:Y=>V(Y.target.value),placeholder:ah,className:"input",autoFocus:!0})]}),D.jsxs("div",{className:"border-t border-border pt-4",children:[D.jsxs("div",{className:"flex items-center justify-between mb-2",children:[D.jsx("label",{className:"text-xs text-secondary",children:"Command Presets"}),D.jsx("select",{value:Z,onChange:Y=>z(Y.target.value),className:"input text-xs py-1 px-2 w-auto",children:q.map(Y=>D.jsx("option",{value:Y.id,children:Y.label},Y.id))})]}),D.jsx("p",{className:"text-[10px] text-muted mb-3",children:"Default preset is pre-selected when creating new sessions."}),D.jsx("div",{className:"space-y-3",children:q.map(Y=>D.jsxs("div",{className:"border border-border p-3 space-y-2",children:[D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx("div",{className:"flex items-center gap-2",children:D.jsx("input",{value:Y.label,onChange:Xe=>zt(Y.id,{label:Xe.target.value}),className:"input text-sm py-1 px-2 w-32",placeholder:"Label"})}),!Y.isBuiltIn&&D.jsx("button",{type:"button",onClick:()=>Pr(Y.id),className:"btn text-xs px-2 py-1 text-error hover:bg-error/10",children:"Delete"})]}),D.jsxs("div",{children:[D.jsx("label",{className:"text-[10px] text-muted block mb-1",children:"Command"}),D.jsx("input",{value:Y.command,onChange:Xe=>zt(Y.id,{command:Xe.target.value}),className:"input text-xs py-1 px-2 font-mono w-full",placeholder:"command --flags"})]}),!Y.isBuiltIn&&D.jsxs("div",{children:[D.jsx("label",{className:"text-[10px] text-muted block mb-1",children:"Icon"}),D.jsxs("select",{value:Y.agentType||"",onChange:Xe=>zt(Y.id,{agentType:Xe.target.value||void 0}),className:"input text-xs py-1 px-2 w-auto",children:[D.jsx("option",{value:"",children:"Terminal"}),D.jsx("option",{value:"claude",children:"Claude"}),D.jsx("option",{value:"codex",children:"Codex"})]})]})]},Y.id))}),Se?D.jsxs("div",{className:"mt-3 border border-border p-3 space-y-2",children:[D.jsx("div",{className:"text-xs text-secondary mb-2",children:"New Preset"}),D.jsx("input",{value:$e,onChange:Y=>Ke(Y.target.value),className:"input text-xs py-1 px-2 w-full",placeholder:"Label"}),D.jsx("input",{value:Ue,onChange:Y=>rt(Y.target.value),className:"input text-xs py-1 px-2 font-mono w-full",placeholder:"command --flags"}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsxs("select",{value:at,onChange:Y=>dt(Y.target.value),className:"input text-xs py-1 px-2 w-auto",children:[D.jsx("option",{value:"",children:"Terminal Icon"}),D.jsx("option",{value:"claude",children:"Claude Icon"}),D.jsx("option",{value:"codex",children:"Codex Icon"})]}),D.jsx("div",{className:"flex-1"}),D.jsx("button",{type:"button",onClick:()=>Ce(!1),className:"btn text-xs px-2 py-1",children:"Cancel"}),D.jsx("button",{type:"button",onClick:ln,disabled:!$e.trim()||!Ue.trim(),className:"btn btn-primary text-xs px-2 py-1",children:"Add"})]})]}):D.jsx("button",{type:"button",onClick:()=>Ce(!0),disabled:!ys,className:"btn text-xs mt-3 w-full",children:ys?"+ Add Preset":`Max ${Ki} presets`})]}),D.jsxs("div",{className:"border-t border-border pt-4",children:[D.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Session List Order"}),D.jsxs("div",{className:"flex gap-2",children:[D.jsx("button",{type:"button",className:`btn flex-1 ${I==="created"?"btn-primary":""}`,onClick:()=>K("created"),children:"Created"}),D.jsx("button",{type:"button",className:`btn flex-1 ${I==="status"?"btn-primary":""}`,onClick:()=>K("status"),children:"Status"}),D.jsx("button",{type:"button",className:`btn flex-1 ${I==="manual"?"btn-primary":""}`,onClick:()=>K("manual"),children:"Manual"})]}),D.jsx("p",{className:"mt-1.5 text-[10px] text-muted",children:I==="status"?"Sessions auto-resort by status (waiting, working, unknown)":I==="manual"?"Drag sessions to reorder manually":"Sessions stay in creation order"})]}),I==="created"&&D.jsxs("div",{children:[D.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Sort Direction"}),D.jsxs("div",{className:"flex gap-2",children:[D.jsx("button",{type:"button",className:`btn flex-1 ${U==="desc"?"btn-primary":""}`,onClick:()=>J("desc"),children:"Newest First"}),D.jsx("button",{type:"button",className:`btn flex-1 ${U==="asc"?"btn-primary":""}`,onClick:()=>J("asc"),children:"Oldest First"})]})]}),D.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[D.jsx("label",{className:"mb-1 block text-xs text-secondary",children:"Session List Details"}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Project Name"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Show the project folder name under each session."})]}),D.jsx(dn,{checked:oe,onCheckedChange:Le})]}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Last User Message"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Show the most recent user input next to the project name."})]}),D.jsx(dn,{checked:be,onCheckedChange:Re})]}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Session ID Prefix"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Show first 5 characters of agent session IDs in the list."})]}),D.jsx(dn,{checked:De,onCheckedChange:ne})]}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Inactive Sessions Lookback"}),D.jsxs("div",{className:"text-[10px] text-muted",children:["Show inactive sessions from the last N hours (",ou,"-",au,")."]})]}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("input",{type:"number",min:ou,max:au,value:Me,onChange:Y=>{const Xe=parseInt(Y.target.value,10);Xe>=ou&&Xe<=au&&Yo(Xe)},disabled:Ge,className:"input text-xs py-1 px-2 w-16 text-center"}),D.jsx("span",{className:"text-xs text-muted",children:"hrs"})]})]})]}),D.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[D.jsx("label",{className:"mb-1 block text-xs text-secondary",children:"Notifications"}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{className:"flex-1",children:[D.jsx("div",{className:"text-sm text-primary",children:"Permission Sound"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Play a ping when any session needs permission."})]}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("button",{type:"button",onClick:()=>void Kh(),className:"btn text-xs px-2 py-1",children:"Test"}),D.jsx(dn,{checked:W,onCheckedChange:Y=>{re(Y),Y&&Vh()}})]})]}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{className:"flex-1",children:[D.jsx("div",{className:"text-sm text-primary",children:"Idle Sound"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Play a chime when a session finishes working."})]}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("button",{type:"button",onClick:()=>void Gh(),className:"btn text-xs px-2 py-1",children:"Test"}),D.jsx(dn,{checked:ve,onCheckedChange:Y=>{Te(Y),Y&&Vh()}})]})]})]}),D.jsxs("div",{className:"border-t border-border pt-4",children:[D.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Terminal Rendering"}),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"WebGL Acceleration"}),D.jsx("div",{className:"text-[10px] text-muted",children:"GPU rendering for better performance. Disable if you see flickering."})]}),D.jsx(dn,{checked:G,onCheckedChange:ae})]}),G!==m&&D.jsx("p",{className:"mt-2 text-[10px] text-approval",children:"Terminal will reload when saved"}),D.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Mouse Mode"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Enable tmux mouse mode for trackpad/scroll wheel support."})]}),D.jsx(dn,{checked:xe,onCheckedChange:Xo,disabled:je})]}),D.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Font Size"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Terminal text size in pixels (6-24)"})]}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("button",{type:"button",onClick:()=>me(Math.max(6,le-1)),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover",children:D.jsx("span",{className:"text-sm font-bold",children:"−"})}),D.jsx("span",{className:"text-sm text-secondary w-6 text-center",children:le}),D.jsx("button",{type:"button",onClick:()=>me(Math.min(24,le+1)),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover",children:D.jsx("span",{className:"text-sm font-bold",children:"+"})})]})]}),D.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Line Height"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Vertical spacing (1.0 = compact, 2.0 = spacious)"})]}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("input",{type:"range",min:"1.0",max:"2.0",step:"0.1",value:ke,onChange:Y=>X(parseFloat(Y.target.value)),className:"w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent"}),D.jsx("span",{className:"text-xs text-secondary w-8 text-right",children:ke.toFixed(1)})]})]}),D.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Letter Spacing"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Horizontal spacing between characters in pixels"})]}),D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx("input",{type:"range",min:"-3",max:"3",step:"1",value:ee,onChange:Y=>Ae(parseInt(Y.target.value,10)),className:"w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent"}),D.jsxs("span",{className:"text-xs text-secondary w-8 text-right",children:[ee,"px"]})]})]}),D.jsxs("div",{className:"mt-4",children:[D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Font Family"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Terminal typeface"})]}),D.jsx("select",{value:de,onChange:Y=>he(Y.target.value),className:"input text-xs py-1 px-2 w-auto",children:lh.map(Y=>D.jsx("option",{value:Y.id,children:Y.label},Y.id))})]}),de==="custom"&&D.jsx("input",{value:ce,onChange:Y=>te(Y.target.value),placeholder:'"Fira Code", monospace',className:"input text-xs mt-2 font-mono"})]}),D.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("div",{className:"text-sm text-primary",children:"Dark Mode"}),D.jsx("div",{className:"text-[10px] text-muted",children:"Switch between dark and light themes."})]}),D.jsx(dn,{checked:fe==="dark",onCheckedChange:Y=>Ie(Y?"dark":"light")})]})]}),D.jsxs("div",{className:"border-t border-border pt-4",children:[D.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Keyboard Shortcut Modifier"}),D.jsx("div",{className:"grid grid-cols-5 gap-1",children:["auto","ctrl-option","ctrl-shift","cmd-option","cmd-shift"].map(Y=>D.jsx("button",{type:"button",className:`btn text-xs px-2 ${pe===Y?"btn-primary":""}`,onClick:()=>ie(Y),children:Y==="auto"?"Auto":Gi(Y)},Y))}),D.jsx("p",{className:"mt-1.5 text-[10px] text-muted",children:pe==="auto"?`Platform default: ${Gi(Fo("auto"))}`:`Shortcuts: ${Gi(pe)}+[N/X/[/]]`})]})]})}),D.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-4 border-t border-border bg-elevated",children:[D.jsx("button",{type:"button",onClick:()=>t(),className:"btn",children:"Cancel"}),D.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save"})]})]})})}function Fi(e){return(e==null?void 0:e.ownerDocument)||document}let lv=0;function Aw(e){return lv+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${lv}`}const jM=[];function FM(e){k.useEffect(e,jM)}const Ds=0;class Bl{constructor(){rr(this,"currentId",Ds);rr(this,"clear",()=>{this.currentId!==Ds&&(clearTimeout(this.currentId),this.currentId=Ds)});rr(this,"disposeEffect",()=>this.clear)}static create(){return new Bl}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ds,r()},t)}isStarted(){return this.currentId!==Ds}}const qo=typeof navigator<"u",hu=WM(),$M=KM(),HM=VM();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");hu.platform==="MacIntel"&&hu.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(hu.platform);const zM=qo&&/apple/i.test(navigator.vendor);qo&&$M.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const UM=HM.includes("jsdom/");function WM(){if(!qo)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function VM(){if(!qo)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function KM(){if(!qo)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Ol(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Ji(e,t){var n;if(!e||!t)return!1;const r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&RD(r)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function qh(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Xh(e){if(!e||UM)return!0;try{return e.matches(":focus-visible")}catch{return!0}}const qf=k.createContext(void 0);function Xf(){const e=k.useContext(qf);if(!e)throw new Error(gi(73));return e}function du(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const r=e(t);return typeof r=="string"?{description:r}:r}return e}const GM=function(t){const{children:r,timeout:n=5e3,limit:s=3,toastManager:a}=t,[l,i]=k.useState([]),[o,c]=k.useState(!1),[p,u]=k.useState(!1),[m,_]=k.useState(null);l.length===0&&(o&&c(!1),p&&u(!1));const y=o||p,v=k.useRef(new Map),h=k.useRef(null),f=k.useRef(!0),d=k.useRef(!1);function g(T){var O,R;const B=Ol(Fi(h.current));if(!h.current||!Ji(h.current,B)||!Xh(B))return;const H=l.findIndex(P=>P.id===T);let j=null,$=H+1;for(;$<l.length;){if(l[$].transitionStatus!=="ending"){j=l[$];break}$+=1}if(!j)for($=H-1;$>=0;){if(l[$].transitionStatus!=="ending"){j=l[$];break}$-=1}j?(R=(O=j.ref)==null?void 0:O.current)==null||R.focus():m==null||m.focus({preventScroll:!0})}const w=Nt(()=>{d.current||(d.current=!0,v.current.forEach(T=>{if(T.timeout){T.timeout.clear();const B=Date.now()-T.start,H=T.delay-B;T.remaining=H>0?H:0}}))}),b=Nt(()=>{d.current&&(d.current=!1,v.current.forEach((T,B)=>{T.remaining=T.remaining>0?T.remaining:T.delay,T.timeout??(T.timeout=Bl.create()),T.timeout.start(T.remaining,()=>{v.current.delete(B),T.callback()}),T.start=Date.now()}))}),x=Nt(T=>{var j;i($=>{const O=$.map(P=>P.id===T?{...P,transitionStatus:"ending",height:0}:P),R=O.filter(P=>P.transitionStatus!=="ending");return O.map(P=>{if(P.transitionStatus==="ending")return P;const N=R.indexOf(P)>=s;return{...P,limited:N}})});const B=v.current.get(T);B&&B.timeout&&(B.timeout.clear(),v.current.delete(T));const H=l.find($=>$.id===T);(j=H==null?void 0:H.onClose)==null||j.call(H),g(T),l.length===1&&(c(!1),u(!1))}),C=Nt(T=>{var H;i(j=>j.filter($=>$.id!==T));const B=l.find(j=>j.id===T);(H=B==null?void 0:B.onRemove)==null||H.call(B)}),S=Nt((T,B,H)=>{const j=Date.now(),$=f.current&&!o&&!p,O=$?Bl.create():void 0;O==null||O.start(B,()=>{v.current.delete(T),H()}),v.current.set(T,{timeout:O,start:$?j:0,delay:B,remaining:B,callback:H})}),E=Nt(T=>{const B=T.id||Aw("toast"),H={...T,id:B,transitionStatus:"starting"};i($=>{const O=[H,...$],R=O.filter(P=>P.transitionStatus!=="ending");if(R.length>s){const P=R.length-s,N=R.slice(-P);return O.map(F=>N.some(V=>V.id===F.id)?{...F,limited:!0}:{...F,limited:!1})}return O.map(P=>({...P,limited:!1}))});const j=H.timeout??n;return H.type!=="loading"&&j>0&&S(B,j,()=>x(B)),(o||p||!f.current)&&w(),B}),L=Nt((T,B)=>{i(H=>H.map(j=>j.id===T?{...j,...B}:j))}),A=Nt((T,B)=>{const H=du(B.loading),j=E({...H,type:"loading"}),$=T.then(O=>{const R=du(B.success,O);L(j,{...R,type:"success"});const P=R.timeout??n;return P>0&&S(j,P,()=>x(j)),(o||p||!f.current)&&w(),O}).catch(O=>{const R=du(B.error,O);L(j,{...R,type:"error"});const P=R.timeout??n;return P>0&&S(j,P,()=>x(j)),(o||p||!f.current)&&w(),Promise.reject(O)});return{}.hasOwnProperty.call(B,"setPromise")&&B.setPromise($),$});k.useEffect(function(){return a?a[" subscribe"](({action:H,options:j})=>{const $=j.id;H==="promise"&&j.promise?A(j.promise,j):H==="update"&&$?L($,j):H==="close"&&$?x($):E(j)}):void 0},[E,L,S,n,a,A,x]);const M=k.useMemo(()=>({toasts:l,setToasts:i,hovering:o,setHovering:c,focused:p,setFocused:u,expanded:y,add:E,close:x,remove:C,update:L,promise:A,pauseTimers:w,resumeTimers:b,prevFocusElement:m,setPrevFocusElement:_,viewportRef:h,scheduleTimer:S,windowFocusedRef:f}),[E,x,p,o,y,w,m,A,C,b,S,l,L]);return D.jsx(qf.Provider,{value:M,children:r})},fu=k.forwardRef(function(t,r){const[n,s]=k.useState();or(()=>{zM&&s("button")},[]);const a={tabIndex:0,role:n};return D.jsx("span",{...t,ref:r,style:zf,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})}),qM=k.createContext(void 0);let XM=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const YM=k.forwardRef(function(t,r){var O;const{render:n,className:s,children:a,...l}=t,{toasts:i,pauseTimers:o,resumeTimers:c,setHovering:p,setFocused:u,viewportRef:m,windowFocusedRef:_,prevFocusElement:y,setPrevFocusElement:v,expanded:h,focused:f}=Xf(),d=k.useRef(!1),g=k.useRef(!1),w=i.length,b=((O=i[0])==null?void 0:O.height)??0,x=k.useMemo(()=>i.some(R=>R.transitionStatus==="ending"),[i]);k.useEffect(()=>{if(!m.current)return;function R(N){var F;w!==0&&N.key==="F6"&&N.target!==m.current&&(N.preventDefault(),v(Ol(Fi(m.current))),(F=m.current)==null||F.focus({preventScroll:!0}),o(),u(!0))}const P=Mo(m.current);return P.addEventListener("keydown",R),()=>{P.removeEventListener("keydown",R)}},[o,u,v,w,m]),k.useEffect(()=>{if(!m.current||!w)return;const R=Mo(m.current);function P(F){F.target===R&&(_.current=!1,o())}function N(F){if(F.relatedTarget||F.target===R)return;const V=qh(F),q=Ol(Fi(m.current));(!Ji(m.current,V)||!Xh(q))&&c(),setTimeout(()=>{_.current=!0})}return R.addEventListener("blur",P,!0),R.addEventListener("focus",N,!0),()=>{R.removeEventListener("blur",P,!0),R.removeEventListener("focus",N,!0)}},[o,c,m,_,u,w]),k.useEffect(()=>{const R=m.current;if(!R||w===0)return;const P=Fi(R);function N(F){if(F.pointerType!=="touch")return;const V=qh(F);Ji(R,V)||(c(),p(!1),u(!1))}return P.addEventListener("pointerdown",N,!0),()=>{P.removeEventListener("pointerdown",N,!0)}},[w,c,u,p,m]);function C(R){var P,N,F;m.current&&(d.current=!0,R.relatedTarget===m.current?(F=(N=(P=i[0])==null?void 0:P.ref)==null?void 0:N.current)==null||F.focus():y==null||y.focus({preventScroll:!0}))}function S(R){R.key==="Tab"&&R.shiftKey&&R.target===m.current&&(R.preventDefault(),y==null||y.focus({preventScroll:!0}),c())}k.useEffect(()=>{!_.current||x||!g.current||(c(),p(!1),g.current=!1)},[x,c,p,_]);function E(){o(),p(!0),g.current=!1}function L(){i.some(R=>R.transitionStatus==="ending")?g.current=!0:(c(),p(!1))}function A(){if(d.current){d.current=!1;return}f||Xh(Fi(m.current).activeElement)&&(u(!0),o())}function M(R){!f||Ji(m.current,R.relatedTarget)||(u(!1),c())}const T={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:L,onFocus:A,onBlur:M,onKeyDown:S,onClick:A},B=k.useMemo(()=>({expanded:h}),[h]),H=vi("div",t,{ref:[r,m],state:B,props:[T,{style:{[XM.frontmostHeight]:b?`${b}px`:void 0}},l,{children:D.jsxs(k.Fragment,{children:[w>0&&y&&D.jsx(fu,{onFocus:C}),a,w>0&&y&&D.jsx(fu,{onFocus:C})]})}]}),j=k.useMemo(()=>({viewportRef:m}),[m]),$=k.useMemo(()=>i.filter(R=>R.priority==="high"),[i]);return D.jsxs(qM.Provider,{value:j,children:[w>0&&y&&D.jsx(fu,{onFocus:C}),H,!f&&$.length>0&&D.jsx("div",{style:zf,children:$.map(R=>D.jsxs("div",{role:"alert","aria-atomic":!0,children:[D.jsx("div",{children:R.title}),D.jsx("div",{children:R.description})]},R.id))})]})});function JM(e){return aw(19)?e:e?"true":void 0}const Pw=k.createContext(void 0);function Ao(){const e=k.useContext(Pw);if(!e)throw new Error(gi(66));return e}let Iw=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const QM={[Iw.startingStyle]:""},ZM={[Iw.endingStyle]:""},e3={transitionStatus(e){return e==="starting"?QM:e==="ending"?ZM:null}};function t3(e){const t=Go(r3,e).current;return t.next=e,or(t.effect),t}function r3(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const ka=null;class n3{constructor(){rr(this,"callbacks",[]);rr(this,"callbacksCount",0);rr(this,"nextId",1);rr(this,"startId",1);rr(this,"isScheduled",!1);rr(this,"tick",t=>{var s;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a<r.length;a+=1)(s=r[a])==null||s.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}}const La=new n3;class Yf{constructor(){rr(this,"currentId",ka);rr(this,"cancel",()=>{this.currentId!==ka&&(La.cancel(this.currentId),this.currentId=ka)});rr(this,"disposeEffect",()=>this.cancel)}static create(){return new Yf}static request(t){return La.request(t)}static cancel(t){return La.cancel(t)}request(t){this.cancel(),this.currentId=La.request(()=>{this.currentId=ka,t()})}}function i3(){const e=Go(Yf.create).current;return FM(e.disposeEffect),e}function s3(e){return e==null?e:"current"in e?e.current:e}function o3(e,t=!1,r=!0){const n=i3();return Nt((s,a=null)=>{n.cancel();const l=s3(e);l!=null&&(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?s():n.request(()=>{function i(){l&&Promise.all(l.getAnimations().map(o=>o.finished)).then(()=>{a!=null&&a.aborted||Nr.flushSync(s)}).catch(()=>{if(r){if(a!=null&&a.aborted)return;Nr.flushSync(s)}else l.getAnimations().length>0&&l.getAnimations().some(o=>o.pending||o.playState!=="finished")&&i()})}t?n.request(i):i()}))})}function a3(e){const{enabled:t=!0,open:r,ref:n,onComplete:s}=e,a=t3(r),l=Nt(s),i=o3(n,r);k.useEffect(()=>{t&&i(()=>{r===a.current&&l()})},[t,r,l,i,a])}let Gn=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const l3={...e3,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Ms=40,c3=10,fn=.5,u3=1;function cv(e,t,r){switch(e){case"up":return-r;case"down":return r;case"left":return-t;case"right":return t;default:return 0}}function h3(e){const r=window.getComputedStyle(e).transform;let n=0,s=0,a=1;if(r&&r!=="none"){const l=r.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const i=l[1].split(", ").map(parseFloat);i.length===6?(n=i[4],s=i[5],a=Math.sqrt(i[0]*i[0]+i[1]*i[1])):i.length===16&&(n=i[12],s=i[13],a=i[0])}}return{x:n,y:s,scale:a}}const d3=k.forwardRef(function(t,r){var pe;const{toast:n,render:s,className:a,swipeDirection:l=["down","right"],...i}=t,o=((pe=n.positionerProps)==null?void 0:pe.anchor)!==void 0;let c=[];o||(c=Array.isArray(l)?l:[l]);const p=c.length>0,{toasts:u,focused:m,close:_,remove:y,setToasts:v,pauseTimers:h,expanded:f,setHovering:d}=Xf(),[g,w]=k.useState(void 0),[b,x]=k.useState(!1),[C,S]=k.useState(!1),[E,L]=k.useState(!1),[A,M]=k.useState({x:0,y:0}),[T,B]=k.useState({x:0,y:0,scale:1}),[H,j]=k.useState(),[$,O]=k.useState(),[R,P]=k.useState(null),N=k.useRef(null),F=k.useRef({x:0,y:0}),V=k.useRef({x:0,y:0,scale:1}),q=k.useRef(void 0),Q=k.useRef(0),Z=k.useRef(!1),z=k.useRef({x:0,y:0}),I=k.useRef(!1),K=k.useMemo(()=>u.indexOf(n),[n,u]),U=k.useMemo(()=>u.filter(ie=>ie.transitionStatus!=="ending").indexOf(n),[n,u]),J=k.useMemo(()=>u.slice(0,u.indexOf(n)).reduce((ie,oe)=>ie+(oe.height||0),0),[u,n]);a3({open:n.transitionStatus!=="ending",ref:N,onComplete(){n.transitionStatus==="ending"&&y(n.id)}});const G=Nt(()=>{const ie=N.current;if(!ie)return;const oe=ie.style.height;ie.style.height="auto";const Le=ie.offsetHeight;ie.style.height=oe,Nr.flushSync(()=>{v(be=>be.map(Re=>Re.id===n.id?{...Re,ref:N,height:Le,transitionStatus:void 0}:Re))})});or(G,[G]);function ae(ie,oe){let Le=ie,be=oe;return!c.includes("left")&&!c.includes("right")?Le=ie>0?ie**fn:-(Math.abs(ie)**fn):(!c.includes("right")&&ie>0&&(Le=ie**fn),!c.includes("left")&&ie<0&&(Le=-(Math.abs(ie)**fn))),!c.includes("up")&&!c.includes("down")?be=oe>0?oe**fn:-(Math.abs(oe)**fn):(!c.includes("down")&&oe>0&&(be=oe**fn),!c.includes("up")&&oe<0&&(be=-(Math.abs(oe)**fn))),{x:Le,y:be}}function le(ie){var be;if(ie.button!==0)return;ie.pointerType==="touch"&&h();const oe=qh(ie.nativeEvent);if(!(oe&&oe.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(Z.current=!1,q.current=void 0,Q.current=0,F.current={x:ie.clientX,y:ie.clientY},z.current=F.current,N.current){const Re=h3(N.current);V.current=Re,B(Re),M({x:Re.x,y:Re.y})}d(!0),x(!0),S(!1),P(null),I.current=!0,(be=N.current)==null||be.setPointerCapture(ie.pointerId)}}function me(ie){if(!b)return;ie.preventDefault(),I.current&&(F.current={x:ie.clientX,y:ie.clientY},I.current=!1);const{clientY:oe,clientX:Le,movementX:be,movementY:Re}=ie;(Re<0&&oe>z.current.y||Re>0&&oe<z.current.y)&&(z.current={x:z.current.x,y:oe}),(be<0&&Le>z.current.x||be>0&&Le<z.current.x)&&(z.current={x:Le,y:z.current.y});const De=Le-F.current.x,ne=oe-F.current.y,fe=oe-z.current.y,Ie=Le-z.current.x;if(!C&&Math.sqrt(De*De+ne*ne)>=u3&&(S(!0),R===null)){const Be=c.includes("left")||c.includes("right"),je=c.includes("up")||c.includes("down");if(Be&&je){const He=Math.abs(De),Me=Math.abs(ne);P(He>Me?"horizontal":"vertical")}}let W;if(!q.current)R==="vertical"?ne>0?W="down":ne<0&&(W="up"):R==="horizontal"?De>0?W="right":De<0&&(W="left"):Math.abs(De)>=Math.abs(ne)?W=De>0?"right":"left":W=ne>0?"down":"up",W&&c.includes(W)&&(q.current=W,Q.current=cv(W,De,ne),w(W));else{const xe=q.current,Be=cv(xe,Ie,fe);Be>Ms?(Z.current=!1,w(xe)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&Q.current-Be>=c3&&(Z.current=!0)}const re=ae(De,ne);let ve=V.current.x,Te=V.current.y;R==="horizontal"?(c.includes("left")||c.includes("right"))&&(ve+=re.x):(R==="vertical"||(c.includes("left")||c.includes("right"))&&(ve+=re.x),(c.includes("up")||c.includes("down"))&&(Te+=re.y)),M({x:ve,y:Te})}function ke(ie){var De;if(!b)return;if(x(!1),S(!1),P(null),(De=N.current)==null||De.releasePointerCapture(ie.pointerId),Z.current){M({x:T.x,y:T.y}),w(void 0);return}let oe=!1;const Le=A.x-T.x,be=A.y-T.y;let Re;for(const ne of c){switch(ne){case"right":Le>Ms&&(oe=!0,Re="right");break;case"left":Le<-Ms&&(oe=!0,Re="left");break;case"down":be>Ms&&(oe=!0,Re="down");break;case"up":be<-Ms&&(oe=!0,Re="up");break}if(oe)break}oe?(w(Re),L(!0),_(n.id)):(M({x:T.x,y:T.y}),w(void 0))}function X(ie){if(ie.key==="Escape"){if(!N.current||!Ji(N.current,Ol(Fi(N.current))))return;_(n.id)}}k.useEffect(()=>{if(!p)return;const ie=N.current;if(!ie)return;function oe(Le){Ji(ie,Le.target)&&Le.preventDefault()}return ie.addEventListener("touchmove",oe,{passive:!1}),()=>{ie.removeEventListener("touchmove",oe)}},[p]);function ee(){if(!b&&A.x===T.x&&A.y===T.y&&!E)return{[Gn.swipeMovementX]:"0px",[Gn.swipeMovementY]:"0px"};const ie=A.x-T.x,oe=A.y-T.y;return{transition:b?"none":void 0,transform:b?`translateX(${A.x}px) translateY(${A.y}px) scale(${T.scale})`:void 0,[Gn.swipeMovementX]:`${ie}px`,[Gn.swipeMovementY]:`${oe}px`}}const Ae=n.priority==="high",de={role:Ae?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":H,"aria-describedby":$,"aria-hidden":Ae&&!m?!0:void 0,onPointerDown:p?le:void 0,onPointerMove:p?me:void 0,onPointerUp:p?ke:void 0,onKeyDown:X,inert:JM(n.limited),style:{...ee(),[Gn.index]:n.transitionStatus==="ending"?K:U,[Gn.offsetY]:`${J}px`,[Gn.height]:n.height?`${n.height}px`:void 0}},he=k.useMemo(()=>({rootRef:N,toast:n,titleId:H,setTitleId:j,descriptionId:$,setDescriptionId:O,swiping:b,swipeDirection:g,recalculateHeight:G,index:K,visibleIndex:U,expanded:f}),[n,H,$,b,g,G,K,U,f]),ce=k.useMemo(()=>({transitionStatus:n.transitionStatus,expanded:f,limited:n.limited||!1,type:n.type,swiping:he.swiping,swipeDirection:he.swipeDirection}),[f,n.transitionStatus,n.limited,n.type,he.swiping,he.swipeDirection]),te=vi("div",t,{ref:[r,he.rootRef],state:ce,stateAttributesMapping:l3,props:[de,i]});return D.jsx(Pw.Provider,{value:he,children:te})}),f3=k.forwardRef(function(t,r){const{render:n,className:s,id:a,children:l,...i}=t,{toast:o}=Ao(),c=l??o.description,p=!!c,u=Wf(a),{setDescriptionId:m}=Ao();or(()=>{if(p)return m(u),()=>{m(void 0)}},[p,u,m]);const _=k.useMemo(()=>({type:o.type}),[o.type]),y=vi("p",t,{ref:r,state:_,props:{...i,id:u,children:c}});return p?y:null}),p3=k.forwardRef(function(t,r){const{render:n,className:s,id:a,children:l,...i}=t,{toast:o}=Ao(),c=l??o.title,p=!!c,u=Wf(a),{setTitleId:m}=Ao();or(()=>{if(p)return m(u),()=>{m(void 0)}},[p,u,m]);const _=k.useMemo(()=>({type:o.type}),[o.type]),y=vi("h2",t,{ref:r,state:_,props:{...i,id:u,children:c}});return p?y:null}),m3=k.forwardRef(function(t,r){const{render:n,className:s,disabled:a,nativeButton:l=!0,...i}=t,{close:o,expanded:c}=Xf(),{toast:p}=Ao(),{getButtonProps:u,buttonRef:m}=hw({disabled:a,native:l}),_=k.useMemo(()=>({type:p.type}),[p.type]);return vi("button",t,{ref:[r,m],state:_,props:[{"aria-hidden":!c,onClick(){o(p.id)}},i,u]})});function g3(){const e=k.useContext(qf);if(!e)throw new Error(gi(73));const{toasts:t,add:r,close:n,update:s,promise:a}=e;return k.useMemo(()=>({toasts:t,add:r,close:n,update:s,promise:a}),[t,r,n,s,a])}function v3(){const e=[];function t(r){e.forEach(n=>n(r))}return{" subscribe":function(n){return e.push(n),()=>{const s=e.indexOf(n);s!==-1&&e.splice(s,1)}},add(r){const n=r.id||Aw("toast"),s={...r,id:n,transitionStatus:"starting"};return t({action:"add",options:s}),n},close(r){t({action:"close",options:{id:r}})},update(r,n){t({action:"update",options:{...n,id:r}})},promise(r,n){let s=r;return t({action:"promise",options:{...n,promise:r,setPromise(a){s=a}}}),s}}}const _3=5e3,Bw=v3();function y3({toast:e}){return D.jsxs(d3,{toast:e,className:Pl("relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg","data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]","data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]","data-[ending-style]:opacity-0","data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0","transition-all duration-200",e.type==="error"&&"border-error/50",e.type==="success"&&"border-approval/50",(!e.type||e.type==="info")&&"border-border"),children:[D.jsxs("div",{className:"flex-1 min-w-0",children:[D.jsx(p3,{className:Pl("text-sm font-medium",e.type==="error"&&"text-error",e.type==="success"&&"text-approval",(!e.type||e.type==="info")&&"text-primary"),children:e.title}),e.description&&D.jsx(f3,{className:"mt-1 text-xs text-muted line-clamp-2",children:e.description})]}),D.jsx(m3,{className:"shrink-0 text-muted hover:text-primary transition-colors","aria-label":"Close",children:D.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[D.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),D.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function w3(){const{toasts:e}=g3();return D.jsx(D.Fragment,{children:e.map(t=>D.jsx(y3,{toast:t},t.id))})}function S3(){return D.jsxs(GM,{timeout:_3,toastManager:Bw,children:[D.jsx(w3,{}),D.jsx(YM,{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2"})]})}class x3{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status="connecting",this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.manualClose=!1}connect(){if(this.ws)return;this.manualClose=!1,this.setStatus("connecting");const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,n=new WebSocket(r);this.ws=n,n.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected")},n.onmessage=s=>{try{const a=JSON.parse(s.data);this.listeners.forEach(l=>l(a))}catch{}},n.onerror=()=>{this.setStatus("error","WebSocket error")},n.onclose=()=>{this.ws=null,this.manualClose?this.setStatus("disconnected"):this.scheduleReconnect()}}disconnect(){var t;this.manualClose=!0,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null}send(t){var r;((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeStatus(t){return this.statusListeners.add(t),t(this.status,this.error),()=>this.statusListeners.delete(t)}getStatus(){return this.status}setStatus(t,r=null){this.status=t,this.error=r,this.statusListeners.forEach(n=>n(t,r))}scheduleReconnect(){this.reconnectAttempts+=1;const t=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);this.setStatus("reconnecting"),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}}const qn=new x3;function b3(){const e=et(l=>l.setConnectionStatus),t=et(l=>l.setConnectionError),[r,n]=k.useState(qn.getStatus());k.useEffect(()=>{qn.connect();const l=qn.subscribeStatus((i,o)=>{n(i),e(i),t(o)});return()=>{l()}},[t,e]);const s=k.useMemo(()=>qn.send.bind(qn),[]),a=k.useMemo(()=>qn.subscribe.bind(qn),[]);return{status:r,sendMessage:s,subscribe:a}}const C3=100;function E3({viewport:e,win:t,doc:r}){if(!e)return!1;const n=Math.max(0,e.offsetTop||0),s=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+n),l=Math.max(0,a),i=Math.max(0,e.height||0),o=Math.max(0,e.width||0);return r.documentElement.style.setProperty("--keyboard-inset",`${l}px`),r.documentElement.style.setProperty("--viewport-offset-top",`${n}px`),r.documentElement.style.setProperty("--viewport-offset-left",`${s}px`),r.documentElement.style.setProperty("--visual-viewport-height",`${i}px`),r.documentElement.style.setProperty("--visual-viewport-width",`${o}px`),l>C3?r.documentElement.classList.add("keyboard-visible"):r.documentElement.classList.remove("keyboard-visible"),!0}function k3(e){e.documentElement.style.removeProperty("--keyboard-inset"),e.documentElement.style.removeProperty("--viewport-offset-top"),e.documentElement.style.removeProperty("--viewport-offset-left"),e.documentElement.style.removeProperty("--visual-viewport-height"),e.documentElement.style.removeProperty("--visual-viewport-width"),e.documentElement.classList.remove("keyboard-visible")}function L3(){k.useEffect(()=>{const e=window.visualViewport;if(!e)return;let t=null,r=null;const n=()=>{var v;const _=document.activeElement;if(!_)return!1;const y=(v=_.tagName)==null?void 0:v.toLowerCase();return y==="input"||y==="textarea"?!0:!!_.isContentEditable},s=()=>{E3({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!="function"){s();return}t!==null&&window.cancelAnimationFrame(t);const _=performance.now(),y=()=>{s(),performance.now()-_<1500?t=window.requestAnimationFrame(y):t=null};t=window.requestAnimationFrame(y)},l=()=>{if(!n()){o();return}s()},i=()=>{r!==null||typeof window.setInterval!="function"||(r=window.setInterval(l,250),l())},o=()=>{r===null||typeof window.clearInterval!="function"||(window.clearInterval(r),r=null)},c=()=>{n()?(a(),i(),s()):o()},p=()=>{c()},u=()=>{c()},m=()=>{a()};return s(),c(),e.addEventListener("resize",s),e.addEventListener("scroll",s),typeof window.addEventListener=="function"&&(window.addEventListener("resize",s),window.addEventListener("orientationchange",m)),typeof document.addEventListener=="function"&&(document.addEventListener("focusin",p),document.addEventListener("focusout",u),document.addEventListener("focus",p,!0),document.addEventListener("blur",u,!0)),()=>{e.removeEventListener("resize",s),e.removeEventListener("scroll",s),typeof window.removeEventListener=="function"&&(window.removeEventListener("resize",s),window.removeEventListener("orientationchange",m)),typeof document.removeEventListener=="function"&&(document.removeEventListener("focusin",p),document.removeEventListener("focusout",u),document.removeEventListener("focus",p,!0),document.removeEventListener("blur",u,!0)),t!==null&&typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(t),o(),k3(document)}},[])}function R3(){const[e,t]=k.useState(!1),[r,n]=k.useState(!1),[s,a]=k.useState(null),[l,i]=k.useState(null),o=et(X=>X.sessions),c=et(X=>X.agentSessions),p=et(X=>X.selectedSessionId),u=et(X=>X.setSessions),m=et(X=>X.setAgentSessions),_=et(X=>X.setHostStatuses),y=et(X=>X.updateSession),v=et(X=>X.setSelectedSessionId),h=et(X=>X.hasLoaded),f=et(X=>X.connectionStatus),d=et(X=>X.connectionError),g=et(X=>X.clearExitingSession),w=et(X=>X.markSessionExiting),b=Ml(X=>X.theme),x=ue(X=>X.defaultProjectDir),C=ue(X=>X.commandPresets),S=ue(X=>X.defaultPresetId),E=ue(X=>X.lastProjectPath),L=ue(X=>X.setLastProjectPath),A=ue(X=>X.addRecentPath),M=ue(X=>X.shortcutModifier),T=ue(X=>X.sidebarWidth),B=ue(X=>X.setSidebarWidth),H=ue(X=>X.projectFilters),j=ue(X=>X.hostFilters),$=ue(X=>X.soundOnPermission),O=ue(X=>X.soundOnIdle),{sendMessage:R,subscribe:P}=b3();L3(),k.useEffect(()=>{if(typeof document>"u"||!$&&!O)return;const X=()=>{Vh(),document.removeEventListener("click",X),document.removeEventListener("keydown",X),document.removeEventListener("touchstart",X)};return document.addEventListener("click",X,{once:!0,passive:!0}),document.addEventListener("keydown",X,{once:!0,passive:!0}),document.addEventListener("touchstart",X,{once:!0,passive:!0}),()=>{document.removeEventListener("click",X),document.removeEventListener("keydown",X),document.removeEventListener("touchstart",X)}},[$,O]);const N=k.useRef(!1),F=k.useCallback(X=>{X.preventDefault(),N.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]);k.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const X=Ae=>{if(!N.current)return;const de=Ae.clientX;B(Math.max(C0,Math.min(E0,de)))},ee=()=>{N.current&&(N.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",X),document.addEventListener("mouseup",ee),()=>{document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",ee)}},[B]),k.useEffect(()=>{const X=P(ee=>{var Ae,de;if(ee.type==="sessions"){const he=et.getState().sessions,{soundOnPermission:ce,soundOnIdle:te}=ue.getState();if(ce||te)for(const pe of ee.sessions){const ie=he.find(oe=>oe.id===pe.id);ie&&ie.status!==pe.status&&(ie.status!=="permission"&&pe.status==="permission"&&ce&&Kh(),ie.status==="working"&&pe.status==="waiting"&&te&&Gh())}u(ee.sessions)}if(ee.type==="host-status"&&_(ee.hosts),ee.type==="session-update"){const ce=et.getState().sessions.find(ie=>ie.id===ee.session.id),te=ce==null?void 0:ce.status,pe=ee.session.status;if(y(ee.session),te){const{soundOnPermission:ie,soundOnIdle:oe}=ue.getState();te!=="permission"&&pe==="permission"&&ie&&Kh(),te==="working"&&pe==="waiting"&&oe&&Gh()}}if(ee.type==="session-created"){const he=et.getState().sessions;he.some(pe=>pe.id===ee.session.id)||u([ee.session,...he]),v(ee.session.id),A(ee.session.projectPath);const{projectFilters:ce,setProjectFilters:te}=ue.getState();ce.length>0&&!ce.includes(ee.session.projectPath)&&te([...ce,ee.session.projectPath])}if(ee.type==="session-removed"){const he=et.getState().sessions,ce=he.filter(te=>te.id!==ee.sessionId);ce.length!==he.length&&u(ce)}if(ee.type==="agent-sessions"&&m(ee.active,ee.inactive),ee.type==="session-orphaned"){const he=et.getState().sessions,ce=he.filter(te=>{var pe;return((pe=te.agentSessionId)==null?void 0:pe.trim())!==ee.session.sessionId});ce.length!==he.length&&u(ce)}if(ee.type==="session-resume-result")if(ee.ok&&ee.session){const he=et.getState().sessions;he.some(ce=>ce.id===ee.session.id)||u([ee.session,...he]),v(ee.session.id)}else ee.ok||(a(`${(Ae=ee.error)==null?void 0:Ae.code}: ${(de=ee.error)==null?void 0:de.message}`),window.setTimeout(()=>a(null),6e3));ee.type==="terminal-error"&&(!ee.sessionId||ee.sessionId===p)&&(a(`${ee.code}: ${ee.message}`),window.setTimeout(()=>a(null),6e3)),ee.type==="terminal-ready"&&ee.sessionId===p&&a(null),ee.type==="error"&&(a(ee.message),window.setTimeout(()=>a(null),6e3)),ee.type==="kill-failed"&&(g(ee.sessionId),a(ee.message),window.setTimeout(()=>a(null),6e3)),ee.type==="session-pin-result"&&!ee.ok&&ee.error&&(a(ee.error),window.setTimeout(()=>a(null),6e3)),ee.type==="session-resurrection-failed"&&Bw.add({title:"Session resurrection failed",description:`"${ee.displayName}" could not be resumed: ${ee.error}`,type:"error",timeout:8e3})});return()=>{X()}},[p,A,g,R,v,u,m,_,P,y]);const V=k.useMemo(()=>o.find(X=>X.id===p)||null,[p,o]);k.useEffect(()=>{V!=null&&V.projectPath&&L(V.projectPath)},[V==null?void 0:V.projectPath,L]);const q=ue(X=>X.sessionSortMode),Q=ue(X=>X.sessionSortDirection),Z=ue(X=>X.manualSessionOrder),z=k.useMemo(()=>Nf(o,{mode:q,direction:Q,manualOrder:Z}),[o,q,Q,Z]),I=k.useMemo(()=>{let X=z;return H.length>0&&(X=X.filter(ee=>H.includes(ee.projectPath))),j.length>0&&(X=X.filter(ee=>j.includes(ee.host??""))),X},[z,H,j]);k.useEffect(()=>{p&&I.length>0&&!I.some(X=>X.id===p)&&v(I[0].id)},[p,I,v]),k.useEffect(()=>{window.matchMedia("(max-width: 767px)").matches&&h&&p===null&&z.length>0&&v(z[0].id)},[h,p,z,v]);const K=k.useCallback(X=>{w(X),R({type:"session-kill",sessionId:X})},[w,R]);k.useEffect(()=>{const X=Fo(M),ee=Ae=>{if(Ae.defaultPrevented)return;const de=Ae.code,he=eC(Ae,X);if(he&&(de==="BracketLeft"||de==="BracketRight")){Ae.preventDefault();const ce=I;if(ce.length===0)return;const te=ce.findIndex(oe=>oe.id===p);if(te===-1){v(ce[0].id);return}const ie=(te+(de==="BracketLeft"?-1:1)+ce.length)%ce.length;v(ce[ie].id);return}if(he&&de==="KeyN"){Ae.preventDefault(),e||t(!0);return}if(he&&de==="KeyX"){Ae.preventDefault(),p&&!e&&K(p);return}};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[e,p,v,I,K,M]);const U=()=>t(!0),J=()=>n(!0),G=(X,ee,Ae)=>{R({type:"session-create",projectPath:X,name:ee,command:Ae}),L(X)},ae=X=>{R({type:"session-resume",sessionId:X})},le=(X,ee)=>{R({type:"session-rename",sessionId:X,newName:ee})},me=k.useCallback(X=>{const ee=o.find(Ae=>Ae.id===X);ee&&R({type:"session-create",projectPath:ee.projectPath,command:ee.command})},[o,R]),ke=k.useCallback((X,ee)=>{R({type:"session-pin",sessionId:X,isPinned:ee})},[R]);return k.useEffect(()=>{document.documentElement.setAttribute("data-theme",b)},[b]),k.useEffect(()=>{fetch("/api/server-info").then(X=>X.json()).then(X=>i(X)).catch(()=>{})},[]),D.jsxs("div",{className:"flex h-full overflow-hidden",children:[D.jsxs("div",{className:"hidden h-full flex-col md:flex md:shrink-0",style:{width:T},children:[D.jsx(rC,{connectionStatus:f,onNewSession:U,onOpenSettings:J,tailscaleIp:(l==null?void 0:l.tailscaleIp)??null}),D.jsx(B1,{sessions:o,inactiveSessions:c.inactive,selectedSessionId:p,onSelect:v,onRename:le,onResume:ae,onKill:K,onDuplicate:me,onSetPinned:ke,loading:!h,error:d||s})]}),D.jsx("div",{className:"hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20",onMouseDown:F}),D.jsx(tD,{session:V,sessions:I,connectionStatus:f,sendMessage:R,subscribe:P,onClose:()=>v(null),onSelectSession:v,onNewSession:U,onKillSession:K,onRenameSession:le,onOpenSettings:J,onResumeSession:ae,onSetPinned:ke,inactiveSessions:c.inactive,loading:!h,error:d||s}),D.jsx(nD,{isOpen:e,onClose:()=>t(!1),onCreate:G,defaultProjectDir:x,commandPresets:C,defaultPresetId:S,lastProjectPath:E,activeProjectPath:V==null?void 0:V.projectPath}),D.jsx(NM,{isOpen:r,onClose:()=>n(!1)}),D.jsx(S3,{})]})}jo()&&document.documentElement.classList.add("ios");Jb()&&document.documentElement.classList.add("ios-pwa");const Ow=document.getElementById("root");if(!Ow)throw new Error("Root element not found");b0(Ow).render(D.jsx(mt.StrictMode,{children:D.jsx(R3,{})}));