termbridge 0.2.0 → 0.3.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,103 @@
1
+ function J2(t,e){for(var i=0;i<e.length;i++){const n=e[i];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const l=Object.getOwnPropertyDescriptor(n,a);l&&Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function i(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=i(a);fetch(a.href,l)}})();function Cw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var I_={exports:{}},Jc={};var HS;function ek(){if(HS)return Jc;HS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(n,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var h in a)h!=="key"&&(l[h]=a[h])}else l=a;return a=l.ref,{$$typeof:t,type:n,key:u,ref:a!==void 0?a:null,props:l}}return Jc.Fragment=e,Jc.jsx=i,Jc.jsxs=i,Jc}var US;function tk(){return US||(US=1,I_.exports=ek()),I_.exports}var j=tk(),H_={exports:{}},eu={},U_={exports:{}},F_={};var FS;function ik(){return FS||(FS=1,(function(t){function e(M,A){var z=M.length;M.push(A);e:for(;0<z;){var q=z-1>>>1,Y=M[q];if(0<a(Y,A))M[q]=A,M[z]=Y,z=q;else break e}}function i(M){return M.length===0?null:M[0]}function n(M){if(M.length===0)return null;var A=M[0],z=M.pop();if(z!==A){M[0]=z;e:for(var q=0,Y=M.length,B=Y>>>1;q<B;){var X=2*(q+1)-1,ie=M[X],re=X+1,fe=M[re];if(0>a(ie,z))re<Y&&0>a(fe,ie)?(M[q]=fe,M[re]=z,q=re):(M[q]=ie,M[X]=z,q=X);else if(re<Y&&0>a(fe,z))M[q]=fe,M[re]=z,q=re;else break e}}return A}function a(M,A){var z=M.sortIndex-A.sortIndex;return z!==0?z:M.id-A.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var u=Date,h=u.now();t.unstable_now=function(){return u.now()-h}}var f=[],d=[],p=1,v=null,g=3,y=!1,b=!1,C=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function E(M){for(var A=i(d);A!==null;){if(A.callback===null)n(d);else if(A.startTime<=M)n(d),A.sortIndex=A.expirationTime,e(f,A);else break;A=i(d)}}function H(M){if(C=!1,E(M),!b)if(i(f)!==null)b=!0,U||(U=!0,D());else{var A=i(d);A!==null&&$(H,A.startTime-M)}}var U=!1,I=-1,N=5,F=-1;function J(){return x?!0:!(t.unstable_now()-F<N)}function G(){if(x=!1,U){var M=t.unstable_now();F=M;var A=!0;try{e:{b=!1,C&&(C=!1,R(I),I=-1),y=!0;var z=g;try{t:{for(E(M),v=i(f);v!==null&&!(v.expirationTime>M&&J());){var q=v.callback;if(typeof q=="function"){v.callback=null,g=v.priorityLevel;var Y=q(v.expirationTime<=M);if(M=t.unstable_now(),typeof Y=="function"){v.callback=Y,E(M),A=!0;break t}v===i(f)&&n(f),E(M)}else n(f);v=i(f)}if(v!==null)A=!0;else{var B=i(d);B!==null&&$(H,B.startTime-M),A=!1}}break e}finally{v=null,g=z,y=!1}A=void 0}}finally{A?D():U=!1}}}var D;if(typeof L=="function")D=function(){L(G)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,P=O.port2;O.port1.onmessage=G,D=function(){P.postMessage(null)}}else D=function(){k(G,0)};function $(M,A){I=k(function(){M(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(M){switch(g){case 1:case 2:case 3:var A=3;break;default:A=g}var z=g;g=A;try{return M()}finally{g=z}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(M,A){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var z=g;g=M;try{return A()}finally{g=z}},t.unstable_scheduleCallback=function(M,A,z){var q=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?q+z:q):z=q,M){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,M={id:p++,callback:A,priorityLevel:M,startTime:z,expirationTime:Y,sortIndex:-1},z>q?(M.sortIndex=z,e(d,M),i(f)===null&&M===i(d)&&(C?(R(I),I=-1):C=!0,$(H,z-q))):(M.sortIndex=Y,e(f,M),b||y||(b=!0,U||(U=!0,D()))),M},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(M){var A=g;return function(){var z=g;g=A;try{return M.apply(this,arguments)}finally{g=z}}}})(F_)),F_}var $S;function sk(){return $S||($S=1,U_.exports=ik()),U_.exports}var $_={exports:{}},Ke={};var WS;function rk(){if(WS)return Ke;WS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),g=Symbol.iterator;function y(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,x={};function k(B,X,ie){this.props=B,this.context=X,this.refs=x,this.updater=ie||b}k.prototype.isReactComponent={},k.prototype.setState=function(B,X){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,X,"setState")},k.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function R(){}R.prototype=k.prototype;function L(B,X,ie){this.props=B,this.context=X,this.refs=x,this.updater=ie||b}var E=L.prototype=new R;E.constructor=L,C(E,k.prototype),E.isPureReactComponent=!0;var H=Array.isArray;function U(){}var I={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function F(B,X,ie){var re=ie.ref;return{$$typeof:t,type:B,key:X,ref:re!==void 0?re:null,props:ie}}function J(B,X){return F(B.type,X,B.props)}function G(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function D(B){var X={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ie){return X[ie]})}var O=/\/+/g;function P(B,X){return typeof B=="object"&&B!==null&&B.key!=null?D(""+B.key):X.toString(36)}function $(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(U,U):(B.status="pending",B.then(function(X){B.status==="pending"&&(B.status="fulfilled",B.value=X)},function(X){B.status==="pending"&&(B.status="rejected",B.reason=X)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function M(B,X,ie,re,fe){var he=typeof B;(he==="undefined"||he==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(he){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case t:case e:oe=!0;break;case p:return oe=B._init,M(oe(B._payload),X,ie,re,fe)}}if(oe)return fe=fe(B),oe=re===""?"."+P(B,0):re,H(fe)?(ie="",oe!=null&&(ie=oe.replace(O,"$&/")+"/"),M(fe,X,ie,"",function(we){return we})):fe!=null&&(G(fe)&&(fe=J(fe,ie+(fe.key==null||B&&B.key===fe.key?"":(""+fe.key).replace(O,"$&/")+"/")+oe)),X.push(fe)),1;oe=0;var ve=re===""?".":re+":";if(H(B))for(var de=0;de<B.length;de++)re=B[de],he=ve+P(re,de),oe+=M(re,X,ie,he,fe);else if(de=y(B),typeof de=="function")for(B=de.call(B),de=0;!(re=B.next()).done;)re=re.value,he=ve+P(re,de++),oe+=M(re,X,ie,he,fe);else if(he==="object"){if(typeof B.then=="function")return M($(B),X,ie,re,fe);throw X=String(B),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return oe}function A(B,X,ie){if(B==null)return B;var re=[],fe=0;return M(B,re,"","",function(he){return X.call(ie,he,fe++)}),re}function z(B){if(B._status===-1){var X=B._result;X=X(),X.then(function(ie){(B._status===0||B._status===-1)&&(B._status=1,B._result=ie)},function(ie){(B._status===0||B._status===-1)&&(B._status=2,B._result=ie)}),B._status===-1&&(B._status=0,B._result=X)}if(B._status===1)return B._result.default;throw B._result}var q=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},Y={map:A,forEach:function(B,X,ie){A(B,function(){X.apply(this,arguments)},ie)},count:function(B){var X=0;return A(B,function(){X++}),X},toArray:function(B){return A(B,function(X){return X})||[]},only:function(B){if(!G(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ke.Activity=v,Ke.Children=Y,Ke.Component=k,Ke.Fragment=i,Ke.Profiler=a,Ke.PureComponent=L,Ke.StrictMode=n,Ke.Suspense=f,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(B){return I.H.useMemoCache(B)}},Ke.cache=function(B){return function(){return B.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(B,X,ie){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var re=C({},B.props),fe=B.key;if(X!=null)for(he in X.key!==void 0&&(fe=""+X.key),X)!N.call(X,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&X.ref===void 0||(re[he]=X[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var oe=Array(he),ve=0;ve<he;ve++)oe[ve]=arguments[ve+2];re.children=oe}return F(B.type,fe,re)},Ke.createContext=function(B){return B={$$typeof:u,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:l,_context:B},B},Ke.createElement=function(B,X,ie){var re,fe={},he=null;if(X!=null)for(re in X.key!==void 0&&(he=""+X.key),X)N.call(X,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(fe[re]=X[re]);var oe=arguments.length-2;if(oe===1)fe.children=ie;else if(1<oe){for(var ve=Array(oe),de=0;de<oe;de++)ve[de]=arguments[de+2];fe.children=ve}if(B&&B.defaultProps)for(re in oe=B.defaultProps,oe)fe[re]===void 0&&(fe[re]=oe[re]);return F(B,he,fe)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(B){return{$$typeof:h,render:B}},Ke.isValidElement=G,Ke.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:z}},Ke.memo=function(B,X){return{$$typeof:d,type:B,compare:X===void 0?null:X}},Ke.startTransition=function(B){var X=I.T,ie={};I.T=ie;try{var re=B(),fe=I.S;fe!==null&&fe(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(U,q)}catch(he){q(he)}finally{X!==null&&ie.types!==null&&(X.types=ie.types),I.T=X}},Ke.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Ke.use=function(B){return I.H.use(B)},Ke.useActionState=function(B,X,ie){return I.H.useActionState(B,X,ie)},Ke.useCallback=function(B,X){return I.H.useCallback(B,X)},Ke.useContext=function(B){return I.H.useContext(B)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(B,X){return I.H.useDeferredValue(B,X)},Ke.useEffect=function(B,X){return I.H.useEffect(B,X)},Ke.useEffectEvent=function(B){return I.H.useEffectEvent(B)},Ke.useId=function(){return I.H.useId()},Ke.useImperativeHandle=function(B,X,ie){return I.H.useImperativeHandle(B,X,ie)},Ke.useInsertionEffect=function(B,X){return I.H.useInsertionEffect(B,X)},Ke.useLayoutEffect=function(B,X){return I.H.useLayoutEffect(B,X)},Ke.useMemo=function(B,X){return I.H.useMemo(B,X)},Ke.useOptimistic=function(B,X){return I.H.useOptimistic(B,X)},Ke.useReducer=function(B,X,ie){return I.H.useReducer(B,X,ie)},Ke.useRef=function(B){return I.H.useRef(B)},Ke.useState=function(B){return I.H.useState(B)},Ke.useSyncExternalStore=function(B,X,ie){return I.H.useSyncExternalStore(B,X,ie)},Ke.useTransition=function(){return I.H.useTransition()},Ke.version="19.2.3",Ke}var jS;function Uu(){return jS||(jS=1,$_.exports=rk()),$_.exports}var W_={exports:{}},es={};var VS;function nk(){if(VS)return es;VS=1;var t=Uu();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var n={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(f,d,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:v==null?null:""+v,children:f,containerInfo:d,implementation:p}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return es.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,es.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return l(f,d,null,p)},es.flushSync=function(f){var d=u.T,p=n.p;try{if(u.T=null,n.p=2,f)return f()}finally{u.T=d,n.p=p,n.d.f()}},es.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(f,d))},es.prefetchDNS=function(f){typeof f=="string"&&n.d.D(f)},es.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,v=h(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?n.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:g,fetchPriority:y}):p==="script"&&n.d.X(f,{crossOrigin:v,integrity:g,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},es.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=h(d.as,d.crossOrigin);n.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&n.d.M(f)},es.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,v=h(p,d.crossOrigin);n.d.L(f,p,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},es.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=h(d.as,d.crossOrigin);n.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else n.d.m(f)},es.requestFormReset=function(f){n.d.r(f)},es.unstable_batchedUpdates=function(f,d){return f(d)},es.useFormState=function(f,d,p){return u.H.useFormState(f,d,p)},es.useFormStatus=function(){return u.H.useHostTransitionStatus()},es.version="19.2.3",es}var qS;function xw(){if(qS)return W_.exports;qS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),W_.exports=nk(),W_.exports}var YS;function ak(){if(YS)return eu;YS=1;var t=sk(),e=Uu(),i=xw();function n(s){var r="https://react.dev/errors/"+s;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+s+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var r=s,o=s;if(s.alternate)for(;r.return;)r=r.return;else{s=r;do r=s,(r.flags&4098)!==0&&(o=r.return),s=r.return;while(s)}return r.tag===3?o:null}function u(s){if(s.tag===13){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function h(s){if(s.tag===31){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function f(s){if(l(s)!==s)throw Error(n(188))}function d(s){var r=s.alternate;if(!r){if(r=l(s),r===null)throw Error(n(188));return r!==s?null:s}for(var o=s,c=r;;){var m=o.return;if(m===null)break;var _=m.alternate;if(_===null){if(c=m.return,c!==null){o=c;continue}break}if(m.child===_.child){for(_=m.child;_;){if(_===o)return f(m),s;if(_===c)return f(m),r;_=_.sibling}throw Error(n(188))}if(o.return!==c.return)o=m,c=_;else{for(var w=!1,T=m.child;T;){if(T===o){w=!0,o=m,c=_;break}if(T===c){w=!0,c=m,o=_;break}T=T.sibling}if(!w){for(T=_.child;T;){if(T===o){w=!0,o=_,c=m;break}if(T===c){w=!0,c=_,o=m;break}T=T.sibling}if(!w)throw Error(n(189))}}if(o.alternate!==c)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?s:r}function p(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s;for(s=s.child;s!==null;){if(r=p(s),r!==null)return r;s=s.sibling}return null}var v=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),L=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function D(s){return s===null||typeof s!="object"?null:(s=G&&s[G]||s["@@iterator"],typeof s=="function"?s:null)}var O=Symbol.for("react.client.reference");function P(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===O?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case C:return"Fragment";case k:return"Profiler";case x:return"StrictMode";case H:return"Suspense";case U:return"SuspenseList";case F:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case L:return s.displayName||"Context";case R:return(s._context.displayName||"Context")+".Consumer";case E:var r=s.render;return s=s.displayName,s||(s=r.displayName||r.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case I:return r=s.displayName||null,r!==null?r:P(s.type)||"Memo";case N:r=s._payload,s=s._init;try{return P(s(r))}catch{}}return null}var $=Array.isArray,M=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},q=[],Y=-1;function B(s){return{current:s}}function X(s){0>Y||(s.current=q[Y],q[Y]=null,Y--)}function ie(s,r){Y++,q[Y]=s.current,s.current=r}var re=B(null),fe=B(null),he=B(null),oe=B(null);function ve(s,r){switch(ie(he,r),ie(fe,s),ie(re,null),r.nodeType){case 9:case 11:s=(s=r.documentElement)&&(s=s.namespaceURI)?lS(s):0;break;default:if(s=r.tagName,r=r.namespaceURI)r=lS(r),s=cS(r,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}X(re),ie(re,s)}function de(){X(re),X(fe),X(he)}function we(s){s.memoizedState!==null&&ie(oe,s);var r=re.current,o=cS(r,s.type);r!==o&&(ie(fe,s),ie(re,o))}function Le(s){fe.current===s&&(X(re),X(fe)),oe.current===s&&(X(oe),Gc._currentValue=z)}var tt,Ge;function xe(s){if(tt===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);tt=r&&r[1]||"",Ge=-1<o.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+tt+s+Ge}var Oe=!1;function ge(s,r){if(!s||Oe)return"";Oe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(se){var te=se}Reflect.construct(s,[],le)}else{try{le.call()}catch(se){te=se}s.call(le.prototype)}}else{try{throw Error()}catch(se){te=se}(le=s())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(se){if(se&&te&&typeof se.stack=="string")return[se.stack,te.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=c.DetermineComponentFrameRoot(),w=_[0],T=_[1];if(w&&T){var W=w.split(`
4
+ `),Q=T.split(`
5
+ `);for(m=c=0;c<W.length&&!W[c].includes("DetermineComponentFrameRoot");)c++;for(;m<Q.length&&!Q[m].includes("DetermineComponentFrameRoot");)m++;if(c===W.length||m===Q.length)for(c=W.length-1,m=Q.length-1;1<=c&&0<=m&&W[c]!==Q[m];)m--;for(;1<=c&&0<=m;c--,m--)if(W[c]!==Q[m]){if(c!==1||m!==1)do if(c--,m--,0>m||W[c]!==Q[m]){var ne=`
6
+ `+W[c].replace(" at new "," at ");return s.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",s.displayName)),ne}while(1<=c&&0<=m);break}}}finally{Oe=!1,Error.prepareStackTrace=o}return(o=s?s.displayName||s.name:"")?xe(o):""}function _t(s,r){switch(s.tag){case 26:case 27:case 5:return xe(s.type);case 16:return xe("Lazy");case 13:return s.child!==r&&r!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return ge(s.type,!1);case 11:return ge(s.type.render,!1);case 1:return ge(s.type,!0);case 31:return xe("Activity");default:return""}}function St(s){try{var r="",o=null;do r+=_t(s,o),o=s,s=s.return;while(s);return r}catch(c){return`
7
+ Error generating stack: `+c.message+`
8
+ `+c.stack}}var dt=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,pe=t.unstable_cancelCallback,Gt=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Qe=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,xt=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Ms=t.unstable_NormalPriority,rs=t.unstable_LowPriority,Qn=t.unstable_IdlePriority,Jn=t.log,jr=t.unstable_setDisableYieldValue,Xs=null,ri=null;function $i(s){if(typeof Jn=="function"&&jr(s),ri&&typeof ri.setStrictMode=="function")try{ri.setStrictMode(Xs,s)}catch{}}var At=Math.clz32?Math.clz32:fn,ni=Math.log,Zs=Math.LN2;function fn(s){return s>>>=0,s===0?32:31-(ni(s)/Zs|0)|0}var Qs=256,kt=262144,Rr=4194304;function Wi(s){var r=s&42;if(r!==0)return r;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function As(s,r,o){var c=s.pendingLanes;if(c===0)return 0;var m=0,_=s.suspendedLanes,w=s.pingedLanes;s=s.warmLanes;var T=c&134217727;return T!==0?(c=T&~_,c!==0?m=Wi(c):(w&=T,w!==0?m=Wi(w):o||(o=T&~s,o!==0&&(m=Wi(o))))):(T=c&~_,T!==0?m=Wi(T):w!==0?m=Wi(w):o||(o=c&~s,o!==0&&(m=Wi(o)))),m===0?0:r!==0&&r!==m&&(r&_)===0&&(_=m&-m,o=r&-r,_>=o||_===32&&(o&4194048)!==0)?r:m}function Mr(s,r){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&r)===0}function ea(s,r){switch(s){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qi(){var s=Rr;return Rr<<=1,(Rr&62914560)===0&&(Rr=4194304),s}function Js(s){for(var r=[],o=0;31>o;o++)r.push(s);return r}function Ut(s,r){s.pendingLanes|=r,r!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ze(s,r,o,c,m,_){var w=s.pendingLanes;s.pendingLanes=o,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=o,s.entangledLanes&=o,s.errorRecoveryDisabledLanes&=o,s.shellSuspendCounter=0;var T=s.entanglements,W=s.expirationTimes,Q=s.hiddenUpdates;for(o=w&~o;0<o;){var ne=31-At(o),le=1<<ne;T[ne]=0,W[ne]=-1;var te=Q[ne];if(te!==null)for(Q[ne]=null,ne=0;ne<te.length;ne++){var se=te[ne];se!==null&&(se.lane&=-536870913)}o&=~le}c!==0&&Lt(s,c,0),_!==0&&m===0&&s.tag!==0&&(s.suspendedLanes|=_&~(w&~r))}function Lt(s,r,o){s.pendingLanes|=r,s.suspendedLanes&=~r;var c=31-At(r);s.entangledLanes|=r,s.entanglements[c]=s.entanglements[c]|1073741824|o&261930}function Ko(s,r){var o=s.entangledLanes|=r;for(s=s.entanglements;o;){var c=31-At(o),m=1<<c;m&r|s[c]&r&&(s[c]|=r),o&=~m}}function er(s,r){var o=r&-r;return o=(o&42)!==0?1:ji(o),(o&(s.suspendedLanes|r))!==0?0:o}function ji(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Se(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ft(){var s=A.p;return s!==0?s:(s=window.event,s===void 0?32:DS(s.type))}function Xe(s,r){var o=A.p;try{return A.p=s,r()}finally{A.p=o}}var Fe=Math.random().toString(36).slice(2),Te="__reactFiber$"+Fe,He="__reactProps$"+Fe,Ft="__reactContainer$"+Fe,Bt="__reactEvents$"+Fe,tr="__reactListeners$"+Fe,ir="__reactHandles$"+Fe,Ar="__reactResources$"+Fe,Ls="__reactMarker$"+Fe;function Lr(s){delete s[Te],delete s[He],delete s[Bt],delete s[tr],delete s[ir]}function ci(s){var r=s[Te];if(r)return r;for(var o=s.parentNode;o;){if(r=o[Ft]||o[Te]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(s=pS(s);s!==null;){if(o=s[Te])return o;s=pS(s)}return r}s=o,o=s.parentNode}return null}function ms(s){if(s=s[Te]||s[Ft]){var r=s.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return s}return null}function ui(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s.stateNode;throw Error(n(33))}function Ei(s){var r=s[Ar];return r||(r=s[Ar]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function be(s){s[Ls]=!0}var mn=new Set,Xu={};function _s(s,r){sr(s,r),sr(s+"Capture",r)}function sr(s,r){for(Xu[s]=r,s=0;s<r.length;s++)mn.add(r[s])}var Dr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ta={},nc={};function Go(s){return dt.call(nc,s)?!0:dt.call(ta,s)?!1:Dr.test(s)?nc[s]=!0:(ta[s]=!0,!1)}function Vr(s,r,o){if(Go(r))if(o===null)s.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":s.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){s.removeAttribute(r);return}}s.setAttribute(r,""+o)}}function _n(s,r,o){if(o===null)s.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(r);return}s.setAttribute(r,""+o)}}function rr(s,r,o,c){if(c===null)s.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttributeNS(r,o,""+c)}}function nt(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ac(s){var r=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Pf(s,r,o){var c=Object.getOwnPropertyDescriptor(s.constructor.prototype,r);if(!s.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,_=c.set;return Object.defineProperty(s,r,{configurable:!0,get:function(){return m.call(this)},set:function(w){o=""+w,_.call(this,w)}}),Object.defineProperty(s,r,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){s._valueTracker=null,delete s[r]}}}}function oc(s){if(!s._valueTracker){var r=ac(s)?"checked":"value";s._valueTracker=Pf(s,r,""+s[r])}}function Zu(s){if(!s)return!1;var r=s._valueTracker;if(!r)return!0;var o=r.getValue(),c="";return s&&(c=ac(s)?s.checked?"true":"false":s.value),s=c,s!==o?(r.setValue(s),!0):!1}function ia(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var mt=/[\n"\\]/g;function Vi(s){return s.replace(mt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function jt(s,r,o,c,m,_,w,T){s.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?s.type=w:s.removeAttribute("type"),r!=null?w==="number"?(r===0&&s.value===""||s.value!=r)&&(s.value=""+nt(r)):s.value!==""+nt(r)&&(s.value=""+nt(r)):w!=="submit"&&w!=="reset"||s.removeAttribute("value"),r!=null?sa(s,w,nt(r)):o!=null?sa(s,w,nt(o)):c!=null&&s.removeAttribute("value"),m==null&&_!=null&&(s.defaultChecked=!!_),m!=null&&(s.checked=m&&typeof m!="function"&&typeof m!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.name=""+nt(T):s.removeAttribute("name")}function Xo(s,r,o,c,m,_,w,T){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),r!=null||o!=null){if(!(_!=="submit"&&_!=="reset"||r!=null)){oc(s);return}o=o!=null?""+nt(o):"",r=r!=null?""+nt(r):o,T||r===s.value||(s.value=r),s.defaultValue=r}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,s.checked=T?s.checked:!!c,s.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(s.name=w),oc(s)}function sa(s,r,o){r==="number"&&ia(s.ownerDocument)===s||s.defaultValue===""+o||(s.defaultValue=""+o)}function pn(s,r,o,c){if(s=s.options,r){r={};for(var m=0;m<o.length;m++)r["$"+o[m]]=!0;for(o=0;o<s.length;o++)m=r.hasOwnProperty("$"+s[o].value),s[o].selected!==m&&(s[o].selected=m),m&&c&&(s[o].defaultSelected=!0)}else{for(o=""+nt(o),r=null,m=0;m<s.length;m++){if(s[m].value===o){s[m].selected=!0,c&&(s[m].defaultSelected=!0);return}r!==null||s[m].disabled||(r=s[m])}r!==null&&(r.selected=!0)}}function Zo(s,r,o){if(r!=null&&(r=""+nt(r),r!==s.value&&(s.value=r),o==null)){s.defaultValue!==r&&(s.defaultValue=r);return}s.defaultValue=o!=null?""+nt(o):""}function Ti(s,r,o,c){if(r==null){if(c!=null){if(o!=null)throw Error(n(92));if($(c)){if(1<c.length)throw Error(n(93));c=c[0]}o=c}o==null&&(o=""),r=o}o=nt(r),s.defaultValue=o,c=s.textContent,c===o&&c!==""&&c!==null&&(s.value=c),oc(s)}function ra(s,r){if(r){var o=s.firstChild;if(o&&o===s.lastChild&&o.nodeType===3){o.nodeValue=r;return}}s.textContent=r}var zf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function lc(s,r,o){var c=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?s.setProperty(r,""):r==="float"?s.cssFloat="":s[r]="":c?s.setProperty(r,o):typeof o!="number"||o===0||zf.has(r)?r==="float"?s.cssFloat=o:s[r]=(""+o).trim():s[r]=o+"px"}function cc(s,r,o){if(r!=null&&typeof r!="object")throw Error(n(62));if(s=s.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="");for(var m in r)c=r[m],r.hasOwnProperty(m)&&o[m]!==c&&lc(s,m,c)}else for(var _ in r)r.hasOwnProperty(_)&&lc(s,_,r[_])}function uc(s){if(s.indexOf("-")===-1)return!1;switch(s){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 Qu=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),If=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Or(s){return If.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ri(){}var na=null;function qr(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var ns=null,Ds=null;function nr(s){var r=ms(s);if(r&&(s=r.stateNode)){var o=s[He]||null;e:switch(s=r.stateNode,r.type){case"input":if(jt(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=s;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Vi(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var c=o[r];if(c!==s&&c.form===s.form){var m=c[He]||null;if(!m)throw Error(n(90));jt(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(r=0;r<o.length;r++)c=o[r],c.form===s.form&&Zu(c)}break e;case"textarea":Zo(s,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&pn(s,!!o.multiple,r,!1)}}}var gn=!1;function ar(s,r,o){if(gn)return s(r,o);gn=!0;try{var c=s(r);return c}finally{if(gn=!1,(ns!==null||Ds!==null)&&(Uh(),ns&&(r=ns,s=Ds,Ds=ns=null,nr(r),s)))for(r=0;r<s.length;r++)nr(s[r])}}function Os(s,r){var o=s.stateNode;if(o===null)return null;var c=o[He]||null;if(c===null)return null;o=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(s=s.type,c=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!c;break e;default:s=!1}if(s)return null;if(o&&typeof o!="function")throw Error(n(231,r,typeof o));return o}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qo=!1;if(or)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){Qo=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch{Qo=!1}var Br=null,Jo=null,el=null;function hc(){if(el)return el;var s,r=Jo,o=r.length,c,m="value"in Br?Br.value:Br.textContent,_=m.length;for(s=0;s<o&&r[s]===m[s];s++);var w=o-s;for(c=1;c<=w&&r[o-c]===m[_-c];c++);return el=m.slice(s,1<c?1-c:void 0)}function Ja(s){var r=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&r===13&&(s=13)):s=r,s===10&&(s=13),32<=s||s===13?s:0}function vn(){return!0}function Ju(){return!1}function Vt(s){function r(o,c,m,_,w){this._reactName=o,this._targetInst=m,this.type=c,this.nativeEvent=_,this.target=w,this.currentTarget=null;for(var T in s)s.hasOwnProperty(T)&&(o=s[T],this[T]=o?o(_):_[T]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?vn:Ju,this.isPropagationStopped=Ju,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),r}var yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eo=Vt(yn),to=v({},yn,{view:0,detail:0}),Hf=Vt(to),dc,fc,io,Mi=v({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sl,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==io&&(io&&s.type==="mousemove"?(dc=s.screenX-io.screenX,fc=s.screenY-io.screenY):fc=dc=0,io=s),dc)},movementY:function(s){return"movementY"in s?s.movementY:fc}}),yt=Vt(Mi),Bs=v({},Mi,{dataTransfer:0}),mc=Vt(Bs),tl=v({},to,{relatedTarget:0}),so=Vt(tl),ro=v({},yn,{animationName:0,elapsedTime:0,pseudoElement:0}),oa=Vt(ro),_c=v({},yn,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),pc=Vt(_c),gc=v({},yn,{data:0}),il=Vt(gc),eh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uf={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"},Ff={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $f(s){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(s):(s=Ff[s])?!!r[s]:!1}function sl(){return $f}var Wf=v({},to,{key:function(s){if(s.key){var r=eh[s.key]||s.key;if(r!=="Unidentified")return r}return s.type==="keypress"?(s=Ja(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Uf[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sl,charCode:function(s){return s.type==="keypress"?Ja(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Ja(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),th=Vt(Wf),ih=v({},Mi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),no=Vt(ih),rl=v({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sl}),jf=Vt(rl),sh=v({},yn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vf=Vt(sh),qf=v({},Mi,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),ee=Vt(qf),ue=v({},yn,{newState:0,oldState:0}),me=Vt(ue),_e=[9,13,27,32],Ae=or&&"CompositionEvent"in window,Be=null;or&&"documentMode"in document&&(Be=document.documentMode);var Je=or&&"TextEvent"in window&&!Be,Xt=or&&(!Ae||Be&&8<Be&&11>=Be),yi=" ",Yr=!1;function Nr(s,r){switch(s){case"keyup":return _e.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function as(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var os=!1;function Sn(s,r){switch(s){case"compositionend":return as(r);case"keypress":return r.which!==32?null:(Yr=!0,yi);case"textInput":return s=r.data,s===yi&&Yr?null:s;default:return null}}function Zt(s,r){if(os)return s==="compositionend"||!Ae&&Nr(s,r)?(s=hc(),el=Jo=Br=null,os=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Xt&&r.locale!=="ko"?null:r.data;default:return null}}var Dt={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 lr(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r==="input"?!!Dt[s.type]:r==="textarea"}function Kr(s,r,o,c){ns?Ds?Ds.push(c):Ds=[c]:ns=c,r=Yh(r,"onChange"),0<r.length&&(o=new eo("onChange","change",null,o,c),s.push({event:o,listeners:r}))}var cr=null,Ji=null;function $e(s){iS(s,0)}function Pr(s){var r=ui(s);if(Zu(r))return s}function rh(s,r){if(s==="change")return r}var ao=!1;if(or){var oo;if(or){var la="oninput"in document;if(!la){var bn=document.createElement("div");bn.setAttribute("oninput","return;"),la=typeof bn.oninput=="function"}oo=la}else oo=!1;ao=oo&&(!document.documentMode||9<document.documentMode)}function vc(){cr&&(cr.detachEvent("onpropertychange",yc),Ji=cr=null)}function yc(s){if(s.propertyName==="value"&&Pr(Ji)){var r=[];Kr(r,Ji,s,qr(s)),ar($e,r)}}function nh(s,r,o){s==="focusin"?(vc(),cr=r,Ji=o,cr.attachEvent("onpropertychange",yc)):s==="focusout"&&vc()}function bt(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Pr(Ji)}function ps(s,r){if(s==="click")return Pr(r)}function Ns(s,r){if(s==="input"||s==="change")return Pr(r)}function Gr(s,r){return s===r&&(s!==0||1/s===1/r)||s!==s&&r!==r}var Si=typeof Object.is=="function"?Object.is:Gr;function ca(s,r){if(Si(s,r))return!0;if(typeof s!="object"||s===null||typeof r!="object"||r===null)return!1;var o=Object.keys(s),c=Object.keys(r);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var m=o[c];if(!dt.call(r,m)||!Si(s[m],r[m]))return!1}return!0}function lo(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function co(s,r){var o=lo(s);s=0;for(var c;o;){if(o.nodeType===3){if(c=s+o.textContent.length,s<=r&&c>=r)return{node:o,offset:r-s};s=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=lo(o)}}function Rv(s,r){return s&&r?s===r?!0:s&&s.nodeType===3?!1:r&&r.nodeType===3?Rv(s,r.parentNode):"contains"in s?s.contains(r):s.compareDocumentPosition?!!(s.compareDocumentPosition(r)&16):!1:!1}function Mv(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var r=ia(s.document);r instanceof s.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)s=r.contentWindow;else break;r=ia(s.document)}return r}function Yf(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r&&(r==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||r==="textarea"||s.contentEditable==="true")}var D5=or&&"documentMode"in document&&11>=document.documentMode,nl=null,Kf=null,Sc=null,Gf=!1;function Av(s,r,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Gf||nl==null||nl!==ia(c)||(c=nl,"selectionStart"in c&&Yf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Sc&&ca(Sc,c)||(Sc=c,c=Yh(Kf,"onSelect"),0<c.length&&(r=new eo("onSelect","select",null,r,o),s.push({event:r,listeners:c}),r.target=nl)))}function uo(s,r){var o={};return o[s.toLowerCase()]=r.toLowerCase(),o["Webkit"+s]="webkit"+r,o["Moz"+s]="moz"+r,o}var al={animationend:uo("Animation","AnimationEnd"),animationiteration:uo("Animation","AnimationIteration"),animationstart:uo("Animation","AnimationStart"),transitionrun:uo("Transition","TransitionRun"),transitionstart:uo("Transition","TransitionStart"),transitioncancel:uo("Transition","TransitionCancel"),transitionend:uo("Transition","TransitionEnd")},Xf={},Lv={};or&&(Lv=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function ho(s){if(Xf[s])return Xf[s];if(!al[s])return s;var r=al[s],o;for(o in r)if(r.hasOwnProperty(o)&&o in Lv)return Xf[s]=r[o];return s}var Dv=ho("animationend"),Ov=ho("animationiteration"),Bv=ho("animationstart"),O5=ho("transitionrun"),B5=ho("transitionstart"),N5=ho("transitioncancel"),Nv=ho("transitionend"),Pv=new Map,Zf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Zf.push("scrollEnd");function zr(s,r){Pv.set(s,r),_s(r,[s])}var ah=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ur=[],ol=0,Qf=0;function oh(){for(var s=ol,r=Qf=ol=0;r<s;){var o=ur[r];ur[r++]=null;var c=ur[r];ur[r++]=null;var m=ur[r];ur[r++]=null;var _=ur[r];if(ur[r++]=null,c!==null&&m!==null){var w=c.pending;w===null?m.next=m:(m.next=w.next,w.next=m),c.pending=m}_!==0&&zv(o,m,_)}}function lh(s,r,o,c){ur[ol++]=s,ur[ol++]=r,ur[ol++]=o,ur[ol++]=c,Qf|=c,s.lanes|=c,s=s.alternate,s!==null&&(s.lanes|=c)}function Jf(s,r,o,c){return lh(s,r,o,c),ch(s)}function fo(s,r){return lh(s,null,null,r),ch(s)}function zv(s,r,o){s.lanes|=o;var c=s.alternate;c!==null&&(c.lanes|=o);for(var m=!1,_=s.return;_!==null;)_.childLanes|=o,c=_.alternate,c!==null&&(c.childLanes|=o),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(m=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,m&&r!==null&&(m=31-At(o),s=_.hiddenUpdates,c=s[m],c===null?s[m]=[r]:c.push(r),r.lane=o|536870912),_):null}function ch(s){if(50<$c)throw $c=0,l_=null,Error(n(185));for(var r=s.return;r!==null;)s=r,r=s.return;return s.tag===3?s.stateNode:null}var ll={};function P5(s,r,o,c){this.tag=s,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ps(s,r,o,c){return new P5(s,r,o,c)}function em(s){return s=s.prototype,!(!s||!s.isReactComponent)}function wn(s,r){var o=s.alternate;return o===null?(o=Ps(s.tag,r,s.key,s.mode),o.elementType=s.elementType,o.type=s.type,o.stateNode=s.stateNode,o.alternate=s,s.alternate=o):(o.pendingProps=r,o.type=s.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=s.flags&65011712,o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,r=s.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=s.sibling,o.index=s.index,o.ref=s.ref,o.refCleanup=s.refCleanup,o}function Iv(s,r){s.flags&=65011714;var o=s.alternate;return o===null?(s.childLanes=0,s.lanes=r,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,r=o.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),s}function uh(s,r,o,c,m,_){var w=0;if(c=s,typeof s=="function")em(s)&&(w=1);else if(typeof s=="string")w=F2(s,o,re.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case F:return s=Ps(31,o,r,m),s.elementType=F,s.lanes=_,s;case C:return mo(o.children,m,_,r);case x:w=8,m|=24;break;case k:return s=Ps(12,o,r,m|2),s.elementType=k,s.lanes=_,s;case H:return s=Ps(13,o,r,m),s.elementType=H,s.lanes=_,s;case U:return s=Ps(19,o,r,m),s.elementType=U,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case L:w=10;break e;case R:w=9;break e;case E:w=11;break e;case I:w=14;break e;case N:w=16,c=null;break e}w=29,o=Error(n(130,s===null?"null":typeof s,"")),c=null}return r=Ps(w,o,r,m),r.elementType=s,r.type=c,r.lanes=_,r}function mo(s,r,o,c){return s=Ps(7,s,c,r),s.lanes=o,s}function tm(s,r,o){return s=Ps(6,s,null,r),s.lanes=o,s}function Hv(s){var r=Ps(18,null,null,0);return r.stateNode=s,r}function im(s,r,o){return r=Ps(4,s.children!==null?s.children:[],s.key,r),r.lanes=o,r.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},r}var Uv=new WeakMap;function hr(s,r){if(typeof s=="object"&&s!==null){var o=Uv.get(s);return o!==void 0?o:(r={value:s,source:r,stack:St(r)},Uv.set(s,r),r)}return{value:s,source:r,stack:St(r)}}var cl=[],ul=0,hh=null,bc=0,dr=[],fr=0,ua=null,Xr=1,Zr="";function Cn(s,r){cl[ul++]=bc,cl[ul++]=hh,hh=s,bc=r}function Fv(s,r,o){dr[fr++]=Xr,dr[fr++]=Zr,dr[fr++]=ua,ua=s;var c=Xr;s=Zr;var m=32-At(c)-1;c&=~(1<<m),o+=1;var _=32-At(r)+m;if(30<_){var w=m-m%5;_=(c&(1<<w)-1).toString(32),c>>=w,m-=w,Xr=1<<32-At(r)+m|o<<m|c,Zr=_+s}else Xr=1<<_|o<<m|c,Zr=s}function sm(s){s.return!==null&&(Cn(s,1),Fv(s,1,0))}function rm(s){for(;s===hh;)hh=cl[--ul],cl[ul]=null,bc=cl[--ul],cl[ul]=null;for(;s===ua;)ua=dr[--fr],dr[fr]=null,Zr=dr[--fr],dr[fr]=null,Xr=dr[--fr],dr[fr]=null}function $v(s,r){dr[fr++]=Xr,dr[fr++]=Zr,dr[fr++]=ua,Xr=r.id,Zr=r.overflow,ua=s}var qi=null,Nt=null,ht=!1,ha=null,mr=!1,nm=Error(n(519));function da(s){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wc(hr(r,s)),nm}function Wv(s){var r=s.stateNode,o=s.type,c=s.memoizedProps;switch(r[Te]=s,r[He]=c,o){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(o=0;o<jc.length;o++)lt(jc[o],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":lt("invalid",r),Xo(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":lt("invalid",r);break;case"textarea":lt("invalid",r),Ti(r,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||c.suppressHydrationWarning===!0||aS(r.textContent,o)?(c.popover!=null&&(lt("beforetoggle",r),lt("toggle",r)),c.onScroll!=null&&lt("scroll",r),c.onScrollEnd!=null&&lt("scrollend",r),c.onClick!=null&&(r.onclick=Ri),r=!0):r=!1,r||da(s,!0)}function jv(s){for(qi=s.return;qi;)switch(qi.tag){case 5:case 31:case 13:mr=!1;return;case 27:case 3:mr=!0;return;default:qi=qi.return}}function hl(s){if(s!==qi)return!1;if(!ht)return jv(s),ht=!0,!1;var r=s.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=s.type,o=!(o!=="form"&&o!=="button")||C_(s.type,s.memoizedProps)),o=!o),o&&Nt&&da(s),jv(s),r===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));Nt=_S(s)}else if(r===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));Nt=_S(s)}else r===27?(r=Nt,Ea(s.type)?(s=R_,R_=null,Nt=s):Nt=r):Nt=qi?pr(s.stateNode.nextSibling):null;return!0}function _o(){Nt=qi=null,ht=!1}function am(){var s=ha;return s!==null&&(Ss===null?Ss=s:Ss.push.apply(Ss,s),ha=null),s}function wc(s){ha===null?ha=[s]:ha.push(s)}var om=B(null),po=null,xn=null;function fa(s,r,o){ie(om,r._currentValue),r._currentValue=o}function kn(s){s._currentValue=om.current,X(om)}function lm(s,r,o){for(;s!==null;){var c=s.alternate;if((s.childLanes&r)!==r?(s.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),s===o)break;s=s.return}}function cm(s,r,o,c){var m=s.child;for(m!==null&&(m.return=s);m!==null;){var _=m.dependencies;if(_!==null){var w=m.child;_=_.firstContext;e:for(;_!==null;){var T=_;_=m;for(var W=0;W<r.length;W++)if(T.context===r[W]){_.lanes|=o,T=_.alternate,T!==null&&(T.lanes|=o),lm(_.return,o,s),c||(w=null);break e}_=T.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(n(341));w.lanes|=o,_=w.alternate,_!==null&&(_.lanes|=o),lm(w,o,s),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===s){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function dl(s,r,o,c){s=null;for(var m=r,_=!1;m!==null;){if(!_){if((m.flags&524288)!==0)_=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(n(387));if(w=w.memoizedProps,w!==null){var T=m.type;Si(m.pendingProps.value,w.value)||(s!==null?s.push(T):s=[T])}}else if(m===oe.current){if(w=m.alternate,w===null)throw Error(n(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(s!==null?s.push(Gc):s=[Gc])}m=m.return}s!==null&&cm(r,s,o,c),r.flags|=262144}function dh(s){for(s=s.firstContext;s!==null;){if(!Si(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function go(s){po=s,xn=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Yi(s){return Vv(po,s)}function fh(s,r){return po===null&&go(s),Vv(s,r)}function Vv(s,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},xn===null){if(s===null)throw Error(n(308));xn=r,s.dependencies={lanes:0,firstContext:r},s.flags|=524288}else xn=xn.next=r;return o}var z5=typeof AbortController<"u"?AbortController:function(){var s=[],r=this.signal={aborted:!1,addEventListener:function(o,c){s.push(c)}};this.abort=function(){r.aborted=!0,s.forEach(function(o){return o()})}},I5=t.unstable_scheduleCallback,H5=t.unstable_NormalPriority,hi={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function um(){return{controller:new z5,data:new Map,refCount:0}}function Cc(s){s.refCount--,s.refCount===0&&I5(H5,function(){s.controller.abort()})}var xc=null,hm=0,fl=0,ml=null;function U5(s,r){if(xc===null){var o=xc=[];hm=0,fl=m_(),ml={status:"pending",value:void 0,then:function(c){o.push(c)}}}return hm++,r.then(qv,qv),r}function qv(){if(--hm===0&&xc!==null){ml!==null&&(ml.status="fulfilled");var s=xc;xc=null,fl=0,ml=null;for(var r=0;r<s.length;r++)(0,s[r])()}}function F5(s,r){var o=[],c={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return s.then(function(){c.status="fulfilled",c.value=r;for(var m=0;m<o.length;m++)(0,o[m])(r)},function(m){for(c.status="rejected",c.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),c}var Yv=M.S;M.S=function(s,r){Ay=Qe(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&U5(s,r),Yv!==null&&Yv(s,r)};var vo=B(null);function dm(){var s=vo.current;return s!==null?s:Ot.pooledCache}function mh(s,r){r===null?ie(vo,vo.current):ie(vo,r.pool)}function Kv(){var s=dm();return s===null?null:{parent:hi._currentValue,pool:s}}var _l=Error(n(460)),fm=Error(n(474)),_h=Error(n(542)),ph={then:function(){}};function Gv(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Xv(s,r,o){switch(o=s[o],o===void 0?s.push(r):o!==r&&(r.then(Ri,Ri),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,Qv(s),s;default:if(typeof r.status=="string")r.then(Ri,Ri);else{if(s=Ot,s!==null&&100<s.shellSuspendCounter)throw Error(n(482));s=r,s.status="pending",s.then(function(c){if(r.status==="pending"){var m=r;m.status="fulfilled",m.value=c}},function(c){if(r.status==="pending"){var m=r;m.status="rejected",m.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,Qv(s),s}throw So=r,_l}}function yo(s){try{var r=s._init;return r(s._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(So=o,_l):o}}var So=null;function Zv(){if(So===null)throw Error(n(459));var s=So;return So=null,s}function Qv(s){if(s===_l||s===_h)throw Error(n(483))}var pl=null,kc=0;function gh(s){var r=kc;return kc+=1,pl===null&&(pl=[]),Xv(pl,s,r)}function Ec(s,r){r=r.props.ref,s.ref=r!==void 0?r:null}function vh(s,r){throw r.$$typeof===g?Error(n(525)):(s=Object.prototype.toString.call(r),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":s)))}function Jv(s){function r(K,V){if(s){var Z=K.deletions;Z===null?(K.deletions=[V],K.flags|=16):Z.push(V)}}function o(K,V){if(!s)return null;for(;V!==null;)r(K,V),V=V.sibling;return null}function c(K){for(var V=new Map;K!==null;)K.key!==null?V.set(K.key,K):V.set(K.index,K),K=K.sibling;return V}function m(K,V){return K=wn(K,V),K.index=0,K.sibling=null,K}function _(K,V,Z){return K.index=Z,s?(Z=K.alternate,Z!==null?(Z=Z.index,Z<V?(K.flags|=67108866,V):Z):(K.flags|=67108866,V)):(K.flags|=1048576,V)}function w(K){return s&&K.alternate===null&&(K.flags|=67108866),K}function T(K,V,Z,ae){return V===null||V.tag!==6?(V=tm(Z,K.mode,ae),V.return=K,V):(V=m(V,Z),V.return=K,V)}function W(K,V,Z,ae){var Ie=Z.type;return Ie===C?ne(K,V,Z.props.children,ae,Z.key):V!==null&&(V.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===N&&yo(Ie)===V.type)?(V=m(V,Z.props),Ec(V,Z),V.return=K,V):(V=uh(Z.type,Z.key,Z.props,null,K.mode,ae),Ec(V,Z),V.return=K,V)}function Q(K,V,Z,ae){return V===null||V.tag!==4||V.stateNode.containerInfo!==Z.containerInfo||V.stateNode.implementation!==Z.implementation?(V=im(Z,K.mode,ae),V.return=K,V):(V=m(V,Z.children||[]),V.return=K,V)}function ne(K,V,Z,ae,Ie){return V===null||V.tag!==7?(V=mo(Z,K.mode,ae,Ie),V.return=K,V):(V=m(V,Z),V.return=K,V)}function le(K,V,Z){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=tm(""+V,K.mode,Z),V.return=K,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case y:return Z=uh(V.type,V.key,V.props,null,K.mode,Z),Ec(Z,V),Z.return=K,Z;case b:return V=im(V,K.mode,Z),V.return=K,V;case N:return V=yo(V),le(K,V,Z)}if($(V)||D(V))return V=mo(V,K.mode,Z,null),V.return=K,V;if(typeof V.then=="function")return le(K,gh(V),Z);if(V.$$typeof===L)return le(K,fh(K,V),Z);vh(K,V)}return null}function te(K,V,Z,ae){var Ie=V!==null?V.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ie!==null?null:T(K,V,""+Z,ae);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case y:return Z.key===Ie?W(K,V,Z,ae):null;case b:return Z.key===Ie?Q(K,V,Z,ae):null;case N:return Z=yo(Z),te(K,V,Z,ae)}if($(Z)||D(Z))return Ie!==null?null:ne(K,V,Z,ae,null);if(typeof Z.then=="function")return te(K,V,gh(Z),ae);if(Z.$$typeof===L)return te(K,V,fh(K,Z),ae);vh(K,Z)}return null}function se(K,V,Z,ae,Ie){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return K=K.get(Z)||null,T(V,K,""+ae,Ie);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:return K=K.get(ae.key===null?Z:ae.key)||null,W(V,K,ae,Ie);case b:return K=K.get(ae.key===null?Z:ae.key)||null,Q(V,K,ae,Ie);case N:return ae=yo(ae),se(K,V,Z,ae,Ie)}if($(ae)||D(ae))return K=K.get(Z)||null,ne(V,K,ae,Ie,null);if(typeof ae.then=="function")return se(K,V,Z,gh(ae),Ie);if(ae.$$typeof===L)return se(K,V,Z,fh(V,ae),Ie);vh(V,ae)}return null}function Ee(K,V,Z,ae){for(var Ie=null,pt=null,De=V,et=V=0,ut=null;De!==null&&et<Z.length;et++){De.index>et?(ut=De,De=null):ut=De.sibling;var gt=te(K,De,Z[et],ae);if(gt===null){De===null&&(De=ut);break}s&&De&&gt.alternate===null&&r(K,De),V=_(gt,V,et),pt===null?Ie=gt:pt.sibling=gt,pt=gt,De=ut}if(et===Z.length)return o(K,De),ht&&Cn(K,et),Ie;if(De===null){for(;et<Z.length;et++)De=le(K,Z[et],ae),De!==null&&(V=_(De,V,et),pt===null?Ie=De:pt.sibling=De,pt=De);return ht&&Cn(K,et),Ie}for(De=c(De);et<Z.length;et++)ut=se(De,K,et,Z[et],ae),ut!==null&&(s&&ut.alternate!==null&&De.delete(ut.key===null?et:ut.key),V=_(ut,V,et),pt===null?Ie=ut:pt.sibling=ut,pt=ut);return s&&De.forEach(function(La){return r(K,La)}),ht&&Cn(K,et),Ie}function Ue(K,V,Z,ae){if(Z==null)throw Error(n(151));for(var Ie=null,pt=null,De=V,et=V=0,ut=null,gt=Z.next();De!==null&&!gt.done;et++,gt=Z.next()){De.index>et?(ut=De,De=null):ut=De.sibling;var La=te(K,De,gt.value,ae);if(La===null){De===null&&(De=ut);break}s&&De&&La.alternate===null&&r(K,De),V=_(La,V,et),pt===null?Ie=La:pt.sibling=La,pt=La,De=ut}if(gt.done)return o(K,De),ht&&Cn(K,et),Ie;if(De===null){for(;!gt.done;et++,gt=Z.next())gt=le(K,gt.value,ae),gt!==null&&(V=_(gt,V,et),pt===null?Ie=gt:pt.sibling=gt,pt=gt);return ht&&Cn(K,et),Ie}for(De=c(De);!gt.done;et++,gt=Z.next())gt=se(De,K,et,gt.value,ae),gt!==null&&(s&&gt.alternate!==null&&De.delete(gt.key===null?et:gt.key),V=_(gt,V,et),pt===null?Ie=gt:pt.sibling=gt,pt=gt);return s&&De.forEach(function(Q2){return r(K,Q2)}),ht&&Cn(K,et),Ie}function Rt(K,V,Z,ae){if(typeof Z=="object"&&Z!==null&&Z.type===C&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case y:e:{for(var Ie=Z.key;V!==null;){if(V.key===Ie){if(Ie=Z.type,Ie===C){if(V.tag===7){o(K,V.sibling),ae=m(V,Z.props.children),ae.return=K,K=ae;break e}}else if(V.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===N&&yo(Ie)===V.type){o(K,V.sibling),ae=m(V,Z.props),Ec(ae,Z),ae.return=K,K=ae;break e}o(K,V);break}else r(K,V);V=V.sibling}Z.type===C?(ae=mo(Z.props.children,K.mode,ae,Z.key),ae.return=K,K=ae):(ae=uh(Z.type,Z.key,Z.props,null,K.mode,ae),Ec(ae,Z),ae.return=K,K=ae)}return w(K);case b:e:{for(Ie=Z.key;V!==null;){if(V.key===Ie)if(V.tag===4&&V.stateNode.containerInfo===Z.containerInfo&&V.stateNode.implementation===Z.implementation){o(K,V.sibling),ae=m(V,Z.children||[]),ae.return=K,K=ae;break e}else{o(K,V);break}else r(K,V);V=V.sibling}ae=im(Z,K.mode,ae),ae.return=K,K=ae}return w(K);case N:return Z=yo(Z),Rt(K,V,Z,ae)}if($(Z))return Ee(K,V,Z,ae);if(D(Z)){if(Ie=D(Z),typeof Ie!="function")throw Error(n(150));return Z=Ie.call(Z),Ue(K,V,Z,ae)}if(typeof Z.then=="function")return Rt(K,V,gh(Z),ae);if(Z.$$typeof===L)return Rt(K,V,fh(K,Z),ae);vh(K,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,V!==null&&V.tag===6?(o(K,V.sibling),ae=m(V,Z),ae.return=K,K=ae):(o(K,V),ae=tm(Z,K.mode,ae),ae.return=K,K=ae),w(K)):o(K,V)}return function(K,V,Z,ae){try{kc=0;var Ie=Rt(K,V,Z,ae);return pl=null,Ie}catch(De){if(De===_l||De===_h)throw De;var pt=Ps(29,De,null,K.mode);return pt.lanes=ae,pt.return=K,pt}}}var bo=Jv(!0),e0=Jv(!1),ma=!1;function mm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _m(s,r){s=s.updateQueue,r.updateQueue===s&&(r.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function _a(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function pa(s,r,o){var c=s.updateQueue;if(c===null)return null;if(c=c.shared,(vt&2)!==0){var m=c.pending;return m===null?r.next=r:(r.next=m.next,m.next=r),c.pending=r,r=ch(s),zv(s,null,o),r}return lh(s,c,r,o),ch(s)}function Tc(s,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var c=r.lanes;c&=s.pendingLanes,o|=c,r.lanes=o,Ko(s,o)}}function pm(s,r){var o=s.updateQueue,c=s.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var m=null,_=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};_===null?m=_=w:_=_.next=w,o=o.next}while(o!==null);_===null?m=_=r:_=_.next=r}else m=_=r;o={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:_,shared:c.shared,callbacks:c.callbacks},s.updateQueue=o;return}s=o.lastBaseUpdate,s===null?o.firstBaseUpdate=r:s.next=r,o.lastBaseUpdate=r}var gm=!1;function Rc(){if(gm){var s=ml;if(s!==null)throw s}}function Mc(s,r,o,c){gm=!1;var m=s.updateQueue;ma=!1;var _=m.firstBaseUpdate,w=m.lastBaseUpdate,T=m.shared.pending;if(T!==null){m.shared.pending=null;var W=T,Q=W.next;W.next=null,w===null?_=Q:w.next=Q,w=W;var ne=s.alternate;ne!==null&&(ne=ne.updateQueue,T=ne.lastBaseUpdate,T!==w&&(T===null?ne.firstBaseUpdate=Q:T.next=Q,ne.lastBaseUpdate=W))}if(_!==null){var le=m.baseState;w=0,ne=Q=W=null,T=_;do{var te=T.lane&-536870913,se=te!==T.lane;if(se?(ct&te)===te:(c&te)===te){te!==0&&te===fl&&(gm=!0),ne!==null&&(ne=ne.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Ee=s,Ue=T;te=r;var Rt=o;switch(Ue.tag){case 1:if(Ee=Ue.payload,typeof Ee=="function"){le=Ee.call(Rt,le,te);break e}le=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Ue.payload,te=typeof Ee=="function"?Ee.call(Rt,le,te):Ee,te==null)break e;le=v({},le,te);break e;case 2:ma=!0}}te=T.callback,te!==null&&(s.flags|=64,se&&(s.flags|=8192),se=m.callbacks,se===null?m.callbacks=[te]:se.push(te))}else se={lane:te,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ne===null?(Q=ne=se,W=le):ne=ne.next=se,w|=te;if(T=T.next,T===null){if(T=m.shared.pending,T===null)break;se=T,T=se.next,se.next=null,m.lastBaseUpdate=se,m.shared.pending=null}}while(!0);ne===null&&(W=le),m.baseState=W,m.firstBaseUpdate=Q,m.lastBaseUpdate=ne,_===null&&(m.shared.lanes=0),ba|=w,s.lanes=w,s.memoizedState=le}}function t0(s,r){if(typeof s!="function")throw Error(n(191,s));s.call(r)}function i0(s,r){var o=s.callbacks;if(o!==null)for(s.callbacks=null,s=0;s<o.length;s++)t0(o[s],r)}var gl=B(null),yh=B(0);function s0(s,r){s=Bn,ie(yh,s),ie(gl,r),Bn=s|r.baseLanes}function vm(){ie(yh,Bn),ie(gl,gl.current)}function ym(){Bn=yh.current,X(gl),X(yh)}var zs=B(null),_r=null;function ga(s){var r=s.alternate;ie(ai,ai.current&1),ie(zs,s),_r===null&&(r===null||gl.current!==null||r.memoizedState!==null)&&(_r=s)}function Sm(s){ie(ai,ai.current),ie(zs,s),_r===null&&(_r=s)}function r0(s){s.tag===22?(ie(ai,ai.current),ie(zs,s),_r===null&&(_r=s)):va()}function va(){ie(ai,ai.current),ie(zs,zs.current)}function Is(s){X(zs),_r===s&&(_r=null),X(ai)}var ai=B(0);function Sh(s){for(var r=s;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||E_(o)||T_(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var En=0,Ze=null,Et=null,di=null,bh=!1,vl=!1,wo=!1,wh=0,Ac=0,yl=null,$5=0;function Qt(){throw Error(n(321))}function bm(s,r){if(r===null)return!1;for(var o=0;o<r.length&&o<s.length;o++)if(!Si(s[o],r[o]))return!1;return!0}function wm(s,r,o,c,m,_){return En=_,Ze=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,M.H=s===null||s.memoizedState===null?F0:zm,wo=!1,_=o(c,m),wo=!1,vl&&(_=a0(r,o,c,m)),n0(s),_}function n0(s){M.H=Oc;var r=Et!==null&&Et.next!==null;if(En=0,di=Et=Ze=null,bh=!1,Ac=0,yl=null,r)throw Error(n(300));s===null||fi||(s=s.dependencies,s!==null&&dh(s)&&(fi=!0))}function a0(s,r,o,c){Ze=s;var m=0;do{if(vl&&(yl=null),Ac=0,vl=!1,25<=m)throw Error(n(301));if(m+=1,di=Et=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}M.H=$0,_=r(o,c)}while(vl);return _}function W5(){var s=M.H,r=s.useState()[0];return r=typeof r.then=="function"?Lc(r):r,s=s.useState()[0],(Et!==null?Et.memoizedState:null)!==s&&(Ze.flags|=1024),r}function Cm(){var s=wh!==0;return wh=0,s}function xm(s,r,o){r.updateQueue=s.updateQueue,r.flags&=-2053,s.lanes&=~o}function km(s){if(bh){for(s=s.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}bh=!1}En=0,di=Et=Ze=null,vl=!1,Ac=wh=0,yl=null}function ls(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return di===null?Ze.memoizedState=di=s:di=di.next=s,di}function oi(){if(Et===null){var s=Ze.alternate;s=s!==null?s.memoizedState:null}else s=Et.next;var r=di===null?Ze.memoizedState:di.next;if(r!==null)di=r,Et=s;else{if(s===null)throw Ze.alternate===null?Error(n(467)):Error(n(310));Et=s,s={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},di===null?Ze.memoizedState=di=s:di=di.next=s}return di}function Ch(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lc(s){var r=Ac;return Ac+=1,yl===null&&(yl=[]),s=Xv(yl,s,r),r=Ze,(di===null?r.memoizedState:di.next)===null&&(r=r.alternate,M.H=r===null||r.memoizedState===null?F0:zm),s}function xh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Lc(s);if(s.$$typeof===L)return Yi(s)}throw Error(n(438,String(s)))}function Em(s){var r=null,o=Ze.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var c=Ze.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(m){return m.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Ch(),Ze.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(s),c=0;c<s;c++)o[c]=J;return r.index++,o}function Tn(s,r){return typeof r=="function"?r(s):r}function kh(s){var r=oi();return Tm(r,Et,s)}function Tm(s,r,o){var c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=o;var m=s.baseQueue,_=c.pending;if(_!==null){if(m!==null){var w=m.next;m.next=_.next,_.next=w}r.baseQueue=m=_,c.pending=null}if(_=s.baseState,m===null)s.memoizedState=_;else{r=m.next;var T=w=null,W=null,Q=r,ne=!1;do{var le=Q.lane&-536870913;if(le!==Q.lane?(ct&le)===le:(En&le)===le){var te=Q.revertLane;if(te===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),le===fl&&(ne=!0);else if((En&te)===te){Q=Q.next,te===fl&&(ne=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},W===null?(T=W=le,w=_):W=W.next=le,Ze.lanes|=te,ba|=te;le=Q.action,wo&&o(_,le),_=Q.hasEagerState?Q.eagerState:o(_,le)}else te={lane:le,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},W===null?(T=W=te,w=_):W=W.next=te,Ze.lanes|=le,ba|=le;Q=Q.next}while(Q!==null&&Q!==r);if(W===null?w=_:W.next=T,!Si(_,s.memoizedState)&&(fi=!0,ne&&(o=ml,o!==null)))throw o;s.memoizedState=_,s.baseState=w,s.baseQueue=W,c.lastRenderedState=_}return m===null&&(c.lanes=0),[s.memoizedState,c.dispatch]}function Rm(s){var r=oi(),o=r.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=s;var c=o.dispatch,m=o.pending,_=r.memoizedState;if(m!==null){o.pending=null;var w=m=m.next;do _=s(_,w.action),w=w.next;while(w!==m);Si(_,r.memoizedState)||(fi=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),o.lastRenderedState=_}return[_,c]}function o0(s,r,o){var c=Ze,m=oi(),_=ht;if(_){if(o===void 0)throw Error(n(407));o=o()}else o=r();var w=!Si((Et||m).memoizedState,o);if(w&&(m.memoizedState=o,fi=!0),m=m.queue,Lm(u0.bind(null,c,m,s),[s]),m.getSnapshot!==r||w||di!==null&&di.memoizedState.tag&1){if(c.flags|=2048,Sl(9,{destroy:void 0},c0.bind(null,c,m,o,r),null),Ot===null)throw Error(n(349));_||(En&127)!==0||l0(c,r,o)}return o}function l0(s,r,o){s.flags|=16384,s={getSnapshot:r,value:o},r=Ze.updateQueue,r===null?(r=Ch(),Ze.updateQueue=r,r.stores=[s]):(o=r.stores,o===null?r.stores=[s]:o.push(s))}function c0(s,r,o,c){r.value=o,r.getSnapshot=c,h0(r)&&d0(s)}function u0(s,r,o){return o(function(){h0(r)&&d0(s)})}function h0(s){var r=s.getSnapshot;s=s.value;try{var o=r();return!Si(s,o)}catch{return!0}}function d0(s){var r=fo(s,2);r!==null&&bs(r,s,2)}function Mm(s){var r=ls();if(typeof s=="function"){var o=s;if(s=o(),wo){$i(!0);try{o()}finally{$i(!1)}}}return r.memoizedState=r.baseState=s,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:s},r}function f0(s,r,o,c){return s.baseState=o,Tm(s,Et,typeof c=="function"?c:Tn)}function j5(s,r,o,c,m){if(Rh(s))throw Error(n(485));if(s=r.action,s!==null){var _={payload:m,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){_.listeners.push(w)}};M.T!==null?o(!0):_.isTransition=!1,c(_),o=r.pending,o===null?(_.next=r.pending=_,m0(r,_)):(_.next=o.next,r.pending=o.next=_)}}function m0(s,r){var o=r.action,c=r.payload,m=s.state;if(r.isTransition){var _=M.T,w={};M.T=w;try{var T=o(m,c),W=M.S;W!==null&&W(w,T),_0(s,r,T)}catch(Q){Am(s,r,Q)}finally{_!==null&&w.types!==null&&(_.types=w.types),M.T=_}}else try{_=o(m,c),_0(s,r,_)}catch(Q){Am(s,r,Q)}}function _0(s,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){p0(s,r,c)},function(c){return Am(s,r,c)}):p0(s,r,o)}function p0(s,r,o){r.status="fulfilled",r.value=o,g0(r),s.state=o,r=s.pending,r!==null&&(o=r.next,o===r?s.pending=null:(o=o.next,r.next=o,m0(s,o)))}function Am(s,r,o){var c=s.pending;if(s.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=o,g0(r),r=r.next;while(r!==c)}s.action=null}function g0(s){s=s.listeners;for(var r=0;r<s.length;r++)(0,s[r])()}function v0(s,r){return r}function y0(s,r){if(ht){var o=Ot.formState;if(o!==null){e:{var c=Ze;if(ht){if(Nt){t:{for(var m=Nt,_=mr;m.nodeType!==8;){if(!_){m=null;break t}if(m=pr(m.nextSibling),m===null){m=null;break t}}_=m.data,m=_==="F!"||_==="F"?m:null}if(m){Nt=pr(m.nextSibling),c=m.data==="F!";break e}}da(c)}c=!1}c&&(r=o[0])}}return o=ls(),o.memoizedState=o.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:v0,lastRenderedState:r},o.queue=c,o=I0.bind(null,Ze,c),c.dispatch=o,c=Mm(!1),_=Pm.bind(null,Ze,!1,c.queue),c=ls(),m={state:r,dispatch:null,action:s,pending:null},c.queue=m,o=j5.bind(null,Ze,m,_,o),m.dispatch=o,c.memoizedState=s,[r,o,!1]}function S0(s){var r=oi();return b0(r,Et,s)}function b0(s,r,o){if(r=Tm(s,r,v0)[0],s=kh(Tn)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Lc(r)}catch(w){throw w===_l?_h:w}else c=r;r=oi();var m=r.queue,_=m.dispatch;return o!==r.memoizedState&&(Ze.flags|=2048,Sl(9,{destroy:void 0},V5.bind(null,m,o),null)),[c,_,s]}function V5(s,r){s.action=r}function w0(s){var r=oi(),o=Et;if(o!==null)return b0(r,o,s);oi(),r=r.memoizedState,o=oi();var c=o.queue.dispatch;return o.memoizedState=s,[r,c,!1]}function Sl(s,r,o,c){return s={tag:s,create:o,deps:c,inst:r,next:null},r=Ze.updateQueue,r===null&&(r=Ch(),Ze.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=s.next=s:(c=o.next,o.next=s,s.next=c,r.lastEffect=s),s}function C0(){return oi().memoizedState}function Eh(s,r,o,c){var m=ls();Ze.flags|=s,m.memoizedState=Sl(1|r,{destroy:void 0},o,c===void 0?null:c)}function Th(s,r,o,c){var m=oi();c=c===void 0?null:c;var _=m.memoizedState.inst;Et!==null&&c!==null&&bm(c,Et.memoizedState.deps)?m.memoizedState=Sl(r,_,o,c):(Ze.flags|=s,m.memoizedState=Sl(1|r,_,o,c))}function x0(s,r){Eh(8390656,8,s,r)}function Lm(s,r){Th(2048,8,s,r)}function q5(s){Ze.flags|=4;var r=Ze.updateQueue;if(r===null)r=Ch(),Ze.updateQueue=r,r.events=[s];else{var o=r.events;o===null?r.events=[s]:o.push(s)}}function k0(s){var r=oi().memoizedState;return q5({ref:r,nextImpl:s}),function(){if((vt&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function E0(s,r){return Th(4,2,s,r)}function T0(s,r){return Th(4,4,s,r)}function R0(s,r){if(typeof r=="function"){s=s();var o=r(s);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return s=s(),r.current=s,function(){r.current=null}}function M0(s,r,o){o=o!=null?o.concat([s]):null,Th(4,4,R0.bind(null,r,s),o)}function Dm(){}function A0(s,r){var o=oi();r=r===void 0?null:r;var c=o.memoizedState;return r!==null&&bm(r,c[1])?c[0]:(o.memoizedState=[s,r],s)}function L0(s,r){var o=oi();r=r===void 0?null:r;var c=o.memoizedState;if(r!==null&&bm(r,c[1]))return c[0];if(c=s(),wo){$i(!0);try{s()}finally{$i(!1)}}return o.memoizedState=[c,r],c}function Om(s,r,o){return o===void 0||(En&1073741824)!==0&&(ct&261930)===0?s.memoizedState=r:(s.memoizedState=o,s=Dy(),Ze.lanes|=s,ba|=s,o)}function D0(s,r,o,c){return Si(o,r)?o:gl.current!==null?(s=Om(s,o,c),Si(s,r)||(fi=!0),s):(En&42)===0||(En&1073741824)!==0&&(ct&261930)===0?(fi=!0,s.memoizedState=o):(s=Dy(),Ze.lanes|=s,ba|=s,r)}function O0(s,r,o,c,m){var _=A.p;A.p=_!==0&&8>_?_:8;var w=M.T,T={};M.T=T,Pm(s,!1,r,o);try{var W=m(),Q=M.S;if(Q!==null&&Q(T,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var ne=F5(W,c);Dc(s,r,ne,Fs(s))}else Dc(s,r,c,Fs(s))}catch(le){Dc(s,r,{then:function(){},status:"rejected",reason:le},Fs())}finally{A.p=_,w!==null&&T.types!==null&&(w.types=T.types),M.T=w}}function Y5(){}function Bm(s,r,o,c){if(s.tag!==5)throw Error(n(476));var m=B0(s).queue;O0(s,m,r,z,o===null?Y5:function(){return N0(s),o(c)})}function B0(s){var r=s.memoizedState;if(r!==null)return r;r={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:z},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:o},next:null},s.memoizedState=r,s=s.alternate,s!==null&&(s.memoizedState=r),r}function N0(s){var r=B0(s);r.next===null&&(r=s.alternate.memoizedState),Dc(s,r.next.queue,{},Fs())}function Nm(){return Yi(Gc)}function P0(){return oi().memoizedState}function z0(){return oi().memoizedState}function K5(s){for(var r=s.return;r!==null;){switch(r.tag){case 24:case 3:var o=Fs();s=_a(o);var c=pa(r,s,o);c!==null&&(bs(c,r,o),Tc(c,r,o)),r={cache:um()},s.payload=r;return}r=r.return}}function G5(s,r,o){var c=Fs();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Rh(s)?H0(r,o):(o=Jf(s,r,o,c),o!==null&&(bs(o,s,c),U0(o,r,c)))}function I0(s,r,o){var c=Fs();Dc(s,r,o,c)}function Dc(s,r,o,c){var m={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Rh(s))H0(r,m);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var w=r.lastRenderedState,T=_(w,o);if(m.hasEagerState=!0,m.eagerState=T,Si(T,w))return lh(s,r,m,0),Ot===null&&oh(),!1}catch{}if(o=Jf(s,r,m,c),o!==null)return bs(o,s,c),U0(o,r,c),!0}return!1}function Pm(s,r,o,c){if(c={lane:2,revertLane:m_(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Rh(s)){if(r)throw Error(n(479))}else r=Jf(s,o,c,2),r!==null&&bs(r,s,2)}function Rh(s){var r=s.alternate;return s===Ze||r!==null&&r===Ze}function H0(s,r){vl=bh=!0;var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}function U0(s,r,o){if((o&4194048)!==0){var c=r.lanes;c&=s.pendingLanes,o|=c,r.lanes=o,Ko(s,o)}}var Oc={readContext:Yi,use:xh,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};Oc.useEffectEvent=Qt;var F0={readContext:Yi,use:xh,useCallback:function(s,r){return ls().memoizedState=[s,r===void 0?null:r],s},useContext:Yi,useEffect:x0,useImperativeHandle:function(s,r,o){o=o!=null?o.concat([s]):null,Eh(4194308,4,R0.bind(null,r,s),o)},useLayoutEffect:function(s,r){return Eh(4194308,4,s,r)},useInsertionEffect:function(s,r){Eh(4,2,s,r)},useMemo:function(s,r){var o=ls();r=r===void 0?null:r;var c=s();if(wo){$i(!0);try{s()}finally{$i(!1)}}return o.memoizedState=[c,r],c},useReducer:function(s,r,o){var c=ls();if(o!==void 0){var m=o(r);if(wo){$i(!0);try{o(r)}finally{$i(!1)}}}else m=r;return c.memoizedState=c.baseState=m,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:m},c.queue=s,s=s.dispatch=G5.bind(null,Ze,s),[c.memoizedState,s]},useRef:function(s){var r=ls();return s={current:s},r.memoizedState=s},useState:function(s){s=Mm(s);var r=s.queue,o=I0.bind(null,Ze,r);return r.dispatch=o,[s.memoizedState,o]},useDebugValue:Dm,useDeferredValue:function(s,r){var o=ls();return Om(o,s,r)},useTransition:function(){var s=Mm(!1);return s=O0.bind(null,Ze,s.queue,!0,!1),ls().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,r,o){var c=Ze,m=ls();if(ht){if(o===void 0)throw Error(n(407));o=o()}else{if(o=r(),Ot===null)throw Error(n(349));(ct&127)!==0||l0(c,r,o)}m.memoizedState=o;var _={value:o,getSnapshot:r};return m.queue=_,x0(u0.bind(null,c,_,s),[s]),c.flags|=2048,Sl(9,{destroy:void 0},c0.bind(null,c,_,o,r),null),o},useId:function(){var s=ls(),r=Ot.identifierPrefix;if(ht){var o=Zr,c=Xr;o=(c&~(1<<32-At(c)-1)).toString(32)+o,r="_"+r+"R_"+o,o=wh++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=$5++,r="_"+r+"r_"+o.toString(32)+"_";return s.memoizedState=r},useHostTransitionStatus:Nm,useFormState:y0,useActionState:y0,useOptimistic:function(s){var r=ls();r.memoizedState=r.baseState=s;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Pm.bind(null,Ze,!0,o),o.dispatch=r,[s,r]},useMemoCache:Em,useCacheRefresh:function(){return ls().memoizedState=K5.bind(null,Ze)},useEffectEvent:function(s){var r=ls(),o={impl:s};return r.memoizedState=o,function(){if((vt&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}},zm={readContext:Yi,use:xh,useCallback:A0,useContext:Yi,useEffect:Lm,useImperativeHandle:M0,useInsertionEffect:E0,useLayoutEffect:T0,useMemo:L0,useReducer:kh,useRef:C0,useState:function(){return kh(Tn)},useDebugValue:Dm,useDeferredValue:function(s,r){var o=oi();return D0(o,Et.memoizedState,s,r)},useTransition:function(){var s=kh(Tn)[0],r=oi().memoizedState;return[typeof s=="boolean"?s:Lc(s),r]},useSyncExternalStore:o0,useId:P0,useHostTransitionStatus:Nm,useFormState:S0,useActionState:S0,useOptimistic:function(s,r){var o=oi();return f0(o,Et,s,r)},useMemoCache:Em,useCacheRefresh:z0};zm.useEffectEvent=k0;var $0={readContext:Yi,use:xh,useCallback:A0,useContext:Yi,useEffect:Lm,useImperativeHandle:M0,useInsertionEffect:E0,useLayoutEffect:T0,useMemo:L0,useReducer:Rm,useRef:C0,useState:function(){return Rm(Tn)},useDebugValue:Dm,useDeferredValue:function(s,r){var o=oi();return Et===null?Om(o,s,r):D0(o,Et.memoizedState,s,r)},useTransition:function(){var s=Rm(Tn)[0],r=oi().memoizedState;return[typeof s=="boolean"?s:Lc(s),r]},useSyncExternalStore:o0,useId:P0,useHostTransitionStatus:Nm,useFormState:w0,useActionState:w0,useOptimistic:function(s,r){var o=oi();return Et!==null?f0(o,Et,s,r):(o.baseState=s,[s,o.queue.dispatch])},useMemoCache:Em,useCacheRefresh:z0};$0.useEffectEvent=k0;function Im(s,r,o,c){r=s.memoizedState,o=o(c,r),o=o==null?r:v({},r,o),s.memoizedState=o,s.lanes===0&&(s.updateQueue.baseState=o)}var Hm={enqueueSetState:function(s,r,o){s=s._reactInternals;var c=Fs(),m=_a(c);m.payload=r,o!=null&&(m.callback=o),r=pa(s,m,c),r!==null&&(bs(r,s,c),Tc(r,s,c))},enqueueReplaceState:function(s,r,o){s=s._reactInternals;var c=Fs(),m=_a(c);m.tag=1,m.payload=r,o!=null&&(m.callback=o),r=pa(s,m,c),r!==null&&(bs(r,s,c),Tc(r,s,c))},enqueueForceUpdate:function(s,r){s=s._reactInternals;var o=Fs(),c=_a(o);c.tag=2,r!=null&&(c.callback=r),r=pa(s,c,o),r!==null&&(bs(r,s,o),Tc(r,s,o))}};function W0(s,r,o,c,m,_,w){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(c,_,w):r.prototype&&r.prototype.isPureReactComponent?!ca(o,c)||!ca(m,_):!0}function j0(s,r,o,c){s=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,c),r.state!==s&&Hm.enqueueReplaceState(r,r.state,null)}function Co(s,r){var o=r;if("ref"in r){o={};for(var c in r)c!=="ref"&&(o[c]=r[c])}if(s=s.defaultProps){o===r&&(o=v({},o));for(var m in s)o[m]===void 0&&(o[m]=s[m])}return o}function V0(s){ah(s)}function q0(s){console.error(s)}function Y0(s){ah(s)}function Mh(s,r){try{var o=s.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function K0(s,r,o){try{var c=s.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Um(s,r,o){return o=_a(o),o.tag=3,o.payload={element:null},o.callback=function(){Mh(s,r)},o}function G0(s){return s=_a(s),s.tag=3,s}function X0(s,r,o,c){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var _=c.value;s.payload=function(){return m(_)},s.callback=function(){K0(r,o,c)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(s.callback=function(){K0(r,o,c),typeof m!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function X5(s,r,o,c,m){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=o.alternate,r!==null&&dl(r,o,m,!0),o=zs.current,o!==null){switch(o.tag){case 31:case 13:return _r===null?Fh():o.alternate===null&&Jt===0&&(Jt=3),o.flags&=-257,o.flags|=65536,o.lanes=m,c===ph?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([c]):r.add(c),h_(s,c,m)),!1;case 22:return o.flags|=65536,c===ph?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([c]):o.add(c)),h_(s,c,m)),!1}throw Error(n(435,o.tag))}return h_(s,c,m),Fh(),!1}if(ht)return r=zs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=m,c!==nm&&(s=Error(n(422),{cause:c}),wc(hr(s,o)))):(c!==nm&&(r=Error(n(423),{cause:c}),wc(hr(r,o))),s=s.current.alternate,s.flags|=65536,m&=-m,s.lanes|=m,c=hr(c,o),m=Um(s.stateNode,c,m),pm(s,m),Jt!==4&&(Jt=2)),!1;var _=Error(n(520),{cause:c});if(_=hr(_,o),Fc===null?Fc=[_]:Fc.push(_),Jt!==4&&(Jt=2),r===null)return!0;c=hr(c,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,s=m&-m,o.lanes|=s,s=Um(o.stateNode,c,s),pm(o,s),!1;case 1:if(r=o.type,_=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(wa===null||!wa.has(_))))return o.flags|=65536,m&=-m,o.lanes|=m,m=G0(m),X0(m,s,o,c),pm(o,m),!1}o=o.return}while(o!==null);return!1}var Fm=Error(n(461)),fi=!1;function Ki(s,r,o,c){r.child=s===null?e0(r,null,o,c):bo(r,s.child,o,c)}function Z0(s,r,o,c,m){o=o.render;var _=r.ref;if("ref"in c){var w={};for(var T in c)T!=="ref"&&(w[T]=c[T])}else w=c;return go(r),c=wm(s,r,o,w,_,m),T=Cm(),s!==null&&!fi?(xm(s,r,m),Rn(s,r,m)):(ht&&T&&sm(r),r.flags|=1,Ki(s,r,c,m),r.child)}function Q0(s,r,o,c,m){if(s===null){var _=o.type;return typeof _=="function"&&!em(_)&&_.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=_,J0(s,r,_,c,m)):(s=uh(o.type,null,c,r,r.mode,m),s.ref=r.ref,s.return=r,r.child=s)}if(_=s.child,!Gm(s,m)){var w=_.memoizedProps;if(o=o.compare,o=o!==null?o:ca,o(w,c)&&s.ref===r.ref)return Rn(s,r,m)}return r.flags|=1,s=wn(_,c),s.ref=r.ref,s.return=r,r.child=s}function J0(s,r,o,c,m){if(s!==null){var _=s.memoizedProps;if(ca(_,c)&&s.ref===r.ref)if(fi=!1,r.pendingProps=c=_,Gm(s,m))(s.flags&131072)!==0&&(fi=!0);else return r.lanes=s.lanes,Rn(s,r,m)}return $m(s,r,o,c,m)}function ey(s,r,o,c){var m=c.children,_=s!==null?s.memoizedState:null;if(s===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(_=_!==null?_.baseLanes|o:o,s!==null){for(c=r.child=s.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~_}else c=0,r.child=null;return ty(s,r,_,o,c)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},s!==null&&mh(r,_!==null?_.cachePool:null),_!==null?s0(r,_):vm(),r0(r);else return c=r.lanes=536870912,ty(s,r,_!==null?_.baseLanes|o:o,o,c)}else _!==null?(mh(r,_.cachePool),s0(r,_),va(),r.memoizedState=null):(s!==null&&mh(r,null),vm(),va());return Ki(s,r,m,o),r.child}function Bc(s,r){return s!==null&&s.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ty(s,r,o,c,m){var _=dm();return _=_===null?null:{parent:hi._currentValue,pool:_},r.memoizedState={baseLanes:o,cachePool:_},s!==null&&mh(r,null),vm(),r0(r),s!==null&&dl(s,r,c,!0),r.childLanes=m,null}function Ah(s,r){return r=Dh({mode:r.mode,children:r.children},s.mode),r.ref=s.ref,s.child=r,r.return=s,r}function iy(s,r,o){return bo(r,s.child,null,o),s=Ah(r,r.pendingProps),s.flags|=2,Is(r),r.memoizedState=null,s}function Z5(s,r,o){var c=r.pendingProps,m=(r.flags&128)!==0;if(r.flags&=-129,s===null){if(ht){if(c.mode==="hidden")return s=Ah(r,c),r.lanes=536870912,Bc(null,s);if(Sm(r),(s=Nt)?(s=mS(s,mr),s=s!==null&&s.data==="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:ua!==null?{id:Xr,overflow:Zr}:null,retryLane:536870912,hydrationErrors:null},o=Hv(s),o.return=r,r.child=o,qi=r,Nt=null)):s=null,s===null)throw da(r);return r.lanes=536870912,null}return Ah(r,c)}var _=s.memoizedState;if(_!==null){var w=_.dehydrated;if(Sm(r),m)if(r.flags&256)r.flags&=-257,r=iy(s,r,o);else if(r.memoizedState!==null)r.child=s.child,r.flags|=128,r=null;else throw Error(n(558));else if(fi||dl(s,r,o,!1),m=(o&s.childLanes)!==0,fi||m){if(c=Ot,c!==null&&(w=er(c,o),w!==0&&w!==_.retryLane))throw _.retryLane=w,fo(s,w),bs(c,s,w),Fm;Fh(),r=iy(s,r,o)}else s=_.treeContext,Nt=pr(w.nextSibling),qi=r,ht=!0,ha=null,mr=!1,s!==null&&$v(r,s),r=Ah(r,c),r.flags|=4096;return r}return s=wn(s.child,{mode:c.mode,children:c.children}),s.ref=r.ref,r.child=s,s.return=r,s}function Lh(s,r){var o=r.ref;if(o===null)s!==null&&s.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(n(284));(s===null||s.ref!==o)&&(r.flags|=4194816)}}function $m(s,r,o,c,m){return go(r),o=wm(s,r,o,c,void 0,m),c=Cm(),s!==null&&!fi?(xm(s,r,m),Rn(s,r,m)):(ht&&c&&sm(r),r.flags|=1,Ki(s,r,o,m),r.child)}function sy(s,r,o,c,m,_){return go(r),r.updateQueue=null,o=a0(r,c,o,m),n0(s),c=Cm(),s!==null&&!fi?(xm(s,r,_),Rn(s,r,_)):(ht&&c&&sm(r),r.flags|=1,Ki(s,r,o,_),r.child)}function ry(s,r,o,c,m){if(go(r),r.stateNode===null){var _=ll,w=o.contextType;typeof w=="object"&&w!==null&&(_=Yi(w)),_=new o(c,_),r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Hm,r.stateNode=_,_._reactInternals=r,_=r.stateNode,_.props=c,_.state=r.memoizedState,_.refs={},mm(r),w=o.contextType,_.context=typeof w=="object"&&w!==null?Yi(w):ll,_.state=r.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Im(r,o,w,c),_.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(w=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),w!==_.state&&Hm.enqueueReplaceState(_,_.state,null),Mc(r,c,_,m),Rc(),_.state=r.memoizedState),typeof _.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(s===null){_=r.stateNode;var T=r.memoizedProps,W=Co(o,T);_.props=W;var Q=_.context,ne=o.contextType;w=ll,typeof ne=="object"&&ne!==null&&(w=Yi(ne));var le=o.getDerivedStateFromProps;ne=typeof le=="function"||typeof _.getSnapshotBeforeUpdate=="function",T=r.pendingProps!==T,ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(T||Q!==w)&&j0(r,_,c,w),ma=!1;var te=r.memoizedState;_.state=te,Mc(r,c,_,m),Rc(),Q=r.memoizedState,T||te!==Q||ma?(typeof le=="function"&&(Im(r,o,le,c),Q=r.memoizedState),(W=ma||W0(r,o,W,c,te,Q,w))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(r.flags|=4194308)):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=Q),_.props=c,_.state=Q,_.context=w,c=W):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{_=r.stateNode,_m(s,r),w=r.memoizedProps,ne=Co(o,w),_.props=ne,le=r.pendingProps,te=_.context,Q=o.contextType,W=ll,typeof Q=="object"&&Q!==null&&(W=Yi(Q)),T=o.getDerivedStateFromProps,(Q=typeof T=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(w!==le||te!==W)&&j0(r,_,c,W),ma=!1,te=r.memoizedState,_.state=te,Mc(r,c,_,m),Rc();var se=r.memoizedState;w!==le||te!==se||ma||s!==null&&s.dependencies!==null&&dh(s.dependencies)?(typeof T=="function"&&(Im(r,o,T,c),se=r.memoizedState),(ne=ma||W0(r,o,ne,c,te,se,W)||s!==null&&s.dependencies!==null&&dh(s.dependencies))?(Q||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(c,se,W),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(c,se,W)),typeof _.componentDidUpdate=="function"&&(r.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof _.componentDidUpdate!="function"||w===s.memoizedProps&&te===s.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||w===s.memoizedProps&&te===s.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=se),_.props=c,_.state=se,_.context=W,c=ne):(typeof _.componentDidUpdate!="function"||w===s.memoizedProps&&te===s.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||w===s.memoizedProps&&te===s.memoizedState||(r.flags|=1024),c=!1)}return _=c,Lh(s,r),c=(r.flags&128)!==0,_||c?(_=r.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:_.render(),r.flags|=1,s!==null&&c?(r.child=bo(r,s.child,null,m),r.child=bo(r,null,o,m)):Ki(s,r,o,m),r.memoizedState=_.state,s=r.child):s=Rn(s,r,m),s}function ny(s,r,o,c){return _o(),r.flags|=256,Ki(s,r,o,c),r.child}var Wm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jm(s){return{baseLanes:s,cachePool:Kv()}}function Vm(s,r,o){return s=s!==null?s.childLanes&~o:0,r&&(s|=Us),s}function ay(s,r,o){var c=r.pendingProps,m=!1,_=(r.flags&128)!==0,w;if((w=_)||(w=s!==null&&s.memoizedState===null?!1:(ai.current&2)!==0),w&&(m=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,s===null){if(ht){if(m?ga(r):va(),(s=Nt)?(s=mS(s,mr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:ua!==null?{id:Xr,overflow:Zr}:null,retryLane:536870912,hydrationErrors:null},o=Hv(s),o.return=r,r.child=o,qi=r,Nt=null)):s=null,s===null)throw da(r);return T_(s)?r.lanes=32:r.lanes=536870912,null}var T=c.children;return c=c.fallback,m?(va(),m=r.mode,T=Dh({mode:"hidden",children:T},m),c=mo(c,m,o,null),T.return=r,c.return=r,T.sibling=c,r.child=T,c=r.child,c.memoizedState=jm(o),c.childLanes=Vm(s,w,o),r.memoizedState=Wm,Bc(null,c)):(ga(r),qm(r,T))}var W=s.memoizedState;if(W!==null&&(T=W.dehydrated,T!==null)){if(_)r.flags&256?(ga(r),r.flags&=-257,r=Ym(s,r,o)):r.memoizedState!==null?(va(),r.child=s.child,r.flags|=128,r=null):(va(),T=c.fallback,m=r.mode,c=Dh({mode:"visible",children:c.children},m),T=mo(T,m,o,null),T.flags|=2,c.return=r,T.return=r,c.sibling=T,r.child=c,bo(r,s.child,null,o),c=r.child,c.memoizedState=jm(o),c.childLanes=Vm(s,w,o),r.memoizedState=Wm,r=Bc(null,c));else if(ga(r),T_(T)){if(w=T.nextSibling&&T.nextSibling.dataset,w)var Q=w.dgst;w=Q,c=Error(n(419)),c.stack="",c.digest=w,wc({value:c,source:null,stack:null}),r=Ym(s,r,o)}else if(fi||dl(s,r,o,!1),w=(o&s.childLanes)!==0,fi||w){if(w=Ot,w!==null&&(c=er(w,o),c!==0&&c!==W.retryLane))throw W.retryLane=c,fo(s,c),bs(w,s,c),Fm;E_(T)||Fh(),r=Ym(s,r,o)}else E_(T)?(r.flags|=192,r.child=s.child,r=null):(s=W.treeContext,Nt=pr(T.nextSibling),qi=r,ht=!0,ha=null,mr=!1,s!==null&&$v(r,s),r=qm(r,c.children),r.flags|=4096);return r}return m?(va(),T=c.fallback,m=r.mode,W=s.child,Q=W.sibling,c=wn(W,{mode:"hidden",children:c.children}),c.subtreeFlags=W.subtreeFlags&65011712,Q!==null?T=wn(Q,T):(T=mo(T,m,o,null),T.flags|=2),T.return=r,c.return=r,c.sibling=T,r.child=c,Bc(null,c),c=r.child,T=s.child.memoizedState,T===null?T=jm(o):(m=T.cachePool,m!==null?(W=hi._currentValue,m=m.parent!==W?{parent:W,pool:W}:m):m=Kv(),T={baseLanes:T.baseLanes|o,cachePool:m}),c.memoizedState=T,c.childLanes=Vm(s,w,o),r.memoizedState=Wm,Bc(s.child,c)):(ga(r),o=s.child,s=o.sibling,o=wn(o,{mode:"visible",children:c.children}),o.return=r,o.sibling=null,s!==null&&(w=r.deletions,w===null?(r.deletions=[s],r.flags|=16):w.push(s)),r.child=o,r.memoizedState=null,o)}function qm(s,r){return r=Dh({mode:"visible",children:r},s.mode),r.return=s,s.child=r}function Dh(s,r){return s=Ps(22,s,null,r),s.lanes=0,s}function Ym(s,r,o){return bo(r,s.child,null,o),s=qm(r,r.pendingProps.children),s.flags|=2,r.memoizedState=null,s}function oy(s,r,o){s.lanes|=r;var c=s.alternate;c!==null&&(c.lanes|=r),lm(s.return,r,o)}function Km(s,r,o,c,m,_){var w=s.memoizedState;w===null?s.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:m,treeForkCount:_}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=o,w.tailMode=m,w.treeForkCount=_)}function ly(s,r,o){var c=r.pendingProps,m=c.revealOrder,_=c.tail;c=c.children;var w=ai.current,T=(w&2)!==0;if(T?(w=w&1|2,r.flags|=128):w&=1,ie(ai,w),Ki(s,r,c,o),c=ht?bc:0,!T&&s!==null&&(s.flags&128)!==0)e:for(s=r.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&oy(s,o,r);else if(s.tag===19)oy(s,o,r);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(m){case"forwards":for(o=r.child,m=null;o!==null;)s=o.alternate,s!==null&&Sh(s)===null&&(m=o),o=o.sibling;o=m,o===null?(m=r.child,r.child=null):(m=o.sibling,o.sibling=null),Km(r,!1,m,o,_,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,m=r.child,r.child=null;m!==null;){if(s=m.alternate,s!==null&&Sh(s)===null){r.child=m;break}s=m.sibling,m.sibling=o,o=m,m=s}Km(r,!0,o,null,_,c);break;case"together":Km(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function Rn(s,r,o){if(s!==null&&(r.dependencies=s.dependencies),ba|=r.lanes,(o&r.childLanes)===0)if(s!==null){if(dl(s,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(s!==null&&r.child!==s.child)throw Error(n(153));if(r.child!==null){for(s=r.child,o=wn(s,s.pendingProps),r.child=o,o.return=r;s.sibling!==null;)s=s.sibling,o=o.sibling=wn(s,s.pendingProps),o.return=r;o.sibling=null}return r.child}function Gm(s,r){return(s.lanes&r)!==0?!0:(s=s.dependencies,!!(s!==null&&dh(s)))}function Q5(s,r,o){switch(r.tag){case 3:ve(r,r.stateNode.containerInfo),fa(r,hi,s.memoizedState.cache),_o();break;case 27:case 5:we(r);break;case 4:ve(r,r.stateNode.containerInfo);break;case 10:fa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Sm(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(ga(r),r.flags|=128,null):(o&r.child.childLanes)!==0?ay(s,r,o):(ga(r),s=Rn(s,r,o),s!==null?s.sibling:null);ga(r);break;case 19:var m=(s.flags&128)!==0;if(c=(o&r.childLanes)!==0,c||(dl(s,r,o,!1),c=(o&r.childLanes)!==0),m){if(c)return ly(s,r,o);r.flags|=128}if(m=r.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ie(ai,ai.current),c)break;return null;case 22:return r.lanes=0,ey(s,r,o,r.pendingProps);case 24:fa(r,hi,s.memoizedState.cache)}return Rn(s,r,o)}function cy(s,r,o){if(s!==null)if(s.memoizedProps!==r.pendingProps)fi=!0;else{if(!Gm(s,o)&&(r.flags&128)===0)return fi=!1,Q5(s,r,o);fi=(s.flags&131072)!==0}else fi=!1,ht&&(r.flags&1048576)!==0&&Fv(r,bc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(s=yo(r.elementType),r.type=s,typeof s=="function")em(s)?(c=Co(s,c),r.tag=1,r=ry(null,r,s,c,o)):(r.tag=0,r=$m(null,r,s,c,o));else{if(s!=null){var m=s.$$typeof;if(m===E){r.tag=11,r=Z0(null,r,s,c,o);break e}else if(m===I){r.tag=14,r=Q0(null,r,s,c,o);break e}}throw r=P(s)||s,Error(n(306,r,""))}}return r;case 0:return $m(s,r,r.type,r.pendingProps,o);case 1:return c=r.type,m=Co(c,r.pendingProps),ry(s,r,c,m,o);case 3:e:{if(ve(r,r.stateNode.containerInfo),s===null)throw Error(n(387));c=r.pendingProps;var _=r.memoizedState;m=_.element,_m(s,r),Mc(r,c,null,o);var w=r.memoizedState;if(c=w.cache,fa(r,hi,c),c!==_.cache&&cm(r,[hi],o,!0),Rc(),c=w.element,_.isDehydrated)if(_={element:c,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){r=ny(s,r,c,o);break e}else if(c!==m){m=hr(Error(n(424)),r),wc(m),r=ny(s,r,c,o);break e}else for(s=r.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Nt=pr(s.firstChild),qi=r,ht=!0,ha=null,mr=!0,o=e0(r,null,c,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(_o(),c===m){r=Rn(s,r,o);break e}Ki(s,r,c,o)}r=r.child}return r;case 26:return Lh(s,r),s===null?(o=SS(r.type,null,r.pendingProps,null))?r.memoizedState=o:ht||(o=r.type,s=r.pendingProps,c=Kh(he.current).createElement(o),c[Te]=r,c[He]=s,Gi(c,o,s),be(c),r.stateNode=c):r.memoizedState=SS(r.type,s.memoizedProps,r.pendingProps,s.memoizedState),null;case 27:return we(r),s===null&&ht&&(c=r.stateNode=gS(r.type,r.pendingProps,he.current),qi=r,mr=!0,m=Nt,Ea(r.type)?(R_=m,Nt=pr(c.firstChild)):Nt=m),Ki(s,r,r.pendingProps.children,o),Lh(s,r),s===null&&(r.flags|=4194304),r.child;case 5:return s===null&&ht&&((m=c=Nt)&&(c=R2(c,r.type,r.pendingProps,mr),c!==null?(r.stateNode=c,qi=r,Nt=pr(c.firstChild),mr=!1,m=!0):m=!1),m||da(r)),we(r),m=r.type,_=r.pendingProps,w=s!==null?s.memoizedProps:null,c=_.children,C_(m,_)?c=null:w!==null&&C_(m,w)&&(r.flags|=32),r.memoizedState!==null&&(m=wm(s,r,W5,null,null,o),Gc._currentValue=m),Lh(s,r),Ki(s,r,c,o),r.child;case 6:return s===null&&ht&&((s=o=Nt)&&(o=M2(o,r.pendingProps,mr),o!==null?(r.stateNode=o,qi=r,Nt=null,s=!0):s=!1),s||da(r)),null;case 13:return ay(s,r,o);case 4:return ve(r,r.stateNode.containerInfo),c=r.pendingProps,s===null?r.child=bo(r,null,c,o):Ki(s,r,c,o),r.child;case 11:return Z0(s,r,r.type,r.pendingProps,o);case 7:return Ki(s,r,r.pendingProps,o),r.child;case 8:return Ki(s,r,r.pendingProps.children,o),r.child;case 12:return Ki(s,r,r.pendingProps.children,o),r.child;case 10:return c=r.pendingProps,fa(r,r.type,c.value),Ki(s,r,c.children,o),r.child;case 9:return m=r.type._context,c=r.pendingProps.children,go(r),m=Yi(m),c=c(m),r.flags|=1,Ki(s,r,c,o),r.child;case 14:return Q0(s,r,r.type,r.pendingProps,o);case 15:return J0(s,r,r.type,r.pendingProps,o);case 19:return ly(s,r,o);case 31:return Z5(s,r,o);case 22:return ey(s,r,o,r.pendingProps);case 24:return go(r),c=Yi(hi),s===null?(m=dm(),m===null&&(m=Ot,_=um(),m.pooledCache=_,_.refCount++,_!==null&&(m.pooledCacheLanes|=o),m=_),r.memoizedState={parent:c,cache:m},mm(r),fa(r,hi,m)):((s.lanes&o)!==0&&(_m(s,r),Mc(r,null,null,o),Rc()),m=s.memoizedState,_=r.memoizedState,m.parent!==c?(m={parent:c,cache:c},r.memoizedState=m,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=m),fa(r,hi,c)):(c=_.cache,fa(r,hi,c),c!==m.cache&&cm(r,[hi],o,!0))),Ki(s,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function Mn(s){s.flags|=4}function Xm(s,r,o,c,m){if((r=(s.mode&32)!==0)&&(r=!1),r){if(s.flags|=16777216,(m&335544128)===m)if(s.stateNode.complete)s.flags|=8192;else if(Py())s.flags|=8192;else throw So=ph,fm}else s.flags&=-16777217}function uy(s,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!kS(r))if(Py())s.flags|=8192;else throw So=ph,fm}function Oh(s,r){r!==null&&(s.flags|=4),s.flags&16384&&(r=s.tag!==22?Qi():536870912,s.lanes|=r,xl|=r)}function Nc(s,r){if(!ht)switch(s.tailMode){case"hidden":r=s.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?s.tail=null:o.sibling=null;break;case"collapsed":o=s.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r||s.tail===null?s.tail=null:s.tail.sibling=null:c.sibling=null}}function Pt(s){var r=s.alternate!==null&&s.alternate.child===s.child,o=0,c=0;if(r)for(var m=s.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=s,m=m.sibling;else for(m=s.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=s,m=m.sibling;return s.subtreeFlags|=c,s.childLanes=o,r}function J5(s,r,o){var c=r.pendingProps;switch(rm(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(r),null;case 1:return Pt(r),null;case 3:return o=r.stateNode,c=null,s!==null&&(c=s.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),kn(hi),de(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(s===null||s.child===null)&&(hl(r)?Mn(r):s===null||s.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,am())),Pt(r),null;case 26:var m=r.type,_=r.memoizedState;return s===null?(Mn(r),_!==null?(Pt(r),uy(r,_)):(Pt(r),Xm(r,m,null,c,o))):_?_!==s.memoizedState?(Mn(r),Pt(r),uy(r,_)):(Pt(r),r.flags&=-16777217):(s=s.memoizedProps,s!==c&&Mn(r),Pt(r),Xm(r,m,s,c,o)),null;case 27:if(Le(r),o=he.current,m=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==c&&Mn(r);else{if(!c){if(r.stateNode===null)throw Error(n(166));return Pt(r),null}s=re.current,hl(r)?Wv(r):(s=gS(m,c,o),r.stateNode=s,Mn(r))}return Pt(r),null;case 5:if(Le(r),m=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==c&&Mn(r);else{if(!c){if(r.stateNode===null)throw Error(n(166));return Pt(r),null}if(_=re.current,hl(r))Wv(r);else{var w=Kh(he.current);switch(_){case 1:_=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:_=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":_=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":_=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":_=w.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?_.multiple=!0:c.size&&(_.size=c.size);break;default:_=typeof c.is=="string"?w.createElement(m,{is:c.is}):w.createElement(m)}}_[Te]=r,_[He]=c;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)_.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=_;e:switch(Gi(_,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Mn(r)}}return Pt(r),Xm(r,r.type,s===null?null:s.memoizedProps,r.pendingProps,o),null;case 6:if(s&&r.stateNode!=null)s.memoizedProps!==c&&Mn(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(n(166));if(s=he.current,hl(r)){if(s=r.stateNode,o=r.memoizedProps,c=null,m=qi,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}s[Te]=r,s=!!(s.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||aS(s.nodeValue,o)),s||da(r,!0)}else s=Kh(s).createTextNode(c),s[Te]=r,r.stateNode=s}return Pt(r),null;case 31:if(o=r.memoizedState,s===null||s.memoizedState!==null){if(c=hl(r),o!==null){if(s===null){if(!c)throw Error(n(318));if(s=r.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(557));s[Te]=r}else _o(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pt(r),s=!1}else o=am(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=o),s=!0;if(!s)return r.flags&256?(Is(r),r):(Is(r),null);if((r.flags&128)!==0)throw Error(n(558))}return Pt(r),null;case 13:if(c=r.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(m=hl(r),c!==null&&c.dehydrated!==null){if(s===null){if(!m)throw Error(n(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[Te]=r}else _o(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pt(r),m=!1}else m=am(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),m=!0;if(!m)return r.flags&256?(Is(r),r):(Is(r),null)}return Is(r),(r.flags&128)!==0?(r.lanes=o,r):(o=c!==null,s=s!==null&&s.memoizedState!==null,o&&(c=r.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),_=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(_=c.memoizedState.cachePool.pool),_!==m&&(c.flags|=2048)),o!==s&&o&&(r.child.flags|=8192),Oh(r,r.updateQueue),Pt(r),null);case 4:return de(),s===null&&v_(r.stateNode.containerInfo),Pt(r),null;case 10:return kn(r.type),Pt(r),null;case 19:if(X(ai),c=r.memoizedState,c===null)return Pt(r),null;if(m=(r.flags&128)!==0,_=c.rendering,_===null)if(m)Nc(c,!1);else{if(Jt!==0||s!==null&&(s.flags&128)!==0)for(s=r.child;s!==null;){if(_=Sh(s),_!==null){for(r.flags|=128,Nc(c,!1),s=_.updateQueue,r.updateQueue=s,Oh(r,s),r.subtreeFlags=0,s=o,o=r.child;o!==null;)Iv(o,s),o=o.sibling;return ie(ai,ai.current&1|2),ht&&Cn(r,c.treeForkCount),r.child}s=s.sibling}c.tail!==null&&Qe()>Ih&&(r.flags|=128,m=!0,Nc(c,!1),r.lanes=4194304)}else{if(!m)if(s=Sh(_),s!==null){if(r.flags|=128,m=!0,s=s.updateQueue,r.updateQueue=s,Oh(r,s),Nc(c,!0),c.tail===null&&c.tailMode==="hidden"&&!_.alternate&&!ht)return Pt(r),null}else 2*Qe()-c.renderingStartTime>Ih&&o!==536870912&&(r.flags|=128,m=!0,Nc(c,!1),r.lanes=4194304);c.isBackwards?(_.sibling=r.child,r.child=_):(s=c.last,s!==null?s.sibling=_:r.child=_,c.last=_)}return c.tail!==null?(s=c.tail,c.rendering=s,c.tail=s.sibling,c.renderingStartTime=Qe(),s.sibling=null,o=ai.current,ie(ai,m?o&1|2:o&1),ht&&Cn(r,c.treeForkCount),s):(Pt(r),null);case 22:case 23:return Is(r),ym(),c=r.memoizedState!==null,s!==null?s.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(o&536870912)!==0&&(r.flags&128)===0&&(Pt(r),r.subtreeFlags&6&&(r.flags|=8192)):Pt(r),o=r.updateQueue,o!==null&&Oh(r,o.retryQueue),o=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==o&&(r.flags|=2048),s!==null&&X(vo),null;case 24:return o=null,s!==null&&(o=s.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),kn(hi),Pt(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function e2(s,r){switch(rm(r),r.tag){case 1:return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 3:return kn(hi),de(),s=r.flags,(s&65536)!==0&&(s&128)===0?(r.flags=s&-65537|128,r):null;case 26:case 27:case 5:return Le(r),null;case 31:if(r.memoizedState!==null){if(Is(r),r.alternate===null)throw Error(n(340));_o()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 13:if(Is(r),s=r.memoizedState,s!==null&&s.dehydrated!==null){if(r.alternate===null)throw Error(n(340));_o()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 19:return X(ai),null;case 4:return de(),null;case 10:return kn(r.type),null;case 22:case 23:return Is(r),ym(),s!==null&&X(vo),s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 24:return kn(hi),null;case 25:return null;default:return null}}function hy(s,r){switch(rm(r),r.tag){case 3:kn(hi),de();break;case 26:case 27:case 5:Le(r);break;case 4:de();break;case 31:r.memoizedState!==null&&Is(r);break;case 13:Is(r);break;case 19:X(ai);break;case 10:kn(r.type);break;case 22:case 23:Is(r),ym(),s!==null&&X(vo);break;case 24:kn(hi)}}function Pc(s,r){try{var o=r.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var m=c.next;o=m;do{if((o.tag&s)===s){c=void 0;var _=o.create,w=o.inst;c=_(),w.destroy=c}o=o.next}while(o!==m)}}catch(T){Ct(r,r.return,T)}}function ya(s,r,o){try{var c=r.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var _=m.next;c=_;do{if((c.tag&s)===s){var w=c.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,m=r;var W=o,Q=T;try{Q()}catch(ne){Ct(m,W,ne)}}}c=c.next}while(c!==_)}}catch(ne){Ct(r,r.return,ne)}}function dy(s){var r=s.updateQueue;if(r!==null){var o=s.stateNode;try{i0(r,o)}catch(c){Ct(s,s.return,c)}}}function fy(s,r,o){o.props=Co(s.type,s.memoizedProps),o.state=s.memoizedState;try{o.componentWillUnmount()}catch(c){Ct(s,r,c)}}function zc(s,r){try{var o=s.ref;if(o!==null){switch(s.tag){case 26:case 27:case 5:var c=s.stateNode;break;case 30:c=s.stateNode;break;default:c=s.stateNode}typeof o=="function"?s.refCleanup=o(c):o.current=c}}catch(m){Ct(s,r,m)}}function Qr(s,r){var o=s.ref,c=s.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(m){Ct(s,r,m)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(m){Ct(s,r,m)}else o.current=null}function my(s){var r=s.type,o=s.memoizedProps,c=s.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(m){Ct(s,s.return,m)}}function Zm(s,r,o){try{var c=s.stateNode;w2(c,s.type,o,r),c[He]=r}catch(m){Ct(s,s.return,m)}}function _y(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ea(s.type)||s.tag===4}function Qm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||_y(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ea(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Jm(s,r,o){var c=s.tag;if(c===5||c===6)s=s.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(s,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(s),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Ri));else if(c!==4&&(c===27&&Ea(s.type)&&(o=s.stateNode,r=null),s=s.child,s!==null))for(Jm(s,r,o),s=s.sibling;s!==null;)Jm(s,r,o),s=s.sibling}function Bh(s,r,o){var c=s.tag;if(c===5||c===6)s=s.stateNode,r?o.insertBefore(s,r):o.appendChild(s);else if(c!==4&&(c===27&&Ea(s.type)&&(o=s.stateNode),s=s.child,s!==null))for(Bh(s,r,o),s=s.sibling;s!==null;)Bh(s,r,o),s=s.sibling}function py(s){var r=s.stateNode,o=s.memoizedProps;try{for(var c=s.type,m=r.attributes;m.length;)r.removeAttributeNode(m[0]);Gi(r,c,o),r[Te]=s,r[He]=o}catch(_){Ct(s,s.return,_)}}var An=!1,mi=!1,e_=!1,gy=typeof WeakSet=="function"?WeakSet:Set,Ai=null;function t2(s,r){if(s=s.containerInfo,b_=td,s=Mv(s),Yf(s)){if("selectionStart"in s)var o={start:s.selectionStart,end:s.selectionEnd};else e:{o=(o=s.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var m=c.anchorOffset,_=c.focusNode;c=c.focusOffset;try{o.nodeType,_.nodeType}catch{o=null;break e}var w=0,T=-1,W=-1,Q=0,ne=0,le=s,te=null;t:for(;;){for(var se;le!==o||m!==0&&le.nodeType!==3||(T=w+m),le!==_||c!==0&&le.nodeType!==3||(W=w+c),le.nodeType===3&&(w+=le.nodeValue.length),(se=le.firstChild)!==null;)te=le,le=se;for(;;){if(le===s)break t;if(te===o&&++Q===m&&(T=w),te===_&&++ne===c&&(W=w),(se=le.nextSibling)!==null)break;le=te,te=le.parentNode}le=se}o=T===-1||W===-1?null:{start:T,end:W}}else o=null}o=o||{start:0,end:0}}else o=null;for(w_={focusedElem:s,selectionRange:o},td=!1,Ai=r;Ai!==null;)if(r=Ai,s=r.child,(r.subtreeFlags&1028)!==0&&s!==null)s.return=r,Ai=s;else for(;Ai!==null;){switch(r=Ai,_=r.alternate,s=r.flags,r.tag){case 0:if((s&4)!==0&&(s=r.updateQueue,s=s!==null?s.events:null,s!==null))for(o=0;o<s.length;o++)m=s[o],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,o=r,m=_.memoizedProps,_=_.memoizedState,c=o.stateNode;try{var Ee=Co(o.type,m);s=c.getSnapshotBeforeUpdate(Ee,_),c.__reactInternalSnapshotBeforeUpdate=s}catch(Ue){Ct(o,o.return,Ue)}}break;case 3:if((s&1024)!==0){if(s=r.stateNode.containerInfo,o=s.nodeType,o===9)k_(s);else if(o===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":k_(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(n(163))}if(s=r.sibling,s!==null){s.return=r.return,Ai=s;break}Ai=r.return}}function vy(s,r,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Dn(s,o),c&4&&Pc(5,o);break;case 1:if(Dn(s,o),c&4)if(s=o.stateNode,r===null)try{s.componentDidMount()}catch(w){Ct(o,o.return,w)}else{var m=Co(o.type,r.memoizedProps);r=r.memoizedState;try{s.componentDidUpdate(m,r,s.__reactInternalSnapshotBeforeUpdate)}catch(w){Ct(o,o.return,w)}}c&64&&dy(o),c&512&&zc(o,o.return);break;case 3:if(Dn(s,o),c&64&&(s=o.updateQueue,s!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{i0(s,r)}catch(w){Ct(o,o.return,w)}}break;case 27:r===null&&c&4&&py(o);case 26:case 5:Dn(s,o),r===null&&c&4&&my(o),c&512&&zc(o,o.return);break;case 12:Dn(s,o);break;case 31:Dn(s,o),c&4&&by(s,o);break;case 13:Dn(s,o),c&4&&wy(s,o),c&64&&(s=o.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(o=u2.bind(null,o),A2(s,o))));break;case 22:if(c=o.memoizedState!==null||An,!c){r=r!==null&&r.memoizedState!==null||mi,m=An;var _=mi;An=c,(mi=r)&&!_?On(s,o,(o.subtreeFlags&8772)!==0):Dn(s,o),An=m,mi=_}break;case 30:break;default:Dn(s,o)}}function yy(s){var r=s.alternate;r!==null&&(s.alternate=null,yy(r)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(r=s.stateNode,r!==null&&Lr(r)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var $t=null,gs=!1;function Ln(s,r,o){for(o=o.child;o!==null;)Sy(s,r,o),o=o.sibling}function Sy(s,r,o){if(ri&&typeof ri.onCommitFiberUnmount=="function")try{ri.onCommitFiberUnmount(Xs,o)}catch{}switch(o.tag){case 26:mi||Qr(o,r),Ln(s,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:mi||Qr(o,r);var c=$t,m=gs;Ea(o.type)&&($t=o.stateNode,gs=!1),Ln(s,r,o),qc(o.stateNode),$t=c,gs=m;break;case 5:mi||Qr(o,r);case 6:if(c=$t,m=gs,$t=null,Ln(s,r,o),$t=c,gs=m,$t!==null)if(gs)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(o.stateNode)}catch(_){Ct(o,r,_)}else try{$t.removeChild(o.stateNode)}catch(_){Ct(o,r,_)}break;case 18:$t!==null&&(gs?(s=$t,dS(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,o.stateNode),Dl(s)):dS($t,o.stateNode));break;case 4:c=$t,m=gs,$t=o.stateNode.containerInfo,gs=!0,Ln(s,r,o),$t=c,gs=m;break;case 0:case 11:case 14:case 15:ya(2,o,r),mi||ya(4,o,r),Ln(s,r,o);break;case 1:mi||(Qr(o,r),c=o.stateNode,typeof c.componentWillUnmount=="function"&&fy(o,r,c)),Ln(s,r,o);break;case 21:Ln(s,r,o);break;case 22:mi=(c=mi)||o.memoizedState!==null,Ln(s,r,o),mi=c;break;default:Ln(s,r,o)}}function by(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Dl(s)}catch(o){Ct(r,r.return,o)}}}function wy(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Dl(s)}catch(o){Ct(r,r.return,o)}}function i2(s){switch(s.tag){case 31:case 13:case 19:var r=s.stateNode;return r===null&&(r=s.stateNode=new gy),r;case 22:return s=s.stateNode,r=s._retryCache,r===null&&(r=s._retryCache=new gy),r;default:throw Error(n(435,s.tag))}}function Nh(s,r){var o=i2(s);r.forEach(function(c){if(!o.has(c)){o.add(c);var m=h2.bind(null,s,c);c.then(m,m)}})}function vs(s,r){var o=r.deletions;if(o!==null)for(var c=0;c<o.length;c++){var m=o[c],_=s,w=r,T=w;e:for(;T!==null;){switch(T.tag){case 27:if(Ea(T.type)){$t=T.stateNode,gs=!1;break e}break;case 5:$t=T.stateNode,gs=!1;break e;case 3:case 4:$t=T.stateNode.containerInfo,gs=!0;break e}T=T.return}if($t===null)throw Error(n(160));Sy(_,w,m),$t=null,gs=!1,_=m.alternate,_!==null&&(_.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Cy(r,s),r=r.sibling}var Ir=null;function Cy(s,r){var o=s.alternate,c=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:vs(r,s),ys(s),c&4&&(ya(3,s,s.return),Pc(3,s),ya(5,s,s.return));break;case 1:vs(r,s),ys(s),c&512&&(mi||o===null||Qr(o,o.return)),c&64&&An&&(s=s.updateQueue,s!==null&&(c=s.callbacks,c!==null&&(o=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var m=Ir;if(vs(r,s),ys(s),c&512&&(mi||o===null||Qr(o,o.return)),c&4){var _=o!==null?o.memoizedState:null;if(c=s.memoizedState,o===null)if(c===null)if(s.stateNode===null){e:{c=s.type,o=s.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":_=m.getElementsByTagName("title")[0],(!_||_[Ls]||_[Te]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=m.createElement(c),m.head.insertBefore(_,m.querySelector("head > title"))),Gi(_,c,o),_[Te]=s,be(_),c=_;break e;case"link":var w=CS("link","href",m).get(c+(o.href||""));if(w){for(var T=0;T<w.length;T++)if(_=w[T],_.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&_.getAttribute("rel")===(o.rel==null?null:o.rel)&&_.getAttribute("title")===(o.title==null?null:o.title)&&_.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(T,1);break t}}_=m.createElement(c),Gi(_,c,o),m.head.appendChild(_);break;case"meta":if(w=CS("meta","content",m).get(c+(o.content||""))){for(T=0;T<w.length;T++)if(_=w[T],_.getAttribute("content")===(o.content==null?null:""+o.content)&&_.getAttribute("name")===(o.name==null?null:o.name)&&_.getAttribute("property")===(o.property==null?null:o.property)&&_.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&_.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(T,1);break t}}_=m.createElement(c),Gi(_,c,o),m.head.appendChild(_);break;default:throw Error(n(468,c))}_[Te]=s,be(_),c=_}s.stateNode=c}else xS(m,s.type,s.stateNode);else s.stateNode=wS(m,c,s.memoizedProps);else _!==c?(_===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):_.count--,c===null?xS(m,s.type,s.stateNode):wS(m,c,s.memoizedProps)):c===null&&s.stateNode!==null&&Zm(s,s.memoizedProps,o.memoizedProps)}break;case 27:vs(r,s),ys(s),c&512&&(mi||o===null||Qr(o,o.return)),o!==null&&c&4&&Zm(s,s.memoizedProps,o.memoizedProps);break;case 5:if(vs(r,s),ys(s),c&512&&(mi||o===null||Qr(o,o.return)),s.flags&32){m=s.stateNode;try{ra(m,"")}catch(Ee){Ct(s,s.return,Ee)}}c&4&&s.stateNode!=null&&(m=s.memoizedProps,Zm(s,m,o!==null?o.memoizedProps:m)),c&1024&&(e_=!0);break;case 6:if(vs(r,s),ys(s),c&4){if(s.stateNode===null)throw Error(n(162));c=s.memoizedProps,o=s.stateNode;try{o.nodeValue=c}catch(Ee){Ct(s,s.return,Ee)}}break;case 3:if(Zh=null,m=Ir,Ir=Gh(r.containerInfo),vs(r,s),Ir=m,ys(s),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Dl(r.containerInfo)}catch(Ee){Ct(s,s.return,Ee)}e_&&(e_=!1,xy(s));break;case 4:c=Ir,Ir=Gh(s.stateNode.containerInfo),vs(r,s),ys(s),Ir=c;break;case 12:vs(r,s),ys(s);break;case 31:vs(r,s),ys(s),c&4&&(c=s.updateQueue,c!==null&&(s.updateQueue=null,Nh(s,c)));break;case 13:vs(r,s),ys(s),s.child.flags&8192&&s.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zh=Qe()),c&4&&(c=s.updateQueue,c!==null&&(s.updateQueue=null,Nh(s,c)));break;case 22:m=s.memoizedState!==null;var W=o!==null&&o.memoizedState!==null,Q=An,ne=mi;if(An=Q||m,mi=ne||W,vs(r,s),mi=ne,An=Q,ys(s),c&8192)e:for(r=s.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,m&&(o===null||W||An||mi||xo(s)),o=null,r=s;;){if(r.tag===5||r.tag===26){if(o===null){W=o=r;try{if(_=W.stateNode,m)w=_.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{T=W.stateNode;var le=W.memoizedProps.style,te=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ee){Ct(W,W.return,Ee)}}}else if(r.tag===6){if(o===null){W=r;try{W.stateNode.nodeValue=m?"":W.memoizedProps}catch(Ee){Ct(W,W.return,Ee)}}}else if(r.tag===18){if(o===null){W=r;try{var se=W.stateNode;m?fS(se,!0):fS(W.stateNode,!1)}catch(Ee){Ct(W,W.return,Ee)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===s)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=s.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,Nh(s,o))));break;case 19:vs(r,s),ys(s),c&4&&(c=s.updateQueue,c!==null&&(s.updateQueue=null,Nh(s,c)));break;case 30:break;case 21:break;default:vs(r,s),ys(s)}}function ys(s){var r=s.flags;if(r&2){try{for(var o,c=s.return;c!==null;){if(_y(c)){o=c;break}c=c.return}if(o==null)throw Error(n(160));switch(o.tag){case 27:var m=o.stateNode,_=Qm(s);Bh(s,_,m);break;case 5:var w=o.stateNode;o.flags&32&&(ra(w,""),o.flags&=-33);var T=Qm(s);Bh(s,T,w);break;case 3:case 4:var W=o.stateNode.containerInfo,Q=Qm(s);Jm(s,Q,W);break;default:throw Error(n(161))}}catch(ne){Ct(s,s.return,ne)}s.flags&=-3}r&4096&&(s.flags&=-4097)}function xy(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var r=s;xy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),s=s.sibling}}function Dn(s,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)vy(s,r.alternate,r),r=r.sibling}function xo(s){for(s=s.child;s!==null;){var r=s;switch(r.tag){case 0:case 11:case 14:case 15:ya(4,r,r.return),xo(r);break;case 1:Qr(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&fy(r,r.return,o),xo(r);break;case 27:qc(r.stateNode);case 26:case 5:Qr(r,r.return),xo(r);break;case 22:r.memoizedState===null&&xo(r);break;case 30:xo(r);break;default:xo(r)}s=s.sibling}}function On(s,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,m=s,_=r,w=_.flags;switch(_.tag){case 0:case 11:case 15:On(m,_,o),Pc(4,_);break;case 1:if(On(m,_,o),c=_,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(Q){Ct(c,c.return,Q)}if(c=_,m=c.updateQueue,m!==null){var T=c.stateNode;try{var W=m.shared.hiddenCallbacks;if(W!==null)for(m.shared.hiddenCallbacks=null,m=0;m<W.length;m++)t0(W[m],T)}catch(Q){Ct(c,c.return,Q)}}o&&w&64&&dy(_),zc(_,_.return);break;case 27:py(_);case 26:case 5:On(m,_,o),o&&c===null&&w&4&&my(_),zc(_,_.return);break;case 12:On(m,_,o);break;case 31:On(m,_,o),o&&w&4&&by(m,_);break;case 13:On(m,_,o),o&&w&4&&wy(m,_);break;case 22:_.memoizedState===null&&On(m,_,o),zc(_,_.return);break;case 30:break;default:On(m,_,o)}r=r.sibling}}function t_(s,r){var o=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(s!=null&&s.refCount++,o!=null&&Cc(o))}function i_(s,r){s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Cc(s))}function Hr(s,r,o,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ky(s,r,o,c),r=r.sibling}function ky(s,r,o,c){var m=r.flags;switch(r.tag){case 0:case 11:case 15:Hr(s,r,o,c),m&2048&&Pc(9,r);break;case 1:Hr(s,r,o,c);break;case 3:Hr(s,r,o,c),m&2048&&(s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Cc(s)));break;case 12:if(m&2048){Hr(s,r,o,c),s=r.stateNode;try{var _=r.memoizedProps,w=_.id,T=_.onPostCommit;typeof T=="function"&&T(w,r.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(W){Ct(r,r.return,W)}}else Hr(s,r,o,c);break;case 31:Hr(s,r,o,c);break;case 13:Hr(s,r,o,c);break;case 23:break;case 22:_=r.stateNode,w=r.alternate,r.memoizedState!==null?_._visibility&2?Hr(s,r,o,c):Ic(s,r):_._visibility&2?Hr(s,r,o,c):(_._visibility|=2,bl(s,r,o,c,(r.subtreeFlags&10256)!==0||!1)),m&2048&&t_(w,r);break;case 24:Hr(s,r,o,c),m&2048&&i_(r.alternate,r);break;default:Hr(s,r,o,c)}}function bl(s,r,o,c,m){for(m=m&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var _=s,w=r,T=o,W=c,Q=w.flags;switch(w.tag){case 0:case 11:case 15:bl(_,w,T,W,m),Pc(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?bl(_,w,T,W,m):Ic(_,w):(ne._visibility|=2,bl(_,w,T,W,m)),m&&Q&2048&&t_(w.alternate,w);break;case 24:bl(_,w,T,W,m),m&&Q&2048&&i_(w.alternate,w);break;default:bl(_,w,T,W,m)}r=r.sibling}}function Ic(s,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=s,c=r,m=c.flags;switch(c.tag){case 22:Ic(o,c),m&2048&&t_(c.alternate,c);break;case 24:Ic(o,c),m&2048&&i_(c.alternate,c);break;default:Ic(o,c)}r=r.sibling}}var Hc=8192;function wl(s,r,o){if(s.subtreeFlags&Hc)for(s=s.child;s!==null;)Ey(s,r,o),s=s.sibling}function Ey(s,r,o){switch(s.tag){case 26:wl(s,r,o),s.flags&Hc&&s.memoizedState!==null&&$2(o,Ir,s.memoizedState,s.memoizedProps);break;case 5:wl(s,r,o);break;case 3:case 4:var c=Ir;Ir=Gh(s.stateNode.containerInfo),wl(s,r,o),Ir=c;break;case 22:s.memoizedState===null&&(c=s.alternate,c!==null&&c.memoizedState!==null?(c=Hc,Hc=16777216,wl(s,r,o),Hc=c):wl(s,r,o));break;default:wl(s,r,o)}}function Ty(s){var r=s.alternate;if(r!==null&&(s=r.child,s!==null)){r.child=null;do r=s.sibling,s.sibling=null,s=r;while(s!==null)}}function Uc(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];Ai=c,My(c,s)}Ty(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Ry(s),s=s.sibling}function Ry(s){switch(s.tag){case 0:case 11:case 15:Uc(s),s.flags&2048&&ya(9,s,s.return);break;case 3:Uc(s);break;case 12:Uc(s);break;case 22:var r=s.stateNode;s.memoizedState!==null&&r._visibility&2&&(s.return===null||s.return.tag!==13)?(r._visibility&=-3,Ph(s)):Uc(s);break;default:Uc(s)}}function Ph(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];Ai=c,My(c,s)}Ty(s)}for(s=s.child;s!==null;){switch(r=s,r.tag){case 0:case 11:case 15:ya(8,r,r.return),Ph(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Ph(r));break;default:Ph(r)}s=s.sibling}}function My(s,r){for(;Ai!==null;){var o=Ai;switch(o.tag){case 0:case 11:case 15:ya(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Cc(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,Ai=c;else e:for(o=s;Ai!==null;){c=Ai;var m=c.sibling,_=c.return;if(yy(c),c===o){Ai=null;break e}if(m!==null){m.return=_,Ai=m;break e}Ai=_}}}var s2={getCacheForType:function(s){var r=Yi(hi),o=r.data.get(s);return o===void 0&&(o=s(),r.data.set(s,o)),o},cacheSignal:function(){return Yi(hi).controller.signal}},r2=typeof WeakMap=="function"?WeakMap:Map,vt=0,Ot=null,ot=null,ct=0,wt=0,Hs=null,Sa=!1,Cl=!1,s_=!1,Bn=0,Jt=0,ba=0,ko=0,r_=0,Us=0,xl=0,Fc=null,Ss=null,n_=!1,zh=0,Ay=0,Ih=1/0,Hh=null,wa=null,bi=0,Ca=null,kl=null,Nn=0,a_=0,o_=null,Ly=null,$c=0,l_=null;function Fs(){return(vt&2)!==0&&ct!==0?ct&-ct:M.T!==null?m_():ft()}function Dy(){if(Us===0)if((ct&536870912)===0||ht){var s=kt;kt<<=1,(kt&3932160)===0&&(kt=262144),Us=s}else Us=536870912;return s=zs.current,s!==null&&(s.flags|=32),Us}function bs(s,r,o){(s===Ot&&(wt===2||wt===9)||s.cancelPendingCommit!==null)&&(El(s,0),xa(s,ct,Us,!1)),Ut(s,o),((vt&2)===0||s!==Ot)&&(s===Ot&&((vt&2)===0&&(ko|=o),Jt===4&&xa(s,ct,Us,!1)),Jr(s))}function Oy(s,r,o){if((vt&6)!==0)throw Error(n(327));var c=!o&&(r&127)===0&&(r&s.expiredLanes)===0||Mr(s,r),m=c?o2(s,r):u_(s,r,!0),_=c;do{if(m===0){Cl&&!c&&xa(s,r,0,!1);break}else{if(o=s.current.alternate,_&&!n2(o)){m=u_(s,r,!1),_=!1;continue}if(m===2){if(_=r,s.errorRecoveryDisabledLanes&_)var w=0;else w=s.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var T=s;m=Fc;var W=T.current.memoizedState.isDehydrated;if(W&&(El(T,w).flags|=256),w=u_(T,w,!1),w!==2){if(s_&&!W){T.errorRecoveryDisabledLanes|=_,ko|=_,m=4;break e}_=Ss,Ss=m,_!==null&&(Ss===null?Ss=_:Ss.push.apply(Ss,_))}m=w}if(_=!1,m!==2)continue}}if(m===1){El(s,0),xa(s,r,0,!0);break}e:{switch(c=s,_=m,_){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:xa(c,r,Us,!Sa);break e;case 2:Ss=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(m=zh+300-Qe(),10<m)){if(xa(c,r,Us,!Sa),As(c,0,!0)!==0)break e;Nn=r,c.timeoutHandle=uS(By.bind(null,c,o,Ss,Hh,n_,r,Us,ko,xl,Sa,_,"Throttled",-0,0),m);break e}By(c,o,Ss,Hh,n_,r,Us,ko,xl,Sa,_,null,-0,0)}}break}while(!0);Jr(s)}function By(s,r,o,c,m,_,w,T,W,Q,ne,le,te,se){if(s.timeoutHandle=-1,le=r.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ri},Ey(r,_,le);var Ee=(_&62914560)===_?zh-Qe():(_&4194048)===_?Ay-Qe():0;if(Ee=W2(le,Ee),Ee!==null){Nn=_,s.cancelPendingCommit=Ee($y.bind(null,s,r,_,o,c,m,w,T,W,ne,le,null,te,se)),xa(s,_,w,!Q);return}}$y(s,r,_,o,c,m,w,T,W)}function n2(s){for(var r=s;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var m=o[c],_=m.getSnapshot;m=m.value;try{if(!Si(_(),m))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function xa(s,r,o,c){r&=~r_,r&=~ko,s.suspendedLanes|=r,s.pingedLanes&=~r,c&&(s.warmLanes|=r),c=s.expirationTimes;for(var m=r;0<m;){var _=31-At(m),w=1<<_;c[_]=-1,m&=~w}o!==0&&Lt(s,o,r)}function Uh(){return(vt&6)===0?(Wc(0),!1):!0}function c_(){if(ot!==null){if(wt===0)var s=ot.return;else s=ot,xn=po=null,km(s),pl=null,kc=0,s=ot;for(;s!==null;)hy(s.alternate,s),s=s.return;ot=null}}function El(s,r){var o=s.timeoutHandle;o!==-1&&(s.timeoutHandle=-1,k2(o)),o=s.cancelPendingCommit,o!==null&&(s.cancelPendingCommit=null,o()),Nn=0,c_(),Ot=s,ot=o=wn(s.current,null),ct=r,wt=0,Hs=null,Sa=!1,Cl=Mr(s,r),s_=!1,xl=Us=r_=ko=ba=Jt=0,Ss=Fc=null,n_=!1,(r&8)!==0&&(r|=r&32);var c=s.entangledLanes;if(c!==0)for(s=s.entanglements,c&=r;0<c;){var m=31-At(c),_=1<<m;r|=s[m],c&=~_}return Bn=r,oh(),o}function Ny(s,r){Ze=null,M.H=Oc,r===_l||r===_h?(r=Zv(),wt=3):r===fm?(r=Zv(),wt=4):wt=r===Fm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Hs=r,ot===null&&(Jt=1,Mh(s,hr(r,s.current)))}function Py(){var s=zs.current;return s===null?!0:(ct&4194048)===ct?_r===null:(ct&62914560)===ct||(ct&536870912)!==0?s===_r:!1}function zy(){var s=M.H;return M.H=Oc,s===null?Oc:s}function Iy(){var s=M.A;return M.A=s2,s}function Fh(){Jt=4,Sa||(ct&4194048)!==ct&&zs.current!==null||(Cl=!0),(ba&134217727)===0&&(ko&134217727)===0||Ot===null||xa(Ot,ct,Us,!1)}function u_(s,r,o){var c=vt;vt|=2;var m=zy(),_=Iy();(Ot!==s||ct!==r)&&(Hh=null,El(s,r)),r=!1;var w=Jt;e:do try{if(wt!==0&&ot!==null){var T=ot,W=Hs;switch(wt){case 8:c_(),w=6;break e;case 3:case 2:case 9:case 6:zs.current===null&&(r=!0);var Q=wt;if(wt=0,Hs=null,Tl(s,T,W,Q),o&&Cl){w=0;break e}break;default:Q=wt,wt=0,Hs=null,Tl(s,T,W,Q)}}a2(),w=Jt;break}catch(ne){Ny(s,ne)}while(!0);return r&&s.shellSuspendCounter++,xn=po=null,vt=c,M.H=m,M.A=_,ot===null&&(Ot=null,ct=0,oh()),w}function a2(){for(;ot!==null;)Hy(ot)}function o2(s,r){var o=vt;vt|=2;var c=zy(),m=Iy();Ot!==s||ct!==r?(Hh=null,Ih=Qe()+500,El(s,r)):Cl=Mr(s,r);e:do try{if(wt!==0&&ot!==null){r=ot;var _=Hs;t:switch(wt){case 1:wt=0,Hs=null,Tl(s,r,_,1);break;case 2:case 9:if(Gv(_)){wt=0,Hs=null,Uy(r);break}r=function(){wt!==2&&wt!==9||Ot!==s||(wt=7),Jr(s)},_.then(r,r);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:Gv(_)?(wt=0,Hs=null,Uy(r)):(wt=0,Hs=null,Tl(s,r,_,7));break;case 5:var w=null;switch(ot.tag){case 26:w=ot.memoizedState;case 5:case 27:var T=ot;if(w?kS(w):T.stateNode.complete){wt=0,Hs=null;var W=T.sibling;if(W!==null)ot=W;else{var Q=T.return;Q!==null?(ot=Q,$h(Q)):ot=null}break t}}wt=0,Hs=null,Tl(s,r,_,5);break;case 6:wt=0,Hs=null,Tl(s,r,_,6);break;case 8:c_(),Jt=6;break e;default:throw Error(n(462))}}l2();break}catch(ne){Ny(s,ne)}while(!0);return xn=po=null,M.H=c,M.A=m,vt=o,ot!==null?0:(Ot=null,ct=0,oh(),Jt)}function l2(){for(;ot!==null&&!Gt();)Hy(ot)}function Hy(s){var r=cy(s.alternate,s,Bn);s.memoizedProps=s.pendingProps,r===null?$h(s):ot=r}function Uy(s){var r=s,o=r.alternate;switch(r.tag){case 15:case 0:r=sy(o,r,r.pendingProps,r.type,void 0,ct);break;case 11:r=sy(o,r,r.pendingProps,r.type.render,r.ref,ct);break;case 5:km(r);default:hy(o,r),r=ot=Iv(r,Bn),r=cy(o,r,Bn)}s.memoizedProps=s.pendingProps,r===null?$h(s):ot=r}function Tl(s,r,o,c){xn=po=null,km(r),pl=null,kc=0;var m=r.return;try{if(X5(s,m,r,o,ct)){Jt=1,Mh(s,hr(o,s.current)),ot=null;return}}catch(_){if(m!==null)throw ot=m,_;Jt=1,Mh(s,hr(o,s.current)),ot=null;return}r.flags&32768?(ht||c===1?s=!0:Cl||(ct&536870912)!==0?s=!1:(Sa=s=!0,(c===2||c===9||c===3||c===6)&&(c=zs.current,c!==null&&c.tag===13&&(c.flags|=16384))),Fy(r,s)):$h(r)}function $h(s){var r=s;do{if((r.flags&32768)!==0){Fy(r,Sa);return}s=r.return;var o=J5(r.alternate,r,Bn);if(o!==null){ot=o;return}if(r=r.sibling,r!==null){ot=r;return}ot=r=s}while(r!==null);Jt===0&&(Jt=5)}function Fy(s,r){do{var o=e2(s.alternate,s);if(o!==null){o.flags&=32767,ot=o;return}if(o=s.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(s=s.sibling,s!==null)){ot=s;return}ot=s=o}while(s!==null);Jt=6,ot=null}function $y(s,r,o,c,m,_,w,T,W){s.cancelPendingCommit=null;do Wh();while(bi!==0);if((vt&6)!==0)throw Error(n(327));if(r!==null){if(r===s.current)throw Error(n(177));if(_=r.lanes|r.childLanes,_|=Qf,ze(s,o,_,w,T,W),s===Ot&&(ot=Ot=null,ct=0),kl=r,Ca=s,Nn=o,a_=_,o_=m,Ly=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,d2(Ms,function(){return Yy(),null})):(s.callbackNode=null,s.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=M.T,M.T=null,m=A.p,A.p=2,w=vt,vt|=4;try{t2(s,r,o)}finally{vt=w,A.p=m,M.T=c}}bi=1,Wy(),jy(),Vy()}}function Wy(){if(bi===1){bi=0;var s=Ca,r=kl,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=M.T,M.T=null;var c=A.p;A.p=2;var m=vt;vt|=4;try{Cy(r,s);var _=w_,w=Mv(s.containerInfo),T=_.focusedElem,W=_.selectionRange;if(w!==T&&T&&T.ownerDocument&&Rv(T.ownerDocument.documentElement,T)){if(W!==null&&Yf(T)){var Q=W.start,ne=W.end;if(ne===void 0&&(ne=Q),"selectionStart"in T)T.selectionStart=Q,T.selectionEnd=Math.min(ne,T.value.length);else{var le=T.ownerDocument||document,te=le&&le.defaultView||window;if(te.getSelection){var se=te.getSelection(),Ee=T.textContent.length,Ue=Math.min(W.start,Ee),Rt=W.end===void 0?Ue:Math.min(W.end,Ee);!se.extend&&Ue>Rt&&(w=Rt,Rt=Ue,Ue=w);var K=co(T,Ue),V=co(T,Rt);if(K&&V&&(se.rangeCount!==1||se.anchorNode!==K.node||se.anchorOffset!==K.offset||se.focusNode!==V.node||se.focusOffset!==V.offset)){var Z=le.createRange();Z.setStart(K.node,K.offset),se.removeAllRanges(),Ue>Rt?(se.addRange(Z),se.extend(V.node,V.offset)):(Z.setEnd(V.node,V.offset),se.addRange(Z))}}}}for(le=[],se=T;se=se.parentNode;)se.nodeType===1&&le.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var ae=le[T];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}td=!!b_,w_=b_=null}finally{vt=m,A.p=c,M.T=o}}s.current=r,bi=2}}function jy(){if(bi===2){bi=0;var s=Ca,r=kl,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=M.T,M.T=null;var c=A.p;A.p=2;var m=vt;vt|=4;try{vy(s,r.alternate,r)}finally{vt=m,A.p=c,M.T=o}}bi=3}}function Vy(){if(bi===4||bi===3){bi=0,Ne();var s=Ca,r=kl,o=Nn,c=Ly;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?bi=5:(bi=0,kl=Ca=null,qy(s,s.pendingLanes));var m=s.pendingLanes;if(m===0&&(wa=null),Se(o),r=r.stateNode,ri&&typeof ri.onCommitFiberRoot=="function")try{ri.onCommitFiberRoot(Xs,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=M.T,m=A.p,A.p=2,M.T=null;try{for(var _=s.onRecoverableError,w=0;w<c.length;w++){var T=c[w];_(T.value,{componentStack:T.stack})}}finally{M.T=r,A.p=m}}(Nn&3)!==0&&Wh(),Jr(s),m=s.pendingLanes,(o&261930)!==0&&(m&42)!==0?s===l_?$c++:($c=0,l_=s):$c=0,Wc(0)}}function qy(s,r){(s.pooledCacheLanes&=r)===0&&(r=s.pooledCache,r!=null&&(s.pooledCache=null,Cc(r)))}function Wh(){return Wy(),jy(),Vy(),Yy()}function Yy(){if(bi!==5)return!1;var s=Ca,r=a_;a_=0;var o=Se(Nn),c=M.T,m=A.p;try{A.p=32>o?32:o,M.T=null,o=o_,o_=null;var _=Ca,w=Nn;if(bi=0,kl=Ca=null,Nn=0,(vt&6)!==0)throw Error(n(331));var T=vt;if(vt|=4,Ry(_.current),ky(_,_.current,w,o),vt=T,Wc(0,!1),ri&&typeof ri.onPostCommitFiberRoot=="function")try{ri.onPostCommitFiberRoot(Xs,_)}catch{}return!0}finally{A.p=m,M.T=c,qy(s,r)}}function Ky(s,r,o){r=hr(o,r),r=Um(s.stateNode,r,2),s=pa(s,r,2),s!==null&&(Ut(s,2),Jr(s))}function Ct(s,r,o){if(s.tag===3)Ky(s,s,o);else for(;r!==null;){if(r.tag===3){Ky(r,s,o);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(wa===null||!wa.has(c))){s=hr(o,s),o=G0(2),c=pa(r,o,2),c!==null&&(X0(o,c,r,s),Ut(c,2),Jr(c));break}}r=r.return}}function h_(s,r,o){var c=s.pingCache;if(c===null){c=s.pingCache=new r2;var m=new Set;c.set(r,m)}else m=c.get(r),m===void 0&&(m=new Set,c.set(r,m));m.has(o)||(s_=!0,m.add(o),s=c2.bind(null,s,r,o),r.then(s,s))}function c2(s,r,o){var c=s.pingCache;c!==null&&c.delete(r),s.pingedLanes|=s.suspendedLanes&o,s.warmLanes&=~o,Ot===s&&(ct&o)===o&&(Jt===4||Jt===3&&(ct&62914560)===ct&&300>Qe()-zh?(vt&2)===0&&El(s,0):r_|=o,xl===ct&&(xl=0)),Jr(s)}function Gy(s,r){r===0&&(r=Qi()),s=fo(s,r),s!==null&&(Ut(s,r),Jr(s))}function u2(s){var r=s.memoizedState,o=0;r!==null&&(o=r.retryLane),Gy(s,o)}function h2(s,r){var o=0;switch(s.tag){case 31:case 13:var c=s.stateNode,m=s.memoizedState;m!==null&&(o=m.retryLane);break;case 19:c=s.stateNode;break;case 22:c=s.stateNode._retryCache;break;default:throw Error(n(314))}c!==null&&c.delete(r),Gy(s,o)}function d2(s,r){return ke(s,r)}var jh=null,Rl=null,d_=!1,Vh=!1,f_=!1,ka=0;function Jr(s){s!==Rl&&s.next===null&&(Rl===null?jh=Rl=s:Rl=Rl.next=s),Vh=!0,d_||(d_=!0,m2())}function Wc(s,r){if(!f_&&Vh){f_=!0;do for(var o=!1,c=jh;c!==null;){if(s!==0){var m=c.pendingLanes;if(m===0)var _=0;else{var w=c.suspendedLanes,T=c.pingedLanes;_=(1<<31-At(42|s)+1)-1,_&=m&~(w&~T),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(o=!0,Jy(c,_))}else _=ct,_=As(c,c===Ot?_:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(_&3)===0||Mr(c,_)||(o=!0,Jy(c,_));c=c.next}while(o);f_=!1}}function f2(){Xy()}function Xy(){Vh=d_=!1;var s=0;ka!==0&&x2()&&(s=ka);for(var r=Qe(),o=null,c=jh;c!==null;){var m=c.next,_=Zy(c,r);_===0?(c.next=null,o===null?jh=m:o.next=m,m===null&&(Rl=o)):(o=c,(s!==0||(_&3)!==0)&&(Vh=!0)),c=m}bi!==0&&bi!==5||Wc(s),ka!==0&&(ka=0)}function Zy(s,r){for(var o=s.suspendedLanes,c=s.pingedLanes,m=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var w=31-At(_),T=1<<w,W=m[w];W===-1?((T&o)===0||(T&c)!==0)&&(m[w]=ea(T,r)):W<=r&&(s.expiredLanes|=T),_&=~T}if(r=Ot,o=ct,o=As(s,s===r?o:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),c=s.callbackNode,o===0||s===r&&(wt===2||wt===9)||s.cancelPendingCommit!==null)return c!==null&&c!==null&&pe(c),s.callbackNode=null,s.callbackPriority=0;if((o&3)===0||Mr(s,o)){if(r=o&-o,r===s.callbackPriority)return r;switch(c!==null&&pe(c),Se(o)){case 2:case 8:o=je;break;case 32:o=Ms;break;case 268435456:o=Qn;break;default:o=Ms}return c=Qy.bind(null,s),o=ke(o,c),s.callbackPriority=r,s.callbackNode=o,r}return c!==null&&c!==null&&pe(c),s.callbackPriority=2,s.callbackNode=null,2}function Qy(s,r){if(bi!==0&&bi!==5)return s.callbackNode=null,s.callbackPriority=0,null;var o=s.callbackNode;if(Wh()&&s.callbackNode!==o)return null;var c=ct;return c=As(s,s===Ot?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),c===0?null:(Oy(s,c,r),Zy(s,Qe()),s.callbackNode!=null&&s.callbackNode===o?Qy.bind(null,s):null)}function Jy(s,r){if(Wh())return null;Oy(s,r,!0)}function m2(){E2(function(){(vt&6)!==0?ke(xt,f2):Xy()})}function m_(){if(ka===0){var s=fl;s===0&&(s=Qs,Qs<<=1,(Qs&261888)===0&&(Qs=256)),ka=s}return ka}function eS(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Or(""+s)}function tS(s,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,s.id&&o.setAttribute("form",s.id),r.parentNode.insertBefore(o,r),s=new FormData(s),o.parentNode.removeChild(o),s}function _2(s,r,o,c,m){if(r==="submit"&&o&&o.stateNode===m){var _=eS((m[He]||null).action),w=c.submitter;w&&(r=(r=w[He]||null)?eS(r.formAction):w.getAttribute("formAction"),r!==null&&(_=r,w=null));var T=new eo("action","action",null,c,m);s.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ka!==0){var W=w?tS(m,w):new FormData(m);Bm(o,{pending:!0,data:W,method:m.method,action:_},null,W)}}else typeof _=="function"&&(T.preventDefault(),W=w?tS(m,w):new FormData(m),Bm(o,{pending:!0,data:W,method:m.method,action:_},_,W))},currentTarget:m}]})}}for(var __=0;__<Zf.length;__++){var p_=Zf[__],p2=p_.toLowerCase(),g2=p_[0].toUpperCase()+p_.slice(1);zr(p2,"on"+g2)}zr(Dv,"onAnimationEnd"),zr(Ov,"onAnimationIteration"),zr(Bv,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(O5,"onTransitionRun"),zr(B5,"onTransitionStart"),zr(N5,"onTransitionCancel"),zr(Nv,"onTransitionEnd"),sr("onMouseEnter",["mouseout","mouseover"]),sr("onMouseLeave",["mouseout","mouseover"]),sr("onPointerEnter",["pointerout","pointerover"]),sr("onPointerLeave",["pointerout","pointerover"]),_s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_s("onBeforeInput",["compositionend","keypress","textInput","paste"]),_s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jc="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(" "),v2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jc));function iS(s,r){r=(r&4)!==0;for(var o=0;o<s.length;o++){var c=s[o],m=c.event;c=c.listeners;e:{var _=void 0;if(r)for(var w=c.length-1;0<=w;w--){var T=c[w],W=T.instance,Q=T.currentTarget;if(T=T.listener,W!==_&&m.isPropagationStopped())break e;_=T,m.currentTarget=Q;try{_(m)}catch(ne){ah(ne)}m.currentTarget=null,_=W}else for(w=0;w<c.length;w++){if(T=c[w],W=T.instance,Q=T.currentTarget,T=T.listener,W!==_&&m.isPropagationStopped())break e;_=T,m.currentTarget=Q;try{_(m)}catch(ne){ah(ne)}m.currentTarget=null,_=W}}}}function lt(s,r){var o=r[Bt];o===void 0&&(o=r[Bt]=new Set);var c=s+"__bubble";o.has(c)||(sS(r,s,2,!1),o.add(c))}function g_(s,r,o){var c=0;r&&(c|=4),sS(o,s,c,r)}var qh="_reactListening"+Math.random().toString(36).slice(2);function v_(s){if(!s[qh]){s[qh]=!0,mn.forEach(function(o){o!=="selectionchange"&&(v2.has(o)||g_(o,!1,s),g_(o,!0,s))});var r=s.nodeType===9?s:s.ownerDocument;r===null||r[qh]||(r[qh]=!0,g_("selectionchange",!1,r))}}function sS(s,r,o,c){switch(DS(r)){case 2:var m=q2;break;case 8:m=Y2;break;default:m=O_}o=m.bind(null,r,o,s),m=void 0,!Qo||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(m=!0),c?m!==void 0?s.addEventListener(r,o,{capture:!0,passive:m}):s.addEventListener(r,o,!0):m!==void 0?s.addEventListener(r,o,{passive:m}):s.addEventListener(r,o,!1)}function y_(s,r,o,c,m){var _=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var T=c.stateNode.containerInfo;if(T===m)break;if(w===4)for(w=c.return;w!==null;){var W=w.tag;if((W===3||W===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;T!==null;){if(w=ci(T),w===null)return;if(W=w.tag,W===5||W===6||W===26||W===27){c=_=w;continue e}T=T.parentNode}}c=c.return}ar(function(){var Q=_,ne=qr(o),le=[];e:{var te=Pv.get(s);if(te!==void 0){var se=eo,Ee=s;switch(s){case"keypress":if(Ja(o)===0)break e;case"keydown":case"keyup":se=th;break;case"focusin":Ee="focus",se=so;break;case"focusout":Ee="blur",se=so;break;case"beforeblur":case"afterblur":se=so;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=yt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=mc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=jf;break;case Dv:case Ov:case Bv:se=oa;break;case Nv:se=Vf;break;case"scroll":case"scrollend":se=Hf;break;case"wheel":se=ee;break;case"copy":case"cut":case"paste":se=pc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=no;break;case"toggle":case"beforetoggle":se=me}var Ue=(r&4)!==0,Rt=!Ue&&(s==="scroll"||s==="scrollend"),K=Ue?te!==null?te+"Capture":null:te;Ue=[];for(var V=Q,Z;V!==null;){var ae=V;if(Z=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||Z===null||K===null||(ae=Os(V,K),ae!=null&&Ue.push(Vc(V,ae,Z))),Rt)break;V=V.return}0<Ue.length&&(te=new se(te,Ee,null,o,ne),le.push({event:te,listeners:Ue}))}}if((r&7)===0){e:{if(te=s==="mouseover"||s==="pointerover",se=s==="mouseout"||s==="pointerout",te&&o!==na&&(Ee=o.relatedTarget||o.fromElement)&&(ci(Ee)||Ee[Ft]))break e;if((se||te)&&(te=ne.window===ne?ne:(te=ne.ownerDocument)?te.defaultView||te.parentWindow:window,se?(Ee=o.relatedTarget||o.toElement,se=Q,Ee=Ee?ci(Ee):null,Ee!==null&&(Rt=l(Ee),Ue=Ee.tag,Ee!==Rt||Ue!==5&&Ue!==27&&Ue!==6)&&(Ee=null)):(se=null,Ee=Q),se!==Ee)){if(Ue=yt,ae="onMouseLeave",K="onMouseEnter",V="mouse",(s==="pointerout"||s==="pointerover")&&(Ue=no,ae="onPointerLeave",K="onPointerEnter",V="pointer"),Rt=se==null?te:ui(se),Z=Ee==null?te:ui(Ee),te=new Ue(ae,V+"leave",se,o,ne),te.target=Rt,te.relatedTarget=Z,ae=null,ci(ne)===Q&&(Ue=new Ue(K,V+"enter",Ee,o,ne),Ue.target=Z,Ue.relatedTarget=Rt,ae=Ue),Rt=ae,se&&Ee)t:{for(Ue=y2,K=se,V=Ee,Z=0,ae=K;ae;ae=Ue(ae))Z++;ae=0;for(var Ie=V;Ie;Ie=Ue(Ie))ae++;for(;0<Z-ae;)K=Ue(K),Z--;for(;0<ae-Z;)V=Ue(V),ae--;for(;Z--;){if(K===V||V!==null&&K===V.alternate){Ue=K;break t}K=Ue(K),V=Ue(V)}Ue=null}else Ue=null;se!==null&&rS(le,te,se,Ue,!1),Ee!==null&&Rt!==null&&rS(le,Rt,Ee,Ue,!0)}}e:{if(te=Q?ui(Q):window,se=te.nodeName&&te.nodeName.toLowerCase(),se==="select"||se==="input"&&te.type==="file")var pt=rh;else if(lr(te))if(ao)pt=Ns;else{pt=bt;var De=nh}else se=te.nodeName,!se||se.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?Q&&uc(Q.elementType)&&(pt=rh):pt=ps;if(pt&&(pt=pt(s,Q))){Kr(le,pt,o,ne);break e}De&&De(s,te,Q),s==="focusout"&&Q&&te.type==="number"&&Q.memoizedProps.value!=null&&sa(te,"number",te.value)}switch(De=Q?ui(Q):window,s){case"focusin":(lr(De)||De.contentEditable==="true")&&(nl=De,Kf=Q,Sc=null);break;case"focusout":Sc=Kf=nl=null;break;case"mousedown":Gf=!0;break;case"contextmenu":case"mouseup":case"dragend":Gf=!1,Av(le,o,ne);break;case"selectionchange":if(D5)break;case"keydown":case"keyup":Av(le,o,ne)}var et;if(Ae)e:{switch(s){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else os?Nr(s,o)&&(ut="onCompositionEnd"):s==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(Xt&&o.locale!=="ko"&&(os||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&os&&(et=hc()):(Br=ne,Jo="value"in Br?Br.value:Br.textContent,os=!0)),De=Yh(Q,ut),0<De.length&&(ut=new il(ut,s,null,o,ne),le.push({event:ut,listeners:De}),et?ut.data=et:(et=as(o),et!==null&&(ut.data=et)))),(et=Je?Sn(s,o):Zt(s,o))&&(ut=Yh(Q,"onBeforeInput"),0<ut.length&&(De=new il("onBeforeInput","beforeinput",null,o,ne),le.push({event:De,listeners:ut}),De.data=et)),_2(le,s,Q,o,ne)}iS(le,r)})}function Vc(s,r,o){return{instance:s,listener:r,currentTarget:o}}function Yh(s,r){for(var o=r+"Capture",c=[];s!==null;){var m=s,_=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||_===null||(m=Os(s,o),m!=null&&c.unshift(Vc(s,m,_)),m=Os(s,r),m!=null&&c.push(Vc(s,m,_))),s.tag===3)return c;s=s.return}return[]}function y2(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function rS(s,r,o,c,m){for(var _=r._reactName,w=[];o!==null&&o!==c;){var T=o,W=T.alternate,Q=T.stateNode;if(T=T.tag,W!==null&&W===c)break;T!==5&&T!==26&&T!==27||Q===null||(W=Q,m?(Q=Os(o,_),Q!=null&&w.unshift(Vc(o,Q,W))):m||(Q=Os(o,_),Q!=null&&w.push(Vc(o,Q,W)))),o=o.return}w.length!==0&&s.push({event:r,listeners:w})}var S2=/\r\n?/g,b2=/\u0000|\uFFFD/g;function nS(s){return(typeof s=="string"?s:""+s).replace(S2,`
9
+ `).replace(b2,"")}function aS(s,r){return r=nS(r),nS(s)===r}function Tt(s,r,o,c,m,_){switch(o){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ra(s,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ra(s,""+c);break;case"className":_n(s,"class",c);break;case"tabIndex":_n(s,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":_n(s,o,c);break;case"style":cc(s,c,_);break;case"data":if(r!=="object"){_n(s,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||o!=="href")){s.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){s.removeAttribute(o);break}c=Or(""+c),s.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){s.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(o==="formAction"?(r!=="input"&&Tt(s,r,"name",m.name,m,null),Tt(s,r,"formEncType",m.formEncType,m,null),Tt(s,r,"formMethod",m.formMethod,m,null),Tt(s,r,"formTarget",m.formTarget,m,null)):(Tt(s,r,"encType",m.encType,m,null),Tt(s,r,"method",m.method,m,null),Tt(s,r,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){s.removeAttribute(o);break}c=Or(""+c),s.setAttribute(o,c);break;case"onClick":c!=null&&(s.onclick=Ri);break;case"onScroll":c!=null&&lt("scroll",s);break;case"onScrollEnd":c!=null&&lt("scrollend",s);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(n(61));if(o=c.__html,o!=null){if(m.children!=null)throw Error(n(60));s.innerHTML=o}}break;case"multiple":s.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":s.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){s.removeAttribute("xlink:href");break}o=Or(""+c),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?s.setAttribute(o,""+c):s.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?s.setAttribute(o,""):s.removeAttribute(o);break;case"capture":case"download":c===!0?s.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?s.setAttribute(o,c):s.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?s.setAttribute(o,c):s.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?s.removeAttribute(o):s.setAttribute(o,c);break;case"popover":lt("beforetoggle",s),lt("toggle",s),Vr(s,"popover",c);break;case"xlinkActuate":rr(s,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":rr(s,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":rr(s,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":rr(s,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":rr(s,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":rr(s,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":rr(s,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":rr(s,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":rr(s,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Vr(s,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Qu.get(o)||o,Vr(s,o,c))}}function S_(s,r,o,c,m,_){switch(o){case"style":cc(s,c,_);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(n(61));if(o=c.__html,o!=null){if(m.children!=null)throw Error(n(60));s.innerHTML=o}}break;case"children":typeof c=="string"?ra(s,c):(typeof c=="number"||typeof c=="bigint")&&ra(s,""+c);break;case"onScroll":c!=null&&lt("scroll",s);break;case"onScrollEnd":c!=null&&lt("scrollend",s);break;case"onClick":c!=null&&(s.onclick=Ri);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xu.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(m=o.endsWith("Capture"),r=o.slice(2,m?o.length-7:void 0),_=s[He]||null,_=_!=null?_[o]:null,typeof _=="function"&&s.removeEventListener(r,_,m),typeof c=="function")){typeof _!="function"&&_!==null&&(o in s?s[o]=null:s.hasAttribute(o)&&s.removeAttribute(o)),s.addEventListener(r,c,m);break e}o in s?s[o]=c:c===!0?s.setAttribute(o,""):Vr(s,o,c)}}}function Gi(s,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",s),lt("load",s);var c=!1,m=!1,_;for(_ in o)if(o.hasOwnProperty(_)){var w=o[_];if(w!=null)switch(_){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Tt(s,r,_,w,o,null)}}m&&Tt(s,r,"srcSet",o.srcSet,o,null),c&&Tt(s,r,"src",o.src,o,null);return;case"input":lt("invalid",s);var T=_=w=m=null,W=null,Q=null;for(c in o)if(o.hasOwnProperty(c)){var ne=o[c];if(ne!=null)switch(c){case"name":m=ne;break;case"type":w=ne;break;case"checked":W=ne;break;case"defaultChecked":Q=ne;break;case"value":_=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,r));break;default:Tt(s,r,c,ne,o,null)}}Xo(s,_,T,W,Q,w,m,!1);return;case"select":lt("invalid",s),c=w=_=null;for(m in o)if(o.hasOwnProperty(m)&&(T=o[m],T!=null))switch(m){case"value":_=T;break;case"defaultValue":w=T;break;case"multiple":c=T;default:Tt(s,r,m,T,o,null)}r=_,o=w,s.multiple=!!c,r!=null?pn(s,!!c,r,!1):o!=null&&pn(s,!!c,o,!0);return;case"textarea":lt("invalid",s),_=m=c=null;for(w in o)if(o.hasOwnProperty(w)&&(T=o[w],T!=null))switch(w){case"value":c=T;break;case"defaultValue":m=T;break;case"children":_=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(n(91));break;default:Tt(s,r,w,T,o,null)}Ti(s,c,m,_);return;case"option":for(W in o)o.hasOwnProperty(W)&&(c=o[W],c!=null)&&(W==="selected"?s.selected=c&&typeof c!="function"&&typeof c!="symbol":Tt(s,r,W,c,o,null));return;case"dialog":lt("beforetoggle",s),lt("toggle",s),lt("cancel",s),lt("close",s);break;case"iframe":case"object":lt("load",s);break;case"video":case"audio":for(c=0;c<jc.length;c++)lt(jc[c],s);break;case"image":lt("error",s),lt("load",s);break;case"details":lt("toggle",s);break;case"embed":case"source":case"link":lt("error",s),lt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in o)if(o.hasOwnProperty(Q)&&(c=o[Q],c!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Tt(s,r,Q,c,o,null)}return;default:if(uc(r)){for(ne in o)o.hasOwnProperty(ne)&&(c=o[ne],c!==void 0&&S_(s,r,ne,c,o,void 0));return}}for(T in o)o.hasOwnProperty(T)&&(c=o[T],c!=null&&Tt(s,r,T,c,o,null))}function w2(s,r,o,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,_=null,w=null,T=null,W=null,Q=null,ne=null;for(se in o){var le=o[se];if(o.hasOwnProperty(se)&&le!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":W=le;default:c.hasOwnProperty(se)||Tt(s,r,se,null,c,le)}}for(var te in c){var se=c[te];if(le=o[te],c.hasOwnProperty(te)&&(se!=null||le!=null))switch(te){case"type":_=se;break;case"name":m=se;break;case"checked":Q=se;break;case"defaultChecked":ne=se;break;case"value":w=se;break;case"defaultValue":T=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(n(137,r));break;default:se!==le&&Tt(s,r,te,se,c,le)}}jt(s,w,T,W,Q,ne,_,m);return;case"select":se=w=T=te=null;for(_ in o)if(W=o[_],o.hasOwnProperty(_)&&W!=null)switch(_){case"value":break;case"multiple":se=W;default:c.hasOwnProperty(_)||Tt(s,r,_,null,c,W)}for(m in c)if(_=c[m],W=o[m],c.hasOwnProperty(m)&&(_!=null||W!=null))switch(m){case"value":te=_;break;case"defaultValue":T=_;break;case"multiple":w=_;default:_!==W&&Tt(s,r,m,_,c,W)}r=T,o=w,c=se,te!=null?pn(s,!!o,te,!1):!!c!=!!o&&(r!=null?pn(s,!!o,r,!0):pn(s,!!o,o?[]:"",!1));return;case"textarea":se=te=null;for(T in o)if(m=o[T],o.hasOwnProperty(T)&&m!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Tt(s,r,T,null,c,m)}for(w in c)if(m=c[w],_=o[w],c.hasOwnProperty(w)&&(m!=null||_!=null))switch(w){case"value":te=m;break;case"defaultValue":se=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(n(91));break;default:m!==_&&Tt(s,r,w,m,c,_)}Zo(s,te,se);return;case"option":for(var Ee in o)te=o[Ee],o.hasOwnProperty(Ee)&&te!=null&&!c.hasOwnProperty(Ee)&&(Ee==="selected"?s.selected=!1:Tt(s,r,Ee,null,c,te));for(W in c)te=c[W],se=o[W],c.hasOwnProperty(W)&&te!==se&&(te!=null||se!=null)&&(W==="selected"?s.selected=te&&typeof te!="function"&&typeof te!="symbol":Tt(s,r,W,te,c,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ue in o)te=o[Ue],o.hasOwnProperty(Ue)&&te!=null&&!c.hasOwnProperty(Ue)&&Tt(s,r,Ue,null,c,te);for(Q in c)if(te=c[Q],se=o[Q],c.hasOwnProperty(Q)&&te!==se&&(te!=null||se!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(n(137,r));break;default:Tt(s,r,Q,te,c,se)}return;default:if(uc(r)){for(var Rt in o)te=o[Rt],o.hasOwnProperty(Rt)&&te!==void 0&&!c.hasOwnProperty(Rt)&&S_(s,r,Rt,void 0,c,te);for(ne in c)te=c[ne],se=o[ne],!c.hasOwnProperty(ne)||te===se||te===void 0&&se===void 0||S_(s,r,ne,te,c,se);return}}for(var K in o)te=o[K],o.hasOwnProperty(K)&&te!=null&&!c.hasOwnProperty(K)&&Tt(s,r,K,null,c,te);for(le in c)te=c[le],se=o[le],!c.hasOwnProperty(le)||te===se||te==null&&se==null||Tt(s,r,le,te,c,se)}function oS(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function C2(){if(typeof performance.getEntriesByType=="function"){for(var s=0,r=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var m=o[c],_=m.transferSize,w=m.initiatorType,T=m.duration;if(_&&T&&oS(w)){for(w=0,T=m.responseEnd,c+=1;c<o.length;c++){var W=o[c],Q=W.startTime;if(Q>T)break;var ne=W.transferSize,le=W.initiatorType;ne&&oS(le)&&(W=W.responseEnd,w+=ne*(W<T?1:(T-Q)/(W-Q)))}if(--c,r+=8*(_+w)/(m.duration/1e3),s++,10<s)break}}if(0<s)return r/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var b_=null,w_=null;function Kh(s){return s.nodeType===9?s:s.ownerDocument}function lS(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cS(s,r){if(s===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&r==="foreignObject"?0:s}function C_(s,r){return s==="textarea"||s==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var x_=null;function x2(){var s=window.event;return s&&s.type==="popstate"?s===x_?!1:(x_=s,!0):(x_=null,!1)}var uS=typeof setTimeout=="function"?setTimeout:void 0,k2=typeof clearTimeout=="function"?clearTimeout:void 0,hS=typeof Promise=="function"?Promise:void 0,E2=typeof queueMicrotask=="function"?queueMicrotask:typeof hS<"u"?function(s){return hS.resolve(null).then(s).catch(T2)}:uS;function T2(s){setTimeout(function(){throw s})}function Ea(s){return s==="head"}function dS(s,r){var o=r,c=0;do{var m=o.nextSibling;if(s.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(c===0){s.removeChild(m),Dl(r);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")qc(s.ownerDocument.documentElement);else if(o==="head"){o=s.ownerDocument.head,qc(o);for(var _=o.firstChild;_;){var w=_.nextSibling,T=_.nodeName;_[Ls]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&_.rel.toLowerCase()==="stylesheet"||o.removeChild(_),_=w}}else o==="body"&&qc(s.ownerDocument.body);o=m}while(o);Dl(r)}function fS(s,r){var o=s;s=0;do{var c=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(s===0)break;s--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||s++;o=c}while(o)}function k_(s){var r=s.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":k_(o),Lr(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}s.removeChild(o)}}function R2(s,r,o,c){for(;s.nodeType===1;){var m=o;if(s.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(c){if(!s[Ls])switch(r){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==m.rel||s.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||s.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||s.getAttribute("title")!==(m.title==null?null:m.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(m.src==null?null:m.src)||s.getAttribute("type")!==(m.type==null?null:m.type)||s.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(r==="input"&&s.type==="hidden"){var _=m.name==null?null:""+m.name;if(m.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=pr(s.nextSibling),s===null)break}return null}function M2(s,r,o){if(r==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=pr(s.nextSibling),s===null))return null;return s}function mS(s,r){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!r||(s=pr(s.nextSibling),s===null))return null;return s}function E_(s){return s.data==="$?"||s.data==="$~"}function T_(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function A2(s,r){var o=s.ownerDocument;if(s.data==="$~")s._reactRetry=r;else if(s.data!=="$?"||o.readyState!=="loading")r();else{var c=function(){r(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),s._reactRetry=c}}function pr(s){for(;s!=null;s=s.nextSibling){var r=s.nodeType;if(r===1||r===3)break;if(r===8){if(r=s.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return s}var R_=null;function _S(s){s=s.nextSibling;for(var r=0;s;){if(s.nodeType===8){var o=s.data;if(o==="/$"||o==="/&"){if(r===0)return pr(s.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}s=s.nextSibling}return null}function pS(s){s=s.previousSibling;for(var r=0;s;){if(s.nodeType===8){var o=s.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return s;r--}else o!=="/$"&&o!=="/&"||r++}s=s.previousSibling}return null}function gS(s,r,o){switch(r=Kh(o),s){case"html":if(s=r.documentElement,!s)throw Error(n(452));return s;case"head":if(s=r.head,!s)throw Error(n(453));return s;case"body":if(s=r.body,!s)throw Error(n(454));return s;default:throw Error(n(451))}}function qc(s){for(var r=s.attributes;r.length;)s.removeAttributeNode(r[0]);Lr(s)}var gr=new Map,vS=new Set;function Gh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Pn=A.d;A.d={f:L2,r:D2,D:O2,C:B2,L:N2,m:P2,X:I2,S:z2,M:H2};function L2(){var s=Pn.f(),r=Uh();return s||r}function D2(s){var r=ms(s);r!==null&&r.tag===5&&r.type==="form"?N0(r):Pn.r(s)}var Ml=typeof document>"u"?null:document;function yS(s,r,o){var c=Ml;if(c&&typeof r=="string"&&r){var m=Vi(r);m='link[rel="'+s+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),vS.has(m)||(vS.add(m),s={rel:s,crossOrigin:o,href:r},c.querySelector(m)===null&&(r=c.createElement("link"),Gi(r,"link",s),be(r),c.head.appendChild(r)))}}function O2(s){Pn.D(s),yS("dns-prefetch",s,null)}function B2(s,r){Pn.C(s,r),yS("preconnect",s,r)}function N2(s,r,o){Pn.L(s,r,o);var c=Ml;if(c&&s&&r){var m='link[rel="preload"][as="'+Vi(r)+'"]';r==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+Vi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+Vi(o.imageSizes)+'"]')):m+='[href="'+Vi(s)+'"]';var _=m;switch(r){case"style":_=Al(s);break;case"script":_=Ll(s)}gr.has(_)||(s=v({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:s,as:r},o),gr.set(_,s),c.querySelector(m)!==null||r==="style"&&c.querySelector(Yc(_))||r==="script"&&c.querySelector(Kc(_))||(r=c.createElement("link"),Gi(r,"link",s),be(r),c.head.appendChild(r)))}}function P2(s,r){Pn.m(s,r);var o=Ml;if(o&&s){var c=r&&typeof r.as=="string"?r.as:"script",m='link[rel="modulepreload"][as="'+Vi(c)+'"][href="'+Vi(s)+'"]',_=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Ll(s)}if(!gr.has(_)&&(s=v({rel:"modulepreload",href:s},r),gr.set(_,s),o.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Kc(_)))return}c=o.createElement("link"),Gi(c,"link",s),be(c),o.head.appendChild(c)}}}function z2(s,r,o){Pn.S(s,r,o);var c=Ml;if(c&&s){var m=Ei(c).hoistableStyles,_=Al(s);r=r||"default";var w=m.get(_);if(!w){var T={loading:0,preload:null};if(w=c.querySelector(Yc(_)))T.loading=5;else{s=v({rel:"stylesheet",href:s,"data-precedence":r},o),(o=gr.get(_))&&M_(s,o);var W=w=c.createElement("link");be(W),Gi(W,"link",s),W._p=new Promise(function(Q,ne){W.onload=Q,W.onerror=ne}),W.addEventListener("load",function(){T.loading|=1}),W.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Xh(w,r,c)}w={type:"stylesheet",instance:w,count:1,state:T},m.set(_,w)}}}function I2(s,r){Pn.X(s,r);var o=Ml;if(o&&s){var c=Ei(o).hoistableScripts,m=Ll(s),_=c.get(m);_||(_=o.querySelector(Kc(m)),_||(s=v({src:s,async:!0},r),(r=gr.get(m))&&A_(s,r),_=o.createElement("script"),be(_),Gi(_,"link",s),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},c.set(m,_))}}function H2(s,r){Pn.M(s,r);var o=Ml;if(o&&s){var c=Ei(o).hoistableScripts,m=Ll(s),_=c.get(m);_||(_=o.querySelector(Kc(m)),_||(s=v({src:s,async:!0,type:"module"},r),(r=gr.get(m))&&A_(s,r),_=o.createElement("script"),be(_),Gi(_,"link",s),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},c.set(m,_))}}function SS(s,r,o,c){var m=(m=he.current)?Gh(m):null;if(!m)throw Error(n(446));switch(s){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Al(o.href),o=Ei(m).hoistableStyles,c=o.get(r),c||(c={type:"style",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){s=Al(o.href);var _=Ei(m).hoistableStyles,w=_.get(s);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,w),(_=m.querySelector(Yc(s)))&&!_._p&&(w.instance=_,w.state.loading=5),gr.has(s)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},gr.set(s,o),_||U2(m,s,o,w.state))),r&&c===null)throw Error(n(528,""));return w}if(r&&c!==null)throw Error(n(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ll(o),o=Ei(m).hoistableScripts,c=o.get(r),c||(c={type:"script",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,s))}}function Al(s){return'href="'+Vi(s)+'"'}function Yc(s){return'link[rel="stylesheet"]['+s+"]"}function bS(s){return v({},s,{"data-precedence":s.precedence,precedence:null})}function U2(s,r,o,c){s.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=s.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Gi(r,"link",o),be(r),s.head.appendChild(r))}function Ll(s){return'[src="'+Vi(s)+'"]'}function Kc(s){return"script[async]"+s}function wS(s,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var c=s.querySelector('style[data-href~="'+Vi(o.href)+'"]');if(c)return r.instance=c,be(c),c;var m=v({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(s.ownerDocument||s).createElement("style"),be(c),Gi(c,"style",m),Xh(c,o.precedence,s),r.instance=c;case"stylesheet":m=Al(o.href);var _=s.querySelector(Yc(m));if(_)return r.state.loading|=4,r.instance=_,be(_),_;c=bS(o),(m=gr.get(m))&&M_(c,m),_=(s.ownerDocument||s).createElement("link"),be(_);var w=_;return w._p=new Promise(function(T,W){w.onload=T,w.onerror=W}),Gi(_,"link",c),r.state.loading|=4,Xh(_,o.precedence,s),r.instance=_;case"script":return _=Ll(o.src),(m=s.querySelector(Kc(_)))?(r.instance=m,be(m),m):(c=o,(m=gr.get(_))&&(c=v({},o),A_(c,m)),s=s.ownerDocument||s,m=s.createElement("script"),be(m),Gi(m,"link",c),s.head.appendChild(m),r.instance=m);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Xh(c,o.precedence,s));return r.instance}function Xh(s,r,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,_=m,w=0;w<c.length;w++){var T=c[w];if(T.dataset.precedence===r)_=T;else if(_!==m)break}_?_.parentNode.insertBefore(s,_.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(s,r.firstChild))}function M_(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.title==null&&(s.title=r.title)}function A_(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.integrity==null&&(s.integrity=r.integrity)}var Zh=null;function CS(s,r,o){if(Zh===null){var c=new Map,m=Zh=new Map;m.set(o,c)}else m=Zh,c=m.get(o),c||(c=new Map,m.set(o,c));if(c.has(s))return c;for(c.set(s,null),o=o.getElementsByTagName(s),m=0;m<o.length;m++){var _=o[m];if(!(_[Ls]||_[Te]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var w=_.getAttribute(r)||"";w=s+w;var T=c.get(w);T?T.push(_):c.set(w,[_])}}return c}function xS(s,r,o){s=s.ownerDocument||s,s.head.insertBefore(o,r==="title"?s.querySelector("head > title"):null)}function F2(s,r,o){if(o===1||r.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(s=r.disabled,typeof r.precedence=="string"&&s==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function kS(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function $2(s,r,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=Al(c.href),_=r.querySelector(Yc(m));if(_){r=_._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(s.count++,s=Qh.bind(s),r.then(s,s)),o.state.loading|=4,o.instance=_,be(_);return}_=r.ownerDocument||r,c=bS(c),(m=gr.get(m))&&M_(c,m),_=_.createElement("link"),be(_);var w=_;w._p=new Promise(function(T,W){w.onload=T,w.onerror=W}),Gi(_,"link",c),o.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(s.count++,o=Qh.bind(s),r.addEventListener("load",o),r.addEventListener("error",o))}}var L_=0;function W2(s,r){return s.stylesheets&&s.count===0&&ed(s,s.stylesheets),0<s.count||0<s.imgCount?function(o){var c=setTimeout(function(){if(s.stylesheets&&ed(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+r);0<s.imgBytes&&L_===0&&(L_=62500*C2());var m=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&ed(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>L_?50:800)+r);return s.unsuspend=o,function(){s.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Qh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ed(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Jh=null;function ed(s,r){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Jh=new Map,r.forEach(j2,s),Jh=null,Qh.call(s))}function j2(s,r){if(!(r.state.loading&4)){var o=Jh.get(s);if(o)var c=o.get(null);else{o=new Map,Jh.set(s,o);for(var m=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<m.length;_++){var w=m[_];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),c=w)}c&&o.set(null,c)}m=r.instance,w=m.getAttribute("data-precedence"),_=o.get(w)||c,_===c&&o.set(null,m),o.set(w,m),this.count++,c=Qh.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),_?_.parentNode.insertBefore(m,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(m,s.firstChild)),r.state.loading|=4}}var Gc={$$typeof:L,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function V2(s,r,o,c,m,_,w,T,W){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Js(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.hiddenUpdates=Js(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=_,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function ES(s,r,o,c,m,_,w,T,W,Q,ne,le){return s=new V2(s,r,o,w,W,Q,ne,le,T),r=1,_===!0&&(r|=24),_=Ps(3,null,null,r),s.current=_,_.stateNode=s,r=um(),r.refCount++,s.pooledCache=r,r.refCount++,_.memoizedState={element:c,isDehydrated:o,cache:r},mm(_),s}function TS(s){return s?(s=ll,s):ll}function RS(s,r,o,c,m,_){m=TS(m),c.context===null?c.context=m:c.pendingContext=m,c=_a(r),c.payload={element:o},_=_===void 0?null:_,_!==null&&(c.callback=_),o=pa(s,c,r),o!==null&&(bs(o,s,r),Tc(o,s,r))}function MS(s,r){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var o=s.retryLane;s.retryLane=o!==0&&o<r?o:r}}function D_(s,r){MS(s,r),(s=s.alternate)&&MS(s,r)}function AS(s){if(s.tag===13||s.tag===31){var r=fo(s,67108864);r!==null&&bs(r,s,67108864),D_(s,67108864)}}function LS(s){if(s.tag===13||s.tag===31){var r=Fs();r=ji(r);var o=fo(s,r);o!==null&&bs(o,s,r),D_(s,r)}}var td=!0;function q2(s,r,o,c){var m=M.T;M.T=null;var _=A.p;try{A.p=2,O_(s,r,o,c)}finally{A.p=_,M.T=m}}function Y2(s,r,o,c){var m=M.T;M.T=null;var _=A.p;try{A.p=8,O_(s,r,o,c)}finally{A.p=_,M.T=m}}function O_(s,r,o,c){if(td){var m=B_(c);if(m===null)y_(s,r,c,id,o),OS(s,c);else if(G2(m,s,r,o,c))c.stopPropagation();else if(OS(s,c),r&4&&-1<K2.indexOf(s)){for(;m!==null;){var _=ms(m);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var w=Wi(_.pendingLanes);if(w!==0){var T=_;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var W=1<<31-At(w);T.entanglements[1]|=W,w&=~W}Jr(_),(vt&6)===0&&(Ih=Qe()+500,Wc(0))}}break;case 31:case 13:T=fo(_,2),T!==null&&bs(T,_,2),Uh(),D_(_,2)}if(_=B_(c),_===null&&y_(s,r,c,id,o),_===m)break;m=_}m!==null&&c.stopPropagation()}else y_(s,r,c,null,o)}}function B_(s){return s=qr(s),N_(s)}var id=null;function N_(s){if(id=null,s=ci(s),s!==null){var r=l(s);if(r===null)s=null;else{var o=r.tag;if(o===13){if(s=u(r),s!==null)return s;s=null}else if(o===31){if(s=h(r),s!==null)return s;s=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;s=null}else r!==s&&(s=null)}}return id=s,null}function DS(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ye()){case xt:return 2;case je:return 8;case Ms:case rs:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var P_=!1,Ta=null,Ra=null,Ma=null,Xc=new Map,Zc=new Map,Aa=[],K2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function OS(s,r){switch(s){case"focusin":case"focusout":Ta=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":Xc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zc.delete(r.pointerId)}}function Qc(s,r,o,c,m,_){return s===null||s.nativeEvent!==_?(s={blockedOn:r,domEventName:o,eventSystemFlags:c,nativeEvent:_,targetContainers:[m]},r!==null&&(r=ms(r),r!==null&&AS(r)),s):(s.eventSystemFlags|=c,r=s.targetContainers,m!==null&&r.indexOf(m)===-1&&r.push(m),s)}function G2(s,r,o,c,m){switch(r){case"focusin":return Ta=Qc(Ta,s,r,o,c,m),!0;case"dragenter":return Ra=Qc(Ra,s,r,o,c,m),!0;case"mouseover":return Ma=Qc(Ma,s,r,o,c,m),!0;case"pointerover":var _=m.pointerId;return Xc.set(_,Qc(Xc.get(_)||null,s,r,o,c,m)),!0;case"gotpointercapture":return _=m.pointerId,Zc.set(_,Qc(Zc.get(_)||null,s,r,o,c,m)),!0}return!1}function BS(s){var r=ci(s.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=u(o),r!==null){s.blockedOn=r,Xe(s.priority,function(){LS(o)});return}}else if(r===31){if(r=h(o),r!==null){s.blockedOn=r,Xe(s.priority,function(){LS(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){s.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}s.blockedOn=null}function sd(s){if(s.blockedOn!==null)return!1;for(var r=s.targetContainers;0<r.length;){var o=B_(s.nativeEvent);if(o===null){o=s.nativeEvent;var c=new o.constructor(o.type,o);na=c,o.target.dispatchEvent(c),na=null}else return r=ms(o),r!==null&&AS(r),s.blockedOn=o,!1;r.shift()}return!0}function NS(s,r,o){sd(s)&&o.delete(r)}function X2(){P_=!1,Ta!==null&&sd(Ta)&&(Ta=null),Ra!==null&&sd(Ra)&&(Ra=null),Ma!==null&&sd(Ma)&&(Ma=null),Xc.forEach(NS),Zc.forEach(NS)}function rd(s,r){s.blockedOn===r&&(s.blockedOn=null,P_||(P_=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,X2)))}var nd=null;function PS(s){nd!==s&&(nd=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){nd===s&&(nd=null);for(var r=0;r<s.length;r+=3){var o=s[r],c=s[r+1],m=s[r+2];if(typeof c!="function"){if(N_(c||o)===null)continue;break}var _=ms(o);_!==null&&(s.splice(r,3),r-=3,Bm(_,{pending:!0,data:m,method:o.method,action:c},c,m))}}))}function Dl(s){function r(W){return rd(W,s)}Ta!==null&&rd(Ta,s),Ra!==null&&rd(Ra,s),Ma!==null&&rd(Ma,s),Xc.forEach(r),Zc.forEach(r);for(var o=0;o<Aa.length;o++){var c=Aa[o];c.blockedOn===s&&(c.blockedOn=null)}for(;0<Aa.length&&(o=Aa[0],o.blockedOn===null);)BS(o),o.blockedOn===null&&Aa.shift();if(o=(s.ownerDocument||s).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var m=o[c],_=o[c+1],w=m[He]||null;if(typeof _=="function")w||PS(o);else if(w){var T=null;if(_&&_.hasAttribute("formAction")){if(m=_,w=_[He]||null)T=w.formAction;else if(N_(m)!==null)continue}else T=w.action;typeof T=="function"?o[c+1]=T:(o.splice(c,3),c-=3),PS(o)}}}function zS(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function r(){m!==null&&(m(),m=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),m!==null&&(m(),m=null)}}}function z_(s){this._internalRoot=s}ad.prototype.render=z_.prototype.render=function(s){var r=this._internalRoot;if(r===null)throw Error(n(409));var o=r.current,c=Fs();RS(o,c,s,r,null,null)},ad.prototype.unmount=z_.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var r=s.containerInfo;RS(s.current,2,null,s,null,null),Uh(),r[Ft]=null}};function ad(s){this._internalRoot=s}ad.prototype.unstable_scheduleHydration=function(s){if(s){var r=ft();s={blockedOn:null,target:s,priority:r};for(var o=0;o<Aa.length&&r!==0&&r<Aa[o].priority;o++);Aa.splice(o,0,s),o===0&&BS(s)}};var IS=e.version;if(IS!=="19.2.3")throw Error(n(527,IS,"19.2.3"));A.findDOMNode=function(s){var r=s._reactInternals;if(r===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=d(r),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var Z2={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var od=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!od.isDisabled&&od.supportsFiber)try{Xs=od.inject(Z2),ri=od}catch{}}return eu.createRoot=function(s,r){if(!a(s))throw Error(n(299));var o=!1,c="",m=V0,_=q0,w=Y0;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(_=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=ES(s,1,!1,null,null,o,c,null,m,_,w,zS),s[Ft]=r.current,v_(s),new z_(r)},eu.hydrateRoot=function(s,r,o){if(!a(s))throw Error(n(299));var c=!1,m="",_=V0,w=q0,T=Y0,W=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(_=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(T=o.onRecoverableError),o.formState!==void 0&&(W=o.formState)),r=ES(s,1,!0,r,o??null,c,m,W,_,w,T,zS),r.context=TS(null),o=r.current,c=Fs(),c=ji(c),m=_a(c),m.callback=null,pa(o,m,c),o=c,r.current.lanes=o,Ut(r,o),Jr(r),s[Ft]=r.current,v_(s),new ad(r)},eu.version="19.2.3",eu}var KS;function ok(){if(KS)return H_.exports;KS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),H_.exports=ak(),H_.exports}var lk=ok();const Fp=new WeakMap,ck=new WeakMap,Kd={current:[]};let j_=!1,ku=0;const vu=new Set,ld=new Map;function kw(t){for(const e of t){if(Kd.current.includes(e))continue;Kd.current.push(e),e.recompute();const i=ck.get(e);if(i)for(const n of i){const a=Fp.get(n);a?.length&&kw(a)}}}function uk(t){const e={prevVal:t.prevState,currentVal:t.state};for(const i of t.listeners)i(e)}function hk(t){const e={prevVal:t.prevState,currentVal:t.state};for(const i of t.listeners)i(e)}function Ew(t){if(ku>0&&!ld.has(t)&&ld.set(t,t.prevState),vu.add(t),!(ku>0)&&!j_)try{for(j_=!0;vu.size>0;){const e=Array.from(vu);vu.clear();for(const i of e){const n=ld.get(i)??i.prevState;i.prevState=n,uk(i)}for(const i of e){const n=Fp.get(i);n&&(Kd.current.push(i),kw(n))}for(const i of e){const n=Fp.get(i);if(n)for(const a of n)hk(a)}}}finally{j_=!1,Kd.current=[],ld.clear()}}function Eu(t){ku++;try{t()}finally{if(ku--,ku===0){const e=vu.values().next().value;e&&Ew(e)}}}function dk(t){return typeof t=="function"}class fk{constructor(e,i){this.listeners=new Set,this.subscribe=n=>{var a,l;this.listeners.add(n);const u=(l=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:l.call(a,n,this);return()=>{this.listeners.delete(n),u?.()}},this.prevState=e,this.state=e,this.options=i}setState(e){var i,n,a;this.prevState=this.state,(i=this.options)!=null&&i.updateFn?this.state=this.options.updateFn(this.prevState)(e):dk(e)?this.state=e(this.prevState):this.state=e,(a=(n=this.options)==null?void 0:n.onUpdate)==null||a.call(n),Ew(this)}}const Ya="__TSR_index",GS="popstate",XS="beforeunload";function mk(t){let e=t.getLocation();const i=new Set,n=(u,h)=>{e=t.getLocation(),i.forEach(f=>f({location:e,action:u,navigateOpts:h}))},a=u=>{t.notifyOnIndexChange??!0?n(u):e=t.getLocation()},l=async({task:u,navigateOpts:h,...f})=>{if(h?.ignoreBlocker??!1)return u(),{type:"SUCCESS"};const p=t.getBlockers?.()??[],v=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const g of p){const y=Gd(f.path,f.state);if(await g.blockerFn({currentLocation:e,nextLocation:y,action:f.type}))return t.onBlocked?.(),{type:"BLOCKED"}}return u(),{type:"SUCCESS"}};return{get location(){return e},get length(){return t.getLength()},subscribers:i,subscribe:u=>(i.add(u),()=>{i.delete(u)}),push:(u,h,f)=>{const d=e.state[Ya];return h=ZS(d+1,h),l({task:()=>{t.pushState(u,h),n({type:"PUSH"},f)},navigateOpts:f,type:"PUSH",path:u,state:h})},replace:(u,h,f)=>{const d=e.state[Ya];return h=ZS(d,h),l({task:()=>{t.replaceState(u,h),n({type:"REPLACE"},f)},navigateOpts:f,type:"REPLACE",path:u,state:h})},go:(u,h)=>{l({task:()=>{t.go(u),a({type:"GO",index:u})},navigateOpts:h,type:"GO"})},back:u=>{l({task:()=>{t.back(u?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{t.forward(u?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>e.state[Ya]!==0,createHref:u=>t.createHref(u),block:u=>{if(!t.setBlockers)return()=>{};const h=t.getBlockers?.()??[];return t.setBlockers([...h,u]),()=>{const f=t.getBlockers?.()??[];t.setBlockers?.(f.filter(d=>d!==u))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:n}}function ZS(t,e){e||(e={});const i=Gg();return{...e,key:i,__TSR_key:i,[Ya]:t}}function _k(t){const e=typeof document<"u"?window:void 0,i=e.history.pushState,n=e.history.replaceState;let a=[];const l=()=>a,u=N=>a=N,h=(N=>N),f=(()=>Gd(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const N=Gg();e.history.replaceState({[Ya]:0,key:N,__TSR_key:N},"")}let d=f(),p,v=!1,g=!1,y=!1,b=!1;const C=()=>d;let x,k;const R=()=>{x&&(I._ignoreSubscribers=!0,(x.isPush?e.history.pushState:e.history.replaceState)(x.state,"",x.href),I._ignoreSubscribers=!1,x=void 0,k=void 0,p=void 0)},L=(N,F,J)=>{const G=h(F);k||(p=d),d=Gd(F,J),x={href:G,state:J,isPush:x?.isPush||N==="push"},k||(k=Promise.resolve().then(()=>R()))},E=N=>{d=f(),I.notify({type:N})},H=async()=>{if(g){g=!1;return}const N=f(),F=N.state[Ya]-d.state[Ya],J=F===1,G=F===-1,D=!J&&!G||v;v=!1;const O=D?"GO":G?"BACK":"FORWARD",P=D?{type:"GO",index:F}:{type:G?"BACK":"FORWARD"};if(y)y=!1;else{const $=l();if(typeof document<"u"&&$.length){for(const M of $)if(await M.blockerFn({currentLocation:d,nextLocation:N,action:O})){g=!0,e.history.go(1),I.notify(P);return}}}d=f(),I.notify(P)},U=N=>{if(b){b=!1;return}let F=!1;const J=l();if(typeof document<"u"&&J.length)for(const G of J){const D=G.enableBeforeUnload??!0;if(D===!0){F=!0;break}if(typeof D=="function"&&D()===!0){F=!0;break}}if(F)return N.preventDefault(),N.returnValue=""},I=mk({getLocation:C,getLength:()=>e.history.length,pushState:(N,F)=>L("push",N,F),replaceState:(N,F)=>L("replace",N,F),back:N=>(N&&(y=!0),b=!0,e.history.back()),forward:N=>{N&&(y=!0),b=!0,e.history.forward()},go:N=>{v=!0,e.history.go(N)},createHref:N=>h(N),flush:R,destroy:()=>{e.history.pushState=i,e.history.replaceState=n,e.removeEventListener(XS,U,{capture:!0}),e.removeEventListener(GS,H)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return e.addEventListener(XS,U,{capture:!0}),e.addEventListener(GS,H),e.history.pushState=function(...N){const F=i.apply(e.history,N);return I._ignoreSubscribers||E("PUSH"),F},e.history.replaceState=function(...N){const F=n.apply(e.history,N);return I._ignoreSubscribers||E("REPLACE"),F},I}function pk(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function Gd(t,e){const i=pk(t),n=i.indexOf("#"),a=i.indexOf("?"),l=Gg();return{href:i,pathname:i.substring(0,n>0?a>0?Math.min(n,a):n:a>0?a:i.length),hash:n>-1?i.substring(n):"",search:a>-1?i.slice(a,n===-1?void 0:n):"",state:e||{[Ya]:0,key:l,__TSR_key:l}}}function Gg(){return(Math.random()+1).toString(36).substring(7)}function Xd(t){return t[t.length-1]}function gk(t){return typeof t=="function"}function Wa(t,e){return gk(t)?t(e):t}const vk=Object.prototype.hasOwnProperty;function wr(t,e,i=0){if(t===e)return t;if(i>500)return e;const n=e,a=eb(t)&&eb(n);if(!a&&!(Zd(t)&&Zd(n)))return n;const l=a?t:QS(t);if(!l)return n;const u=a?n:QS(n);if(!u)return n;const h=l.length,f=u.length,d=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const g=a?v:u[v],y=t[g],b=n[g];if(y===b){d[g]=y,(a?v<h:vk.call(t,g))&&p++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){d[g]=b;continue}const C=wr(y,b,i+1);d[g]=C,C===y&&p++}return h===f&&p===h?t:d}function QS(t){const e=[],i=Object.getOwnPropertyNames(t);for(const a of i){if(!Object.prototype.propertyIsEnumerable.call(t,a))return!1;e.push(a)}const n=Object.getOwnPropertySymbols(t);for(const a of n){if(!Object.prototype.propertyIsEnumerable.call(t,a))return!1;e.push(a)}return e}function Zd(t){if(!JS(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const i=e.prototype;return!(!JS(i)||!i.hasOwnProperty("isPrototypeOf"))}function JS(t){return Object.prototype.toString.call(t)==="[object Object]"}function eb(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function No(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0,a=t.length;n<a;n++)if(!No(t[n],e[n],i))return!1;return!0}if(Zd(t)&&Zd(e)){const n=i?.ignoreUndefined??!0;if(i?.partial){for(const u in e)if((!n||e[u]!==void 0)&&!No(t[u],e[u],i))return!1;return!0}let a=0;if(!n)a=Object.keys(t).length;else for(const u in t)t[u]!==void 0&&a++;let l=0;for(const u in e)if((!n||e[u]!==void 0)&&(l++,l>a||!No(t[u],e[u],i)))return!1;return a===l}return!1}function Xl(t){let e,i;const n=new Promise((a,l)=>{e=a,i=l});return n.status="pending",n.resolve=a=>{n.status="resolved",n.value=a,e(a),t?.(a)},n.reject=a=>{n.status="rejected",i(a)},n}function Ka(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function yk(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function tb(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,i=>{try{return decodeURI(i)}catch{return i}})}return yk(e)}const Tw=["http:","https:","mailto:","tel:"];function Qd(t){if(!t)return!1;try{const e=new URL(t);return!Tw.includes(e.protocol)}catch{return!1}}const Sk={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},bk=/[&><\u2028\u2029]/g;function wk(t){return t.replace(bk,e=>Sk[e])}function ib(t,e){if(!t)return t;const i=/%25|%5C/gi;let n=0,a="",l;for(;(l=i.exec(t))!==null;)a+=tb(t.slice(n,l.index))+l[0],n=i.lastIndex;return a=a+tb(n?t.slice(n):t),a.startsWith("//")&&(a="/"+a.replace(/^\/+/,"")),a}var Ck="Invariant failed";function Gn(t,e){if(!t)throw new Error(Ck)}function Jd(t){const e=new Map;let i,n;const a=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,n&&(n.next=l,l.prev=n)):(l.next.prev=void 0,i=l.next,l.next=void 0,n&&(l.prev=n,n.next=l)),n=l)};return{get(l){const u=e.get(l);if(u)return a(u),u.value},set(l,u){if(e.size>=t&&i){const f=i;e.delete(f.key),f.next&&(i=f.next,f.next.prev=void 0),f===n&&(n=void 0)}const h=e.get(l);if(h)h.value=u,a(h);else{const f={key:l,value:u,prev:n};n&&(n.next=f),n=f,i||(i=f),e.set(l,f)}},clear(){e.clear(),i=void 0,n=void 0}}}const Zl=0,Fo=1,$o=2,Bu=3,Fl=4,xk=5,kk=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Ek=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Tk=/^([^{]*)\{\$\}([^}]*)$/;function Xg(t,e,i=new Uint16Array(6)){const n=t.indexOf("/",e),a=n===-1?t.length:n,l=t.substring(e,a);if(!l||!l.includes("$"))return i[0]=Zl,i[1]=e,i[2]=e,i[3]=a,i[4]=a,i[5]=a,i;if(l==="$"){const d=t.length;return i[0]=$o,i[1]=e,i[2]=e,i[3]=d,i[4]=d,i[5]=d,i}if(l.charCodeAt(0)===36)return i[0]=Fo,i[1]=e,i[2]=e+1,i[3]=a,i[4]=a,i[5]=a,i;const u=l.match(Tk);if(u){const p=u[1].length;return i[0]=$o,i[1]=e+p,i[2]=e+p+1,i[3]=e+p+2,i[4]=e+p+3,i[5]=t.length,i}const h=l.match(Ek);if(h){const d=h[1],p=h[2],v=h[3],g=d.length;return i[0]=Bu,i[1]=e+g,i[2]=e+g+3,i[3]=e+g+3+p.length,i[4]=a-v.length,i[5]=a,i}const f=l.match(kk);if(f){const d=f[1],p=f[2],v=f[3],g=d.length;return i[0]=Fo,i[1]=e+g,i[2]=e+g+2,i[3]=e+g+2+p.length,i[4]=a-v.length,i[5]=a,i}return i[0]=Zl,i[1]=e,i[2]=e,i[3]=a,i[4]=a,i[5]=a,i}function vf(t,e,i,n,a,l,u){u?.(i);let h=n;{const f=i.fullPath??i.from,d=f.length,p=i.options?.caseSensitive??t,v=!!(i.options?.params?.parse&&i.options?.skipRouteOnParseError?.params);for(;h<d;){const y=Xg(f,h,e);let b;const C=h,x=y[5];switch(h=x+1,l++,y[0]){case Zl:{const R=f.substring(y[2],y[3]);if(p){const L=a.static?.get(R);if(L)b=L;else{a.static??=new Map;const E=Lo(i.fullPath??i.from);E.parent=a,E.depth=l,b=E,a.static.set(R,E)}}else{const L=R.toLowerCase(),E=a.staticInsensitive?.get(L);if(E)b=E;else{a.staticInsensitive??=new Map;const H=Lo(i.fullPath??i.from);H.parent=a,H.depth=l,b=H,a.staticInsensitive.set(L,H)}}break}case Fo:{const R=f.substring(C,y[1]),L=f.substring(y[4],x),E=p&&!!(R||L),H=R?E?R:R.toLowerCase():void 0,U=L?E?L:L.toLowerCase():void 0,I=!v&&a.dynamic?.find(N=>!N.skipOnParamError&&N.caseSensitive===E&&N.prefix===H&&N.suffix===U);if(I)b=I;else{const N=q_(Fo,i.fullPath??i.from,E,H,U);b=N,N.depth=l,N.parent=a,a.dynamic??=[],a.dynamic.push(N)}break}case Bu:{const R=f.substring(C,y[1]),L=f.substring(y[4],x),E=p&&!!(R||L),H=R?E?R:R.toLowerCase():void 0,U=L?E?L:L.toLowerCase():void 0,I=!v&&a.optional?.find(N=>!N.skipOnParamError&&N.caseSensitive===E&&N.prefix===H&&N.suffix===U);if(I)b=I;else{const N=q_(Bu,i.fullPath??i.from,E,H,U);b=N,N.parent=a,N.depth=l,a.optional??=[],a.optional.push(N)}break}case $o:{const R=f.substring(C,y[1]),L=f.substring(y[4],x),E=p&&!!(R||L),H=R?E?R:R.toLowerCase():void 0,U=L?E?L:L.toLowerCase():void 0,I=q_($o,i.fullPath??i.from,E,H,U);b=I,I.parent=a,I.depth=l,a.wildcard??=[],a.wildcard.push(I)}}a=b}if(v&&i.children&&!i.isRoot&&i.id&&i.id.charCodeAt(i.id.lastIndexOf("/")+1)===95){const y=Lo(i.fullPath??i.from);y.kind=xk,y.parent=a,l++,y.depth=l,a.pathless??=[],a.pathless.push(y),a=y}const g=(i.path||!i.children)&&!i.isRoot;if(g&&f.endsWith("/")){const y=Lo(i.fullPath??i.from);y.kind=Fl,y.parent=a,l++,y.depth=l,a.index=y,a=y}a.parse=i.options?.params?.parse??null,a.skipOnParamError=v,a.parsingPriority=i.options?.skipRouteOnParseError?.priority??0,g&&!a.route&&(a.route=i,a.fullPath=i.fullPath??i.from)}if(i.children)for(const f of i.children)vf(t,e,f,h,a,l,u)}function V_(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function Fa(t){if(t.pathless)for(const e of t.pathless)Fa(e);if(t.static)for(const e of t.static.values())Fa(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())Fa(e);if(t.dynamic?.length){t.dynamic.sort(V_);for(const e of t.dynamic)Fa(e)}if(t.optional?.length){t.optional.sort(V_);for(const e of t.optional)Fa(e)}if(t.wildcard?.length){t.wildcard.sort(V_);for(const e of t.wildcard)Fa(e)}}function Lo(t){return{kind:Zl,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function q_(t,e,i,n,a){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:i,prefix:n,suffix:a}}function Rk(t,e){const i=Lo("/"),n=new Uint16Array(6);for(const a of t)vf(!1,n,a,1,i,0);Fa(i),e.masksTree=i,e.flatCache=Jd(1e3)}function Mk(t,e){t||="/";const i=e.flatCache.get(t);if(i)return i;const n=Zg(t,e.masksTree);return e.flatCache.set(t,n),n}function Ak(t,e,i,n,a){t||="/",n||="/";const l=e?`case\0${t}`:t;let u=a.singleCache.get(l);if(!u){u=Lo("/");const h=new Uint16Array(6);vf(e,h,{from:t},1,u,0),a.singleCache.set(l,u)}return Zg(n,u,i)}function Lk(t,e,i=!1){const n=i?t:`nofuzz\0${t}`,a=e.matchCache.get(n);if(a!==void 0)return a;t||="/";let l;try{l=Zg(t,e.segmentTree,i)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=Bk(l.route)),e.matchCache.set(n,l),l}function Dk(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Ok(t,e=!1,i){const n=Lo(t.fullPath),a=new Uint16Array(6),l={},u={};let h=0;return vf(e,a,t,1,n,0,d=>{if(i?.(d,h),Gn(!(d.id in l),`Duplicate routes found with id: ${String(d.id)}`),l[d.id]=d,h!==0&&d.path){const p=Dk(d.fullPath);(!u[p]||d.fullPath.endsWith("/"))&&(u[p]=d)}h++}),Fa(n),{processedTree:{segmentTree:n,singleCache:Jd(1e3),matchCache:Jd(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Zg(t,e,i=!1){const n=t.split("/"),a=Pk(t,n,e,i);if(!a)return null;const[l]=Rw(t,n,a);return{route:a.node.route,rawParams:l,parsedParams:a.parsedParams}}function Rw(t,e,i){const n=Nk(i.node);let a=null;const l={};let u=i.extract?.part??0,h=i.extract?.node??0,f=i.extract?.path??0;for(;h<n.length;u++,h++,f++){const d=n[h],p=e[u],v=f;if(p&&(f+=p.length),d.kind===Fo){a??=i.node.fullPath.split("/");const g=a[h],y=d.prefix?.length??0;if(g.charCodeAt(y)===123){const C=d.suffix?.length??0,x=g.substring(y+2,g.length-C-1),k=p.substring(y,p.length-C);l[x]=decodeURIComponent(k)}else{const C=g.substring(1);l[C]=decodeURIComponent(p)}}else if(d.kind===Bu){if(i.skipped&1<<h){u--;continue}a??=i.node.fullPath.split("/");const g=a[h],y=d.prefix?.length??0,b=d.suffix?.length??0,C=g.substring(y+3,g.length-b-1),x=d.suffix||d.prefix?p.substring(y,p.length-b):p;x&&(l[C]=decodeURIComponent(x))}else if(d.kind===$o){const g=d,y=t.substring(v+(g.prefix?.length??0),t.length-(g.suffix?.length??0)),b=decodeURIComponent(y);l["*"]=b,l._splat=b;break}}return i.rawParams&&Object.assign(l,i.rawParams),[l,{part:u,node:h,path:f}]}function Bk(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function Nk(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function Pk(t,e,i,n){if(t==="/"&&i.index)return{node:i.index,skipped:0};const a=!Xd(e),l=a&&t!=="/",u=e.length-(a?1:0),h=[{node:i,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,d=null,p=null;for(;h.length;){const v=h.pop(),{node:g,index:y,skipped:b,depth:C,statics:x,dynamics:k,optionals:R}=v;let{extract:L,rawParams:E,parsedParams:H}=v;if(g.skipOnParamError){if(!Y_(t,e,v))continue;E=v.rawParams,L=v.extract,H=v.parsedParams}n&&g.route&&g.kind!==Fl&&tu(d,v)&&(d=v);const U=y===u;if(U&&(g.route&&!l&&tu(p,v)&&(p=v),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const I=U?void 0:e[y];let N;if(U&&g.index){const F={node:g.index,index:y,skipped:b,depth:C+1,statics:x,dynamics:k,optionals:R,extract:L,rawParams:E,parsedParams:H};if(g.index.skipOnParamError&&!Y_(t,e,F))continue;if(x===u&&!k&&!R&&!b)return F;tu(p,F)&&(p=F)}if(g.wildcard&&tu(f,v))for(const F of g.wildcard){const{prefix:J,suffix:G}=F;if(J&&(U||!(F.caseSensitive?I:N??=I.toLowerCase()).startsWith(J)))continue;if(G){if(U)continue;const O=e.slice(y).join("/").slice(-G.length);if((F.caseSensitive?O:O.toLowerCase())!==G)continue}const D={node:F,index:u,skipped:b,depth:C,statics:x,dynamics:k,optionals:R,extract:L,rawParams:E,parsedParams:H};if(!(F.skipOnParamError&&!Y_(t,e,D))){f=D;break}}if(g.optional){const F=b|1<<C,J=C+1;for(let G=g.optional.length-1;G>=0;G--){const D=g.optional[G];h.push({node:D,index:y,skipped:F,depth:J,statics:x,dynamics:k,optionals:R,extract:L,rawParams:E,parsedParams:H})}if(!U)for(let G=g.optional.length-1;G>=0;G--){const D=g.optional[G],{prefix:O,suffix:P}=D;if(O||P){const $=D.caseSensitive?I:N??=I.toLowerCase();if(O&&!$.startsWith(O)||P&&!$.endsWith(P))continue}h.push({node:D,index:y+1,skipped:b,depth:J,statics:x,dynamics:k,optionals:R+1,extract:L,rawParams:E,parsedParams:H})}}if(!U&&g.dynamic&&I)for(let F=g.dynamic.length-1;F>=0;F--){const J=g.dynamic[F],{prefix:G,suffix:D}=J;if(G||D){const O=J.caseSensitive?I:N??=I.toLowerCase();if(G&&!O.startsWith(G)||D&&!O.endsWith(D))continue}h.push({node:J,index:y+1,skipped:b,depth:C+1,statics:x,dynamics:k+1,optionals:R,extract:L,rawParams:E,parsedParams:H})}if(!U&&g.staticInsensitive){const F=g.staticInsensitive.get(N??=I.toLowerCase());F&&h.push({node:F,index:y+1,skipped:b,depth:C+1,statics:x+1,dynamics:k,optionals:R,extract:L,rawParams:E,parsedParams:H})}if(!U&&g.static){const F=g.static.get(I);F&&h.push({node:F,index:y+1,skipped:b,depth:C+1,statics:x+1,dynamics:k,optionals:R,extract:L,rawParams:E,parsedParams:H})}if(g.pathless){const F=C+1;for(let J=g.pathless.length-1;J>=0;J--){const G=g.pathless[J];h.push({node:G,index:y,skipped:b,depth:F,statics:x,dynamics:k,optionals:R,extract:L,rawParams:E,parsedParams:H})}}}if(p&&f)return tu(f,p)?p:f;if(p)return p;if(f)return f;if(n&&d){let v=d.index;for(let y=0;y<d.index;y++)v+=e[y].length;const g=v===t.length?"/":t.slice(v);return d.rawParams??={},d.rawParams["**"]=decodeURIComponent(g),d}return null}function Y_(t,e,i){try{const[n,a]=Rw(t,e,i);i.rawParams=n,i.extract=a;const l=i.node.parse(n);return i.parsedParams=Object.assign({},i.parsedParams,l),!0}catch{return null}}function tu(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===Fl)>(t.node.kind===Fl)||e.node.kind===Fl==(t.node.kind===Fl)&&e.depth>t.depth))):!0}function Ad(t){return Qg(t.filter(e=>e!==void 0).join("/"))}function Qg(t){return t.replace(/\/{2,}/g,"/")}function Mw(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Ga(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function Aw(t){return Ga(Mw(t))}function ef(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function zk(t,e,i){return ef(t,i)===ef(e,i)}function Ik({base:t,to:e,trailingSlash:i="never",cache:n}){const a=e.startsWith("/"),l=!a&&e===".";let u;if(n){u=a?e:l?t:t+"\0"+e;const v=n.get(u);if(v)return v}let h;if(l)h=t.split("/");else if(a)h=e.split("/");else{for(h=t.split("/");h.length>1&&Xd(h)==="";)h.pop();const v=e.split("/");for(let g=0,y=v.length;g<y;g++){const b=v[g];b===""?g?g===y-1&&h.push(b):h=[b]:b===".."?h.pop():b==="."||h.push(b)}}h.length>1&&(Xd(h)===""?i==="never"&&h.pop():i==="always"&&h.push(""));let f,d="";for(let v=0;v<h.length;v++){v>0&&(d+="/");const g=h[v];if(!g)continue;f=Xg(g,0,f);const y=f[0];if(y===Zl){d+=g;continue}const b=f[5],C=g.substring(0,f[1]),x=g.substring(f[4],b),k=g.substring(f[2],f[3]);y===Fo?d+=C||x?`${C}{$${k}}${x}`:`$${k}`:y===$o?d+=C||x?`${C}{$}${x}`:"$":d+=`${C}{-$${k}}${x}`}d=Qg(d);const p=d||"/";return u&&n&&n.set(u,p),p}function K_(t,e,i){const n=e[t];return typeof n!="string"?n:t==="_splat"?encodeURI(n):Hk(n,i)}function G_({path:t,params:e,decodeCharMap:i}){let n=!1;const a={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:a,isMissingParams:n};const l=t.length;let u=0,h,f="";for(;u<l;){const p=u;h=Xg(t,p,h);const v=h[5];if(u=v+1,p===v)continue;const g=h[0];if(g===Zl){f+="/"+t.substring(p,v);continue}if(g===$o){const y=e._splat;a._splat=y,a["*"]=y;const b=t.substring(p,h[1]),C=t.substring(h[4],v);if(!y){n=!0,(b||C)&&(f+="/"+b+C);continue}const x=K_("_splat",e,i);f+="/"+b+x+C;continue}if(g===Fo){const y=t.substring(h[2],h[3]);!n&&!(y in e)&&(n=!0),a[y]=e[y];const b=t.substring(p,h[1]),C=t.substring(h[4],v),x=K_(y,e,i)??"undefined";f+="/"+b+x+C;continue}if(g===Bu){const y=t.substring(h[2],h[3]),b=e[y];if(b==null)continue;a[y]=b;const C=t.substring(p,h[1]),x=t.substring(h[4],v),k=K_(y,e,i)??"";f+="/"+C+k+x;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:n}}function Hk(t,e){let i=encodeURIComponent(t);if(e)for(const[n,a]of e)i=i.replaceAll(n,a);return i}function Ks(t){return!!t?.isNotFound}function Uk(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const tf="tsr-scroll-restoration-v1_3",Fk=(t,e)=>{let i;return(...n)=>{i||(i=setTimeout(()=>{t(...n),i=null},e))}};function $k(){const t=Uk();if(!t)return null;const e=t.getItem(tf);let i=e?JSON.parse(e):{};return{state:i,set:n=>{i=Wa(n,i)||i;try{t.setItem(tf,JSON.stringify(i))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const cd=$k(),$p=t=>t.state.__TSR_key||t.href;function Wk(t){const e=[];let i;for(;i=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(i.children,t)+1})`),t=i;return`${e.reverse().join(" > ")}`.toLowerCase()}let sf=!1;function Lw({storageKey:t,key:e,behavior:i,shouldScrollRestoration:n,scrollToTopSelectors:a,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(d){console.error(d);return}const h=e||window.history.state?.__TSR_key,f=u[h];sf=!0;e:{if(n&&f&&Object.keys(f).length>0){for(const v in f){const g=f[v];if(v==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:i});else if(v){const y=document.querySelector(v);y&&(y.scrollLeft=g.scrollX,y.scrollTop=g.scrollY)}}break e}const d=(l??window.location).hash.split("#",2)[1];if(d){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const g=document.getElementById(d);g&&g.scrollIntoView(v)}break e}const p={top:0,left:0,behavior:i};if(window.scrollTo(p),a)for(const v of a){if(v==="window")continue;const g=typeof v=="function"?v():document.querySelector(v);g&&g.scrollTo(p)}}sf=!1}function jk(t,e){if(!cd&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!cd))return;t.isScrollRestorationSetup=!0,sf=!1;const n=t.options.getScrollRestorationKey||$p;window.history.scrollRestoration="manual";const a=l=>{if(sf||!t.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const f=l.target.getAttribute("data-scroll-restoration-id");f?u=`[data-scroll-restoration-id="${f}"]`:u=Wk(l.target)}const h=n(t.state.location);cd.set(f=>{const d=f[h]||={},p=d[u]||={};if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",Fk(a,100),!0),t.subscribe("onRendered",l=>{const u=n(l.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(Lw({storageKey:tf,key:u,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&cd.set(h=>(h[u]||={},h)))})}function Vk(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const i=document.getElementById(t.state.location.hash);i&&i.scrollIntoView(e)}}}function qk(t,e=String){const i=new URLSearchParams;for(const n in t){const a=t[n];a!==void 0&&i.set(n,e(a))}return i.toString()}function X_(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function Yk(t){const e=new URLSearchParams(t),i={};for(const[n,a]of e.entries()){const l=i[n];l==null?i[n]=X_(a):Array.isArray(l)?l.push(X_(a)):i[n]=[l,X_(a)]}return i}const Kk=Xk(JSON.parse),Gk=Zk(JSON.stringify,JSON.parse);function Xk(t){return e=>{e[0]==="?"&&(e=e.substring(1));const i=Yk(e);for(const n in i){const a=i[n];if(typeof a=="string")try{i[n]=t(a)}catch{}}return i}}function Zk(t,e){const i=typeof e=="function";function n(a){if(typeof a=="object"&&a!==null)try{return t(a)}catch{}else if(i&&typeof a=="string")try{return e(a),t(a)}catch{}return a}return a=>{const l=qk(a,n);return l?`?${l}`:""}}const Ys="__root__";function Dw(t){if(t.statusCode=t.statusCode||t.code||307,typeof t.href=="string"&&Qd(t.href))throw new Error(`Redirect blocked: unsafe protocol in href "${t.href}". Only ${Tw.join(", ")} protocols are allowed.`);if(!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const i=new Response(null,{status:t.statusCode,headers:e});if(i.options=t,t.throw)throw i;return i}function kr(t){return t instanceof Response&&!!t.options}const Ld=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},yf=(t,e)=>!!(t.preload&&!t.router.state.matches.some(i=>i.id===e)),Yl=(t,e,i=!0)=>{const n={...t.router.options.context??{}},a=i?e:e-1;for(let l=0;l<=a;l++){const u=t.matches[l];if(!u)continue;const h=t.router.getMatch(u.id);h&&Object.assign(n,h.__routeContext,h.__beforeLoadContext)}return n},Ow=(t,e)=>{const i=t.router.routesById[e.routeId??""]??t.router.routeTree;!i.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(i.options.notFoundComponent=t.router.options.defaultNotFoundComponent),Gn(i.options.notFoundComponent);const n=t.matches.find(a=>a.routeId===i.id);Gn(n,"Could not find match for route: "+i.id),t.updateMatch(n.id,a=>({...a,status:"notFound",error:e,isFetching:!1})),e.routerCode==="BEFORE_LOAD"&&i.parentRoute&&(e.routeId=i.parentRoute.id,Ow(t,e))},ja=(t,e,i)=>{if(!(!kr(i)&&!Ks(i))){if(kr(i)&&i.redirectHandled&&!i.options.reloadDocument)throw i;if(e){e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const n=kr(i)?"redirected":"notFound";e._nonReactive.error=i,t.updateMatch(e.id,a=>({...a,status:n,context:Yl(t,e.index),isFetching:!1,error:i})),Ks(i)&&!i.routeId&&(i.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()}throw kr(i)?(t.rendered=!0,i.options._fromLocation=t.location,i.redirectHandled=!0,i=t.router.resolveRedirect(i),i):(Ow(t,i),i)}},Bw=(t,e)=>{const i=t.router.getMatch(e);return!!(!t.router.isServer&&i._nonReactive.dehydrated||t.router.isServer&&i.ssr===!1)},iu=(t,e,i,n)=>{const{id:a,routeId:l}=t.matches[e],u=t.router.looseRoutesById[l];if(i instanceof Promise)throw i;i.routerCode=n,t.firstBadMatchIndex??=e,ja(t,t.router.getMatch(a),i);try{u.options.onError?.(i)}catch(h){i=h,ja(t,t.router.getMatch(a),i)}t.updateMatch(a,h=>(h._nonReactive.beforeLoadPromise?.resolve(),h._nonReactive.beforeLoadPromise=void 0,h._nonReactive.loadPromise?.resolve(),{...h,error:i,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Qk=(t,e,i,n)=>{const a=t.router.getMatch(e),l=t.matches[i-1]?.id,u=l?t.router.getMatch(l):void 0;if(t.router.isShell()){a.ssr=n.id===Ys;return}if(u?.ssr===!1){a.ssr=!1;return}const h=y=>y===!0&&u?.ssr==="data-only"?"data-only":y,f=t.router.options.defaultSsr??!0;if(n.options.ssr===void 0){a.ssr=h(f);return}if(typeof n.options.ssr!="function"){a.ssr=h(n.options.ssr);return}const{search:d,params:p}=a,v={search:ud(d,a.searchError),params:ud(p,a.paramsError),location:t.location,matches:t.matches.map(y=>({index:y.index,pathname:y.pathname,fullPath:y.fullPath,staticData:y.staticData,id:y.id,routeId:y.routeId,search:ud(y.search,y.searchError),params:ud(y.params,y.paramsError),ssr:y.ssr}))},g=n.options.ssr(v);if(Ka(g))return g.then(y=>{a.ssr=h(y??f)});a.ssr=h(g??f)},Nw=(t,e,i,n)=>{if(n._nonReactive.pendingTimeout!==void 0)return;const a=i.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!yf(t,e)&&(i.options.loader||i.options.beforeLoad||Iw(i))&&typeof a=="number"&&a!==1/0&&(i.options.pendingComponent??t.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{Ld(t)},a);n._nonReactive.pendingTimeout=u}},Jk=(t,e,i)=>{const n=t.router.getMatch(e);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;Nw(t,e,i,n);const a=()=>{const l=t.router.getMatch(e);l.preload&&(l.status==="redirected"||l.status==="notFound")&&ja(t,l,l.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(a):a()},eE=(t,e,i,n)=>{const a=t.router.getMatch(e),l=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Xl(()=>{l?.resolve()});const{paramsError:u,searchError:h}=a;u&&iu(t,i,u,"PARSE_PARAMS"),h&&iu(t,i,h,"VALIDATE_SEARCH"),Nw(t,e,n,a);const f=new AbortController,d=t.matches[i-1]?.id;(d?t.router.getMatch(d):void 0)?.context??t.router.options.context;let v=!1;const g=()=>{v||(v=!0,t.updateMatch(e,U=>({...U,isFetching:"beforeLoad",fetchCount:U.fetchCount+1,abortController:f})))},y=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,U=>({...U,isFetching:!1}))};if(!n.options.beforeLoad){Eu(()=>{g(),y()});return}a._nonReactive.beforeLoadPromise=Xl();const b={...Yl(t,i,!1),...a.__routeContext},{search:C,params:x,cause:k}=a,R=yf(t,e),L={search:C,abortController:f,params:x,preload:R,context:b,location:t.location,navigate:U=>t.router.navigate({...U,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:R?"preload":k,matches:t.matches,...t.router.options.additionalContext},E=U=>{if(U===void 0){Eu(()=>{g(),y()});return}(kr(U)||Ks(U))&&(g(),iu(t,i,U,"BEFORE_LOAD")),Eu(()=>{g(),t.updateMatch(e,I=>({...I,__beforeLoadContext:U})),y()})};let H;try{if(H=n.options.beforeLoad(L),Ka(H))return g(),H.catch(U=>{iu(t,i,U,"BEFORE_LOAD")}).then(E)}catch(U){g(),iu(t,i,U,"BEFORE_LOAD")}E(H)},tE=(t,e)=>{const{id:i,routeId:n}=t.matches[e],a=t.router.looseRoutesById[n],l=()=>{if(t.router.isServer){const f=Qk(t,i,e,a);if(Ka(f))return f.then(h)}return h()},u=()=>eE(t,i,e,a),h=()=>{if(Bw(t,i))return;const f=Jk(t,i,a);return Ka(f)?f.then(u):u()};return l()},iE=(t,e,i)=>{const n=t.router.getMatch(e);if(!n||!i.options.head&&!i.options.scripts&&!i.options.headers)return;const a={ssr:t.router.options.ssr,matches:t.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([i.options.head?.(a),i.options.scripts?.(a),i.options.headers?.(a)]).then(([l,u,h])=>{const f=l?.meta,d=l?.links,p=l?.scripts,v=l?.styles;return{meta:f,links:d,headScripts:p,headers:h,scripts:u,styles:v}})},Pw=(t,e,i,n)=>{const a=t.matchPromises[i-1],{params:l,loaderDeps:u,abortController:h,cause:f}=t.router.getMatch(e),d=Yl(t,i),p=yf(t,e);return{params:l,deps:u,preload:!!p,parentMatchPromise:a,abortController:h,context:d,location:t.location,navigate:v=>t.router.navigate({...v,_fromLocation:t.location}),cause:p?"preload":f,route:n,...t.router.options.additionalContext}},sb=async(t,e,i,n)=>{try{const a=t.router.getMatch(e);try{(!t.router.isServer||a.ssr===!0)&&zw(n);const l=n.options.loader?.(Pw(t,e,i,n)),u=n.options.loader&&Ka(l);if((u||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||a._nonReactive.minPendingPromise)&&t.updateMatch(e,d=>({...d,isFetching:"loader"})),n.options.loader){const d=u?await l:l;ja(t,t.router.getMatch(e),d),d!==void 0&&t.updateMatch(e,p=>({...p,loaderData:d}))}n._lazyPromise&&await n._lazyPromise;const f=a._nonReactive.minPendingPromise;f&&await f,n._componentsPromise&&await n._componentsPromise,t.updateMatch(e,d=>({...d,error:void 0,context:Yl(t,i),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){t.updateMatch(e,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Yl(t,i)}));return}const h=a._nonReactive.minPendingPromise;h&&await h,Ks(l)&&await n.options.notFoundComponent?.preload?.(),ja(t,t.router.getMatch(e),l);try{n.options.onError?.(l)}catch(f){u=f,ja(t,t.router.getMatch(e),f)}t.updateMatch(e,f=>({...f,error:u,context:Yl(t,i),status:"error",isFetching:!1}))}}catch(a){const l=t.router.getMatch(e);l&&(l._nonReactive.loaderPromise=void 0),ja(t,l,a)}},sE=async(t,e)=>{const{id:i,routeId:n}=t.matches[e];let a=!1,l=!1;const u=t.router.looseRoutesById[n];if(Bw(t,i)){if(t.router.isServer)return t.router.getMatch(i)}else{const d=t.router.getMatch(i);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!t.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const p=t.router.getMatch(i),v=p._nonReactive.error||p.error;v&&ja(t,p,v)}else{const p=Date.now()-d.updatedAt,v=yf(t,i),g=v?u.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??t.router.options.defaultStaleTime??0,y=u.options.shouldReload,b=typeof y=="function"?y(Pw(t,i,e,u)):y,C=!!v&&!t.router.state.matches.some(L=>L.id===i),x=t.router.getMatch(i);x._nonReactive.loaderPromise=Xl(),C!==x.preload&&t.updateMatch(i,L=>({...L,preload:C}));const{status:k,invalid:R}=x;a=k==="success"&&(R||(b??p>g)),v&&u.options.preload===!1||(a&&!t.sync?(l=!0,(async()=>{try{await sb(t,i,e,u);const L=t.router.getMatch(i);L._nonReactive.loaderPromise?.resolve(),L._nonReactive.loadPromise?.resolve(),L._nonReactive.loaderPromise=void 0}catch(L){kr(L)&&await t.router.navigate(L.options)}})()):(k!=="success"||a&&t.sync)&&await sb(t,i,e,u))}}const h=t.router.getMatch(i);l||(h._nonReactive.loaderPromise?.resolve(),h._nonReactive.loadPromise?.resolve()),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,l||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const f=l?h.isFetching:!1;return f!==h.isFetching||h.invalid!==!1?(t.updateMatch(i,d=>({...d,isFetching:f,invalid:!1})),t.router.getMatch(i)):h};async function rb(t){const e=Object.assign(t,{matchPromises:[]});!e.router.isServer&&e.router.state.matches.some(i=>i._forcePending)&&Ld(e);try{for(let h=0;h<e.matches.length;h++){const f=tE(e,h);Ka(f)&&await f}const i=e.firstBadMatchIndex??e.matches.length;for(let h=0;h<i;h++)e.matchPromises.push(sE(e,h));const a=(await Promise.allSettled(e.matchPromises)).filter(h=>h.status==="rejected").map(h=>h.reason);let l;for(const h of a){if(kr(h))throw h;!l&&Ks(h)&&(l=h)}for(const h of e.matches){const{id:f,routeId:d}=h,p=e.router.looseRoutesById[d];try{const v=iE(e,f,p);if(v){const g=await v;e.updateMatch(f,y=>({...y,...g}))}}catch(v){console.error(`Error executing head for route ${d}:`,v)}}if(l)throw l;const u=Ld(e);Ka(u)&&await u}catch(i){if(Ks(i)&&!e.preload){const n=Ld(e);throw Ka(n)&&await n,i}if(kr(i))throw i}return e.matches}async function zw(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:i,...n}=e.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const e=()=>{const i=[];for(const n of Hw){const a=t.options[n]?.preload;a&&i.push(a())}if(i.length)return Promise.all(i).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function ud(t,e){return e?{status:"error",error:e}:{status:"success",value:t}}function Iw(t){for(const e of Hw)if(t.options[e]?.preload)return!0;return!1}const Hw=["component","errorComponent","pendingComponent","notFoundComponent"];function rE(t){return{input:({url:e})=>{for(const i of t)e=Wp(i,e);return e},output:({url:e})=>{for(let i=t.length-1;i>=0;i--)e=Uw(t[i],e);return e}}}function nE(t){const e=Aw(t.basepath),i=`/${e}`,n=`${i}/`,a=t.caseSensitive?i:i.toLowerCase(),l=t.caseSensitive?n:n.toLowerCase();return{input:({url:u})=>{const h=t.caseSensitive?u.pathname:u.pathname.toLowerCase();return h===a?u.pathname="/":h.startsWith(l)&&(u.pathname=u.pathname.slice(i.length)),u},output:({url:u})=>(u.pathname=Ad(["/",e,u.pathname]),u)}}function Wp(t,e){const i=t?.input?.({url:e});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return e}function Uw(t,e){const i=t?.output?.({url:e});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return e}function Po(t){const e=t.resolvedLocation,i=t.location,n=e?.pathname!==i.pathname,a=e?.href!==i.href,l=e?.hash!==i.hash;return{fromLocation:e,toLocation:i,pathChanged:n,hrefChanged:a,hashChanged:l}}class aE{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=i=>i(),this.update=i=>{i.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const n=this.options,a=this.basepath??n?.basepath??"/",l=this.basepath===void 0,u=n?.rewrite;this.options={...n,...i},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=_k())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new fk(lE(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),jk(this));let h=!1;const f=this.options.basepath??"/",d=this.options.rewrite;if(l||a!==f||u!==d){this.basepath=f;const g=[];Aw(f)!==""&&g.push(nE({basepath:f})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:rE(g),this.history&&this.updateLatestLocation(),h=!0}h&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:i,routesByPath:n,processedTree:a}=Ok(this.routeTree,this.options.caseSensitive,(u,h)=>{u.init({originalIndex:h})});this.options.routeMasks&&Rk(this.options.routeMasks,a),this.routesById=i,this.routesByPath=n,this.processedTree=a;const l=this.options.notFoundRoute;l&&(l.init({originalIndex:99999999999}),this.routesById[l.id]=l)},this.subscribe=(i,n)=>{const a={eventType:i,fn:n};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=i=>{this.subscribers.forEach(n=>{n.eventType===i.type&&n.fn(i)})},this.parseLocation=(i,n)=>{const a=({href:f,state:d})=>{const p=new URL(f,this.origin),v=Wp(this.rewrite,p),g=this.options.parseSearch(v.search),y=this.options.stringifySearch(g);return v.search=y,{href:v.href.replace(v.origin,""),publicHref:f,url:v,pathname:ib(v.pathname),searchStr:y,search:wr(n?.search,g),hash:v.hash.split("#").reverse()[0]??"",state:wr(n?.state,d)}},l=a(i),{__tempLocation:u,__tempKey:h}=l.state;if(u&&(!h||h===this.tempLocationKey)){const f=a(u);return f.state.key=l.state.key,f.state.__TSR_key=l.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:l}}return l},this.resolvePathCache=Jd(1e3),this.resolvePathWithBase=(i,n)=>Ik({base:i,to:Qg(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(i,n,a)=>typeof i=="string"?this.matchRoutesInternal({pathname:i,search:n},a):this.matchRoutesInternal(i,n),this.getMatchedRoutes=i=>cE({pathname:i,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=i=>{const n=this.getMatch(i);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const i=this.state.matches.filter(l=>l.status==="pending"),n=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...i,...n]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=i=>{const n=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,h=this.matchRoutes(u,{_buildLocation:!0}),f=Xd(h);l.from;const d=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,p=this.resolvePathWithBase(d,"."),v=f.search,g={...f.params},y=l.to?this.resolvePathWithBase(p,`${l.to}`):this.resolvePathWithBase(p,"."),b=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,Wa(l.params,g)),C=G_({path:y,params:b}).interpolatedPath,x=this.matchRoutes(C,void 0,{_buildLocation:!0}).map(J=>this.looseRoutesById[J.routeId]);if(Object.keys(b).length>0)for(const J of x){const G=J.options.params?.stringify??J.options.stringifyParams;G&&Object.assign(b,G(b))}const k=i.leaveParams?y:ib(G_({path:y,params:b,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let R=v;if(i._includeValidateSearch&&this.options.search?.strict){const J={};x.forEach(G=>{if(G.options.validateSearch)try{Object.assign(J,jp(G.options.validateSearch,{...J,...R}))}catch{}}),R=J}R=uE({search:R,dest:l,destRoutes:x,_includeValidateSearch:i._includeValidateSearch}),R=wr(v,R);const L=this.options.stringifySearch(R),E=l.hash===!0?u.hash:l.hash?Wa(l.hash,u.hash):void 0,H=E?`#${E}`:"";let U=l.state===!0?u.state:l.state?Wa(l.state,u.state):{};U=wr(u.state,U);const I=`${k}${L}${H}`,N=new URL(I,this.origin),F=Uw(this.rewrite,N);return{publicHref:F.pathname+F.search+F.hash,href:I,url:F,pathname:k,search:R,searchStr:L,state:U,hash:E??"",unmaskOnReload:l.unmaskOnReload}},a=(l={},u)=>{const h=n(l);let f=u?n(u):void 0;if(!f){const d={};if(this.options.routeMasks){const p=Mk(h.pathname,this.processedTree);if(p){Object.assign(d,p.rawParams);const{from:v,params:g,...y}=p.route,b=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,Wa(g,d));u={from:i.from,...y,params:b},f=n(u)}}}return f&&(h.maskedLocation=f),h};return i.mask?a(i,{from:i.from,...i.mask}):a(i)},this.commitLocation=({viewTransition:i,ignoreBlocker:n,...a})=>{const l=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const d=No(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),d},u=Ga(this.latestLocation.href)===Ga(a.href),h=this.commitLocationPromise;if(this.commitLocationPromise=Xl(()=>{h?.resolve()}),u&&l())this.load();else{let{maskedLocation:f,hashScrollIntoView:d,url:p,...v}=a;f&&(v={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=i,this.history[a.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:n})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:i,resetScroll:n,hashScrollIntoView:a,viewTransition:l,ignoreBlocker:u,href:h,...f}={})=>{if(h){const v=this.history.location.state.__TSR_index,g=Gd(h,{__TSR_index:i?v:v+1}),y=new URL(g.pathname,this.origin),b=Wp(this.rewrite,y);f.to=b.pathname,f.search=this.options.parseSearch(g.search),f.hash=g.hash.slice(1)}const d=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:l,replace:i,resetScroll:n,hashScrollIntoView:a,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:i,reloadDocument:n,href:a,publicHref:l,...u})=>{let h=!1;if(a)try{new URL(`${a}`),h=!0}catch{}if(h&&!n&&(n=!0),n){if(i!==void 0||!a){const d=this.buildLocation({to:i,...u});a=a??d.url.href,l=l??d.url.href}const f=!h&&l?l:a;if(Qd(f))return Promise.resolve();if(!u.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const v of p)if(v?.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...u,href:a,to:i,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const n=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==n.publicHref||n.url.origin!==this.origin){const a=this.getParsedLocationHref(n);throw Dw({href:a})}}const i=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:i,cachedMatches:n.cachedMatches.filter(a=>!i.some(l=>l.id===a.id))}))},this.load=async i=>{let n,a,l;for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Po({resolvedLocation:d,location:f})}),this.emit({type:"onBeforeLoad",...Po({resolvedLocation:d,location:f})}),await rb({router:this,sync:i?.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],v=[],g=[];Eu(()=>{this.__store.setState(y=>{const b=y.matches,C=y.pendingMatches||y.matches;return p=b.filter(x=>!C.some(k=>k.id===x.id)),v=C.filter(x=>!b.some(k=>k.id===x.id)),g=C.filter(x=>b.some(k=>k.id===x.id)),{...y,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...p.filter(x=>x.status!=="error"&&x.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[v,"onEnter"],[g,"onStay"]].forEach(([y,b])=>{y.forEach(C=>{this.looseRoutesById[C.routeId].options[b]?.(C)})})})})}})}catch(f){kr(f)?(n=f,this.isServer||this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Ks(f)&&(a=f),this.__store.setState(d=>({...d,statusCode:n?n.status:a?404:d.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(h=>h.status==="error")&&(u=500),u!==void 0&&this.__store.setState(h=>({...h,statusCode:u}))},this.startViewTransition=i=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,h=typeof n.types=="function"?n.types(Po({resolvedLocation:u,location:l})):n.types;if(h===!1){i();return}a={update:i,types:h}}else a=i;document.startViewTransition(a)}else i()},this.updateMatch=(i,n)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(l=>l.id===i)?"pendingMatches":this.state.matches.some(l=>l.id===i)?"matches":this.state.cachedMatches.some(l=>l.id===i)?"cachedMatches":"";a&&this.__store.setState(l=>({...l,[a]:l[a]?.map(u=>u.id===i?n(u):u)}))})},this.getMatch=i=>{const n=a=>a.id===i;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=i=>{const n=a=>i?.filter?.(a)??!0?{...a,invalid:!0,...i?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(n),cachedMatches:a.cachedMatches.map(n),pendingMatches:a.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:i?.sync})},this.getParsedLocationHref=i=>{let n=i.url.href;return this.origin&&i.url.origin===this.origin&&(n=n.replace(this.origin,"")||"/"),n},this.resolveRedirect=i=>{const n=i.headers.get("Location");if(i.options.href){if(n)try{const a=new URL(n);if(this.origin&&a.origin===this.origin){const l=a.pathname+a.search+a.hash;i.options.href=l,i.headers.set("Location",l)}}catch{}}else{const a=this.buildLocation(i.options),l=this.getParsedLocationHref(a);i.options.href=l,i.headers.set("Location",l)}return i.headers.get("Location")||i.headers.set("Location",i.options.href),i},this.clearCache=i=>{const n=i?.filter;n!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(l=>!n(l))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const i=n=>{const a=this.looseRoutesById[n.routeId];if(!a.options.loader)return!0;const l=(n.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=l};this.clearCache({filter:i})},this.loadRouteChunk=zw,this.preloadRoute=async i=>{const n=this.buildLocation(i);let a=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:i});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(h=>h.id)),u=new Set([...l,...this.state.cachedMatches.map(h=>h.id)]);Eu(()=>{a.forEach(h=>{u.has(h.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,h]}))})});try{return a=await rb({router:this,matches:a,location:n,preload:!0,updateMatch:(h,f)=>{l.has(h)?a=a.map(d=>d.id===h?f(d):d):this.updateMatch(h,f)}}),a}catch(h){if(kr(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:n});Ks(h)||console.error(h);return}},this.matchRoute=(i,n)=>{const a={...i,to:i.to?this.resolvePathWithBase(i.from||"",i.to):void 0,params:i.params||{},leaveParams:!0},l=this.buildLocation(a);if(n?.pending&&this.state.status!=="pending")return!1;const h=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,f=Ak(l.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,h.pathname,this.processedTree);return!f||i.params&&!No(f.rawParams,i.params,{partial:!0})?!1:n?.includeSearch??!0?No(h.search,l.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(i=>i.status==="notFound"||i.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Gk,parseSearch:e.parseSearch??Kk}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,i){const n=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:l,parsedParams:u}=n;let{matchedRoutes:h}=n,f=!1;(a?a.path!=="/"&&l["**"]:Ga(e.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:f=!0);const d=(()=>{if(f){if(this.options.notFoundMode!=="root")for(let g=h.length-1;g>=0;g--){const y=h[g];if(y.children)return y.id}return Ys}})(),p=[],v=g=>g?.id?g.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((g,y)=>{const b=p[y-1],[C,x,k]=(()=>{const P=b?.search??e.search,$=b?._strictSearch??void 0;try{const M=jp(g.options.validateSearch,{...P})??void 0;return[{...P,...M},{...$,...M},void 0]}catch(M){let A=M;if(M instanceof rf||(A=new rf(M.message,{cause:M})),i?.throwOnError)throw A;return[P,{},A]}})(),R=g.options.loaderDeps?.({search:C})??"",L=R?JSON.stringify(R):"",{interpolatedPath:E,usedParams:H}=G_({path:g.fullPath,params:l,decodeCharMap:this.pathParamsDecodeCharMap}),U=g.id+E+L,I=this.getMatch(U),N=this.state.matches.find(P=>P.routeId===g.id),F=I?._strictParams??H;let J;if(!I)if(g.options.skipRouteOnParseError)for(const P in H)P in u&&(F[P]=u[P]);else{const P=g.options.params?.parse??g.options.parseParams;if(P)try{Object.assign(F,P(F))}catch($){if(Ks($)||kr($)?J=$:J=new oE($.message,{cause:$}),i?.throwOnError)throw J}}Object.assign(l,F);const G=N?"stay":"enter";let D;if(I)D={...I,cause:G,params:N?wr(N.params,l):l,_strictParams:F,search:wr(N?N.search:I.search,C),_strictSearch:x};else{const P=g.options.loader||g.options.beforeLoad||g.lazyFn||Iw(g)?"pending":"success";D={id:U,ssr:this.isServer?void 0:g.options.ssr,index:y,routeId:g.id,params:N?wr(N.params,l):l,_strictParams:F,pathname:E,updatedAt:Date.now(),search:N?wr(N.search,C):C,_strictSearch:x,searchError:void 0,status:P,isFetching:!1,error:void 0,paramsError:J,__routeContext:void 0,_nonReactive:{loadPromise:Xl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:G,loaderDeps:N?wr(N.loaderDeps,R):R,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}i?.preload||(D.globalNotFound=d===g.id),D.searchError=k;const O=v(b);D.context={...O,...D.__routeContext,...D.__beforeLoadContext},p.push(D)}),p.forEach((g,y)=>{const b=this.looseRoutesById[g.routeId];if(!this.getMatch(g.id)&&i?._buildLocation!==!0){const x=p[y-1],k=v(x);if(b.options.context){const R={deps:g.loaderDeps,params:g.params,context:k??{},location:e,navigate:L=>this.navigate({...L,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:p};g.__routeContext=b.options.context(R)??void 0}g.context={...k,...g.__routeContext,...g.__beforeLoadContext}}}),p}}class rf extends Error{}class oE extends Error{}function lE(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function jp(t,e){if(t==null)return{};if("~standard"in t){const i=t["~standard"].validate(e);if(i instanceof Promise)throw new rf("Async validation not supported");if(i.issues)throw new rf(JSON.stringify(i.issues,void 0,2),{cause:i});return i.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function cE({pathname:t,routesById:e,processedTree:i}){const n={},a=Ga(t);let l,u;const h=Lk(a,i,!0);return h&&(l=h.route,Object.assign(n,h.rawParams),u=Object.assign({},h.parsedParams)),{matchedRoutes:h?.branch||[e[Ys]],routeParams:n,foundRoute:l,parsedParams:u}}function uE({search:t,dest:e,destRoutes:i,_includeValidateSearch:n}){const a=i.reduce((h,f)=>{const d=[];if("search"in f.options)f.options.search?.middlewares&&d.push(...f.options.search.middlewares);else if(f.options.preSearchFilters||f.options.postSearchFilters){const p=({search:v,next:g})=>{let y=v;"preSearchFilters"in f.options&&f.options.preSearchFilters&&(y=f.options.preSearchFilters.reduce((C,x)=>x(C),v));const b=g(y);return"postSearchFilters"in f.options&&f.options.postSearchFilters?f.options.postSearchFilters.reduce((C,x)=>x(C),b):b};d.push(p)}if(n&&f.options.validateSearch){const p=({search:v,next:g})=>{const y=g(v);try{return{...y,...jp(f.options.validateSearch,y)??void 0}}catch{return y}};d.push(p)}return h.concat(d)},[])??[],l=({search:h})=>e.search?e.search===!0?h:Wa(e.search,h):{};a.push(l);const u=(h,f)=>{if(h>=a.length)return f;const d=a[h];return d({search:f,next:v=>u(h+1,v)})};return u(0,t)}const hE="Error preloading route! ☝️";class Fw{constructor(e){if(this.init=i=>{this.originalIndex=i.originalIndex;const n=this.options,a=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Ys:this.parentRoute||Gn(!1);let l=a?Ys:n?.path;l&&l!=="/"&&(l=Mw(l));const u=n?.id||l;let h=a?Ys:Ad([this.parentRoute.id===Ys?"":this.parentRoute.id,u]);l===Ys&&(l="/"),h!==Ys&&(h=Ad(["/",h]));const f=h===Ys?"/":Ad([this.parentRoute.fullPath,l]);this._path=l,this._id=h,this._fullPath=f,this._to=Ga(f)},this.addChildren=i=>this._addFileChildren(i),this._addFileChildren=i=>(Array.isArray(i)&&(this.children=i),typeof i=="object"&&i!==null&&(this.children=Object.values(i)),this),this._addFileTypes=()=>this,this.updateLoader=i=>(Object.assign(this.options,i),this),this.update=i=>(Object.assign(this.options,i),this),this.lazy=i=>(this.lazyFn=i,this),this.redirect=i=>Dw({from:this.fullPath,...i}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class dE extends Fw{constructor(e){super(e)}}var S=Uu();const We=Cw(S),$w=J2({__proto__:null,default:We},[S]),hd=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Z_(t){const e=S.useRef({value:t,prev:null}),i=e.current.value;return t!==i&&(e.current={value:t,prev:i}),e.current.prev}function fE(t,e,i={},n={}){S.useEffect(()=>{if(!t.current||n.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([l])=>{e(l)},i);return a.observe(t.current),()=>{a.disconnect()}},[e,i,n.disabled,t])}function mE(t){const e=S.useRef(null);return S.useImperativeHandle(t,()=>e.current,[]),e}function Jg(t){const e=t.errorComponent??Sf;return j.jsx(_E,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:i,reset:n})=>i?S.createElement(e,{error:i,reset:n}):t.children})}class _E extends S.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,i){i.error&&i.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,i){this.props.onCatch&&this.props.onCatch(e,i)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Sf({error:t}){const[e,i]=S.useState(!1);return j.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[j.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[j.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),j.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>i(n=>!n),children:e?"Hide Error":"Show Error"})]}),j.jsx("div",{style:{height:".25rem"}}),e?j.jsx("div",{children:j.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?j.jsx("code",{children:t.message}):null})}):null]})}function pE({children:t,fallback:e=null}){return gE()?j.jsx(We.Fragment,{children:t}):j.jsx(We.Fragment,{children:e})}function gE(){return We.useSyncExternalStore(vE,()=>!0,()=>!1)}function vE(){return()=>{}}var Q_={exports:{}},J_={},ep={exports:{}},tp={};var nb;function yE(){if(nb)return tp;nb=1;var t=Uu();function e(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var i=typeof Object.is=="function"?Object.is:e,n=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue;function h(v,g){var y=g(),b=n({inst:{value:y,getSnapshot:g}}),C=b[0].inst,x=b[1];return l(function(){C.value=y,C.getSnapshot=g,f(C)&&x({inst:C})},[v,y,g]),a(function(){return f(C)&&x({inst:C}),v(function(){f(C)&&x({inst:C})})},[v]),u(y),y}function f(v){var g=v.getSnapshot;v=v.value;try{var y=g();return!i(v,y)}catch{return!0}}function d(v,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:h;return tp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,tp}var ab;function SE(){return ab||(ab=1,ep.exports=yE()),ep.exports}var ob;function bE(){if(ob)return J_;ob=1;var t=Uu(),e=SE();function i(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:i,a=e.useSyncExternalStore,l=t.useRef,u=t.useEffect,h=t.useMemo,f=t.useDebugValue;return J_.useSyncExternalStoreWithSelector=function(d,p,v,g,y){var b=l(null);if(b.current===null){var C={hasValue:!1,value:null};b.current=C}else C=b.current;b=h(function(){function k(U){if(!R){if(R=!0,L=U,U=g(U),y!==void 0&&C.hasValue){var I=C.value;if(y(I,U))return E=I}return E=U}if(I=E,n(L,U))return I;var N=g(U);return y!==void 0&&y(I,N)?(L=U,I):(L=U,E=N)}var R=!1,L,E,H=v===void 0?null:v;return[function(){return k(p())},H===null?void 0:function(){return k(H())}]},[p,v,g,y]);var x=a(d,b[0],b[1]);return u(function(){C.hasValue=!0,C.value=x},[x]),f(x),x},J_}var lb;function wE(){return lb||(lb=1,Q_.exports=bE()),Q_.exports}var CE=wE();function xE(t,e=n=>n,i={}){const n=i.equal??kE;return CE.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}function kE(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,a]of t)if(!e.has(n)||!Object.is(a,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const i=cb(t);if(i.length!==cb(e).length)return!1;for(let n=0;n<i.length;n++)if(!Object.prototype.hasOwnProperty.call(e,i[n])||!Object.is(t[i[n]],e[i[n]]))return!1;return!0}function cb(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const ip=S.createContext(null);function Ww(){return typeof document>"u"?ip:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ip,ip)}function Gs(t){const e=S.useContext(Ww());return t?.warn,e}function Ts(t){const e=Gs({warn:t?.router===void 0}),i=t?.router||e,n=S.useRef(void 0);return xE(i.__store,a=>{if(t?.select){if(t.structuralSharing??i.options.defaultStructuralSharing){const l=wr(n.current,t.select(a));return n.current=l,l}return t.select(a)}return a})}const bf=S.createContext(void 0),EE=S.createContext(void 0);function cn(t){const e=S.useContext(t.from?EE:bf);return Ts({select:n=>{const a=n.matches.find(l=>t.from?t.from===l.routeId:l.id===e);if(Gn(!((t.shouldThrow??!0)&&!a),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),a!==void 0)return t.select?t.select(a):a},structuralSharing:t.structuralSharing})}function ev(t){return cn({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function tv(t){const{select:e,...i}=t;return cn({...i,select:n=>e?e(n.loaderDeps):n.loaderDeps})}function wf(t){return cn({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const i=t.strict===!1?e.params:e._strictParams;return t.select?t.select(i):i}})}function iv(t){return cn({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function Fu(t){const e=Gs();return S.useCallback(i=>e.navigate({...i,from:i.from??t?.from}),[t?.from,e])}var sv=xw();const jw=Cw(sv);function TE(t,e){const i=Gs(),[n,a]=S.useState(!1),l=S.useRef(!1),u=mE(e),{activeProps:h,inactiveProps:f,activeOptions:d,to:p,preload:v,preloadDelay:g,hashScrollIntoView:y,replace:b,startTransition:C,resetScroll:x,viewTransition:k,children:R,target:L,disabled:E,style:H,className:U,onClick:I,onFocus:N,onMouseEnter:F,onMouseLeave:J,onTouchStart:G,ignoreBlocker:D,params:O,search:P,hash:$,state:M,mask:A,reloadDocument:z,unsafeRelative:q,from:Y,_fromLocation:B,...X}=t,ie=Ts({select:Ne=>Ne.location.search,structuralSharing:!0}),re=t.from,fe=S.useMemo(()=>({...t,from:re}),[i,ie,re,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),he=S.useMemo(()=>i.buildLocation({...fe}),[i,fe]),oe=S.useMemo(()=>{if(E)return;let Ne=he.maskedLocation?he.maskedLocation.url.href:he.url.href,Qe=!1;return i.origin&&(Ne.startsWith(i.origin)?Ne=i.history.createHref(Ne.replace(i.origin,""))||"/":Qe=!0),{href:Ne,external:Qe}},[E,he.maskedLocation,he.url,i.origin,i.history]),ve=S.useMemo(()=>{if(oe?.external)return Qd(oe.href)?void 0:oe.href;try{return new URL(p),Qd(p)?void 0:p}catch{}},[p,oe]),de=t.reloadDocument||ve?!1:v??i.options.defaultPreload,we=g??i.options.defaultPreloadDelay??0,Le=Ts({select:Ne=>{if(ve)return!1;if(d?.exact){if(!zk(Ne.location.pathname,he.pathname,i.basepath))return!1}else{const Qe=ef(Ne.location.pathname,i.basepath),Ye=ef(he.pathname,i.basepath);if(!(Qe.startsWith(Ye)&&(Qe.length===Ye.length||Qe[Ye.length]==="/")))return!1}return(d?.includeSearch??!0)&&!No(Ne.location.search,he.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?Ne.location.hash===he.hash:!0}}),tt=S.useCallback(()=>{i.preloadRoute({...fe}).catch(Ne=>{console.warn(Ne),console.warn(hE)})},[i,fe]),Ge=S.useCallback(Ne=>{Ne?.isIntersecting&&tt()},[tt]);fE(u,Ge,DE,{disabled:!!E||de!=="viewport"}),S.useEffect(()=>{l.current||!E&&de==="render"&&(tt(),l.current=!0)},[E,tt,de]);const xe=Ne=>{const Qe=Ne.currentTarget.getAttribute("target"),Ye=L!==void 0?L:Qe;if(!E&&!OE(Ne)&&!Ne.defaultPrevented&&(!Ye||Ye==="_self")&&Ne.button===0){Ne.preventDefault(),sv.flushSync(()=>{a(!0)});const xt=i.subscribe("onResolved",()=>{xt(),a(!1)});i.navigate({...fe,replace:b,resetScroll:x,hashScrollIntoView:y,startTransition:C,viewTransition:k,ignoreBlocker:D})}};if(ve)return{...X,ref:u,href:ve,...R&&{children:R},...L&&{target:L},...E&&{disabled:E},...H&&{style:H},...U&&{className:U},...I&&{onClick:I},...N&&{onFocus:N},...F&&{onMouseEnter:F},...J&&{onMouseLeave:J},...G&&{onTouchStart:G}};const Oe=Ne=>{E||de&&tt()},ge=Oe,_t=Ne=>{if(!(E||!de))if(!we)tt();else{const Qe=Ne.target;if(su.has(Qe))return;const Ye=setTimeout(()=>{su.delete(Qe),tt()},we);su.set(Qe,Ye)}},St=Ne=>{if(E||!de||!we)return;const Qe=Ne.target,Ye=su.get(Qe);Ye&&(clearTimeout(Ye),su.delete(Qe))},dt=Le?Wa(h,{})??RE:sp,ke=Le?sp:Wa(f,{})??sp,pe=[U,dt.className,ke.className].filter(Boolean).join(" "),Gt=(H||dt.style||ke.style)&&{...H,...dt.style,...ke.style};return{...X,...dt,...ke,href:oe?.href,ref:u,onClick:ru([I,xe]),onFocus:ru([N,Oe]),onMouseEnter:ru([F,_t]),onMouseLeave:ru([J,St]),onTouchStart:ru([G,ge]),disabled:!!E,target:L,...Gt&&{style:Gt},...pe&&{className:pe},...E&&ME,...Le&&AE,...n&&LE}}const sp={},RE={className:"active"},ME={role:"link","aria-disabled":!0},AE={"data-status":"active","aria-current":"page"},LE={"data-transitioning":"transitioning"},su=new WeakMap,DE={rootMargin:"100px"},ru=t=>e=>{for(const i of t)if(i){if(e.defaultPrevented)return;i(e)}},Vw=S.forwardRef((t,e)=>{const{_asChild:i,...n}=t,{type:a,ref:l,...u}=TE(n,e),h=typeof n.children=="function"?n.children({isActive:u["data-status"]==="active"}):n.children;return i===void 0&&delete u.disabled,S.createElement(i||"a",{...u,ref:l},h)});function OE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class BE extends Fw{constructor(e){super(e),this.useMatch=i=>cn({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>cn({...i,from:this.id,select:n=>i?.select?i.select(n.context):n.context}),this.useSearch=i=>iv({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>wf({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>tv({...i,from:this.id}),this.useLoaderData=i=>ev({...i,from:this.id}),this.useNavigate=()=>Fu({from:this.fullPath}),this.Link=We.forwardRef((i,n)=>j.jsx(Vw,{ref:n,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function rv(t){return new BE(t)}class NE extends dE{constructor(e){super(e),this.useMatch=i=>cn({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>cn({...i,from:this.id,select:n=>i?.select?i.select(n.context):n.context}),this.useSearch=i=>iv({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>wf({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>tv({...i,from:this.id}),this.useLoaderData=i=>ev({...i,from:this.id}),this.useNavigate=()=>Fu({from:this.fullPath}),this.Link=We.forwardRef((i,n)=>j.jsx(Vw,{ref:n,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function PE(t){return new NE(t)}function ub(t){return typeof t=="object"?new hb(t,{silent:!0}).createRoute(t):new hb(t,{silent:!0}).createRoute}class hb{constructor(e,i){this.path=e,this.createRoute=n=>{this.silent;const a=rv(n);return a.isRoot=!1,a},this.silent=i?.silent}}class db{constructor(e){this.useMatch=i=>cn({select:i?.select,from:this.options.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>cn({from:this.options.id,select:n=>i?.select?i.select(n.context):n.context}),this.useSearch=i=>iv({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useParams=i=>wf({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useLoaderDeps=i=>tv({...i,from:this.options.id}),this.useLoaderData=i=>ev({...i,from:this.options.id}),this.useNavigate=()=>{const i=Gs();return Fu({from:i.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function fb(t){return typeof t=="object"?new db(t):e=>new db({id:t,...e})}function zE(){const t=Gs(),e=S.useRef({router:t,mounted:!1}),[i,n]=S.useState(!1),{hasPendingMatches:a,isLoading:l}=Ts({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),u=Z_(l),h=l||i||a,f=Z_(h),d=l||a,p=Z_(d);return t.startTransition=v=>{n(!0),S.startTransition(()=>{v(),n(!1)})},S.useEffect(()=>{const v=t.history.subscribe(t.load),g=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ga(t.latestLocation.publicHref)!==Ga(g.publicHref)&&t.commitLocation({...g,replace:!0}),()=>{v()}},[t,t.history]),hd(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(g){console.error(g)}})()},[t]),hd(()=>{u&&!l&&t.emit({type:"onLoad",...Po(t.state)})},[u,t,l]),hd(()=>{p&&!d&&t.emit({type:"onBeforeRouteMount",...Po(t.state)})},[d,p,t]),hd(()=>{if(f&&!h){const v=Po(t.state);t.emit({type:"onResolved",...v}),t.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),v.hrefChanged&&Vk(t)}},[h,f,t]),null}function IE(t){const e=Ts({select:i=>`not-found-${i.location.pathname}-${i.status}`});return j.jsx(Jg,{getResetKey:()=>e,onCatch:(i,n)=>{if(Ks(i))t.onCatch?.(i,n);else throw i},errorComponent:({error:i})=>{if(Ks(i))return t.fallback?.(i);throw i},children:t.children})}function HE(){return j.jsx("p",{children:"Not Found"})}function Hl(t){return j.jsx(j.Fragment,{children:t.children})}function qw(t,e,i){return e.options.notFoundComponent?j.jsx(e.options.notFoundComponent,{...i}):t.options.defaultNotFoundComponent?j.jsx(t.options.defaultNotFoundComponent,{...i}):j.jsx(HE,{})}function UE({children:t}){const e=Gs();return e.isServer?j.jsx("script",{nonce:e.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:t+";document.currentScript.remove()"}}):null}function FE(){const t=Gs();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const i=(t.options.getScrollRestorationKey||$p)(t.latestLocation),n=i!==$p(t.latestLocation)?i:void 0,a={storageKey:tf,shouldScrollRestoration:!0};return n&&(a.key=n),j.jsx(UE,{children:`(${Lw.toString()})(${wk(JSON.stringify(a))})`})}const Yw=S.memo(function({matchId:e}){const i=Gs(),n=Ts({select:k=>{const R=k.matches.find(L=>L.id===e);return Gn(R),{routeId:R.routeId,ssr:R.ssr,_displayPending:R._displayPending}},structuralSharing:!0}),a=i.routesById[n.routeId],l=a.options.pendingComponent??i.options.defaultPendingComponent,u=l?j.jsx(l,{}):null,h=a.options.errorComponent??i.options.defaultErrorComponent,f=a.options.onCatch??i.options.defaultOnCatch,d=a.isRoot?a.options.notFoundComponent??i.options.notFoundRoute?.options.component:a.options.notFoundComponent,p=n.ssr===!1||n.ssr==="data-only",v=(!a.isRoot||a.options.wrapInSuspense||p)&&(a.options.wrapInSuspense??l??(a.options.errorComponent?.preload||p))?S.Suspense:Hl,g=h?Jg:Hl,y=d?IE:Hl,b=Ts({select:k=>k.loadedAt}),C=Ts({select:k=>{const R=k.matches.findIndex(L=>L.id===e);return k.matches[R-1]?.routeId}}),x=a.isRoot?a.options.shellComponent??Hl:Hl;return j.jsxs(x,{children:[j.jsx(bf.Provider,{value:e,children:j.jsx(v,{fallback:u,children:j.jsx(g,{getResetKey:()=>b,errorComponent:h||Sf,onCatch:(k,R)=>{if(Ks(k))throw k;f?.(k,R)},children:j.jsx(y,{fallback:k=>{if(!d||k.routeId&&k.routeId!==n.routeId||!k.routeId&&!a.isRoot)throw k;return S.createElement(d,k)},children:p||n._displayPending?j.jsx(pE,{fallback:u,children:j.jsx(mb,{matchId:e})}):j.jsx(mb,{matchId:e})})})})}),C===Ys&&i.options.scrollRestoration?j.jsxs(j.Fragment,{children:[j.jsx($E,{}),j.jsx(FE,{})]}):null]})});function $E(){const t=Gs(),e=S.useRef(void 0);return j.jsx("script",{suppressHydrationWarning:!0,ref:i=>{i&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...Po(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const mb=S.memo(function({matchId:e}){const i=Gs(),{match:n,key:a,routeId:l}=Ts({select:f=>{const d=f.matches.find(b=>b.id===e),p=d.routeId,g=(i.routesById[p].options.remountDeps??i.options.defaultRemountDeps)?.({routeId:p,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:d.id,status:d.status,error:d.error,invalid:d.invalid,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),u=i.routesById[l],h=S.useMemo(()=>{const f=u.options.component??i.options.defaultComponent;return f?j.jsx(f,{},a):j.jsx(Kw,{})},[a,u.options.component,i.options.defaultComponent]);if(n._displayPending)throw i.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw i.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status==="pending"){const f=u.options.pendingMinMs??i.options.defaultPendingMinMs;if(f){const d=i.getMatch(n.id);if(d&&!d._nonReactive.minPendingPromise&&!i.isServer){const p=Xl();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},f)}}throw i.getMatch(n.id)?._nonReactive.loadPromise}if(n.status==="notFound")return Gn(Ks(n.error)),qw(i,u,n.error);if(n.status==="redirected")throw Gn(kr(n.error)),i.getMatch(n.id)?._nonReactive.loadPromise;if(n.status==="error"){if(i.isServer){const f=(u.options.errorComponent??i.options.defaultErrorComponent)||Sf;return j.jsx(f,{error:n.error,reset:void 0,info:{componentStack:""}})}throw n.error}return h}),Kw=S.memo(function(){const e=Gs(),i=S.useContext(bf),n=Ts({select:d=>d.matches.find(p=>p.id===i)?.routeId}),a=e.routesById[n],l=Ts({select:d=>{const v=d.matches.find(g=>g.id===i);return Gn(v),v.globalNotFound}}),u=Ts({select:d=>{const p=d.matches,v=p.findIndex(g=>g.id===i);return p[v+1]?.id}}),h=e.options.defaultPendingComponent?j.jsx(e.options.defaultPendingComponent,{}):null;if(l)return qw(e,a,void 0);if(!u)return null;const f=j.jsx(Yw,{matchId:u});return n===Ys?j.jsx(S.Suspense,{fallback:h,children:f}):f});function WE(){const t=Gs(),i=t.routesById[Ys].options.pendingComponent??t.options.defaultPendingComponent,n=i?j.jsx(i,{}):null,a=t.isServer||typeof document<"u"&&t.ssr?Hl:S.Suspense,l=j.jsxs(a,{fallback:n,children:[!t.isServer&&j.jsx(zE,{}),j.jsx(jE,{})]});return t.options.InnerWrap?j.jsx(t.options.InnerWrap,{children:l}):l}function jE(){const t=Gs(),e=Ts({select:a=>a.matches[0]?.id}),i=Ts({select:a=>a.loadedAt}),n=e?j.jsx(Yw,{matchId:e}):null;return j.jsx(bf.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?n:j.jsx(Jg,{getResetKey:()=>i,errorComponent:Sf,onCatch:a=>{a.message||a.toString()},children:n})})}const VE=t=>new qE(t);class qE extends aE{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=ub,globalThis.createLazyFileRoute=fb):typeof window<"u"&&(window.createFileRoute=ub,window.createLazyFileRoute=fb);function YE({router:t,children:e,...i}){Object.keys(i).length>0&&t.update({...t.options,...i,context:{...t.options.context,...i.context}});const n=Ww(),a=j.jsx(n.Provider,{value:t,children:e});return t.options.Wrap?j.jsx(t.options.Wrap,{children:a}):a}function KE({router:t,...e}){return j.jsx(YE,{router:t,...e,children:j.jsx(WE,{})})}function nv(){return typeof window<"u"}function av(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function GE(t){return nv()?t instanceof Element||t instanceof av(t).Element:!1}function ov(t){return nv()?t instanceof HTMLElement||t instanceof av(t).HTMLElement:!1}function XE(t){return!nv()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof av(t).ShadowRoot}const _b={};function Nu(t,e){const i=S.useRef(_b);return i.current===_b&&(i.current=t(e)),i}const rp=$w[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],ZE=rp&&rp!==S.useLayoutEffect?rp:t=>t();function Es(t){const e=Nu(QE).current;return e.next=t,ZE(e.effect),e.trampoline}function QE(){const t={next:void 0,callback:JE,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function JE(){}const eT=()=>{},is=typeof document<"u"?S.useLayoutEffect:eT;function Vp(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const Tu={};function Gw(t,e,i,n,a){let l={...qp(t,Tu)};return e&&(l=Dd(l,e)),i&&(l=Dd(l,i)),n&&(l=Dd(l,n)),l}function tT(t){if(t.length===0)return Tu;if(t.length===1)return qp(t[0],Tu);let e={...qp(t[0],Tu)};for(let i=1;i<t.length;i+=1)e=Dd(e,t[i]);return e}function Dd(t,e){return Xw(e)?e(t):iT(t,e)}function iT(t,e){if(!e)return t;for(const i in e){const n=e[i];switch(i){case"style":{t[i]=Vp(t.style,n);break}case"className":{t[i]=Zw(t.className,n);break}default:sT(i,n)?t[i]=rT(t[i],n):t[i]=n}}return t}function sT(t,e){const i=t.charCodeAt(0),n=t.charCodeAt(1),a=t.charCodeAt(2);return i===111&&n===110&&a>=65&&a<=90&&(typeof e=="function"||typeof e>"u")}function Xw(t){return typeof t=="function"}function qp(t,e){return Xw(t)?t(e):t??Tu}function rT(t,e){return e?t?i=>{if(nT(i)){const a=i;Yp(a);const l=e(a);return a.baseUIHandlerPrevented||t?.(a),l}const n=e(i);return t?.(i),n}:e:t}function Yp(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function Zw(t,e){return e?t?e+" "+t:e:t}function nT(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function $u(t,...e){const i=new URL("https://base-ui.com/production-error");return i.searchParams.set("code",t.toString()),e.forEach(n=>i.searchParams.append("args[]",n)),`Base UI error #${t}; visit ${i} for the full message.`}const Qw=S.createContext(void 0);function Jw(t=!1){const e=S.useContext(Qw);if(e===void 0&&!t)throw new Error($u(16));return e}function aT(t){const{focusableWhenDisabled:e,disabled:i,composite:n=!1,tabIndex:a=0,isNativeButton:l}=t,u=n&&e!==!1,h=n&&e===!1;return{props:S.useMemo(()=>{const d={onKeyDown(p){i&&e&&p.key!=="Tab"&&p.preventDefault()}};return n||(d.tabIndex=a,!l&&i&&(d.tabIndex=e?a:-1)),(l&&(e||u)||!l&&i)&&(d["aria-disabled"]=i),l&&(!e||h)&&(d.disabled=i),d},[n,i,e,u,h,l,a])}}function eC(t={}){const{disabled:e=!1,focusableWhenDisabled:i,tabIndex:n=0,native:a=!0}=t,l=S.useRef(null),u=Jw(!0)!==void 0,h=Es(()=>{const g=l.current;return!!(g?.tagName==="A"&&g?.href)}),{props:f}=aT({focusableWhenDisabled:i,disabled:e,composite:u,tabIndex:n,isNativeButton:a}),d=S.useCallback(()=>{const g=l.current;oT(g)&&u&&e&&f.disabled===void 0&&g.disabled&&(g.disabled=!1)},[e,f.disabled,u]);is(d,[d]);const p=S.useCallback((g={})=>{const{onClick:y,onMouseDown:b,onKeyUp:C,onKeyDown:x,onPointerDown:k,...R}=g;return Gw({type:a?"button":void 0,onClick(E){if(e){E.preventDefault();return}y?.(E)},onMouseDown(E){e||b?.(E)},onKeyDown(E){if(e||(Yp(E),x?.(E)),E.baseUIHandlerPrevented)return;const H=E.target===E.currentTarget&&!a&&!h()&&!e,U=E.key==="Enter",I=E.key===" ";H&&((I||U)&&E.preventDefault(),U&&y?.(E))},onKeyUp(E){e||(Yp(E),C?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!a&&!e&&E.key===" "&&y?.(E)},onPointerDown(E){if(e){E.preventDefault();return}k?.(E)}},a?void 0:{role:"button"},f,R)},[e,f,a,h]),v=Es(g=>{l.current=g,d()});return{getButtonProps:p,buttonRef:v}}function oT(t){return ov(t)&&t.tagName==="BUTTON"}function nf(t,e,i,n){const a=Nu(tC).current;return cT(a,t,e,i,n)&&iC(a,[t,e,i,n]),a.callback}function lT(t){const e=Nu(tC).current;return uT(e,t)&&iC(e,t),e.callback}function tC(){return{callback:null,cleanup:null,refs:[]}}function cT(t,e,i,n,a){return t.refs[0]!==e||t.refs[1]!==i||t.refs[2]!==n||t.refs[3]!==a}function uT(t,e){return t.refs.length!==e.length||t.refs.some((i,n)=>i!==e[n])}function iC(t,e){if(t.refs=e,e.every(i=>i==null)){t.callback=null;return}t.callback=i=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),i!=null){const n=Array(e.length).fill(null);for(let a=0;a<e.length;a+=1){const l=e[a];if(l!=null)switch(typeof l){case"function":{const u=l(i);typeof u=="function"&&(n[a]=u);break}case"object":{l.current=i;break}}}t.cleanup=()=>{for(let a=0;a<e.length;a+=1){const l=e[a];if(l!=null)switch(typeof l){case"function":{const u=n[a];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}const hT=parseInt(S.version,10);function dT(t){return hT>=t}function pb(t){if(!S.isValidElement(t))return null;const e=t,i=e.props;return(dT(19)?i?.ref:e.ref)??null}function fT(t,e){const i={};for(const n in t){const a=t[n];if(e?.hasOwnProperty(n)){const l=e[n](a);l!=null&&Object.assign(i,l);continue}a===!0?i[`data-${n.toLowerCase()}`]="":a&&(i[`data-${n.toLowerCase()}`]=a.toString())}return i}function mT(t,e){return typeof t=="function"?t(e):t}function _T(t,e){return typeof t=="function"?t(e):t}function Fr(){}const Kp=Object.freeze([]),nn=Object.freeze({});function Wu(t,e,i={}){const n=e.render,a=pT(e,i);if(i.enabled===!1)return null;const l=i.state??nn;return gT(t,n,a,l)}function pT(t,e={}){const{className:i,style:n,render:a}=t,{state:l=nn,ref:u,props:h,stateAttributesMapping:f,enabled:d=!0}=e,p=d?mT(i,l):void 0,v=d?_T(n,l):void 0,g=d?fT(l,f):nn,y=d?Vp(g,Array.isArray(h)?tT(h):h)??nn:nn;return typeof document<"u"&&(d?Array.isArray(u)?y.ref=lT([y.ref,pb(a),...u]):y.ref=nf(y.ref,pb(a),u):nf(null,null)),d?(p!==void 0&&(y.className=Zw(y.className,p)),v!==void 0&&(y.style=Vp(y.style,v)),y):nn}function gT(t,e,i,n){if(e){if(typeof e=="function")return e(i,n);const a=Gw(i,e.props);return a.ref=i.ref,S.cloneElement(e,a)}if(t&&typeof t=="string")return vT(t,i);throw new Error($u(8))}function vT(t,e){return t==="button"?S.createElement("button",{type:"button",...e,key:e.key}):t==="img"?S.createElement("img",{alt:"",...e,key:e.key}):S.createElement(t,e)}const yT=S.forwardRef(function(e,i){const{render:n,className:a,disabled:l=!1,focusableWhenDisabled:u=!1,nativeButton:h=!0,...f}=e,{getButtonProps:d,buttonRef:p}=eC({disabled:l,focusableWhenDisabled:u,native:h}),v=S.useMemo(()=>({disabled:l}),[l]);return Wu("button",e,{state:v,ref:[i,p],props:[f,d]})});function sC(t){var e,i,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(i=sC(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function rC(){for(var t,e,i=0,n="",a=arguments.length;i<a;i++)(t=arguments[i])&&(e=sC(t))&&(n&&(n+=" "),n+=e);return n}const gb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,vb=rC,nC=(t,e)=>i=>{var n;if(e?.variants==null)return vb(t,i?.class,i?.className);const{variants:a,defaultVariants:l}=e,u=Object.keys(a).map(d=>{const p=i?.[d],v=l?.[d];if(p===null)return null;const g=gb(p)||gb(v);return a[d][g]}),h=i&&Object.entries(i).reduce((d,p)=>{let[v,g]=p;return g===void 0||(d[v]=g),d},{}),f=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:v,className:g,...y}=p;return Object.entries(y).every(b=>{let[C,x]=b;return Array.isArray(x)?x.includes({...l,...h}[C]):{...l,...h}[C]===x})?[...d,v,g]:d},[]);return vb(t,u,f,i?.class,i?.className)},ST=(t,e)=>{const i=new Array(t.length+e.length);for(let n=0;n<t.length;n++)i[n]=t[n];for(let n=0;n<e.length;n++)i[t.length+n]=e[n];return i},bT=(t,e)=>({classGroupId:t,validator:e}),aC=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),af="-",yb=[],wT="arbitrary..",CT=t=>{const e=kT(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return xT(u);const h=u.split(af),f=h[0]===""&&h.length>1?1:0;return oC(h,f,e)},getConflictingClassGroupIds:(u,h)=>{if(h){const f=n[u],d=i[u];return f?d?ST(d,f):f:d||yb}return i[u]||yb}}},oC=(t,e,i)=>{if(t.length-e===0)return i.classGroupId;const a=t[e],l=i.nextPart.get(a);if(l){const d=oC(t,e+1,l);if(d)return d}const u=i.validators;if(u===null)return;const h=e===0?t.join(af):t.slice(e).join(af),f=u.length;for(let d=0;d<f;d++){const p=u[d];if(p.validator(h))return p.classGroupId}},xT=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),i=e.indexOf(":"),n=e.slice(0,i);return n?wT+n:void 0})(),kT=t=>{const{theme:e,classGroups:i}=t;return ET(i,e)},ET=(t,e)=>{const i=aC();for(const n in t){const a=t[n];lv(a,i,n,e)}return i},lv=(t,e,i,n)=>{const a=t.length;for(let l=0;l<a;l++){const u=t[l];TT(u,e,i,n)}},TT=(t,e,i,n)=>{if(typeof t=="string"){RT(t,e,i);return}if(typeof t=="function"){MT(t,e,i,n);return}AT(t,e,i,n)},RT=(t,e,i)=>{const n=t===""?e:lC(e,t);n.classGroupId=i},MT=(t,e,i,n)=>{if(LT(t)){lv(t(n),e,i,n);return}e.validators===null&&(e.validators=[]),e.validators.push(bT(i,t))},AT=(t,e,i,n)=>{const a=Object.entries(t),l=a.length;for(let u=0;u<l;u++){const[h,f]=a[u];lv(f,lC(e,h),i,n)}},lC=(t,e)=>{let i=t;const n=e.split(af),a=n.length;for(let l=0;l<a;l++){const u=n[l];let h=i.nextPart.get(u);h||(h=aC(),i.nextPart.set(u,h)),i=h}return i},LT=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,DT=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,i=Object.create(null),n=Object.create(null);const a=(l,u)=>{i[l]=u,e++,e>t&&(e=0,n=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=n[l])!==void 0)return a(l,u),u},set(l,u){l in i?i[l]=u:a(l,u)}}},Gp="!",Sb=":",OT=[],bb=(t,e,i,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:n,isExternal:a}),BT=t=>{const{prefix:e,experimentalParseClassName:i}=t;let n=a=>{const l=[];let u=0,h=0,f=0,d;const p=a.length;for(let C=0;C<p;C++){const x=a[C];if(u===0&&h===0){if(x===Sb){l.push(a.slice(f,C)),f=C+1;continue}if(x==="/"){d=C;continue}}x==="["?u++:x==="]"?u--:x==="("?h++:x===")"&&h--}const v=l.length===0?a:a.slice(f);let g=v,y=!1;v.endsWith(Gp)?(g=v.slice(0,-1),y=!0):v.startsWith(Gp)&&(g=v.slice(1),y=!0);const b=d&&d>f?d-f:void 0;return bb(l,y,g,b)};if(e){const a=e+Sb,l=n;n=u=>u.startsWith(a)?l(u.slice(a.length)):bb(OT,!1,u,void 0,!0)}if(i){const a=n;n=l=>i({className:l,parseClassName:a})}return n},NT=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((i,n)=>{e.set(i,1e6+n)}),i=>{const n=[];let a=[];for(let l=0;l<i.length;l++){const u=i[l],h=u[0]==="[",f=e.has(u);h||f?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(u)):a.push(u)}return a.length>0&&(a.sort(),n.push(...a)),n}},PT=t=>({cache:DT(t.cacheSize),parseClassName:BT(t),sortModifiers:NT(t),...CT(t)}),zT=/\s+/,IT=(t,e)=>{const{parseClassName:i,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:l}=e,u=[],h=t.trim().split(zT);let f="";for(let d=h.length-1;d>=0;d-=1){const p=h[d],{isExternal:v,modifiers:g,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:C}=i(p);if(v){f=p+(f.length>0?" "+f:f);continue}let x=!!C,k=n(x?b.substring(0,C):b);if(!k){if(!x){f=p+(f.length>0?" "+f:f);continue}if(k=n(b),!k){f=p+(f.length>0?" "+f:f);continue}x=!1}const R=g.length===0?"":g.length===1?g[0]:l(g).join(":"),L=y?R+Gp:R,E=L+k;if(u.indexOf(E)>-1)continue;u.push(E);const H=a(k,x);for(let U=0;U<H.length;++U){const I=H[U];u.push(L+I)}f=p+(f.length>0?" "+f:f)}return f},HT=(...t)=>{let e=0,i,n,a="";for(;e<t.length;)(i=t[e++])&&(n=cC(i))&&(a&&(a+=" "),a+=n);return a},cC=t=>{if(typeof t=="string")return t;let e,i="";for(let n=0;n<t.length;n++)t[n]&&(e=cC(t[n]))&&(i&&(i+=" "),i+=e);return i},UT=(t,...e)=>{let i,n,a,l;const u=f=>{const d=e.reduce((p,v)=>v(p),t());return i=PT(d),n=i.cache.get,a=i.cache.set,l=h,h(f)},h=f=>{const d=n(f);if(d)return d;const p=IT(f,i);return a(f,p),p};return l=u,(...f)=>l(HT(...f))},FT=[],wi=t=>{const e=i=>i[t]||FT;return e.isThemeGetter=!0,e},uC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$T=/^\d+\/\d+$/,WT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jT=/\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$/,VT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ol=t=>$T.test(t),st=t=>!!t&&!Number.isNaN(Number(t)),Da=t=>!!t&&Number.isInteger(Number(t)),np=t=>t.endsWith("%")&&st(t.slice(0,-1)),zn=t=>WT.test(t),KT=()=>!0,GT=t=>jT.test(t)&&!VT.test(t),dC=()=>!1,XT=t=>qT.test(t),ZT=t=>YT.test(t),QT=t=>!Re(t)&&!Me(t),JT=t=>Jl(t,_C,dC),Re=t=>uC.test(t),Eo=t=>Jl(t,pC,GT),ap=t=>Jl(t,rR,st),wb=t=>Jl(t,fC,dC),eR=t=>Jl(t,mC,ZT),dd=t=>Jl(t,gC,XT),Me=t=>hC.test(t),nu=t=>ec(t,pC),tR=t=>ec(t,nR),Cb=t=>ec(t,fC),iR=t=>ec(t,_C),sR=t=>ec(t,mC),fd=t=>ec(t,gC,!0),Jl=(t,e,i)=>{const n=uC.exec(t);return n?n[1]?e(n[1]):i(n[2]):!1},ec=(t,e,i=!1)=>{const n=hC.exec(t);return n?n[1]?e(n[1]):i:!1},fC=t=>t==="position"||t==="percentage",mC=t=>t==="image"||t==="url",_C=t=>t==="length"||t==="size"||t==="bg-size",pC=t=>t==="length",rR=t=>t==="number",nR=t=>t==="family-name",gC=t=>t==="shadow",aR=()=>{const t=wi("color"),e=wi("font"),i=wi("text"),n=wi("font-weight"),a=wi("tracking"),l=wi("leading"),u=wi("breakpoint"),h=wi("container"),f=wi("spacing"),d=wi("radius"),p=wi("shadow"),v=wi("inset-shadow"),g=wi("text-shadow"),y=wi("drop-shadow"),b=wi("blur"),C=wi("perspective"),x=wi("aspect"),k=wi("ease"),R=wi("animate"),L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],H=()=>[...E(),Me,Re],U=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],N=()=>[Me,Re,f],F=()=>[Ol,"full","auto",...N()],J=()=>[Da,"none","subgrid",Me,Re],G=()=>["auto",{span:["full",Da,Me,Re]},Da,Me,Re],D=()=>[Da,"auto",Me,Re],O=()=>["auto","min","max","fr",Me,Re],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...N()],A=()=>[Ol,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],z=()=>[t,Me,Re],q=()=>[...E(),Cb,wb,{position:[Me,Re]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",iR,JT,{size:[Me,Re]}],X=()=>[np,nu,Eo],ie=()=>["","none","full",d,Me,Re],re=()=>["",st,nu,Eo],fe=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[st,np,Cb,wb],ve=()=>["","none",b,Me,Re],de=()=>["none",st,Me,Re],we=()=>["none",st,Me,Re],Le=()=>[st,Me,Re],tt=()=>[Ol,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zn],breakpoint:[zn],color:[KT],container:[zn],"drop-shadow":[zn],ease:["in","out","in-out"],font:[QT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zn],shadow:[zn],spacing:["px",st],text:[zn],"text-shadow":[zn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ol,Re,Me,x]}],container:["container"],columns:[{columns:[st,Re,Me,h]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"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:H()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Da,"auto",Me,Re]}],basis:[{basis:[Ol,"full","auto",h,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,Ol,"auto","initial","none",Re]}],grow:[{grow:["",st,Me,Re]}],shrink:[{shrink:["",st,Me,Re]}],order:[{order:[Da,"first","last","none",Me,Re]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[h,"screen",...A()]}],"min-w":[{"min-w":[h,"screen","none",...A()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",i,nu,Eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Me,ap]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",np,Re]}],"font-family":[{font:[tR,Re,e]}],"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:[a,Me,Re]}],"line-clamp":[{"line-clamp":[st,"none",Me,ap]}],leading:[{leading:[l,...N()]}],"list-image":[{"list-image":["none",Me,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",Me,Eo]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[st,"auto",Me,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Re]}],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",Me,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Da,Me,Re],radial:["",Me,Re],conic:[Da,Me,Re]},sR,eR]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,Me,Re]}],"outline-w":[{outline:["",st,nu,Eo]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",p,fd,dd]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",v,fd,dd]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[st,Eo]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",g,fd,dd]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[st,Me,Re]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Me,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":E()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Re]}],filter:[{filter:["","none",Me,Re]}],blur:[{blur:ve()}],brightness:[{brightness:[st,Me,Re]}],contrast:[{contrast:[st,Me,Re]}],"drop-shadow":[{"drop-shadow":["","none",y,fd,dd]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",st,Me,Re]}],"hue-rotate":[{"hue-rotate":[st,Me,Re]}],invert:[{invert:["",st,Me,Re]}],saturate:[{saturate:[st,Me,Re]}],sepia:[{sepia:["",st,Me,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Re]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[st,Me,Re]}],"backdrop-contrast":[{"backdrop-contrast":[st,Me,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,Me,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,Me,Re]}],"backdrop-invert":[{"backdrop-invert":["",st,Me,Re]}],"backdrop-opacity":[{"backdrop-opacity":[st,Me,Re]}],"backdrop-saturate":[{"backdrop-saturate":[st,Me,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",st,Me,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",Me,Re]}],ease:[{ease:["linear","initial",k,Me,Re]}],delay:[{delay:[st,Me,Re]}],animate:[{animate:["none",R,Me,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Me,Re]}],"perspective-origin":[{"perspective-origin":H()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:we()}],"scale-x":[{"scale-x":we()}],"scale-y":[{"scale-y":we()}],"scale-z":[{"scale-z":we()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[Me,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:H()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tt()}],"translate-x":[{"translate-x":tt()}],"translate-y":[{"translate-y":tt()}],"translate-z":[{"translate-z":tt()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",Me,Re]}],"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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",Me,Re]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[st,nu,Eo,ap]}],stroke:[{stroke:["none",...z()]}],"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"]}},oR=UT(aR);function ju(...t){return oR(rC(t))}const lR=nC("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",toolbar:"hover:bg-input hover:text-foreground aria-expanded:bg-input aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline",headless:"border-0 bg-transparent rounded-none font-normal text-[inherit] whitespace-normal transition-none justify-start"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-md px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-md px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-9","icon-xs":"size-6 rounded-md in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-md in-data-[slot=button-group]:rounded-md","icon-lg":"size-10",headless:"h-auto w-auto gap-0 p-0"}},defaultVariants:{variant:"default",size:"default"}});function Od({className:t,variant:e="default",size:i="default",...n}){return j.jsx(yT,{"data-slot":"button",className:ju(lR({variant:e,size:i,className:t})),...n})}let xb=(function(t){return t.disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});const cR={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},uR={valid(t){return t===null?null:t?{[xb.valid]:""}:{[xb.invalid]:""}}},hR=S.createContext({invalid:void 0,name:void 0,validityData:{state:cR,errors:[],error:"",value:"",initialValue:null},setValidityData:Fr,disabled:void 0,touched:!1,setTouched:Fr,dirty:!1,setDirty:Fr,filled:!1,setFilled:Fr,focused:!1,setFocused:Fr,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:(t=nn)=>t,getInputValidationProps:(t=nn)=>t,inputRef:{current:null},commit:async()=>{}}});function Xp(t=!0){const e=S.useContext(hR);if(e.setValidityData===Fr&&!t)throw new Error($u(28));return e}const dR=S.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Fr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function fR(){return S.useContext(dR)}const mR={...$w};let kb=0;function _R(t,e="mui"){const[i,n]=S.useState(t),a=t||i;return S.useEffect(()=>{i==null&&(kb+=1,n(`${e}-${kb}`))},[i,e]),a}const Eb=mR.useId;function pR(t,e){if(Eb!==void 0){const i=Eb();return t??`${e}-${i}`}return _R(t,e)}function vC(t){return pR(t,"base-ui")}const gR=S.createContext({controlId:void 0,setControlId:Fr,labelId:void 0,setLabelId:Fr,messageIds:[],setMessageIds:Fr,getDescriptionProps:t=>t});function yC(){return S.useContext(gR)}function vR(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}function Tb(t){return t?.ownerDocument||document}const op="ArrowLeft",lp="ArrowRight",yR="ArrowUp",SR="ArrowDown";function bR(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function wR(t,e){if(!t||!e)return!1;const i=e.getRootNode?.();if(t.contains(e))return!0;if(i&&XE(i)){let n=e;for(;n;){if(t===n)return!0;n=n.parentNode||n.host}}return!1}function Bl(t){t.preventDefault(),t.stopPropagation()}const Rb=Math.floor;function md(t,e,i){return Math.floor(t/e)!==i}function Bd(t,e){return e<0||e>=t.current.length}function CR(t,e){return js(t,{disabledIndices:e})}function xR(t,e){return js(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function js(t,{startingIndex:e=-1,decrement:i=!1,disabledIndices:n,amount:a=1}={}){let l=e;do l+=i?-a:a;while(l>=0&&l<=t.current.length-1&&Ru(t,l,n));return l}function kR(t,{event:e,orientation:i,loopFocus:n,rtl:a,cols:l,disabledIndices:u,minIndex:h,maxIndex:f,prevIndex:d,stopEvent:p=!1}){let v=d;const g=[],y={};let b=!1;{let k=null,R=-1;t.current.forEach((L,E)=>{if(L==null)return;const H=L.closest('[role="row"]');H&&(b=!0),(H!==k||R===-1)&&(k=H,R+=1,g[R]=[]),g[R].push(E),y[E]=R})}const C=b&&g.length>0&&g.some(k=>k.length!==l);function x(k){if(!C||d===-1)return;const R=y[d];if(R==null)return;const L=g[R].indexOf(d);let E=k==="up"?R-1:R+1;n&&(E<0?E=g.length-1:E>=g.length&&(E=0));const H=new Set;for(;E>=0&&E<g.length&&!H.has(E);){H.add(E);const U=g[E];if(U.length===0){E=k==="up"?E-1:E+1;continue}const I=Math.min(L,U.length-1);for(let N=I;N>=0;N-=1){const F=U[N];if(!Ru(t,F,u))return F}E=k==="up"?E-1:E+1,n&&(E<0?E=g.length-1:E>=g.length&&(E=0))}}if(e.key===yR){const k=x("up");if(k!==void 0)p&&Bl(e),v=k;else{if(p&&Bl(e),d===-1)v=f;else if(v=js(t,{startingIndex:v,amount:l,decrement:!0,disabledIndices:u}),n&&(d-l<h||v<0)){const R=d%l,L=f%l,E=f-(L-R);L===R?v=f:v=L>R?E:E-l}Bd(t,v)&&(v=d)}}if(e.key===SR){const k=x("down");k!==void 0?(p&&Bl(e),v=k):(p&&Bl(e),d===-1?v=h:(v=js(t,{startingIndex:d,amount:l,disabledIndices:u}),n&&d+l>f&&(v=js(t,{startingIndex:d%l-l,amount:l,disabledIndices:u}))),Bd(t,v)&&(v=d))}if(i==="both"){const k=Rb(d/l);e.key===(a?op:lp)&&(p&&Bl(e),d%l!==l-1?(v=js(t,{startingIndex:d,disabledIndices:u}),n&&md(v,l,k)&&(v=js(t,{startingIndex:d-d%l-1,disabledIndices:u}))):n&&(v=js(t,{startingIndex:d-d%l-1,disabledIndices:u})),md(v,l,k)&&(v=d)),e.key===(a?lp:op)&&(p&&Bl(e),d%l!==0?(v=js(t,{startingIndex:d,decrement:!0,disabledIndices:u}),n&&md(v,l,k)&&(v=js(t,{startingIndex:d+(l-d%l),decrement:!0,disabledIndices:u}))):n&&(v=js(t,{startingIndex:d+(l-d%l),decrement:!0,disabledIndices:u})),md(v,l,k)&&(v=d));const R=Rb(f/l)===k;Bd(t,v)&&(n&&R?v=e.key===(a?lp:op)?f:js(t,{startingIndex:d-d%l-1,disabledIndices:u}):v=d)}return v}function ER(t,e,i){const n=[];let a=0;return t.forEach(({width:l,height:u},h)=>{let f=!1;for(i&&(a=0);!f;){const d=[];for(let p=0;p<l;p+=1)for(let v=0;v<u;v+=1)d.push(a+p+v*e);a%e+l<=e&&d.every(p=>n[p]==null)?(d.forEach(p=>{n[p]=h}),f=!0):a+=1}}),[...n]}function TR(t,e,i,n,a){if(t===-1)return-1;const l=i.indexOf(t),u=e[t];switch(a){case"tl":return l;case"tr":return u?l+u.width-1:l;case"bl":return u?l+(u.height-1)*n:l;case"br":return i.lastIndexOf(t);default:return-1}}function RR(t,e){return e.flatMap((i,n)=>t.includes(i)?[n]:[])}function Ru(t,e,i){if(typeof i=="function")return i(e);if(i)return i.includes(e);const n=t.current[e];return n?n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true":!1}function SC({controlled:t,default:e,name:i,state:n="value"}){const{current:a}=S.useRef(t!==void 0),[l,u]=S.useState(e),h=a?t:l,f=S.useCallback(d=>{a||u(d)},[]);return[h,f]}function MR(t={}){const{id:e,implicit:i=!1,controlRef:n}=t,{controlId:a,setControlId:l}=yC(),u=vC(e);return is(()=>{if(!(!i&&!e||l===Fr)){if(i){const h=n?.current;GE(h)&&h.closest("label")!=null?l(e??null):l(a??u)}else e&&l(e);return()=>{e&&l(void 0)}}},[e,n,a,l,i,u]),a??u}function AR(t){const{enabled:e=!0,value:i,id:n,name:a,controlRef:l,commit:u}=t,{formRef:h}=fR(),{invalid:f,markedDirtyRef:d,validityData:p,setValidityData:v}=Xp(),g=Es(t.getValue);is(()=>{if(!e)return;let y=i;y===void 0&&(y=g()),p.initialValue===null&&y!==null&&v(b=>({...b,initialValue:y}))},[e,v,i,p.initialValue,g]),is(()=>{!e||!n||h.current.fields.set(n,{getValue:g,name:a,controlRef:l,validityData:vR(p,f),validate(y=!0){let b=i;b===void 0&&(b=g()),d.current=!0,y?sv.flushSync(()=>u(b)):u(b)}})},[u,l,e,h,g,n,f,d,a,p,i]),is(()=>{const y=h.current.fields;return()=>{n&&y.delete(n)}},[h,n])}const Zp="none";function Qp(t,e,i,n){let a=!1,l=!1;const u=n??nn;return{reason:t,event:e??new Event("base-ui"),cancel(){a=!0},allowPropagation(){l=!0},get isCanceled(){return a},get isPropagationAllowed(){return l},trigger:i,...u}}const LR=S.forwardRef(function(e,i){const{render:n,className:a,id:l,name:u,value:h,disabled:f=!1,onValueChange:d,defaultValue:p,...v}=e,{state:g,name:y,disabled:b}=Xp(),C=b||f,x=y??u,k=S.useMemo(()=>({...g,disabled:C}),[g,C]),{setTouched:R,setDirty:L,validityData:E,setFocused:H,setFilled:U,validationMode:I,validation:N}=Xp(),{labelId:F}=yC(),J=MR({id:l});is(()=>{const M=h!=null;N.inputRef.current?.value||M&&h!==""?U(!0):M&&h===""&&U(!1)},[N.inputRef,U,h]);const[G,D]=SC({controlled:h,default:p,name:"FieldControl",state:"value"}),O=h!==void 0,P=Es((M,A)=>{d?.(M,A),!A.isCanceled&&D(M)});return AR({id:J,name:x,commit:N.commit,value:G,getValue:()=>N.inputRef.current?.value,controlRef:N.inputRef}),Wu("input",e,{ref:i,state:k,props:[{id:J,disabled:C,name:x,ref:N.inputRef,"aria-labelledby":F,...O?{value:G}:{defaultValue:p},onChange(M){const A=M.currentTarget.value;P(A,Qp(Zp,M.nativeEvent)),L(A!==E.initialValue),U(A!=="")},onFocus(){H(!0)},onBlur(M){R(!0),H(!1),I==="onBlur"&&N.commit(M.currentTarget.value)},onKeyDown(M){M.currentTarget.tagName==="INPUT"&&M.key==="Enter"&&(R(!0),N.commit(M.currentTarget.value))}},N.getInputValidationProps(),v],stateAttributesMapping:uR})}),DR=S.forwardRef(function(e,i){return j.jsx(LR,{ref:i,...e})});function OR({className:t,type:e,...i}){return j.jsx(DR,{type:e,"data-slot":"input",className:ju("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",t),...i})}const bC=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function BR(){return S.useContext(bC)}function wC(t){const{children:e,elementsRef:i,labelsRef:n,onMapChange:a}=t,l=Es(a),u=S.useRef(0),h=Nu(PR).current,f=Nu(NR).current,[d,p]=S.useState(0),v=S.useRef(d),g=Es((k,R)=>{f.set(k,R??null),v.current+=1,p(v.current)}),y=Es(k=>{f.delete(k),v.current+=1,p(v.current)}),b=S.useMemo(()=>{const k=new Map;return Array.from(f.keys()).filter(L=>L.isConnected).sort(zR).forEach((L,E)=>{const H=f.get(L)??{};k.set(L,{...H,index:E})}),k},[f,d]);is(()=>{if(typeof MutationObserver!="function"||b.size===0)return;const k=new MutationObserver(R=>{const L=new Set,E=H=>L.has(H)?L.delete(H):L.add(H);R.forEach(H=>{H.removedNodes.forEach(E),H.addedNodes.forEach(E)}),L.size===0&&(v.current+=1,p(v.current))});return b.forEach((R,L)=>{L.parentElement&&k.observe(L.parentElement,{childList:!0})}),()=>{k.disconnect()}},[b]),is(()=>{v.current===d&&(i.current.length!==b.size&&(i.current.length=b.size),n&&n.current.length!==b.size&&(n.current.length=b.size),u.current=b.size),l(b)},[l,b,i,n,d]),is(()=>()=>{i.current=[]},[i]),is(()=>()=>{n&&(n.current=[])},[n]);const C=Es(k=>(h.add(k),()=>{h.delete(k)}));is(()=>{h.forEach(k=>k(b))},[h,b]);const x=S.useMemo(()=>({register:g,unregister:y,subscribeMapChange:C,elementsRef:i,labelsRef:n,nextIndexRef:u}),[g,y,C,i,n,u]);return j.jsx(bC.Provider,{value:x,children:e})}function NR(){return new Map}function PR(){return new Set}function zR(t,e){const i=t.compareDocumentPosition(e);return i&Node.DOCUMENT_POSITION_FOLLOWING||i&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:i&Node.DOCUMENT_POSITION_PRECEDING||i&Node.DOCUMENT_POSITION_CONTAINS?1:0}const IR=S.createContext(void 0);function CC(){return S.useContext(IR)?.direction??"ltr"}const xC=S.createContext(void 0);function kC(){const t=S.useContext(xC);if(t===void 0)throw new Error($u(64));return t}let HR=(function(t){return t.activationDirection="data-activation-direction",t.orientation="data-orientation",t})({});const EC={tabActivationDirection:t=>({[HR.activationDirection]:t})},UR=S.forwardRef(function(e,i){const{className:n,defaultValue:a=0,onValueChange:l,orientation:u="horizontal",render:h,value:f,...d}=e,p=CC(),v=Object.hasOwn(e,"defaultValue"),g=S.useRef([]),[y,b]=S.useState(()=>new Map),[C,x]=SC({controlled:f,default:a,name:"Tabs",state:"value"}),k=f!==void 0,[R,L]=S.useState(()=>new Map),[E,H]=S.useState("none"),U=Es((A,z)=>{l?.(A,z),!z.isCanceled&&(x(A),H(z.activationDirection))}),I=Es((A,z)=>{b(q=>{if(q.get(A)===z)return q;const Y=new Map(q);return Y.set(A,z),Y})}),N=Es((A,z)=>{b(q=>{if(!q.has(A)||q.get(A)!==z)return q;const Y=new Map(q);return Y.delete(A),Y})}),F=S.useCallback(A=>y.get(A),[y]),J=S.useCallback(A=>{for(const z of R.values())if(A===z?.value)return z?.id},[R]),G=S.useCallback(A=>{if(A===void 0)return null;for(const[z,q]of R.entries())if(q!=null&&A===(q.value??q.index))return z;return null},[R]),D=S.useMemo(()=>({direction:p,getTabElementBySelectedValue:G,getTabIdByPanelValue:J,getTabPanelIdByValue:F,onValueChange:U,orientation:u,registerMountedTabPanel:I,setTabMap:L,unregisterMountedTabPanel:N,tabActivationDirection:E,value:C}),[p,G,J,F,U,u,I,L,N,E,C]),O=S.useMemo(()=>{for(const A of R.values())if(A!=null&&A.value===C)return A},[R,C]),P=S.useMemo(()=>{for(const A of R.values())if(A!=null&&!A.disabled)return A.value},[R]);is(()=>{if(k||R.size===0)return;const A=O?.disabled,z=O==null&&C!==null;if(v&&A&&C===a||!A&&!z)return;const Y=P??null;C!==Y&&(x(Y),H("none"))},[a,P,v,k,O,H,x,R,C]);const M=Wu("div",e,{state:{orientation:u,tabActivationDirection:E},ref:i,props:d,stateAttributesMapping:EC});return j.jsx(xC.Provider,{value:D,children:j.jsx(wC,{elementsRef:g,children:M})})}),TC="data-composite-item-active";let FR=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function $R(t={}){const{label:e,metadata:i,textRef:n,indexGuessBehavior:a,index:l}=t,{register:u,unregister:h,subscribeMapChange:f,elementsRef:d,labelsRef:p,nextIndexRef:v}=BR(),g=S.useRef(-1),[y,b]=S.useState(l??(a===FR.GuessFromOrder?()=>{if(g.current===-1){const k=v.current;v.current+=1,g.current=k}return g.current}:-1)),C=S.useRef(null),x=S.useCallback(k=>{if(C.current=k,y!==-1&&k!==null&&(d.current[y]=k,p)){const R=e!==void 0;p.current[y]=R?e:n?.current?.textContent??k.textContent}},[y,d,p,e,n]);return is(()=>{if(l!=null)return;const k=C.current;if(k)return u(k,i),()=>{h(k)}},[l,u,h,i]),is(()=>{if(l==null)return f(k=>{const R=C.current?k.get(C.current)?.index:null;R!=null&&b(R)})},[l,f,b]),S.useMemo(()=>({ref:x,index:y}),[y,x])}function WR(t={}){const{highlightItemOnHover:e,highlightedIndex:i,onHighlightedIndexChange:n}=Jw(),{ref:a,index:l}=$R(t),u=i===l,h=S.useRef(null),f=nf(a,h);return{compositeProps:S.useMemo(()=>({tabIndex:u?0:-1,onFocus(){n(l)},onMouseMove(){const p=h.current;if(!e||!p)return;const v=p.hasAttribute("disabled")||p.ariaDisabled==="true";!u&&!v&&p.focus()}}),[u,n,l,e]),compositeRef:f,index:l}}const RC=S.createContext(void 0);function jR(){const t=S.useContext(RC);if(t===void 0)throw new Error($u(65));return t}const VR=S.forwardRef(function(e,i){const{className:n,disabled:a=!1,render:l,value:u,id:h,nativeButton:f=!0,...d}=e,{value:p,getTabPanelIdByValue:v,orientation:g}=kC(),{activateOnFocus:y,highlightedTabIndex:b,onTabActivation:C,setHighlightedTabIndex:x,tabsListElement:k}=jR(),R=vC(h),L=S.useMemo(()=>({disabled:a,id:R,value:u}),[a,R,u]),{compositeProps:E,compositeRef:H,index:U}=WR({metadata:L}),I=u===p,N=S.useRef(!1);is(()=>{if(N.current){N.current=!1;return}if(!(I&&U>-1&&b!==U))return;const q=k;if(q!=null){const Y=bR(Tb(q));if(Y&&wR(q,Y))return}a||x(U)},[I,U,b,x,a,k]);const{getButtonProps:F,buttonRef:J}=eC({disabled:a,native:f,focusableWhenDisabled:!0}),G=v(u),D=S.useRef(!1),O=S.useRef(!1);function P(q){I||a||C(u,Qp(Zp,q.nativeEvent,void 0,{activationDirection:"none"}))}function $(q){I||(U>-1&&!a&&x(U),!a&&y&&(!D.current||D.current&&O.current)&&C(u,Qp(Zp,q.nativeEvent,void 0,{activationDirection:"none"})))}function M(q){if(I||a)return;D.current=!0;function Y(){D.current=!1,O.current=!1}(!q.button||q.button===0)&&(O.current=!0,Tb(q.currentTarget).addEventListener("pointerup",Y,{once:!0}))}const A=S.useMemo(()=>({disabled:a,active:I,orientation:g}),[a,I,g]);return Wu("button",e,{state:A,ref:[i,J,H],props:[E,{role:"tab","aria-controls":G,"aria-selected":I,id:R,onClick:P,onFocus:$,onPointerDown:M,[TC]:I?"":void 0,onKeyDownCapture(){N.current=!0}},d,F]})});function qR(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const Mu="ArrowUp",$l="ArrowDown",of="ArrowLeft",Au="ArrowRight",Cf="Home",xf="End",MC=new Set([of,Au]),YR=new Set([of,Au,Cf,xf]),AC=new Set([Mu,$l]),KR=new Set([Mu,$l,Cf,xf]),LC=new Set([...MC,...AC]),GR=new Set([...LC,Cf,xf]),XR="Shift",ZR="Control",QR="Alt",JR="Meta",eM=new Set([XR,ZR,QR,JR]);function tM(t){return ov(t)&&t.tagName==="INPUT"}function Mb(t){return!!(tM(t)&&t.selectionStart!=null||ov(t)&&t.tagName==="TEXTAREA")}function Ab(t,e,i,n){if(!t||!e||!e.scrollTo)return;let a=t.scrollLeft,l=t.scrollTop;const u=t.clientWidth<t.scrollWidth,h=t.clientHeight<t.scrollHeight;if(u&&n!=="vertical"){const f=Lb(t,e,"left"),d=_d(t),p=_d(e);i==="ltr"&&(f+e.offsetWidth+p.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?a=f+e.offsetWidth+p.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:f-p.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(a=f-p.scrollMarginLeft-d.scrollPaddingLeft)),i==="rtl"&&(f-p.scrollMarginRight<t.scrollLeft+d.scrollPaddingLeft?a=f-p.scrollMarginLeft-d.scrollPaddingLeft:f+e.offsetWidth+p.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(a=f+e.offsetWidth+p.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(h&&n!=="horizontal"){const f=Lb(t,e,"top"),d=_d(t),p=_d(e);f-p.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?l=f-p.scrollMarginTop-d.scrollPaddingTop:f+e.offsetHeight+p.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(l=f+e.offsetHeight+p.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:a,top:l,behavior:"auto"})}function Lb(t,e,i){const n=i==="left"?"offsetLeft":"offsetTop";let a=0;for(;e.offsetParent&&(a+=e[n],e.offsetParent!==t);)e=e.offsetParent;return a}function _d(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}const iM=[];function sM(t){const{itemSizes:e,cols:i=1,loopFocus:n=!0,dense:a=!1,orientation:l="both",direction:u,highlightedIndex:h,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:p=!1,stopEventPropagation:v=!1,disabledIndices:g,modifierKeys:y=iM}=t,[b,C]=S.useState(0),x=i>1,k=S.useRef(null),R=nf(k,d),L=S.useRef([]),E=S.useRef(!1),H=h??b,U=Es((F,J=!1)=>{if((f??C)(F),J){const G=L.current[F];Ab(k.current,G,u,l)}}),I=Es(F=>{if(F.size===0||E.current)return;E.current=!0;const J=Array.from(F.keys()),G=J.find(O=>O?.hasAttribute(TC))??null,D=G?J.indexOf(G):-1;D!==-1&&U(D),Ab(k.current,G,u,l)}),N=S.useMemo(()=>({"aria-orientation":l==="both"?void 0:l,ref:R,onFocus(F){!k.current||!Mb(F.target)||F.target.setSelectionRange(0,F.target.value.length??0)},onKeyDown(F){const J=p?GR:LC;if(!J.has(F.key)||rM(F,y)||!k.current)return;const D=u==="rtl",O=D?of:Au,P={horizontal:O,vertical:$l,both:O}[l],$=D?Au:of,M={horizontal:$,vertical:Mu,both:$}[l];if(Mb(F.target)&&!qR(F.target)){const ie=F.target.selectionStart,re=F.target.selectionEnd,fe=F.target.value??"";if(ie==null||F.shiftKey||ie!==re||F.key!==M&&ie<fe.length||F.key!==P&&ie>0)return}let A=H;const z=CR(L,g),q=xR(L,g);if(x){const ie=e||Array.from({length:L.current.length},()=>({width:1,height:1})),re=ER(ie,i,a),fe=re.findIndex(oe=>oe!=null&&!Ru(L,oe,g)),he=re.reduce((oe,ve,de)=>ve!=null&&!Ru(L,ve,g)?de:oe,-1);A=re[kR({current:re.map(oe=>oe?L.current[oe]:null)},{event:F,orientation:l,loopFocus:n,cols:i,disabledIndices:RR([...g||L.current.map((oe,ve)=>Ru(L,ve)?ve:void 0),void 0],re),minIndex:fe,maxIndex:he,prevIndex:TR(H>q?z:H,ie,re,i,F.key===$l?"bl":F.key===Au?"tr":"tl"),rtl:D})]}const Y={horizontal:[O],vertical:[$l],both:[O,$l]}[l],B={horizontal:[$],vertical:[Mu],both:[$,Mu]}[l],X=x?J:{horizontal:p?YR:MC,vertical:p?KR:AC,both:J}[l];p&&(F.key===Cf?A=z:F.key===xf&&(A=q)),A===H&&(Y.includes(F.key)||B.includes(F.key))&&(n&&A===q&&Y.includes(F.key)?A=z:n&&A===z&&B.includes(F.key)?A=q:A=js(L,{startingIndex:A,decrement:B.includes(F.key),disabledIndices:g})),A!==H&&!Bd(L,A)&&(v&&F.stopPropagation(),X.has(F.key)&&F.preventDefault(),U(A,!0),queueMicrotask(()=>{L.current[A]?.focus()}))}}),[i,a,u,g,L,p,H,x,e,n,R,y,U,l,v]);return S.useMemo(()=>({props:N,highlightedIndex:H,onHighlightedIndexChange:U,elementsRef:L,disabledIndices:g,onMapChange:I,relayKeyboardEvent:N.onKeyDown}),[N,H,U,L,g,I])}function rM(t,e){for(const i of eM.values())if(!e.includes(i)&&t.getModifierState(i))return!0;return!1}function nM(t){const{render:e,className:i,refs:n=Kp,props:a=Kp,state:l=nn,stateAttributesMapping:u,highlightedIndex:h,onHighlightedIndexChange:f,orientation:d,dense:p,itemSizes:v,loopFocus:g,cols:y,enableHomeAndEndKeys:b,onMapChange:C,stopEventPropagation:x=!0,rootRef:k,disabledIndices:R,modifierKeys:L,highlightItemOnHover:E=!1,tag:H="div",...U}=t,I=CC(),{props:N,highlightedIndex:F,onHighlightedIndexChange:J,elementsRef:G,onMapChange:D,relayKeyboardEvent:O}=sM({itemSizes:v,cols:y,loopFocus:g,dense:p,orientation:d,highlightedIndex:h,onHighlightedIndexChange:f,rootRef:k,stopEventPropagation:x,enableHomeAndEndKeys:b,direction:I,disabledIndices:R,modifierKeys:L}),P=Wu(H,t,{state:l,ref:n,props:[N,...a,U],stateAttributesMapping:u}),$=S.useMemo(()=>({highlightedIndex:F,onHighlightedIndexChange:J,highlightItemOnHover:E,relayKeyboardEvent:O}),[F,J,E,O]);return j.jsx(Qw.Provider,{value:$,children:j.jsx(wC,{elementsRef:G,onMapChange:M=>{C?.(M),D(M)},children:P})})}const aM=S.forwardRef(function(e,i){const{activateOnFocus:n=!1,className:a,loopFocus:l=!0,render:u,...h}=e,{getTabElementBySelectedValue:f,onValueChange:d,orientation:p,value:v,setTabMap:g,tabActivationDirection:y}=kC(),[b,C]=S.useState(0),[x,k]=S.useState(null),R=oM(v,p,x,f),L=Es((I,N)=>{if(I!==v){const F=R(I);N.activationDirection=F,d(I,N)}}),E=S.useMemo(()=>({orientation:p,tabActivationDirection:y}),[p,y]),H={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},U=S.useMemo(()=>({activateOnFocus:n,highlightedTabIndex:b,onTabActivation:L,setHighlightedTabIndex:C,tabsListElement:x,value:v}),[n,b,L,C,x,v]);return j.jsx(RC.Provider,{value:U,children:j.jsx(nM,{render:u,className:a,state:E,refs:[i,k],props:[H,h],stateAttributesMapping:EC,highlightedIndex:b,enableHomeAndEndKeys:!0,loopFocus:l,orientation:p,onHighlightedIndexChange:C,onMapChange:g,disabledIndices:Kp})})});function Db(t,e){const{left:i,top:n}=t.getBoundingClientRect(),{left:a,top:l}=e.getBoundingClientRect(),u=i-a,h=n-l;return{left:u,top:h}}function oM(t,e,i,n){const[a,l]=S.useState(null);return is(()=>{if(t==null||i==null){l(null);return}const u=n(t);if(u==null){l(null);return}const{left:h,top:f}=Db(u,i);l(e==="horizontal"?h:f)},[e,n,i,t]),S.useCallback(u=>{if(u===t)return"none";if(u==null)return l(null),"none";if(u!=null&&i!=null){const h=n(u);if(h!=null){const{left:f,top:d}=Db(h,i);if(a==null)return l(e==="horizontal"?f:d),"none";if(e==="horizontal"){if(f<a)return l(f),"left";if(f>a)return l(f),"right"}else{if(d<a)return l(d),"up";if(d>a)return l(d),"down"}}}return"none"},[n,e,a,i,t])}function lM({className:t,orientation:e="horizontal",...i}){return j.jsx(UR,{"data-slot":"tabs","data-orientation":e,className:ju("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",t),...i})}const cM=nC("rounded-full p-1 h-11 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-transparent dark:bg-input/30",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function uM({className:t,variant:e="default",...i}){return j.jsx(aM,{"data-slot":"tabs-list","data-variant":e,className:ju(cM({variant:e}),t),...i})}function Ob({className:t,...e}){return j.jsx(VR,{"data-slot":"tabs-trigger",className:ju("gap-1.5 rounded-full border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...e})}function Bb(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hM({getStoredTheme:t,setStoredTheme:e}){const[i,n]=S.useState("system"),[a,l]=S.useState(!0),u=S.useRef(null);S.useEffect(()=>{Promise.resolve(t()).then(d=>{(d==="light"||d==="dark"||d==="system")&&n(d),l(!1)})},[t]);const h=i==="system"?Bb():i;S.useEffect(()=>{if(a||u.current===h)return;u.current=h;const d=document.documentElement;d.classList.remove("light","dark"),d.classList.add(h)},[h,a]),S.useEffect(()=>{if(i!=="system")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{const v=Bb();if(u.current===v)return;u.current=v;const g=document.documentElement;g.classList.remove("light","dark"),g.classList.add(v)};return d.addEventListener("change",p),()=>d.removeEventListener("change",p)},[i]);const f=S.useCallback(async d=>{n(d),await e(d)},[e]);return S.useMemo(()=>({theme:i,setTheme:f,resolvedTheme:h,isLoading:a}),[i,f,h,a])}var DC=Object.defineProperty,dM=Object.getOwnPropertyDescriptor,fM=(t,e)=>{for(var i in e)DC(t,i,{get:e[i],enumerable:!0})},si=(t,e,i,n)=>{for(var a=n>1?void 0:n?dM(e,i):e,l=t.length-1,u;l>=0;l--)(u=t[l])&&(a=(n?u(e,i,a):u(a))||a);return n&&a&&DC(e,i,a),a},Ce=(t,e)=>(i,n)=>e(i,n,t),Nb="Terminal input",Jp={get:()=>Nb,set:t=>Nb=t},Pb="Too much output to announce, navigate to rows manually to read",eg={get:()=>Pb,set:t=>Pb=t};function mM(t){return t.replace(/\r?\n/g,"\r")}function _M(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function pM(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function gM(t,e,i,n){if(t.stopPropagation(),t.clipboardData){let a=t.clipboardData.getData("text/plain");OC(a,e,i,n)}}function OC(t,e,i,n){t=mM(t),t=_M(t,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function BC(t,e,i){let n=i.getBoundingClientRect(),a=t.clientX-n.left-10,l=t.clientY-n.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${a}px`,e.style.top=`${l}px`,e.style.zIndex="1000",e.focus()}function zb(t,e,i,n,a){BC(t,e,i),a&&n.rightClickSelect(t),e.value=n.selectionText,e.select()}function $a(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function kf(t,e=0,i=t.length){let n="";for(let a=e;a<i;++a){let l=t[a];l>65535?(l-=65536,n+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):n+=String.fromCharCode(l)}return n}var vM=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let a=0,l=0;if(this._interim){let u=e.charCodeAt(l++);56320<=u&&u<=57343?i[a++]=(this._interim-55296)*1024+u-56320+65536:(i[a++]=this._interim,i[a++]=u),this._interim=0}for(let u=l;u<n;++u){let h=e.charCodeAt(u);if(55296<=h&&h<=56319){if(++u>=n)return this._interim=h,a;let f=e.charCodeAt(u);56320<=f&&f<=57343?i[a++]=(h-55296)*1024+f-56320+65536:(i[a++]=h,i[a++]=f);continue}h!==65279&&(i[a++]=h)}return a}},yM=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let a=0,l,u,h,f,d=0,p=0;if(this.interim[0]){let y=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let C=0,x;for(;(x=this.interim[++C]&63)&&C<4;)b<<=6,b|=x;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,R=k-C;for(;p<R;){if(p>=n)return 0;if(x=e[p++],(x&192)!==128){p--,y=!0;break}else this.interim[C++]=x,b<<=6,b|=x&63}y||(k===2?b<128?p--:i[a++]=b:k===3?b<2048||b>=55296&&b<=57343||b===65279||(i[a++]=b):b<65536||b>1114111||(i[a++]=b)),this.interim.fill(0)}let v=n-4,g=p;for(;g<n;){for(;g<v&&!((l=e[g])&128)&&!((u=e[g+1])&128)&&!((h=e[g+2])&128)&&!((f=e[g+3])&128);)i[a++]=l,i[a++]=u,i[a++]=h,i[a++]=f,g+=4;if(l=e[g++],l<128)i[a++]=l;else if((l&224)===192){if(g>=n)return this.interim[0]=l,a;if(u=e[g++],(u&192)!==128){g--;continue}if(d=(l&31)<<6|u&63,d<128){g--;continue}i[a++]=d}else if((l&240)===224){if(g>=n)return this.interim[0]=l,a;if(u=e[g++],(u&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=u,a;if(h=e[g++],(h&192)!==128){g--;continue}if(d=(l&15)<<12|(u&63)<<6|h&63,d<2048||d>=55296&&d<=57343||d===65279)continue;i[a++]=d}else if((l&248)===240){if(g>=n)return this.interim[0]=l,a;if(u=e[g++],(u&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=u,a;if(h=e[g++],(h&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=u,this.interim[2]=h,a;if(f=e[g++],(f&192)!==128){g--;continue}if(d=(l&7)<<18|(u&63)<<12|(h&63)<<6|f&63,d<65536||d>1114111)continue;i[a++]=d}}return a}},NC="",Va=" ",Vu=class PC{constructor(){this.fg=0,this.bg=0,this.extended=new lf}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new PC;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},lf=class zC{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new zC(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Er=class IC extends Vu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new lf,this.combinedData=""}static fromCharData(e){let i=new IC;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?$a(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=e[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ib="di$target",tg="di$dependencies",cp=new Map;function SM(t){return t[tg]||[]}function Hi(t){if(cp.has(t))return cp.get(t);let e=function(i,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");bM(e,i,a)};return e._id=t,cp.set(t,e),e}function bM(t,e,i){e[Ib]===e?e[tg].push({id:t,index:i}):(e[tg]=[{id:t,index:i}],e[Ib]=e)}var ds=Hi("BufferService"),HC=Hi("CoreMouseService"),qo=Hi("CoreService"),wM=Hi("CharsetService"),cv=Hi("InstantiationService"),UC=Hi("LogService"),fs=Hi("OptionsService"),FC=Hi("OscLinkService"),CM=Hi("UnicodeService"),qu=Hi("DecorationService"),ig=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let a=[],l=this._optionsService.rawOptions.linkHandler,u=new Er,h=n.getTrimmedLength(),f=-1,d=-1,p=!1;for(let v=0;v<h;v++)if(!(d===-1&&!n.hasContent(v))){if(n.loadCell(v,u),u.hasExtendedAttrs()&&u.extended.urlId)if(d===-1){d=v,f=u.extended.urlId;continue}else p=u.extended.urlId!==f;else d!==-1&&(p=!0);if(p||d!==-1&&v===h-1){let g=this._oscLinkService.getLinkData(f)?.uri;if(g){let y={start:{x:d+1,y:e},end:{x:v+(!p&&v===h-1?1:0),y:e}},b=!1;if(!l?.allowNonHttpProtocols)try{let C=new URL(g);["http:","https:"].includes(C.protocol)||(b=!0)}catch{b=!0}b||a.push({text:g,range:y,activate:(C,x)=>l?l.activate(C,x,y):xM(C,x),hover:(C,x)=>l?.hover?.(C,x,y),leave:(C,x)=>l?.leave?.(C,x,y)})}p=!1,u.hasExtendedAttrs()&&u.extended.urlId?(d=v,f=u.extended.urlId):(d=-1,f=-1)}}i(a)}};ig=si([Ce(0,ds),Ce(1,fs),Ce(2,FC)],ig);function xM(t,e){if(confirm(`Do you want to navigate to ${e}?
10
+
11
+ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var Ef=Hi("CharSizeService"),Xn=Hi("CoreBrowserService"),uv=Hi("MouseService"),Zn=Hi("RenderService"),kM=Hi("SelectionService"),$C=Hi("CharacterJoinerService"),tc=Hi("ThemeService"),WC=Hi("LinkProviderService"),EM=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Hb.isErrorNoTelemetry(e)?new Hb(e.message+`
12
+
13
+ `+e.stack):new Error(e.message+`
14
+
15
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},TM=new EM;function Nd(t){RM(t)||TM.onUnexpectedError(t)}var sg="Canceled";function RM(t){return t instanceof MM?!0:t instanceof Error&&t.name===sg&&t.message===sg}var MM=class extends Error{constructor(){super(sg),this.name=this.message}};function AM(t){return new Error(`Illegal argument: ${t}`)}var Hb=class rg extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof rg)return e;let i=new rg;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},ng=class jC extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,jC.prototype)}};function $s(t,e=0){return t[t.length-(1+e)]}var LM;(t=>{function e(l){return l<0}t.isLessThan=e;function i(l){return l<=0}t.isLessThanOrEqual=i;function n(l){return l>0}t.isGreaterThan=n;function a(l){return l===0}t.isNeitherLessOrGreaterThan=a,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(LM||={});function DM(t,e){let i=this,n=!1,a;return function(){return n||(n=!0,e||(a=t.apply(i,arguments))),a}}var VC;(t=>{function e(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*a(E){yield E}t.single=a;function l(E){return e(E)?E:a(E)}t.wrap=l;function u(E){return E||i}t.from=u;function*h(E){for(let H=E.length-1;H>=0;H--)yield E[H]}t.reverse=h;function f(E){return!E||E[Symbol.iterator]().next().done===!0}t.isEmpty=f;function d(E){return E[Symbol.iterator]().next().value}t.first=d;function p(E,H){let U=0;for(let I of E)if(H(I,U++))return!0;return!1}t.some=p;function v(E,H){for(let U of E)if(H(U))return U}t.find=v;function*g(E,H){for(let U of E)H(U)&&(yield U)}t.filter=g;function*y(E,H){let U=0;for(let I of E)yield H(I,U++)}t.map=y;function*b(E,H){let U=0;for(let I of E)yield*H(I,U++)}t.flatMap=b;function*C(...E){for(let H of E)yield*H}t.concat=C;function x(E,H,U){let I=U;for(let N of E)I=H(I,N);return I}t.reduce=x;function*k(E,H,U=E.length){for(H<0&&(H+=E.length),U<0?U+=E.length:U>E.length&&(U=E.length);H<U;H++)yield E[H]}t.slice=k;function R(E,H=Number.POSITIVE_INFINITY){let U=[];if(H===0)return[U,E];let I=E[Symbol.iterator]();for(let N=0;N<H;N++){let F=I.next();if(F.done)return[U,t.empty()];U.push(F.value)}return[U,{[Symbol.iterator](){return I}}]}t.consume=R;async function L(E){let H=[];for await(let U of E)H.push(U);return Promise.resolve(H)}t.asyncToArray=L})(VC||={});function Wo(t){if(VC.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function OM(...t){return Wt(()=>Wo(t))}function Wt(t){return{dispose:DM(()=>{t()})}}var qC=class YC{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Wo(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?YC.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};qC.DISABLE_DISPOSED_WARNING=!1;var Xa=qC,rt=class{constructor(){this._store=new Xa,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};rt.None=Object.freeze({dispose(){}});var Ql=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},qn=typeof window=="object"?window:globalThis,ag=class og{constructor(e){this.element=e,this.next=og.Undefined,this.prev=og.Undefined}};ag.Undefined=new ag(void 0);var qt=ag,Ub=class{constructor(){this._first=qt.Undefined,this._last=qt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===qt.Undefined}clear(){let e=this._first;for(;e!==qt.Undefined;){let i=e.next;e.prev=qt.Undefined,e.next=qt.Undefined,e=i}this._first=qt.Undefined,this._last=qt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new qt(e);if(this._first===qt.Undefined)this._first=n,this._last=n;else if(i){let l=this._last;this._last=n,n.prev=l,l.next=n}else{let l=this._first;this._first=n,n.next=l,l.prev=n}this._size+=1;let a=!1;return()=>{a||(a=!0,this._remove(n))}}shift(){if(this._first!==qt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==qt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==qt.Undefined&&e.next!==qt.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===qt.Undefined&&e.next===qt.Undefined?(this._first=qt.Undefined,this._last=qt.Undefined):e.next===qt.Undefined?(this._last=this._last.prev,this._last.next=qt.Undefined):e.prev===qt.Undefined&&(this._first=this._first.next,this._first.prev=qt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==qt.Undefined;)yield e.element,e=e.next}},BM=globalThis.performance&&typeof globalThis.performance.now=="function",NM=class KC{static create(e){return new KC(e)}constructor(e){this._now=BM&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Zi;(t=>{t.None=()=>rt.None;function e(D,O){return v(D,()=>{},0,void 0,!0,void 0,O)}t.defer=e;function i(D){return(O,P=null,$)=>{let M=!1,A;return A=D(z=>{if(!M)return A?A.dispose():M=!0,O.call(P,z)},null,$),M&&A.dispose(),A}}t.once=i;function n(D,O,P){return d(($,M=null,A)=>D(z=>$.call(M,O(z)),null,A),P)}t.map=n;function a(D,O,P){return d(($,M=null,A)=>D(z=>{O(z),$.call(M,z)},null,A),P)}t.forEach=a;function l(D,O,P){return d(($,M=null,A)=>D(z=>O(z)&&$.call(M,z),null,A),P)}t.filter=l;function u(D){return D}t.signal=u;function h(...D){return(O,P=null,$)=>{let M=OM(...D.map(A=>A(z=>O.call(P,z))));return p(M,$)}}t.any=h;function f(D,O,P,$){let M=P;return n(D,A=>(M=O(M,A),M),$)}t.reduce=f;function d(D,O){let P,$={onWillAddFirstListener(){P=D(M.fire,M)},onDidRemoveLastListener(){P?.dispose()}},M=new ye($);return O?.add(M),M.event}function p(D,O){return O instanceof Array?O.push(D):O&&O.add(D),D}function v(D,O,P=100,$=!1,M=!1,A,z){let q,Y,B,X=0,ie,re={leakWarningThreshold:A,onWillAddFirstListener(){q=D(he=>{X++,Y=O(Y,he),$&&!B&&(fe.fire(Y),Y=void 0),ie=()=>{let oe=Y;Y=void 0,B=void 0,(!$||X>1)&&fe.fire(oe),X=0},typeof P=="number"?(clearTimeout(B),B=setTimeout(ie,P)):B===void 0&&(B=0,queueMicrotask(ie))})},onWillRemoveListener(){M&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,q.dispose()}},fe=new ye(re);return z?.add(fe),fe.event}t.debounce=v;function g(D,O=0,P){return t.debounce(D,($,M)=>$?($.push(M),$):[M],O,void 0,!0,void 0,P)}t.accumulate=g;function y(D,O=($,M)=>$===M,P){let $=!0,M;return l(D,A=>{let z=$||!O(A,M);return $=!1,M=A,z},P)}t.latch=y;function b(D,O,P){return[t.filter(D,O,P),t.filter(D,$=>!O($),P)]}t.split=b;function C(D,O=!1,P=[],$){let M=P.slice(),A=D(Y=>{M?M.push(Y):q.fire(Y)});$&&$.add(A);let z=()=>{M?.forEach(Y=>q.fire(Y)),M=null},q=new ye({onWillAddFirstListener(){A||(A=D(Y=>q.fire(Y)),$&&$.add(A))},onDidAddFirstListener(){M&&(O?setTimeout(z):z())},onDidRemoveLastListener(){A&&A.dispose(),A=null}});return $&&$.add(q),q.event}t.buffer=C;function x(D,O){return(P,$,M)=>{let A=O(new R);return D(function(z){let q=A.evaluate(z);q!==k&&P.call($,q)},void 0,M)}}t.chain=x;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(P=>(O(P),P)),this}filter(O){return this.steps.push(P=>O(P)?P:k),this}reduce(O,P){let $=P;return this.steps.push(M=>($=O($,M),$)),this}latch(O=(P,$)=>P===$){let P=!0,$;return this.steps.push(M=>{let A=P||!O(M,$);return P=!1,$=M,A?M:k}),this}evaluate(O){for(let P of this.steps)if(O=P(O),O===k)break;return O}}function L(D,O,P=$=>$){let $=(...q)=>z.fire(P(...q)),M=()=>D.on(O,$),A=()=>D.removeListener(O,$),z=new ye({onWillAddFirstListener:M,onDidRemoveLastListener:A});return z.event}t.fromNodeEventEmitter=L;function E(D,O,P=$=>$){let $=(...q)=>z.fire(P(...q)),M=()=>D.addEventListener(O,$),A=()=>D.removeEventListener(O,$),z=new ye({onWillAddFirstListener:M,onDidRemoveLastListener:A});return z.event}t.fromDOMEventEmitter=E;function H(D){return new Promise(O=>i(D)(O))}t.toPromise=H;function U(D){let O=new ye;return D.then(P=>{O.fire(P)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}t.fromPromise=U;function I(D,O){return D(P=>O.fire(P))}t.forward=I;function N(D,O,P){return O(P),D($=>O($))}t.runAndSubscribe=N;class F{constructor(O,P){this._observable=O,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new ye($),P&&P.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,P){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function J(D,O){return new F(D,O).emitter.event}t.fromObservable=J;function G(D){return(O,P,$)=>{let M=0,A=!1,z={beginUpdate(){M++},endUpdate(){M--,M===0&&(D.reportChanges(),A&&(A=!1,O.call(P)))},handlePossibleChange(){},handleChange(){A=!0}};D.addObserver(z),D.reportChanges();let q={dispose(){D.removeObserver(z)}};return $ instanceof Xa?$.add(q):Array.isArray($)&&$.push(q),q}}t.fromObservableLight=G})(Zi||={});var lg=class cg{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${cg._idPool++}`,cg.all.add(this)}start(e){this._stopWatch=new NM,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};lg.all=new Set,lg._idPool=0;var PM=lg,zM=-1,GC=class XC{constructor(e,i,n=(XC._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[l,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(l);let f=new UM(h,l);this._errorHandler(f)}return()=>{let l=this._stacks.get(e.value)||0;this._stacks.set(e.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,a]of this._stacks)(!e||i<a)&&(e=[n,a],i=a);return e}};GC._idPool=1;var IM=GC,HM=class ZC{constructor(e){this.value=e}static create(){let e=new Error;return new ZC(e.stack??"")}print(){console.warn(this.value.split(`
16
+ `).slice(2).join(`
17
+ `))}},UM=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},FM=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},$M=0,up=class{constructor(e){this.value=e,this.id=$M++}},WM=2,jM,ye=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new IM(e?.onListenerError??Nd,this._options?.leakWarningThreshold??zM):void 0,this._perfMon=this._options?._profName?new PM(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new FM(`${h}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||Nd)(d),rt.None}if(this._disposed)return rt.None;i&&(e=e.bind(i));let a=new up(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=HM.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof up?(this._deliveryQueue??=new VM,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let u=Wt(()=>{l?.(),this._removeListener(a)});return n instanceof Xa?n.add(u):Array.isArray(n)&&n.push(u),u},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*WM<=i.length){let l=0;for(let u=0;u<i.length;u++)i[u]?i[l++]=i[u]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=l}}_deliver(e,i){if(!e)return;let n=this._options?.onListenerError||Nd;if(!n){e.value(i);return}try{e.value(i)}catch(a){n(a)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof up)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},VM=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},ug=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ye,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ye,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};ug.INSTANCE=new ug;var hv=ug;function qM(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}hv.INSTANCE.onDidChangeZoomLevel;function YM(t){return hv.INSTANCE.getZoomFactor(t)}hv.INSTANCE.onDidChangeFullscreen;var ic=typeof navigator=="object"?navigator.userAgent:"",hg=ic.indexOf("Firefox")>=0,KM=ic.indexOf("AppleWebKit")>=0,dv=ic.indexOf("Chrome")>=0,GM=!dv&&ic.indexOf("Safari")>=0;ic.indexOf("Electron/")>=0;ic.indexOf("Android")>=0;var hp=!1;if(typeof qn.matchMedia=="function"){let t=qn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=qn.matchMedia("(display-mode: fullscreen)");hp=t.matches,qM(qn,t,({matches:i})=>{hp&&e.matches||(hp=i)})}var Wl="en",dg=!1,fg=!1,Pd=!1,QC=!1,pd,zd=Wl,Fb=Wl,XM,$n,zo=globalThis,Vs;typeof zo.vscode<"u"&&typeof zo.vscode.process<"u"?Vs=zo.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Vs=process);var ZM=typeof Vs?.versions?.electron=="string",QM=ZM&&Vs?.type==="renderer";if(typeof Vs=="object"){dg=Vs.platform==="win32",fg=Vs.platform==="darwin",Pd=Vs.platform==="linux",Pd&&Vs.env.SNAP&&Vs.env.SNAP_REVISION,Vs.env.CI||Vs.env.BUILD_ARTIFACTSTAGINGDIRECTORY,pd=Wl,zd=Wl;let t=Vs.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);pd=e.userLocale,Fb=e.osLocale,zd=e.resolvedLanguage||Wl,XM=e.languagePack?.translationsConfigFile}catch{}QC=!0}else typeof navigator=="object"&&!QM?($n=navigator.userAgent,dg=$n.indexOf("Windows")>=0,fg=$n.indexOf("Macintosh")>=0,($n.indexOf("Macintosh")>=0||$n.indexOf("iPad")>=0||$n.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Pd=$n.indexOf("Linux")>=0,$n?.indexOf("Mobi")>=0,zd=globalThis._VSCODE_NLS_LANGUAGE||Wl,pd=navigator.language.toLowerCase(),Fb=pd):console.error("Unable to resolve platform.");var JC=dg,on=fg,JM=Pd,$b=QC,un=$n,Oa=zd,eA;(t=>{function e(){return Oa}t.value=e;function i(){return Oa.length===2?Oa==="en":Oa.length>=3?Oa[0]==="e"&&Oa[1]==="n"&&Oa[2]==="-":!1}t.isDefaultVariant=i;function n(){return Oa==="en"}t.isDefault=n})(eA||={});var tA=typeof zo.postMessage=="function"&&!zo.importScripts;(()=>{if(tA){let t=[];zo.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,a=t.length;n<a;n++){let l=t[n];if(l.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),l.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),zo.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var iA=!!(un&&un.indexOf("Chrome")>=0);un&&un.indexOf("Firefox")>=0;!iA&&un&&un.indexOf("Safari")>=0;un&&un.indexOf("Edg/")>=0;un&&un.indexOf("Android")>=0;var Nl=typeof navigator=="object"?navigator:{};$b||document.queryCommandSupported&&document.queryCommandSupported("copy")||Nl&&Nl.clipboard&&Nl.clipboard.writeText,$b||Nl&&Nl.clipboard&&Nl.clipboard.readText;var fv=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},dp=new fv,Wb=new fv,jb=new fv,sA=new Array(230),ex;(t=>{function e(h){return dp.keyCodeToStr(h)}t.toString=e;function i(h){return dp.strToKeyCode(h)}t.fromString=i;function n(h){return Wb.keyCodeToStr(h)}t.toUserSettingsUS=n;function a(h){return jb.keyCodeToStr(h)}t.toUserSettingsGeneral=a;function l(h){return Wb.strToKeyCode(h)||jb.strToKeyCode(h)}t.fromUserSettings=l;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return dp.keyCodeToStr(h)}t.toElectronAccelerator=u})(ex||={});var rA=class tx{constructor(e,i,n,a,l){this.ctrlKey=e,this.shiftKey=i,this.altKey=n,this.metaKey=a,this.keyCode=l}equals(e){return e instanceof tx&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${e}${i}${n}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new nA([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},nA=class{constructor(e){if(e.length===0)throw AM("chords");this.chords=e}getHashCode(){let e="";for(let i=0,n=this.chords.length;i<n;i++)i!==0&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}};function aA(t){if(t.charCode){let i=String.fromCharCode(t.charCode).toUpperCase();return ex.fromString(i)}let e=t.keyCode;if(e===3)return 7;if(hg)switch(e){case 59:return 85;case 60:if(JM)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(on)return 57;break}else if(KM&&(on&&e===93||!on&&e===92))return 57;return sA[e]||0}var oA=on?256:2048,lA=512,cA=1024,uA=on?2048:256,Vb=class{constructor(t){this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=e.getModifierState?.("AltGraph"),this.keyCode=aA(e),this.code=e.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=oA),this.altKey&&(e|=lA),this.shiftKey&&(e|=cA),this.metaKey&&(e|=uA),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new rA(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},qb=new WeakMap;function hA(t){if(!t.parent||t.parent===t)return null;try{let e=t.location,i=t.parent.location;if(e.origin!=="null"&&i.origin!=="null"&&e.origin!==i.origin)return null}catch{return null}return t.parent}var dA=class{static getSameOriginWindowChain(t){let e=qb.get(t);if(!e){e=[],qb.set(t,e);let i=t,n;do n=hA(i),n?e.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):e.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i=0,n=0,a=this.getSameOriginWindowChain(t);for(let l of a){let u=l.window.deref();if(i+=u?.scrollY??0,n+=u?.scrollX??0,u===e||!l.iframeElement)break;let h=l.iframeElement.getBoundingClientRect();i+=h.top,n+=h.left}return{top:i,left:n}}},gd=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=dA.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Yb=class{constructor(e,i=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let a=!1;if(dv){let l=navigator.userAgent.match(/Chrome\/(\d+)/);a=(l?parseInt(l[1]):123)<=122}if(e){let l=e,u=e,h=e.view?.devicePixelRatio||1;if(typeof l.wheelDeltaY<"u")a?this.deltaY=l.wheelDeltaY/(120*h):this.deltaY=l.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?hg&&!on?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")GM&&JC?this.deltaX=-(l.wheelDeltaX/120):a?this.deltaX=l.wheelDeltaX/(120*h):this.deltaX=l.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?hg&&!on?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(a?this.deltaY=e.wheelDelta/(120*h):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},ix=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),fA;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof mA?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Zi.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ix})})(fA||={});var mA=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ix:(this._emitter||(this._emitter=new ye),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},mv=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new ng("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new ng("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},_A=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new ng("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let a=n.setInterval(()=>{e()},i);this.disposable=Wt(()=>{n.clearInterval(a),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},pA;(t=>{async function e(n){let a,l=await Promise.all(n.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return l}t.settled=e;function i(n){return new Promise(async(a,l)=>{try{await n(a,l)}catch(u){l(u)}})}t.withAsyncBody=i})(pA||={});var Kb=class yr{static fromArray(e){return new yr(i=>{i.emitMany(e)})}static fromPromise(e){return new yr(async i=>{i.emitMany(await e)})}static fromPromises(e){return new yr(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new yr(async i=>{await Promise.all(e.map(async n=>{for await(let a of n)i.emitOne(a)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ye,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(e(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Zi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new yr(async n=>{for await(let a of e)n.emitOne(i(a))})}map(e){return yr.map(this,e)}static filter(e,i){return new yr(async n=>{for await(let a of e)i(a)&&n.emitOne(a)})}filter(e){return yr.filter(this,e)}static coalesce(e){return yr.filter(e,i=>!!i)}coalesce(){return yr.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return yr.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Kb.EMPTY=Kb.fromArray([]);var{getWindow:an,getWindowId:gA,onDidRegisterWindow:vA}=(function(){let t=new Map,e={window:qn,disposables:new Xa};t.set(qn.vscodeWindowId,e);let i=new ye,n=new ye,a=new ye;function l(u,h){return(typeof u=="number"?t.get(u):void 0)??(h?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(t.has(u.vscodeWindowId))return rt.None;let h=new Xa,f={window:u,disposables:h.add(new Xa)};return t.set(u.vscodeWindowId,f),h.add(Wt(()=>{t.delete(u.vscodeWindowId),n.fire(u)})),h.add(Ve(u,Di.BEFORE_UNLOAD,()=>{a.fire(u)})),i.fire(f),h},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return t.has(u)},getWindowById:l,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let f=u;return f?.view?f.view.window:qn},getDocument(u){return an(u).document}}})(),yA=class{constructor(e,i,n,a){this._node=e,this._type=i,this._handler=n,this._options=a||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ve(t,e,i,n){return new yA(t,e,i,n)}var Gb=function(t,e,i,n){return Ve(t,e,i,n)},_v,SA=class extends _A{constructor(t){super(),this.defaultTarget=t&&an(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},Xb=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Nd(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,n=new Map,a=l=>{i.set(l,!1);let u=t.get(l)??[];for(e.set(l,u),t.set(l,[]),n.set(l,!0);u.length>0;)u.sort(Xb.sort),u.shift().execute();n.set(l,!1)};_v=(l,u,h=0)=>{let f=gA(l),d=new Xb(u,h),p=t.get(f);return p||(p=[],t.set(f,p)),p.push(d),i.get(f)||(i.set(f,!0),l.requestAnimationFrame(()=>a(f))),d}})();function bA(t){let e=t.getBoundingClientRect(),i=an(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var Di={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},wA=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=ws(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=ws(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=ws(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=ws(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=ws(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=ws(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=ws(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=ws(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=ws(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=ws(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=ws(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=ws(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=ws(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=ws(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function ws(t){return typeof t=="number"?`${t}px`:t}function Lu(t){return new wA(t)}var sx=class{constructor(){this._hooks=new Xa,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,a,l){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=a,this._onStopCallback=l;let u=e;try{e.setPointerCapture(i),this._hooks.add(Wt(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{u=an(e)}this._hooks.add(Ve(u,Di.POINTER_MOVE,h=>{if(h.buttons!==n){this.stopMonitoring(!0);return}h.preventDefault(),this._pointerMoveCallback(h)})),this._hooks.add(Ve(u,Di.POINTER_UP,h=>this.stopMonitoring(!0)))}};function CA(t,e,i){let n=null,a=null;if(typeof i.value=="function"?(n="value",a=i.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",a=i.get),!a)throw new Error("not supported");let l=`$memoize$${e}`;i[n]=function(...u){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[l]}}var rn;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(rn||={});var yu=class ts extends rt{constructor(){super(),this.dispatched=!1,this.targets=new Ub,this.ignoreTargets=new Ub,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Zi.runAndSubscribe(vA,({window:e,disposables:i})=>{i.add(Ve(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Ve(e.document,"touchend",n=>this.onTouchEnd(e,n))),i.add(Ve(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:qn,disposables:this._store}))}static addTarget(e){if(!ts.isTouchDevice())return rt.None;ts.INSTANCE||(ts.INSTANCE=new ts);let i=ts.INSTANCE.targets.push(e);return Wt(i)}static ignoreTarget(e){if(!ts.isTouchDevice())return rt.None;ts.INSTANCE||(ts.INSTANCE=new ts);let i=ts.INSTANCE.ignoreTargets.push(e);return Wt(i)}static isTouchDevice(){return"ontouchstart"in qn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,a=e.targetTouches.length;n<a;n++){let l=e.targetTouches.item(n);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:i,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[i],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let u=this.newGestureEvent(rn.Start,l.target);u.pageX=l.pageX,u.pageY=l.pageY,this.dispatchEvent(u)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i){let n=Date.now(),a=Object.keys(this.activeTouches).length;for(let l=0,u=i.changedTouches.length;l<u;l++){let h=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let f=this.activeTouches[h.identifier],d=Date.now()-f.initialTimeStamp;if(d<ts.HOLD_DELAY&&Math.abs(f.initialPageX-$s(f.rollingPageX))<30&&Math.abs(f.initialPageY-$s(f.rollingPageY))<30){let p=this.newGestureEvent(rn.Tap,f.initialTarget);p.pageX=$s(f.rollingPageX),p.pageY=$s(f.rollingPageY),this.dispatchEvent(p)}else if(d>=ts.HOLD_DELAY&&Math.abs(f.initialPageX-$s(f.rollingPageX))<30&&Math.abs(f.initialPageY-$s(f.rollingPageY))<30){let p=this.newGestureEvent(rn.Contextmenu,f.initialTarget);p.pageX=$s(f.rollingPageX),p.pageY=$s(f.rollingPageY),this.dispatchEvent(p)}else if(a===1){let p=$s(f.rollingPageX),v=$s(f.rollingPageY),g=$s(f.rollingTimestamps)-f.rollingTimestamps[0],y=p-f.rollingPageX[0],b=v-f.rollingPageY[0],C=[...this.targets].filter(x=>f.initialTarget instanceof Node&&x.contains(f.initialTarget));this.inertia(e,C,n,Math.abs(y)/g,y>0?1:-1,p,Math.abs(b)/g,b>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(rn.End,f.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(e){if(e.type===rn.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>ts.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,e.tapCount=n}else(e.type===rn.Change||e.type===rn.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(e.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(e.initialTarget)){let a=0,l=e.initialTarget;for(;l&&l!==n;)a++,l=l.parentElement;i.push([a,n])}i.sort((n,a)=>n[0]-a[0]);for(let[n,a]of i)a.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,n,a,l,u,h,f,d){this.handle=_v(e,()=>{let p=Date.now(),v=p-n,g=0,y=0,b=!0;a+=ts.SCROLL_FRICTION*v,h+=ts.SCROLL_FRICTION*v,a>0&&(b=!1,g=l*a*v),h>0&&(b=!1,y=f*h*v);let C=this.newGestureEvent(rn.Change);C.translationX=g,C.translationY=y,i.forEach(x=>x.dispatchEvent(C)),b||this.inertia(e,i,p,a,l,u+g,h,f,d+y)})}onTouchMove(e){let i=Date.now();for(let n=0,a=e.changedTouches.length;n<a;n++){let l=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let u=this.activeTouches[l.identifier],h=this.newGestureEvent(rn.Change,u.initialTarget);h.translationX=l.pageX-$s(u.rollingPageX),h.translationY=l.pageY-$s(u.rollingPageY),h.pageX=l.pageX,h.pageY=l.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(l.pageX),u.rollingPageY.push(l.pageY),u.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};yu.SCROLL_FRICTION=-.005,yu.HOLD_DELAY=700,yu.CLEAR_TAP_COUNT_TIME=400,si([CA],yu,"isTouchDevice",1);var xA=yu,pv=class extends rt{onclick(e,i){this._register(Ve(e,Di.CLICK,n=>i(new gd(an(e),n))))}onmousedown(e,i){this._register(Ve(e,Di.MOUSE_DOWN,n=>i(new gd(an(e),n))))}onmouseover(e,i){this._register(Ve(e,Di.MOUSE_OVER,n=>i(new gd(an(e),n))))}onmouseleave(e,i){this._register(Ve(e,Di.MOUSE_LEAVE,n=>i(new gd(an(e),n))))}onkeydown(e,i){this._register(Ve(e,Di.KEY_DOWN,n=>i(new Vb(n))))}onkeyup(e,i){this._register(Ve(e,Di.KEY_UP,n=>i(new Vb(n))))}oninput(e,i){this._register(Ve(e,Di.INPUT,i))}onblur(e,i){this._register(Ve(e,Di.BLUR,i))}onfocus(e,i){this._register(Ve(e,Di.FOCUS,i))}onchange(e,i){this._register(Ve(e,Di.CHANGE,i))}ignoreGesture(e){return xA.ignoreTarget(e)}},Zb=11,kA=class extends pv{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=Zb+"px",this.domNode.style.height=Zb+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new sx),this._register(Gb(this.bgDomNode,Di.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(Gb(this.domNode,Di.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new SA),this._pointerdownScheduleRepeatTimer=this._register(new mv)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,an(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},EA=class mg{constructor(e,i,n,a,l,u,h){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,a=a|0,l=l|0,u=u|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,i<0&&(i=0),a+i>n&&(a=n-i),a<0&&(a=0),l<0&&(l=0),h+l>u&&(h=u-l),h<0&&(h=0),this.width=i,this.scrollWidth=n,this.scrollLeft=a,this.height=l,this.scrollHeight=u,this.scrollTop=h}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,i){return new mg(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new mg(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let n=this.width!==e.width,a=this.scrollWidth!==e.scrollWidth,l=this.scrollLeft!==e.scrollLeft,u=this.height!==e.height,h=this.scrollHeight!==e.scrollHeight,f=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:a,scrollLeftChanged:l,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:f}}},TA=class extends rt{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ye),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new EA(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let i=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;e?n=new Jb(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=Jb.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let i=this._state;i.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(i,e)))}},Qb=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function fp(t,e){let i=e-t;return function(n){return t+i*AA(n)}}function RA(t,e,i){return function(n){return n<i?t(n/i):e((n-i)/(1-i))}}var Jb=class _g{constructor(e,i,n,a){this.from=e,this.to=i,this.duration=a,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,i,n){if(Math.abs(e-i)>2.5*n){let a,l;return e<i?(a=e+.75*n,l=i-.75*n):(a=e-.75*n,l=i+.75*n),RA(fp(e,a),fp(l,i),.33)}return fp(e,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let i=(e-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),a=this.scrollTop(i);return new Qb(n,a,!1)}return new Qb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,i,n){return _g.start(e,i,n)}static start(e,i,n){n=n+10;let a=Date.now()-10;return new _g(e,i,a,n)}};function MA(t){return Math.pow(t,3)}function AA(t){return 1-MA(1-t)}var LA=class extends rt{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new mv)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},DA=140,rx=class extends pv{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new LA(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new sx),this._shouldRender=!0,this.domNode=Lu(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ve(this.domNode.domNode,Di.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new kA(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,a){this.slider=Lu(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof a=="number"&&this.slider.setHeight(a),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ve(this.slider.domNode,Di.POINTER_DOWN,l=>{l.button===0&&(l.preventDefault(),this._sliderPointerDown(l))})),this.onclick(this.slider.domNode,l=>{l.leftButton&&l.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),a=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),l=this._sliderPointerPosition(e);n<=l&&l<=a?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let l=bA(this.domNode.domNode);i=e.pageX-l.left,n=e.pageY-l.top}let a=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(a):this._scrollbarState.getDesiredScrollPositionFromOffset(a)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),a=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,l=>{let u=this._sliderOrthogonalPointerPosition(l),h=Math.abs(u-n);if(JC&&h>DA){this._setDesiredScrollPositionNow(a.getScrollPosition());return}let f=this._sliderPointerPosition(l)-i;this._setDesiredScrollPositionNow(a.getDesiredScrollPositionFromDelta(f))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},nx=class pg{constructor(e,i,n,a,l,u){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=a,this._scrollSize=l,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new pg(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,n,a,l){let u=Math.max(0,n-e),h=Math.max(0,u-2*i),f=a>0&&a>n;if(!f)return{computedAvailableSize:Math.round(u),computedIsNeeded:f,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(n*h/a))),p=(h-d)/(a-n),v=l*p;return{computedAvailableSize:Math.round(u),computedIsNeeded:f,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let e=pg._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+e;return Math.round(i/this._computedSliderRatio)}},OA=class extends rx{constructor(e,i,n){let a=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new nx(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,a.width,a.scrollWidth,l.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},BA=class extends rx{constructor(t,e,i){let n=t.getScrollDimensions(),a=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i,scrollbarState:new nx(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,n.height,n.scrollHeight,a.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},NA=500,e1=50,PA=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},gg=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,i=0,n=1,a=this._rear;do{let l=a===this._front?e:Math.pow(2,-n);if(e-=l,i+=this._memory[a].score*l,a===this._front)break;a=(this._capacity+a-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(e){if(dv){let i=an(e.browserEvent),n=YM(i);this.accept(Date.now(),e.deltaX*n,e.deltaY*n)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,n){let a=null,l=new PA(e,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=l),l.score=this._computeScore(l,a)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),i){let a=Math.abs(e.deltaX),l=Math.abs(e.deltaY),u=Math.abs(i.deltaX),h=Math.abs(i.deltaY),f=Math.max(Math.min(a,u),1),d=Math.max(Math.min(l,h),1),p=Math.max(a,u),v=Math.max(l,h);p%f===0&&v%d===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};gg.INSTANCE=new gg;var zA=gg,IA=class extends pv{constructor(t,e,i){super(),this._onScroll=this._register(new ye),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ye),this.onWillScroll=this._onWillScroll.event,this._options=UA(e),this._scrollable=i,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let n={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new BA(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new OA(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Lu(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Lu(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Lu(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new mv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Wo(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,on&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new Yb(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Wo(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new Yb(i))};this._mouseWheelToDispose.push(Ve(this._listenOnDomNode,Di.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){if(t.browserEvent?.defaultPrevented)return;let e=zA.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let a=t.deltaY*this._options.mouseWheelScrollSensitivity,l=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!on&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),t.browserEvent&&t.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),f={};if(a){let d=e1*a,p=h.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(f,p)}if(l){let d=e1*l,p=h.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(f,p)}f=this._scrollable.validateScrollPosition(f),(h.scrollLeft!==f.scrollLeft||h.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,i=t.scrollLeft>0,n=i?" left":"",a=e?" top":"",l=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${a}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),NA)}},HA=class extends IA{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function UA(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,on&&(e.className+=" mac"),e}var vg=class extends rt{constructor(e,i,n,a,l,u,h,f){super(),this._bufferService=n,this._optionsService=h,this._renderService=f,this._onRequestScrollLines=this._register(new ye),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new TA({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:p=>_v(a.window,p)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new HA(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(l.onProtocolChange(p=>{this._scrollableElement.updateOptions({handleMouseWheel:!(p&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Zi.runAndSubscribe(u.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=u.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Wt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=a.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(Wt(()=>this._styleElement.remove())),this._register(Zi.runAndSubscribe(u.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${u.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${u.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${u.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
18
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(p=>this._handleScroll(p)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};vg=si([Ce(2,ds),Ce(3,Xn),Ce(4,HC),Ce(5,tc),Ce(6,fs),Ce(7,Zn)],vg);var yg=class extends rt{constructor(e,i,n,a,l){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=a,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(u=>this._removeDecoration(u))),this._register(Wt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};yg=si([Ce(1,ds),Ce(2,Xn),Ce(3,qu),Ce(4,Zn)],yg);var FA=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},en={full:0,left:0,center:0,right:0},Ba={full:0,left:0,center:0,right:0},au={full:0,left:0,center:0,right:0},cf=class extends rt{constructor(e,i,n,a,l,u,h,f){super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=a,this._renderService=l,this._optionsService=u,this._themeService=h,this._coreBrowserService=f,this._colorZoneStore=new FA,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(Wt(()=>this._canvas?.remove()));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);Ba.full=this._canvas.width,Ba.left=e,Ba.center=i,Ba.right=e,this._refreshDrawHeightConstants(),au.full=1,au.left=1,au.center=1+Ba.left,au.right=1+Ba.left+Ba.center}_refreshDrawHeightConstants(){en.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);en.left=i,en.center=i,en.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*en.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*en.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*en.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*en.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(au[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-en[e.position||"full"]/2),Ba[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+en[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};cf=si([Ce(2,ds),Ce(3,qu),Ce(4,Zn),Ce(5,fs),Ce(6,tc),Ce(7,Xn)],cf);var ce;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
19
+ `,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(ce||={});var Id;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(Id||={});var ax;(t=>t.ST=`${ce.ESC}\\`)(ax||={});var Sg=class{constructor(e,i,n,a,l,u){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=a,this._coreService=l,this._renderService=u,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${ce.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let u=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Sg=si([Ce(2,ds),Ce(3,fs),Ce(4,qo),Ce(5,Zn)],Sg);var Oi=0,Bi=0,Ni=0,ti=0,t1={css:"#00000000",rgba:0},gi;(t=>{function e(a,l,u,h){return h!==void 0?`#${To(a)}${To(l)}${To(u)}${To(h)}`:`#${To(a)}${To(l)}${To(u)}`}t.toCss=e;function i(a,l,u,h=255){return(a<<24|l<<16|u<<8|h)>>>0}t.toRgba=i;function n(a,l,u,h){return{css:t.toCss(a,l,u,h),rgba:t.toRgba(a,l,u,h)}}t.toColor=n})(gi||={});var It;(t=>{function e(f,d){if(ti=(d.rgba&255)/255,ti===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,v=d.rgba>>16&255,g=d.rgba>>8&255,y=f.rgba>>24&255,b=f.rgba>>16&255,C=f.rgba>>8&255;Oi=y+Math.round((p-y)*ti),Bi=b+Math.round((v-b)*ti),Ni=C+Math.round((g-C)*ti);let x=gi.toCss(Oi,Bi,Ni),k=gi.toRgba(Oi,Bi,Ni);return{css:x,rgba:k}}t.blend=e;function i(f){return(f.rgba&255)===255}t.isOpaque=i;function n(f,d,p){let v=Hd.ensureContrastRatio(f.rgba,d.rgba,p);if(v)return gi.toColor(v>>24&255,v>>16&255,v>>8&255)}t.ensureContrastRatio=n;function a(f){let d=(f.rgba|255)>>>0;return[Oi,Bi,Ni]=Hd.toChannels(d),{css:gi.toCss(Oi,Bi,Ni),rgba:d}}t.opaque=a;function l(f,d){return ti=Math.round(d*255),[Oi,Bi,Ni]=Hd.toChannels(f.rgba),{css:gi.toCss(Oi,Bi,Ni,ti),rgba:gi.toRgba(Oi,Bi,Ni,ti)}}t.opacity=l;function u(f,d){return ti=f.rgba&255,l(f,ti*d/255)}t.multiplyOpacity=u;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}t.toColorRGB=h})(It||={});var Yt;(t=>{let e,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(e=l,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Oi=parseInt(a.slice(1,2).repeat(2),16),Bi=parseInt(a.slice(2,3).repeat(2),16),Ni=parseInt(a.slice(3,4).repeat(2),16),gi.toColor(Oi,Bi,Ni);case 5:return Oi=parseInt(a.slice(1,2).repeat(2),16),Bi=parseInt(a.slice(2,3).repeat(2),16),Ni=parseInt(a.slice(3,4).repeat(2),16),ti=parseInt(a.slice(4,5).repeat(2),16),gi.toColor(Oi,Bi,Ni,ti);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let l=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return Oi=parseInt(l[1]),Bi=parseInt(l[2]),Ni=parseInt(l[3]),ti=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),gi.toColor(Oi,Bi,Ni,ti);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=a,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Oi,Bi,Ni,ti]=e.getImageData(0,0,1,1).data,ti!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gi.toRgba(Oi,Bi,Ni,ti),css:a}}t.toColor=n})(Yt||={});var cs;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,a,l){let u=n/255,h=a/255,f=l/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return d*.2126+p*.7152+v*.0722}t.relativeLuminance2=i})(cs||={});var Hd;(t=>{function e(u,h){if(ti=(h&255)/255,ti===1)return h;let f=h>>24&255,d=h>>16&255,p=h>>8&255,v=u>>24&255,g=u>>16&255,y=u>>8&255;return Oi=v+Math.round((f-v)*ti),Bi=g+Math.round((d-g)*ti),Ni=y+Math.round((p-y)*ti),gi.toRgba(Oi,Bi,Ni)}t.blend=e;function i(u,h,f){let d=cs.relativeLuminance(u>>8),p=cs.relativeLuminance(h>>8);if(In(d,p)<f){if(p<d){let y=n(u,h,f),b=In(d,cs.relativeLuminance(y>>8));if(b<f){let C=a(u,h,f),x=In(d,cs.relativeLuminance(C>>8));return b>x?y:C}return y}let v=a(u,h,f),g=In(d,cs.relativeLuminance(v>>8));if(g<f){let y=n(u,h,f),b=In(d,cs.relativeLuminance(y>>8));return g>b?v:y}return v}}t.ensureContrastRatio=i;function n(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,y=h>>16&255,b=h>>8&255,C=In(cs.relativeLuminance2(g,y,b),cs.relativeLuminance2(d,p,v));for(;C<f&&(g>0||y>0||b>0);)g-=Math.max(0,Math.ceil(g*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),C=In(cs.relativeLuminance2(g,y,b),cs.relativeLuminance2(d,p,v));return(g<<24|y<<16|b<<8|255)>>>0}t.reduceLuminance=n;function a(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,y=h>>16&255,b=h>>8&255,C=In(cs.relativeLuminance2(g,y,b),cs.relativeLuminance2(d,p,v));for(;C<f&&(g<255||y<255||b<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),C=In(cs.relativeLuminance2(g,y,b),cs.relativeLuminance2(d,p,v));return(g<<24|y<<16|b<<8|255)>>>0}t.increaseLuminance=a;function l(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}t.toChannels=l})(Hd||={});function To(t){let e=t.toString(16);return e.length<2?"0"+e:e}function In(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var $A=class extends Vu{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},uf=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Er}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let i=[],n=e.translateToString(!0),a=0,l=0,u=0,h=e.getFg(0),f=e.getBg(0);for(let d=0;d<e.getTrimmedLength();d++)if(e.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==f){if(d-a>1){let p=this._getJoinedRanges(n,u,l,e,a);for(let v=0;v<p.length;v++)i.push(p[v])}a=d,u=l,h=this._workCell.fg,f=this._workCell.bg}l+=this._workCell.getChars().length||Va.length}if(this._bufferService.cols-a>1){let d=this._getJoinedRanges(n,u,l,e,a);for(let p=0;p<d.length;p++)i.push(d[p])}return i}_getJoinedRanges(t,e,i,n,a){let l=t.substring(e,i),u=[];try{u=this._characterJoiners[0].handler(l)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let f=this._characterJoiners[h].handler(l);for(let d=0;d<f.length;d++)uf._mergeRanges(u,f[d])}catch(f){console.error(f)}return this._stringRangesToCellRanges(u,n,a),u}_stringRangesToCellRanges(t,e,i){let n=0,a=!1,l=0,u=t[n];if(u){for(let h=i;h<this._bufferService.cols;h++){let f=e.getWidth(h),d=e.getString(h).length||Va.length;if(f!==0){if(!a&&u[0]<=l&&(u[0]=h,a=!0),u[1]<=l){if(u[1]=h,u=t[++n],!u)break;u[0]<=l?(u[0]=h,a=!0):a=!1}l+=d}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i=!1;for(let n=0;n<t.length;n++){let a=t[n];if(i){if(e[1]<=a[0])return t[n-1][1]=e[1],t;if(e[1]<=a[1])return t[n-1][1]=Math.max(e[1],a[1]),t.splice(n,1),t;t.splice(n,1),n--}else{if(e[1]<=a[0])return t.splice(n,0,e),t;if(e[1]<=a[1])return a[0]=Math.min(e[0],a[0]),t;e[0]<a[1]&&(a[0]=Math.min(e[0],a[0]),i=!0);continue}}return i?t[t.length-1][1]=e[1]:t.push(e),t}};uf=si([Ce(0,ds)],uf);function WA(t){return 57508<=t&&t<=57558}function jA(t){return 9472<=t&&t<=9631}function VA(t){return WA(t)||jA(t)}function qA(){return{css:{canvas:vd(),cell:vd()},device:{canvas:vd(),cell:vd(),char:{width:0,height:0,left:0,top:0}}}}function vd(){return{width:0,height:0}}var bg=class{constructor(e,i,n,a,l,u,h){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=a,this._coreService=l,this._decorationService=u,this._themeService=h,this._workCell=new Er,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,a,l,u,h,f,d,p,v){let g=[],y=this._characterJoinerService.getJoinedCharacters(i),b=this._themeService.colors,C=e.getNoBgTrimmedLength();n&&C<u+1&&(C=u+1);let x,k=0,R="",L=0,E=0,H=0,U=0,I=!1,N=0,F=!1,J=0,G=0,D=[],O=p!==-1&&v!==-1;for(let P=0;P<C;P++){e.loadCell(P,this._workCell);let $=this._workCell.getWidth();if($===0)continue;let M=!1,A=P>=G,z=P,q=this._workCell;if(y.length>0&&P===y[0][0]&&A){let xe=y.shift(),Oe=this._isCellInSelection(xe[0],i);for(L=xe[0]+1;L<xe[1];L++)A&&=Oe===this._isCellInSelection(L,i);A&&=!n||u<xe[0]||u>=xe[1],A?(M=!0,q=new $A(this._workCell,e.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),z=xe[1]-1,$=q.getWidth()):G=xe[1]}let Y=this._isCellInSelection(P,i),B=n&&P===u,X=O&&P>=p&&P<=v,ie=!1;this._decorationService.forEachDecorationAtCell(P,i,void 0,xe=>{ie=!0});let re=q.getChars()||Va;if(re===" "&&(q.isUnderline()||q.isOverline())&&(re=" "),J=$*f-d.get(re,q.isBold(),q.isItalic()),!x)x=this._document.createElement("span");else if(k&&(Y&&F||!Y&&!F&&q.bg===E)&&(Y&&F&&b.selectionForeground||q.fg===H)&&q.extended.ext===U&&X===I&&J===N&&!B&&!M&&!ie&&A){q.isInvisible()?R+=Va:R+=re,k++;continue}else k&&(x.textContent=R),x=this._document.createElement("span"),k=0,R="";if(E=q.bg,H=q.fg,U=q.extended.ext,I=X,N=J,F=Y,M&&u>=P&&u<=z&&(u=P),!this._coreService.isCursorHidden&&B&&this._coreService.isCursorInitialized){if(D.push("xterm-cursor"),this._coreBrowserService.isFocused)h&&D.push("xterm-cursor-blink"),D.push(a==="bar"?"xterm-cursor-bar":a==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(l)switch(l){case"outline":D.push("xterm-cursor-outline");break;case"block":D.push("xterm-cursor-block");break;case"bar":D.push("xterm-cursor-bar");break;case"underline":D.push("xterm-cursor-underline");break}}if(q.isBold()&&D.push("xterm-bold"),q.isItalic()&&D.push("xterm-italic"),q.isDim()&&D.push("xterm-dim"),q.isInvisible()?R=Va:R=q.getChars()||Va,q.isUnderline()&&(D.push(`xterm-underline-${q.extended.underlineStyle}`),R===" "&&(R=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${Vu.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let xe=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&xe<8&&(xe+=8),x.style.textDecorationColor=b.ansi[xe].css}q.isOverline()&&(D.push("xterm-overline"),R===" "&&(R=" ")),q.isStrikethrough()&&D.push("xterm-strikethrough"),X&&(x.style.textDecoration="underline");let fe=q.getFgColor(),he=q.getFgColorMode(),oe=q.getBgColor(),ve=q.getBgColorMode(),de=!!q.isInverse();if(de){let xe=fe;fe=oe,oe=xe;let Oe=he;he=ve,ve=Oe}let we,Le,tt=!1;this._decorationService.forEachDecorationAtCell(P,i,void 0,xe=>{xe.options.layer!=="top"&&tt||(xe.backgroundColorRGB&&(ve=50331648,oe=xe.backgroundColorRGB.rgba>>8&16777215,we=xe.backgroundColorRGB),xe.foregroundColorRGB&&(he=50331648,fe=xe.foregroundColorRGB.rgba>>8&16777215,Le=xe.foregroundColorRGB),tt=xe.options.layer==="top")}),!tt&&Y&&(we=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,oe=we.rgba>>8&16777215,ve=50331648,tt=!0,b.selectionForeground&&(he=50331648,fe=b.selectionForeground.rgba>>8&16777215,Le=b.selectionForeground)),tt&&D.push("xterm-decoration-top");let Ge;switch(ve){case 16777216:case 33554432:Ge=b.ansi[oe],D.push(`xterm-bg-${oe}`);break;case 50331648:Ge=gi.toColor(oe>>16,oe>>8&255,oe&255),this._addStyle(x,`background-color:#${i1((oe>>>0).toString(16),"0",6)}`);break;default:de?(Ge=b.foreground,D.push("xterm-bg-257")):Ge=b.background}switch(we||q.isDim()&&(we=It.multiplyOpacity(Ge,.5)),he){case 16777216:case 33554432:q.isBold()&&fe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(fe+=8),this._applyMinimumContrast(x,Ge,b.ansi[fe],q,we,void 0)||D.push(`xterm-fg-${fe}`);break;case 50331648:let xe=gi.toColor(fe>>16&255,fe>>8&255,fe&255);this._applyMinimumContrast(x,Ge,xe,q,we,Le)||this._addStyle(x,`color:#${i1(fe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,Ge,b.foreground,q,we,Le)||de&&D.push("xterm-fg-257")}D.length&&(x.className=D.join(" "),D.length=0),!B&&!M&&!ie&&A?k++:x.textContent=R,J!==this.defaultSpacing&&(x.style.letterSpacing=`${J}px`),g.push(x),P=z}return x&&k&&(x.textContent=R),g}_applyMinimumContrast(e,i,n,a,l,u){if(this._optionsService.rawOptions.minimumContrastRatio===1||VA(a.getCode()))return!1;let h=this._getContrastCache(a),f;if(!l&&!u&&(f=h.getColor(i.rgba,n.rgba)),f===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(a.isDim()?2:1);f=It.ensureContrastRatio(l||i,u||n,d),h.setColor((l||i).rgba,(u||n).rgba,f??null)}return f?(this._addStyle(e,`color:${f.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,a=this._selectionEnd;return!n||!a?!1:this._columnSelectMode?n[0]<=a[0]?e>=n[0]&&i>=n[1]&&e<a[0]&&i<=a[1]:e<n[0]&&i>=n[1]&&e>=a[0]&&i<=a[1]:i>n[1]&&i<a[1]||n[1]===a[1]&&i===n[1]&&e>=n[0]&&e<a[0]||n[1]<a[1]&&i===a[1]&&e<a[0]||n[1]<a[1]&&i===n[1]&&e>=n[0]}};bg=si([Ce(1,$C),Ce(2,fs),Ce(3,Xn),Ce(4,qo),Ce(5,qu),Ce(6,tc)],bg);function i1(t,e,i){for(;t.length<i;)t=e+t;return t}var YA=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontStyle="italic";let u=e.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[n,a,l,u],this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(l),this._container.appendChild(u),i.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,i,n,a){e===this._font&&i===this._fontSize&&n===this._weight&&a===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(e,i,n){let a=0;if(!i&&!n&&e.length===1&&(a=e.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];let h=this._measure(e,0);return h>0&&(this._flat[a]=h),h}let l=e;i&&(l+="B"),n&&(l+="I");let u=this._holey.get(l);if(u===void 0){let h=0;i&&(h|=1),n&&(h|=2),u=this._measure(e,h),u>0&&this._holey.set(l,u)}return u}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},KA=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,n,a=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let l=e.buffers.active.ydisp,u=i[1]-l,h=n[1]-l,f=Math.max(u,0),d=Math.min(h,e.rows-1);if(f>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=u,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function GA(){return new KA}var mp="xterm-dom-renderer-owner-",vr="xterm-rows",yd="xterm-fg-",s1="xterm-bg-",ou="xterm-focus",Sd="xterm-selection",XA=1,wg=class extends rt{constructor(e,i,n,a,l,u,h,f,d,p,v,g,y,b){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=a,this._viewportElement=l,this._helperContainer=u,this._linkifier2=h,this._charSizeService=d,this._optionsService=p,this._bufferService=v,this._coreService=g,this._coreBrowserService=y,this._themeService=b,this._terminalClass=XA++,this._rowElements=[],this._selectionRenderModel=GA(),this.onRequestRedraw=this._register(new ye).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(vr),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(Sd),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=qA(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(C=>this._injectCss(C))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance(bg,document),this._element.classList.add(mp+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(C=>this._handleLinkHover(C))),this._register(this._linkifier2.onHideLinkUnderline(C=>this._handleLinkLeave(C))),this._register(Wt(()=>{this._element.classList.remove(mp+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new YA(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${vr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${vr} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${vr} .xterm-dim { color: ${It.multiplyOpacity(e.foreground,.5).css};}`,i+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,a=`blink_bar_${this._terminalClass}`,l=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${a} { 50% { box-shadow: none; }}`,i+=`@keyframes ${l} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${vr}.${ou} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${vr}.${ou} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${vr}.${ou} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${vr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${Sd} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Sd} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Sd} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[u,h]of e.ansi.entries())i+=`${this._terminalSelector} .${yd}${u} { color: ${h.css}; }${this._terminalSelector} .${yd}${u}.xterm-dim { color: ${It.multiplyOpacity(h,.5).css}; }${this._terminalSelector} .${s1}${u} { background-color: ${h.css}; }`;i+=`${this._terminalSelector} .${yd}257 { color: ${It.opaque(e.background).css}; }${this._terminalSelector} .${yd}257.xterm-dim { color: ${It.multiplyOpacity(It.opaque(e.background),.5).css}; }${this._terminalSelector} .${s1}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let a=this._document.createElement("div");this._rowContainer.appendChild(a),this._rowElements.push(a)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),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(ou),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ou),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let a=this._selectionRenderModel.viewportStartRow,l=this._selectionRenderModel.viewportEndRow,u=this._selectionRenderModel.viewportCappedStartRow,h=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(n){let d=e[0]>i[0];f.appendChild(this._createSelectionElement(u,d?i[0]:e[0],d?e[0]:i[0],h-u+1))}else{let d=a===u?e[0]:0,p=u===l?i[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(u,d,p));let v=h-u-1;if(f.appendChild(this._createSelectionElement(u+1,0,this._bufferService.cols,v)),u!==h){let g=l===h?i[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(h,0,g))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,i,n,a=1){let l=this._document.createElement("div"),u=i*this.dimensions.css.cell.width,h=this.dimensions.css.cell.width*(n-i);return u+h>this.dimensions.css.canvas.width&&(h=this.dimensions.css.canvas.width-u),l.style.height=`${a*this.dimensions.css.cell.height}px`,l.style.top=`${e*this.dimensions.css.cell.height}px`,l.style.left=`${u}px`,l.style.width=`${h}px`,l}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,a=n.ybase+n.y,l=Math.min(n.x,this._bufferService.cols-1),u=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,h=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=i;d++){let p=d+n.ydisp,v=this._rowElements[d],g=n.lines.get(p);if(!v||!g)break;v.replaceChildren(...this._rowFactory.createRow(g,p,p===a,h,f,l,u,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${mp}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,a,l,u){n<0&&(e=0),a<0&&(i=0);let h=this._bufferService.rows-1;n=Math.max(Math.min(n,h),0),a=Math.max(Math.min(a,h),0),l=Math.min(l,this._bufferService.cols);let f=this._bufferService.buffer,d=f.ybase+f.y,p=Math.min(f.x,l-1),v=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=a;++b){let C=b+f.ydisp,x=this._rowElements[b],k=f.lines.get(C);if(!x||!k)break;x.replaceChildren(...this._rowFactory.createRow(k,C,C===d,g,y,p,v,this.dimensions.css.cell.width,this._widthCache,u?b===n?e:0:-1,u?(b===a?i:l)-1:-1))}}};wg=si([Ce(7,cv),Ce(8,Ef),Ce(9,fs),Ce(10,ds),Ce(11,qo),Ce(12,Xn),Ce(13,tc)],wg);var Cg=class extends rt{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ye),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new QA(this._optionsService))}catch{this._measureStrategy=this._register(new ZA(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Cg=si([Ce(2,fs)],Cg);var ox=class extends rt{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},ZA=class extends ox{constructor(t,e,i){super(),this._document=t,this._parentElement=e,this._optionsService=i,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}},QA=class extends ox{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},JA=class extends rt{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new eL(this._window)),this._onDprChange=this._register(new ye),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ye),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(a=>this._screenDprMonitor.setWindow(a))),this._register(Zi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ve(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ve(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},eL=class extends rt{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ql),this._onDprChange=this._register(new ye),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Wt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ve(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},tL=class extends rt{constructor(){super(),this.linkProviders=[],this._register(Wt(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function gv(t,e,i){let n=i.getBoundingClientRect(),a=t.getComputedStyle(i),l=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[e.clientX-n.left-l,e.clientY-n.top-u]}function iL(t,e,i,n,a,l,u,h,f){if(!l)return;let d=gv(t,e,i);if(d)return d[0]=Math.ceil((d[0]+(f?u/2:0))/u),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),n+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),a),d}var xg=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,a,l){return iL(window,e,i,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(e,i){let n=gv(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};xg=si([Ce(0,Zn),Ce(1,Ef)],xg);var sL=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},lx={};fM(lx,{getSafariVersion:()=>nL,isChromeOS:()=>dx,isFirefox:()=>cx,isIpad:()=>aL,isIphone:()=>oL,isLegacyEdge:()=>rL,isLinux:()=>vv,isMac:()=>hf,isNode:()=>Tf,isSafari:()=>ux,isWindows:()=>hx});var Tf=typeof process<"u"&&"title"in process,Yu=Tf?"node":navigator.userAgent,Ku=Tf?"node":navigator.platform,cx=Yu.includes("Firefox"),rL=Yu.includes("Edge"),ux=/^((?!chrome|android).)*safari/i.test(Yu);function nL(){if(!ux)return 0;let t=Yu.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var hf=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ku),aL=Ku==="iPad",oL=Ku==="iPhone",hx=["Windows","Win16","Win32","WinCE"].includes(Ku),vv=Ku.indexOf("Linux")>=0,dx=/\bCrOS\b/.test(Yu),fx=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),a=t.timeRemaining(),i*1.5>a){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=a}this.clear()}},lL=class extends fx{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},cL=class extends fx{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},df=!Tf&&"requestIdleCallback"in window?cL:lL,uL=class{constructor(){this._queue=new df}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},kg=class extends rt{constructor(e,i,n,a,l,u,h,f,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=a,this._coreService=l,this._coreBrowserService=f,this._renderer=this._register(new Ql),this._pausedResizeTask=new uL,this._observerDisposable=this._register(new Ql),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 ye),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ye),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ye),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ye),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new sL((p,v)=>this._renderRows(p,v),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new hL(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Wt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(h.onResize(()=>this._fullRefresh())),this._register(h.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(u.onDecorationRegistered(()=>this._fullRefresh())),this._register(u.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(h.cols,h.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(h.buffer.y,h.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(p=>this._registerIntersectionObserver(p,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(a=>this._handleIntersectionChange(a[a.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=Wt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let a=this._syncOutputHandler.flush();a&&(e=Math.min(e,a.start),i=Math.max(i,a.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,n){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,i,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};kg=si([Ce(2,fs),Ce(3,Ef),Ce(4,qo),Ce(5,qu),Ce(6,ds),Ce(7,Xn),Ce(8,tc)],kg);var hL=class{constructor(t,e,i){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function dL(t,e,i,n){let a=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return _L(a,l,t,e,i,n)+Rf(l,e,i,n)+pL(a,l,t,e,i,n);let u;if(l===e)return u=a>t?"D":"C",zu(Math.abs(a-t),Pu(u,n));u=l>e?"D":"C";let h=Math.abs(l-e),f=mL(l>e?t:a,i)+(h-1)*i.cols+1+fL(l>e?a:t);return zu(f,Pu(u,n))}function fL(t,e){return t-1}function mL(t,e){return e.cols-t}function _L(t,e,i,n,a,l){return Rf(e,n,a,l).length===0?"":zu(_x(t,e,t,e-jo(e,a),!1,a).length,Pu("D",l))}function Rf(t,e,i,n){let a=t-jo(t,i),l=e-jo(e,i),u=Math.abs(a-l)-gL(t,e,i);return zu(u,Pu(mx(t,e),n))}function pL(t,e,i,n,a,l){let u;Rf(e,n,a,l).length>0?u=n-jo(n,a):u=e;let h=n,f=vL(t,e,i,n,a,l);return zu(_x(t,u,i,h,f==="C",a).length,Pu(f,l))}function gL(t,e,i){let n=0,a=t-jo(t,i),l=e-jo(e,i);for(let u=0;u<Math.abs(a-l);u++){let h=mx(t,e)==="A"?-1:1;i.buffer.lines.get(a+h*u)?.isWrapped&&n++}return n}function jo(t,e){let i=0,n=e.buffer.lines.get(t),a=n?.isWrapped;for(;a&&t>=0&&t<e.rows;)i++,n=e.buffer.lines.get(--t),a=n?.isWrapped;return i}function vL(t,e,i,n,a,l){let u;return Rf(i,n,a,l).length>0?u=n-jo(n,a):u=e,t<i&&u<=n||t>=i&&u<n?"C":"D"}function mx(t,e){return t>e?"A":"B"}function _x(t,e,i,n,a,l){let u=t,h=e,f="";for(;(u!==i||h!==n)&&h>=0&&h<l.buffer.lines.length;)u+=a?1:-1,a&&u>l.cols-1?(f+=l.buffer.translateBufferLineToString(h,!1,t,u),u=0,t=0,h++):!a&&u<0&&(f+=l.buffer.translateBufferLineToString(h,!1,0,t+1),u=l.cols-1,t=u,h--);return f+l.buffer.translateBufferLineToString(h,!1,t,u)}function Pu(t,e){let i=e?"O":"[";return ce.ESC+i+t}function zu(t,e){t=Math.floor(t);let i="";for(let n=0;n<t;n++)i+=e;return i}var yL=class{constructor(t){this._bufferService=t,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function r1(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var _p=50,SL=15,bL=50,wL=500,CL=" ",xL=new RegExp(CL,"g"),Eg=class extends rt{constructor(e,i,n,a,l,u,h,f,d){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=a,this._coreService=l,this._mouseService=u,this._optionsService=h,this._renderService=f,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Er,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ye),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ye),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ye),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ye),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=p=>this._handleMouseMove(p),this._mouseUpListener=p=>this._handleMouseUp(p),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(p=>this._handleTrim(p)),this._register(this._bufferService.buffers.onBufferActivate(p=>this._handleBufferActivate(p))),this.enable(),this._model=new yL(this._bufferService),this._activeSelectionMode=0,this._register(Wt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(p=>{p.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,a=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let l=e[0]<i[0]?e[0]:i[0],u=e[0]<i[0]?i[0]:e[0];for(let h=e[1];h<=i[1];h++){let f=n.translateBufferLineToString(h,!0,l,u);a.push(f)}}else{let l=e[1]===i[1]?i[0]:void 0;a.push(n.translateBufferLineToString(e[1],!0,e[0],l));for(let u=e[1]+1;u<=i[1]-1;u++){let h=n.lines.get(u),f=n.translateBufferLineToString(u,!0);h?.isWrapped?a[a.length-1]+=f:a.push(f)}if(e[1]!==i[1]){let u=n.lines.get(i[1]),h=n.translateBufferLineToString(i[1],!0,0,i[0]);u&&u.isWrapped?a[a.length-1]+=h:a.push(h)}}return a.map(l=>l.replace(xL," ")).join(hx?`\r
20
+ `:`
21
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),vv&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,a=this._model.finalSelectionEnd;return!n||!a||!i?!1:this._areCoordsInSelection(i,n,a)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,a=this._model.finalSelectionEnd;return!n||!a?!1:this._areCoordsInSelection([e,i],n,a)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=r1(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let a=this._getMouseBufferCoords(e);return a?(this._selectWordAt(a,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=gv(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-_p),_p),i/=_p,i/Math.abs(i)+Math.round(i*(SL-1)))}shouldForceSelection(e){return hf?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),bL)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(hf&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let a=n.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]++}(!i||i[0]!==this._model.selectionEnd[0]||i[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<wL&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let a=dL(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(a,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let a=0;i>=a;a++){let l=e.loadCell(a,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:l>1&&i!==a&&(n+=l-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,a=!0){if(e[0]>=this._bufferService.cols)return;let l=this._bufferService.buffer,u=l.lines.get(e[1]);if(!u)return;let h=l.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(u,e[0]),d=f,p=e[0]-f,v=0,g=0,y=0,b=0;if(h.charAt(f)===" "){for(;f>0&&h.charAt(f-1)===" ";)f--;for(;d<h.length&&h.charAt(d+1)===" ";)d++}else{let k=e[0],R=e[0];u.getWidth(k)===0&&(v++,k--),u.getWidth(R)===2&&(g++,R++);let L=u.getString(R).length;for(L>1&&(b+=L-1,d+=L-1);k>0&&f>0&&!this._isCharWordSeparator(u.loadCell(k-1,this._workCell));){u.loadCell(k-1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===0?(v++,k--):E>1&&(y+=E-1,f-=E-1),f--,k--}for(;R<u.length&&d+1<h.length&&!this._isCharWordSeparator(u.loadCell(R+1,this._workCell));){u.loadCell(R+1,this._workCell);let E=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,R++):E>1&&(b+=E-1,d+=E-1),d++,R++}}d++;let C=f+p-v+y,x=Math.min(this._bufferService.cols,d-f+v+g-y-b);if(!(!i&&h.slice(f,d).trim()==="")){if(n&&C===0&&u.getCodePoint(0)!==32){let k=l.lines.get(e[1]-1);if(k&&u.isWrapped&&k.getCodePoint(this._bufferService.cols-1)!==32){let R=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(R){let L=this._bufferService.cols-R.start;C-=L,x+=L}}}if(a&&C+x===this._bufferService.cols&&u.getCodePoint(this._bufferService.cols-1)!==32){let k=l.lines.get(e[1]+1);if(k?.isWrapped&&k.getCodePoint(0)!==32){let R=this._getWordAt([0,e[1]+1],!1,!1,!0);R&&(x+=R.length)}}return{start:C,length:x}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=r1(n,this._bufferService.cols)}};Eg=si([Ce(3,ds),Ce(4,qo),Ce(5,uv),Ce(6,fs),Ce(7,Zn),Ce(8,Xn)],Eg);var n1=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},a1=class{constructor(){this._color=new n1,this._css=new n1}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},Ci=Object.freeze((()=>{let t=[Yt.toColor("#2e3436"),Yt.toColor("#cc0000"),Yt.toColor("#4e9a06"),Yt.toColor("#c4a000"),Yt.toColor("#3465a4"),Yt.toColor("#75507b"),Yt.toColor("#06989a"),Yt.toColor("#d3d7cf"),Yt.toColor("#555753"),Yt.toColor("#ef2929"),Yt.toColor("#8ae234"),Yt.toColor("#fce94f"),Yt.toColor("#729fcf"),Yt.toColor("#ad7fa8"),Yt.toColor("#34e2e2"),Yt.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],a=e[i/6%6|0],l=e[i%6];t.push({css:gi.toCss(n,a,l),rgba:gi.toRgba(n,a,l)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:gi.toCss(n,n,n),rgba:gi.toRgba(n,n,n)})}return t})()),Mo=Yt.toColor("#ffffff"),Su=Yt.toColor("#000000"),o1=Yt.toColor("#ffffff"),l1=Su,lu={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},kL=Mo,Tg=class extends rt{constructor(e){super(),this._optionsService=e,this._contrastCache=new a1,this._halfContrastCache=new a1,this._onChangeColors=this._register(new ye),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Mo,background:Su,cursor:o1,cursorAccent:l1,selectionForeground:void 0,selectionBackgroundTransparent:lu,selectionBackgroundOpaque:It.blend(Su,lu),selectionInactiveBackgroundTransparent:lu,selectionInactiveBackgroundOpaque:It.blend(Su,lu),scrollbarSliderBackground:It.opacity(Mo,.2),scrollbarSliderHoverBackground:It.opacity(Mo,.4),scrollbarSliderActiveBackground:It.opacity(Mo,.5),overviewRulerBorder:Mo,ansi:Ci.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Mt(e.foreground,Mo),i.background=Mt(e.background,Su),i.cursor=It.blend(i.background,Mt(e.cursor,o1)),i.cursorAccent=It.blend(i.background,Mt(e.cursorAccent,l1)),i.selectionBackgroundTransparent=Mt(e.selectionBackground,lu),i.selectionBackgroundOpaque=It.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Mt(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=It.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Mt(e.selectionForeground,t1):void 0,i.selectionForeground===t1&&(i.selectionForeground=void 0),It.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=It.opacity(i.selectionBackgroundTransparent,.3)),It.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=It.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Mt(e.scrollbarSliderBackground,It.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Mt(e.scrollbarSliderHoverBackground,It.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Mt(e.scrollbarSliderActiveBackground,It.opacity(i.foreground,.5)),i.overviewRulerBorder=Mt(e.overviewRulerBorder,kL),i.ansi=Ci.slice(),i.ansi[0]=Mt(e.black,Ci[0]),i.ansi[1]=Mt(e.red,Ci[1]),i.ansi[2]=Mt(e.green,Ci[2]),i.ansi[3]=Mt(e.yellow,Ci[3]),i.ansi[4]=Mt(e.blue,Ci[4]),i.ansi[5]=Mt(e.magenta,Ci[5]),i.ansi[6]=Mt(e.cyan,Ci[6]),i.ansi[7]=Mt(e.white,Ci[7]),i.ansi[8]=Mt(e.brightBlack,Ci[8]),i.ansi[9]=Mt(e.brightRed,Ci[9]),i.ansi[10]=Mt(e.brightGreen,Ci[10]),i.ansi[11]=Mt(e.brightYellow,Ci[11]),i.ansi[12]=Mt(e.brightBlue,Ci[12]),i.ansi[13]=Mt(e.brightMagenta,Ci[13]),i.ansi[14]=Mt(e.brightCyan,Ci[14]),i.ansi[15]=Mt(e.brightWhite,Ci[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let a=0;a<n;a++)i.ansi[a+16]=Mt(e.extendedAnsi[a],Ci[a+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Tg=si([Ce(0,fs)],Tg);function Mt(t,e){if(t!==void 0)try{return Yt.toColor(t)}catch{}return e}var EL=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},TL=class{constructor(){this._services=new EL,this._services.set(cv,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i=SM(t).sort((l,u)=>l.index-u.index),n=[];for(let l of i){let u=this._services.get(l.id);if(!u)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${l.id._id}.`);n.push(u)}let a=i.length>0?i[0].index:e.length;if(e.length!==a)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${a+1} conflicts with ${e.length} static arguments`);return new t(...e,...n)}},RL={trace:0,debug:1,info:2,warn:3,error:4,off:5},ML="xterm.js: ",Rg=class extends rt{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=RL[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":ML)+i,...n)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};Rg=si([Ce(0,fs)],Rg);var c1=class extends rt{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ye),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ye),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ye),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...n){if(i){for(let a=e;a<this._length-i;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let a=this._length-1;a>=e;a--)this._array[this._getCyclicIndex(a+n.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<n.length;a++)this._array[this._getCyclicIndex(e+a)]=n[a];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let a=this._length+n.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let l=i-1;l>=0;l--)this.set(e+l+n,this.get(e+l));let a=e+i+n-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<i;a++)this.set(e+a+n,this.get(e+a))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},it=3,_i=Object.freeze(new Vu),bd=0,pp=2,bu=class px{constructor(e,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*it);let a=i||Er.fromCharData([0,NC,1,0]);for(let l=0;l<e;++l)this.setCell(l,a);this.length=e}get(e){let i=this._data[e*it+0],n=i&2097151;return[this._data[e*it+1],i&2097152?this._combined[e]:n?$a(n):"",i>>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,i){this._data[e*it+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[e*it+0]=e|2097152|i[2]<<22):this._data[e*it+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[e*it+0]>>22}hasWidth(e){return this._data[e*it+0]&12582912}getFg(e){return this._data[e*it+1]}getBg(e){return this._data[e*it+2]}hasContent(e){return this._data[e*it+0]&4194303}getCodePoint(e){let i=this._data[e*it+0];return i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):i&2097151}isCombined(e){return this._data[e*it+0]&2097152}getString(e){let i=this._data[e*it+0];return i&2097152?this._combined[e]:i&2097151?$a(i&2097151):""}isProtected(e){return this._data[e*it+2]&536870912}loadCell(e,i){return bd=e*it,i.content=this._data[bd+0],i.fg=this._data[bd+1],i.bg=this._data[bd+2],i.content&2097152&&(i.combinedData=this._combined[e]),i.bg&268435456&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){i.content&2097152&&(this._combined[e]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*it+0]=i.content,this._data[e*it+1]=i.fg,this._data[e*it+2]=i.bg}setCellFromCodepoint(e,i,n,a){a.bg&268435456&&(this._extendedAttrs[e]=a.extended),this._data[e*it+0]=i|n<<22,this._data[e*it+1]=a.fg,this._data[e*it+2]=a.bg}addCodepointToCell(e,i,n){let a=this._data[e*it+0];a&2097152?this._combined[e]+=$a(i):a&2097151?(this._combined[e]=$a(a&2097151)+$a(i),a&=-2097152,a|=2097152):a=i|1<<22,n&&(a&=-12582913,a|=n<<22),this._data[e*it+0]=a}insertCells(e,i,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length-e){let a=new Er;for(let l=this.length-e-i-1;l>=0;--l)this.setCell(e+i+l,this.loadCell(e+l,a));for(let l=0;l<i;++l)this.setCell(e+l,n)}else for(let a=e;a<this.length;++a)this.setCell(a,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,i,n){if(e%=this.length,i<this.length-e){let a=new Er;for(let l=0;l<this.length-e-i;++l)this.setCell(e+l,this.loadCell(e+i+l,a));for(let l=this.length-i;l<this.length;++l)this.setCell(l,n)}else for(let a=e;a<this.length;++a)this.setCell(a,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,i,n,a=!1){if(a){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.setCell(e++,n)}resize(e,i){if(e===this.length)return this._data.length*4*pp<this._data.buffer.byteLength;let n=e*it;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let a=new Uint32Array(n);a.set(this._data),this._data=a}for(let a=this.length;a<e;++a)this.setCell(a,i)}else{this._data=this._data.subarray(0,n);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let h=parseInt(a[u],10);h>=e&&delete this._combined[h]}let l=Object.keys(this._extendedAttrs);for(let u=0;u<l.length;u++){let h=parseInt(l[u],10);h>=e&&delete this._extendedAttrs[h]}}return this.length=e,n*4*pp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*pp<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,e);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,e)}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(let i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(let i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let e=new px(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let i in this._combined)e._combined[i]=this._combined[i];for(let i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*it+0]&4194303)return e+(this._data[e*it+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*it+0]&4194303||this._data[e*it+2]&50331648)return e+(this._data[e*it+0]>>22);return 0}copyCellsFrom(e,i,n,a,l){let u=e._data;if(l)for(let f=a-1;f>=0;f--){for(let d=0;d<it;d++)this._data[(n+f)*it+d]=u[(i+f)*it+d];u[(i+f)*it+2]&268435456&&(this._extendedAttrs[n+f]=e._extendedAttrs[i+f])}else for(let f=0;f<a;f++){for(let d=0;d<it;d++)this._data[(n+f)*it+d]=u[(i+f)*it+d];u[(i+f)*it+2]&268435456&&(this._extendedAttrs[n+f]=e._extendedAttrs[i+f])}let h=Object.keys(e._combined);for(let f=0;f<h.length;f++){let d=parseInt(h[f],10);d>=i&&(this._combined[d-i+n]=e._combined[d])}}translateToString(e,i,n,a){i=i??0,n=n??this.length,e&&(n=Math.min(n,this.getTrimmedLength())),a&&(a.length=0);let l="";for(;i<n;){let u=this._data[i*it+0],h=u&2097151,f=u&2097152?this._combined[i]:h?$a(h):Va;if(l+=f,a)for(let d=0;d<f.length;++d)a.push(i);i+=u>>22||1}return a&&a.push(i),l}};function AL(t,e,i,n,a,l){let u=[];for(let h=0;h<t.length-1;h++){let f=h,d=t.get(++f);if(!d.isWrapped)continue;let p=[t.get(h)];for(;f<t.length&&d.isWrapped;)p.push(d),d=t.get(++f);if(!l&&n>=h&&n<f){h+=p.length-1;continue}let v=0,g=Iu(p,v,e),y=1,b=0;for(;y<p.length;){let x=Iu(p,y,e),k=x-b,R=i-g,L=Math.min(k,R);p[v].copyCellsFrom(p[y],b,g,L,!1),g+=L,g===i&&(v++,g=0),b+=L,b===x&&(y++,b=0),g===0&&v!==0&&p[v-1].getWidth(i-1)===2&&(p[v].copyCellsFrom(p[v-1],i-1,g++,1,!1),p[v-1].setCell(i-1,a))}p[v].replaceCells(g,i,a);let C=0;for(let x=p.length-1;x>0&&(x>v||p[x].getTrimmedLength()===0);x--)C++;C>0&&(u.push(h+p.length-C),u.push(C)),h+=p.length-1}return u}function LL(t,e){let i=[],n=0,a=e[n],l=0;for(let u=0;u<t.length;u++)if(a===u){let h=e[++n];t.onDeleteEmitter.fire({index:u-l,amount:h}),u+=h-1,l+=h,a=e[++n]}else i.push(u);return{layout:i,countRemoved:l}}function DL(t,e){let i=[];for(let n=0;n<e.length;n++)i.push(t.get(e[n]));for(let n=0;n<i.length;n++)t.set(n,i[n]);t.length=e.length}function OL(t,e,i){let n=[],a=t.map((f,d)=>Iu(t,d,e)).reduce((f,d)=>f+d),l=0,u=0,h=0;for(;h<a;){if(a-h<i){n.push(a-h);break}l+=i;let f=Iu(t,u,e);l>f&&(l-=f,u++);let d=t[u].getWidth(l-1)===2;d&&l--;let p=d?i-1:i;n.push(p),h+=p}return n}function Iu(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let n=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,a=t[e+1].getWidth(0)===2;return n&&a?i-1:i}var gx=class vx{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=vx._nextId++,this._onDispose=this.register(new ye),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Wo(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};gx._nextId=1;var BL=gx,ki={},Ao=ki.B;ki[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:"≥","{":"π","|":"≠","}":"£","~":"·"};ki.A={"#":"£"};ki.B=void 0;ki[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ki.C=ki[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ki.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ki.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ki.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ki.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ki.E=ki[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ki.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ki.H=ki[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ki["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var u1=4294967295,h1=class{constructor(t,e,i){this._hasScrollback=t,this._optionsService=e,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_i.clone(),this.savedCharset=Ao,this.markers=[],this._nullCell=Er.fromCharData([0,NC,1,0]),this._whitespaceCell=Er.fromCharData([0,Va,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new df,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c1(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new lf),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new lf),this._whitespaceCell}getBlankLine(t,e){return new bu(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>u1?u1:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=_i);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c1(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(_i),n=0,a=this._getCorrectBufferLength(e);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<t)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(t,i);let l=0;if(this._rows<e)for(let u=this._rows;u<e;u++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new bu(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new bu(t,i)));else for(let u=this._rows;u>e;u--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let l=0;l<this.lines.length;l++)n+=+this.lines.get(l).resize(t,i);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=AL(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(_i),i);if(n.length>0){let a=LL(this.lines,n);DL(this.lines,a.layout),this._reflowLargerAdjustViewport(t,e,a.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let n=this.getNullCell(_i),a=i;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new bu(t,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(_i),a=[],l=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=t)continue;let f=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),f.unshift(h);if(!i){let L=this.ybase+this.y;if(L>=u&&L<u+f.length)continue}let d=f[f.length-1].getTrimmedLength(),p=OL(f,this._cols,t),v=p.length-f.length,g;this.ybase===0&&this.y!==this.lines.length-1?g=Math.max(0,this.y-this.lines.maxLength+v):g=Math.max(0,this.lines.length-this.lines.maxLength+v);let y=[];for(let L=0;L<v;L++){let E=this.getBlankLine(_i,!0);y.push(E)}y.length>0&&(a.push({start:u+f.length+l,newLines:y}),l+=y.length),f.push(...y);let b=p.length-1,C=p[b];C===0&&(b--,C=p[b]);let x=f.length-v-1,k=d;for(;x>=0;){let L=Math.min(k,C);if(f[b]===void 0)break;if(f[b].copyCellsFrom(f[x],k-L,C-L,L,!0),C-=L,C===0&&(b--,C=p[b]),k-=L,k===0){x--;let E=Math.max(x,0);k=Iu(f,E,this._cols)}}for(let L=0;L<f.length;L++)p[L]<t&&f[L].setCell(p[L],n);let R=v-g;for(;R-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+l)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+v,this.ybase+e-1)}if(a.length>0){let u=[],h=[];for(let C=0;C<this.lines.length;C++)h.push(this.lines.get(C));let f=this.lines.length,d=f-1,p=0,v=a[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let g=0;for(let C=Math.min(this.lines.maxLength-1,f+l-1);C>=0;C--)if(v&&v.start>d+g){for(let x=v.newLines.length-1;x>=0;x--)this.lines.set(C--,v.newLines[x]);C++,u.push({index:d+1,amount:v.newLines.length}),g+=v.newLines.length,v=a[++p]}else this.lines.set(C,h[d--]);let y=0;for(let C=u.length-1;C>=0;C--)u[C].index+=y,this.lines.onInsertEmitter.fire(u[C]),y+=u[C].amount;let b=Math.max(0,f+l-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(t,e,i=0,n){let a=this.lines.get(t);return a?a.translateToString(e,i,n):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:e,last:i}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new BL(t);return this.markers.push(e),e.register(this.lines.onTrim(i=>{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.line<i.index+i.amount&&e.dispose(),e.line>i.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},NL=class extends rt{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new ye),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 h1(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h1(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},yx=2,Sx=1,Mg=class extends rt{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ye),this.onResize=this._onResize.event,this._onScroll=this._register(new ye),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,yx),this.rows=Math.max(e.rawOptions.rows||0,Sx),this.buffers=this._register(new NL(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let n=this.cols!==e,a=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:n,rowsChanged:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let n=this.buffer,a;a=this._cachedBlankLine,(!a||a.length!==this.cols||a.getFg(0)!==e.fg||a.getBg(0)!==e.bg)&&(a=n.getBlankLine(e,i),this._cachedBlankLine=a),a.isWrapped=i;let l=n.ybase+n.scrollTop,u=n.ybase+n.scrollBottom;if(n.scrollTop===0){let h=n.lines.isFull;u===n.lines.length-1?h?n.lines.recycle().copyFrom(a):n.lines.push(a.clone()):n.lines.splice(u+1,0,a.clone()),h?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let h=u-l+1;n.lines.shiftElements(l+1,h-1,-1),n.lines.set(u,a.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,i){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let a=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),a!==n.ydisp&&(i||this._onScroll.fire(n.ydisp))}};Mg=si([Ce(0,fs)],Mg);var Pl={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:hf,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},PL=["normal","bold","100","200","300","400","500","600","700","800","900"],zL=class extends rt{constructor(e){super(),this._onOptionChange=this._register(new ye),this.onOptionChange=this._onOptionChange.event;let i={...Pl};for(let n in e)if(n in i)try{let a=e[n];i[n]=this._sanitizeAndValidateOption(n,a)}catch(a){console.error(a)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(Wt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Pl))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,a)=>{if(!(n in Pl))throw new Error(`No option with key "${n}"`);a=this._sanitizeAndValidateOption(n,a),this.rawOptions[n]!==a&&(this.rawOptions[n]=a,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let a={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,a)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Pl[e]),!IL(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Pl[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=PL.includes(i)?i:Pl[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function IL(t){return t==="block"||t==="underline"||t==="bar"}function wu(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let n in t)i[n]=e<=1?t[n]:t[n]&&wu(t[n],e-1);return i}var d1=Object.freeze({insertMode:!1}),f1=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Ag=class extends rt{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ye),this.onData=this._onData.event,this._onUserInput=this._register(new ye),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ye),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ye),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=wu(d1),this.decPrivateModes=wu(f1)}reset(){this.modes=wu(d1),this.decPrivateModes=wu(f1)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(a=>a.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};Ag=si([Ce(0,ds),Ce(1,UC),Ce(2,fs)],Ag);var m1={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function gp(t,e){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(i|=64,i|=t.action):(i|=t.button&3,t.button&4&&(i|=64),t.button&8&&(i|=128),t.action===32?i|=32:t.action===0&&!e&&(i|=3)),i}var vp=String.fromCharCode,_1={DEFAULT:t=>{let e=[gp(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${vp(e[0])}${vp(e[1])}${vp(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${gp(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${gp(t,!0)};${t.x};${t.y}${e}`}},Lg=class extends rt{constructor(t,e,i){super(),this._bufferService=t,this._coreService=e,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ye),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(m1))this.addProtocol(n,m1[n]);for(let n of Object.keys(_1))this.addEncoding(n,_1[n]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,i){if(t.deltaY===0||t.shiftKey||e===void 0||i===void 0)return 0;let n=e/i,a=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=n+0,Math.abs(t.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,i){if(i){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};Lg=si([Ce(0,ds),Ce(1,qo),Ce(2,fs)],Lg);var yp=[[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]],HL=[[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]],xi;function UL(t,e){let i=0,n=e.length-1,a;if(t<e[0][0]||t>e[n][1])return!1;for(;n>=i;)if(a=i+n>>1,t>e[a][1])i=a+1;else if(t<e[a][0])n=a-1;else return!0;return!1}var FL=class{constructor(){if(this.version="6",!xi){xi=new Uint8Array(65536),xi.fill(1),xi[0]=0,xi.fill(0,1,32),xi.fill(0,127,160),xi.fill(2,4352,4448),xi[9001]=2,xi[9002]=2,xi.fill(2,11904,42192),xi[12351]=1,xi.fill(2,44032,55204),xi.fill(2,63744,64256),xi.fill(2,65040,65050),xi.fill(2,65072,65136),xi.fill(2,65280,65377),xi.fill(2,65504,65511);for(let e=0;e<yp.length;++e)xi.fill(0,yp[e][0],yp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?xi[e]:UL(e,HL)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),a=n===0&&i!==0;if(a){let l=Do.extractWidth(i);l===0?a=!1:l>n&&(n=l)}return Do.createPropertyValue(0,n,a)}},Do=class Ud{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ye,this.onChange=this._onChange.event;let e=new FL;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,n=!1){return(e&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,n=0,a=e.length;for(let l=0;l<a;++l){let u=e.charCodeAt(l);if(55296<=u&&u<=56319){if(++l>=a)return i+this.wcwidth(u);let d=e.charCodeAt(l);56320<=d&&d<=57343?u=(u-55296)*1024+d-56320+65536:i+=this.wcwidth(d)}let h=this.charProperties(u,n),f=Ud.extractWidth(h);Ud.extractShouldJoin(h)&&(f-=Ud.extractWidth(n)),i+=f,n=h}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},$L=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function p1(t){let e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1)?.get(t.cols-1),i=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var cu=2147483647,WL=256,bx=class Dg{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>WL)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let i=new Dg;if(!e.length)return i;for(let n=Array.isArray(e[0])?1:0;n<e.length;++n){let a=e[n];if(Array.isArray(a))for(let l=0;l<a.length;++l)i.addSubParam(a[l]);else i.addParam(a)}return i}clone(){let e=new Dg(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let n=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,a))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>cu?cu:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>cu?cu:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-n>0&&(e[i]=this._subParams.slice(n,a))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,a=n[i-1];n[i-1]=~a?Math.min(a*10+e,cu):e}},uu=[],jL=class{constructor(){this._state=0,this._active=uu,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let a=n.indexOf(i);a!==-1&&n.splice(a,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=uu}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=uu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||uu,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",kf(e,i,n));else for(let a=this._active.length-1;a>=0;a--)this._active[a].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let a=e[i++];if(a===59){this._state=2,this._start();break}if(a<48||57<a){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+a-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,a=this._active.length-1,l=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=i,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;a>=0&&(n=this._active[a].end(e),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}this._active=uu,this._id=-1,this._state=0}}},Ws=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=kf(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},hu=[],VL=class{constructor(){this._handlers=Object.create(null),this._active=hu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=hu}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let a=n.indexOf(i);a!==-1&&n.splice(a,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=hu,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||hu,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",kf(e,i,n));else for(let a=this._active.length-1;a>=0;a--)this._active[a].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,a=this._active.length-1,l=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=i,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;a>=0&&(n=this._active[a].unhook(e),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}this._active=hu,this._ident=0}},Cu=new bx;Cu.addParam(0);var g1=class{constructor(t){this._handler=t,this._data="",this._params=Cu,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():Cu,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=kf(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=Cu,this._data="",this._hitLimit=!1,i));return this._params=Cu,this._data="",this._hitLimit=!1,e}},qL=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,a){this.table[i<<8|e]=n<<4|a}addMany(e,i,n,a){for(let l=0;l<e.length;l++)this.table[i<<8|e[l]]=n<<4|a}},Cr=160,YL=(function(){let t=new qL(4095),e=Array.apply(null,Array(256)).map((h,f)=>f),i=(h,f)=>e.slice(h,f),n=i(32,127),a=i(0,24);a.push(25),a.push.apply(a,i(28,32));let l=i(0,14),u;t.setDefault(1,0),t.addMany(n,0,2,0);for(u in l)t.addMany([24,26,153,154],u,3,0),t.addMany(i(128,144),u,3,0),t.addMany(i(144,152),u,3,0),t.add(156,u,0,0),t.add(27,u,11,1),t.add(157,u,4,8),t.addMany([152,158,159],u,0,7),t.add(155,u,11,3),t.add(144,u,11,9);return t.addMany(a,0,3,0),t.addMany(a,1,3,1),t.add(127,1,0,1),t.addMany(a,8,0,8),t.addMany(a,3,3,3),t.add(127,3,0,3),t.addMany(a,4,3,4),t.add(127,4,0,4),t.addMany(a,6,3,6),t.addMany(a,5,3,5),t.add(127,5,0,5),t.addMany(a,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(n,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(n,7,0,7),t.addMany(a,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(a,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(a,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(a,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(a,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(a,13,13,13),t.addMany(n,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(Cr,0,2,0),t.add(Cr,8,5,8),t.add(Cr,6,0,6),t.add(Cr,11,0,11),t.add(Cr,13,13,13),t})(),KL=class extends rt{constructor(e=YL){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new bx,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,a)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Wt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new jL),this._dcsParser=this._register(new VL),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let l=0;l<e.intermediates.length;++l){let u=e.intermediates.charCodeAt(l);if(32>u||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=u}}if(e.final.length!==1)throw new Error("final must be a single byte");let a=e.final.charCodeAt(0);if(i[0]>a||a>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=a,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let a=this._escHandlers[n];return a.push(i),{dispose:()=>{let l=a.indexOf(i);l!==-1&&a.splice(l,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let a=this._csiHandlers[n];return a.push(i),{dispose:()=>{let l=a.indexOf(i);l!==-1&&a.splice(l,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,n,a,l){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=a,this._parseStack.chunkPos=l}parse(e,i,n){let a=0,l=0,u=0,h;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,u=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(h=f[d](this._params),h!==!0);d--)if(h instanceof Promise)return this._parseStack.handlerPos=d,h}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(h=f[d](),h!==!0);d--)if(h instanceof Promise)return this._parseStack.handlerPos=d,h}this._parseStack.handlers=[];break;case 6:if(a=e[this._parseStack.chunkPos],h=this._dcsParser.unhook(a!==24&&a!==26,n),h)return h;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=e[this._parseStack.chunkPos],h=this._oscParser.end(a!==24&&a!==26,n),h)return h;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,u=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=u;f<i;++f){switch(a=e[f],l=this._transitions.table[this.currentState<<8|(a<160?a:Cr)],l>>4){case 2:for(let y=f+1;;++y){if(y>=i||(a=e[y])<32||a>126&&a<Cr){this._printHandler(e,f,y),f=y-1;break}if(++y>=i||(a=e[y])<32||a>126&&a<Cr){this._printHandler(e,f,y),f=y-1;break}if(++y>=i||(a=e[y])<32||a>126&&a<Cr){this._printHandler(e,f,y),f=y-1;break}if(++y>=i||(a=e[y])<32||a>126&&a<Cr){this._printHandler(e,f,y),f=y-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|a],p=d?d.length-1:-1;for(;p>=0&&(h=d[p](this._params),h!==!0);p--)if(h instanceof Promise)return this._preserveStack(3,d,p,l,f),h;p<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingJoinState=0;break;case 8:do switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}while(++f<i&&(a=e[f])>47&&a<60);f--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:let v=this._escHandlers[this._collect<<8|a],g=v?v.length-1:-1;for(;g>=0&&(h=v[g](),h!==!0);g--)if(h instanceof Promise)return this._preserveStack(4,v,g,l,f),h;g<0&&this._escHandlerFb(this._collect<<8|a),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let y=f+1;;++y)if(y>=i||(a=e[y])===24||a===26||a===27||a>127&&a<Cr){this._dcsParser.put(e,f,y),f=y-1;break}break;case 14:if(h=this._dcsParser.unhook(a!==24&&a!==26),h)return this._preserveStack(6,[],0,l,f),h;a===27&&(l|=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 y=f+1;;y++)if(y>=i||(a=e[y])<32||a>127&&a<Cr){this._oscParser.put(e,f,y),f=y-1;break}break;case 6:if(h=this._oscParser.end(a!==24&&a!==26),h)return this._preserveStack(5,[],0,l,f),h;a===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=l&15}}},GL=/^([\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})$/,XL=/^[\da-f]+$/;function v1(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let i=GL.exec(e);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(e.indexOf("#")===0&&(e=e.slice(1),XL.exec(e)&&[3,6,9,12].includes(e.length))){let i=e.length/3,n=[0,0,0];for(let a=0;a<3;++a){let l=parseInt(e.slice(i*a,i*a+i),16);n[a]=i===1?l<<4:i===2?l:i===3?l>>4:l>>8}return n}}function Sp(t,e){let i=t.toString(16),n=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function ZL(t,e=16){let[i,n,a]=t;return`rgb:${Sp(i,e)}/${Sp(n,e)}/${Sp(a,e)}`}var QL={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Na=131072,y1=10;function S1(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var b1=5e3,w1=0,JL=class extends rt{constructor(t,e,i,n,a,l,u,h,f=new KL){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=n,this._optionsService=a,this._oscLinkService=l,this._coreMouseService=u,this._unicodeService=h,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new vM,this._utf8Decoder=new yM,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_i.clone(),this._eraseAttrDataInternal=_i.clone(),this._onRequestBell=this._register(new ye),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ye),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ye),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ye),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ye),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ye),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ye),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ye),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ye),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ye),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ye),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ye),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ye),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 Og(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:p.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,p,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:p,data:v})}),this._parser.setDcsHandlerFallback((d,p,v)=>{p==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:p,payload:v})}),this._parser.setPrintHandler((d,p,v)=>this.print(d,p,v)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Id.IND,()=>this.index()),this._parser.setExecuteHandler(Id.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Id.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ws(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Ws(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Ws(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Ws(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Ws(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Ws(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Ws(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Ws(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Ws(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Ws(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Ws(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Ws(d=>this.restoreCursorColor(d))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let d in ki)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g1((d,p)=>this.requestStatusString(d,p)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),b1))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${b1} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,n=this._activeBuffer.x,a=this._activeBuffer.y,l=0,u=this._parseStack.paused;if(u){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>Na&&(l=this._parseStack.position+Na)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(d=>d.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<Na&&(this._parseBuffer=new Uint32Array(Math.min(t.length,Na))),u||this._dirtyRowTracker.clearRange(),t.length>Na)for(let d=l;d<t.length;d+=Na){let p=d+Na<t.length?d+Na:t.length,v=typeof t=="string"?this._stringDecoder.decode(t.substring(d,p),this._parseBuffer):this._utf8Decoder.decode(t.subarray(d,p),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,v))return this._preserveStack(n,a,v,d),this._logSlowResolvingAsync(i),i}else if(!u){let d=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,a,d,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),f=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);f<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(f,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(t,e,i){let n,a,l=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,f=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-e>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let g=this._parser.precedingJoinState;for(let y=e;y<i;++y){if(n=t[y],n<127&&l){let k=l[String.fromCharCode(n)];k&&(n=k.charCodeAt(0))}let b=this._unicodeService.charProperties(n,g);a=Do.extractWidth(b);let C=Do.extractShouldJoin(b),x=C?Do.extractWidth(g):0;if(g=b,u&&this._onA11yChar.fire($a(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-x>h){if(f){let k=v,R=this._activeBuffer.x-x;for(this._activeBuffer.x=x,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),x>0&&v instanceof bu&&v.copyCellsFrom(k,R,0,x,!1);R<h;)k.setCellFromCodepoint(R++,0,1,p)}else if(this._activeBuffer.x=h-1,a===2)continue}if(C&&this._activeBuffer.x){let k=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-k,n,a);for(let R=a-x;--R>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(d&&(v.insertCells(this._activeBuffer.x,a-x,this._activeBuffer.getNullCell(p)),v.getWidth(h-1)===2&&v.setCellFromCodepoint(h-1,0,1,p)),v.setCellFromCodepoint(this._activeBuffer.x++,n,a,p),a>0)for(;--a;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=g,this._activeBuffer.x<h&&i-e>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,i=>S1(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new g1(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Ws(e))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,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(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,i,n=!1,a=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);l.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),a),n&&(l.isWrapped=!1)}_resetBufferLine(t,e=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,e=!1){this._restrictCursor(this._bufferService.cols);let i;switch(t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);i<this._bufferService.rows;i++)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,e),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;e--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;e--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let e=t.params[0]||1;for(;e--;)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(t){let e=t.params[0]||1;for(;e--;)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(_i));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let e=this._parser.precedingJoinState;if(!e)return!0;let i=t.params[0]||1,n=Do.extractWidth(e),a=this._activeBuffer.x-n,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(l.length*i),h=0;for(let d=0;d<l.length;){let p=l.codePointAt(d)||0;u[h++]=p,d+=p>65535?2:1}let f=h;for(let d=1;d<i;++d)u.copyWithin(f,0,h),f+=h;return this.print(u,0,f),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Ao),this._charsetService.setgCharset(1,Ao),this._charsetService.setgCharset(2,Ao),this._charsetService.setgCharset(3,Ao);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),t.params[e]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(t,e){let i;(C=>(C[C.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",C[C.SET=1]="SET",C[C.RESET=2]="RESET",C[C.PERMANENTLY_SET=3]="PERMANENTLY_SET",C[C.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let n=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:l}=this._coreMouseService,u=this._coreService,{buffers:h,cols:f}=this._bufferService,{active:d,alt:p}=h,v=this._optionsService.rawOptions,g=(C,x)=>(u.triggerDataEvent(`${ce.ESC}[${e?"":"?"}${C};${x}$y`),!0),y=C=>C?1:2,b=t.params[0];return e?b===2?g(b,4):b===4?g(b,y(u.modes.insertMode)):b===12?g(b,3):b===20?g(b,y(v.convertEol)):g(b,0):b===1?g(b,y(n.applicationCursorKeys)):b===3?g(b,v.windowOptions.setWinLines?f===80?2:f===132?1:0:0):b===6?g(b,y(n.origin)):b===7?g(b,y(n.wraparound)):b===8?g(b,3):b===9?g(b,y(a==="X10")):b===12?g(b,y(v.cursorBlink)):b===25?g(b,y(!u.isCursorHidden)):b===45?g(b,y(n.reverseWraparound)):b===66?g(b,y(n.applicationKeypad)):b===67?g(b,4):b===1e3?g(b,y(a==="VT200")):b===1002?g(b,y(a==="DRAG")):b===1003?g(b,y(a==="ANY")):b===1004?g(b,y(n.sendFocus)):b===1005?g(b,4):b===1006?g(b,y(l==="SGR")):b===1015?g(b,4):b===1016?g(b,y(l==="SGR_PIXELS")):b===1048?g(b,1):b===47||b===1047||b===1049?g(b,y(d===p)):b===2004?g(b,y(n.bracketedPasteMode)):b===2026?g(b,y(n.synchronizedOutput)):g(b,0)}_updateAttrColor(t,e,i,n,a){return e===2?(t|=50331648,t&=-16777216,t|=Vu.fromColorRGB([i,n,a])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let n=[0,0,-1,0,0,0],a=0,l=0;do{if(n[l+a]=t.params[e+l],t.hasSubParams(e+l)){let u=t.getSubParams(e+l),h=0;do n[1]===5&&(a=1),n[l+h+1+a]=u[h];while(++h<u.length&&h+l+1+a<n.length);break}if(n[1]===5&&l+a>=2||n[1]===2&&l+a>=5)break;n[1]&&(a=1)}while(++l+e<t.length&&l+a<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return l}_processUnderline(t,e){e.extended=e.extended.clone(),(!~t||t>5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=_i.fg,t.bg=_i.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,i,n=this._curAttrData;for(let a=0;a<e;a++)i=t.params[a],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(t.hasSubParams(a)?t.getSubParams(a)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=_i.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=_i.bg&16777215):i===38||i===48||i===58?a+=this._extractColor(t,a,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=_i.fg&16777215,n.bg&=-67108864,n.bg|=_i.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${e};${i}R`);break}return!0}deviceStatusPrivate(t){if(t.params[0]===6){let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${e};${i}R`)}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_i.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(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=e%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(t){let e=t.params[0]||1,i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!S1(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>y1&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>y1&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){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(t){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(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],i=t.split(";");for(;i.length>1;){let n=i.shift(),a=i.shift();if(/^\d+$/.exec(n)){let l=parseInt(n);if(C1(l))if(a==="?")e.push({type:0,index:l});else{let u=v1(a);u&&e.push({type:1,index:l,color:u})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let i=t.slice(0,e).trim(),n=t.slice(e+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),n,a=i.findIndex(l=>l.startsWith("id="));return a!==-1&&(n=i[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let i=t.split(";");for(let n=0;n<i.length&&!(e>=this._specialColors.length);++n,++e)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let a=v1(i[n]);a&&this._onColor.fire([{type:1,index:this._specialColors[e],color:a}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],i=t.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let a=parseInt(i[n]);C1(a)&&e.push({type:2,index:a})}return e.length&&this._onColor.fire(e),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){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,Ao),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(QL[t[0]],ki[t[1]]||Ao),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,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=_i.clone(),this._eraseAttrDataInternal=_i.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new Er;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){let i=this._activeBuffer.ybase+this._activeBuffer.y+e,n=this._activeBuffer.lines.get(i);n&&(n.fill(t),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let i=u=>(this._coreService.triggerDataEvent(`${ce.ESC}${u}${ce.ESC}\\`),!0),n=this._bufferService.buffer,a=this._optionsService.rawOptions;return i(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},Og=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(w1=t,t=e,e=w1),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Og=si([Ce(0,ds)],Og);function C1(t){return 0<=t&&t<256}var e3=5e7,x1=12,t3=50,i3=class extends rt{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ye),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>e3)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let a=this._writeBuffer[this._bufferOffset],l=this._action(a,i);if(l){let h=f=>performance.now()-n>=x1?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(n,f);l.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(h);return}let u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=a.length,performance.now()-n>=x1)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>t3&&(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()}},Bg=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let f=i.addMarker(i.ybase+i.y),d={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(d,f)),this._dataByLinkId.set(d.id,d),d.id}let n=e,a=this._getEntryIdKey(n),l=this._entriesWithId.get(a);if(l)return this.addLineToLink(l.id,i.ybase+i.y),l.id;let u=i.addMarker(i.ybase+i.y),h={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(a=>a.line!==i)){let a=this._bufferService.buffer.addMarker(i);n.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(n,a))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Bg=si([Ce(0,ds)],Bg);var k1=!1,s3=class extends rt{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ql),this._onBinary=this._register(new ye),this.onBinary=this._onBinary.event,this._onData=this._register(new ye),this.onData=this._onData.event,this._onLineFeed=this._register(new ye),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ye),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ye),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ye),this._instantiationService=new TL,this.optionsService=this._register(new zL(e)),this._instantiationService.setService(fs,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Mg)),this._instantiationService.setService(ds,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Rg)),this._instantiationService.setService(UC,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Ag)),this._instantiationService.setService(qo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Lg)),this._instantiationService.setService(HC,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Do)),this._instantiationService.setService(CM,this.unicodeService),this._charsetService=this._instantiationService.createInstance($L),this._instantiationService.setService(wM,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Bg),this._instantiationService.setService(FC,this._oscLinkService),this._inputHandler=this._register(new JL(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Zi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Zi.forward(this._bufferService.onResize,this._onResize)),this._register(Zi.forward(this.coreService.onData,this._onData)),this._register(Zi.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new i3((i,n)=>this._inputHandler.parse(i,n))),this._register(Zi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ye),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!k1&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k1=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,yx),i=Math.max(i,Sx),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(p1.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(p1(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Wt(()=>{for(let i of e)i.dispose()})}}},r3={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function n3(t,e,i,n){let a={type:0,cancel:!1,key:void 0},l=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B");break;case 8:a.key=t.ctrlKey?"\b":ce.DEL,t.altKey&&(a.key=ce.ESC+a.key);break;case 9:if(t.shiftKey){a.key=ce.ESC+"[Z";break}a.key=ce.HT,a.cancel=!0;break;case 13:a.key=t.altKey?ce.ESC+ce.CR:ce.CR,a.cancel=!0;break;case 27:a.key=ce.ESC,t.altKey&&(a.key=ce.ESC+ce.ESC),a.cancel=!0;break;case 37:if(t.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"D":e?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D";break;case 39:if(t.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"C":e?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C";break;case 38:if(t.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"A":e?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A";break;case 40:if(t.metaKey)break;l?a.key=ce.ESC+"[1;"+(l+1)+"B":e?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(a.key=ce.ESC+"[2~");break;case 46:l?a.key=ce.ESC+"[3;"+(l+1)+"~":a.key=ce.ESC+"[3~";break;case 36:l?a.key=ce.ESC+"[1;"+(l+1)+"H":e?a.key=ce.ESC+"OH":a.key=ce.ESC+"[H";break;case 35:l?a.key=ce.ESC+"[1;"+(l+1)+"F":e?a.key=ce.ESC+"OF":a.key=ce.ESC+"[F";break;case 33:t.shiftKey?a.type=2:t.ctrlKey?a.key=ce.ESC+"[5;"+(l+1)+"~":a.key=ce.ESC+"[5~";break;case 34:t.shiftKey?a.type=3:t.ctrlKey?a.key=ce.ESC+"[6;"+(l+1)+"~":a.key=ce.ESC+"[6~";break;case 112:l?a.key=ce.ESC+"[1;"+(l+1)+"P":a.key=ce.ESC+"OP";break;case 113:l?a.key=ce.ESC+"[1;"+(l+1)+"Q":a.key=ce.ESC+"OQ";break;case 114:l?a.key=ce.ESC+"[1;"+(l+1)+"R":a.key=ce.ESC+"OR";break;case 115:l?a.key=ce.ESC+"[1;"+(l+1)+"S":a.key=ce.ESC+"OS";break;case 116:l?a.key=ce.ESC+"[15;"+(l+1)+"~":a.key=ce.ESC+"[15~";break;case 117:l?a.key=ce.ESC+"[17;"+(l+1)+"~":a.key=ce.ESC+"[17~";break;case 118:l?a.key=ce.ESC+"[18;"+(l+1)+"~":a.key=ce.ESC+"[18~";break;case 119:l?a.key=ce.ESC+"[19;"+(l+1)+"~":a.key=ce.ESC+"[19~";break;case 120:l?a.key=ce.ESC+"[20;"+(l+1)+"~":a.key=ce.ESC+"[20~";break;case 121:l?a.key=ce.ESC+"[21;"+(l+1)+"~":a.key=ce.ESC+"[21~";break;case 122:l?a.key=ce.ESC+"[23;"+(l+1)+"~":a.key=ce.ESC+"[23~";break;case 123:l?a.key=ce.ESC+"[24;"+(l+1)+"~":a.key=ce.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?a.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?a.key=ce.NUL:t.keyCode>=51&&t.keyCode<=55?a.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?a.key=ce.DEL:t.keyCode===219?a.key=ce.ESC:t.keyCode===220?a.key=ce.FS:t.keyCode===221&&(a.key=ce.GS);else if((!i||n)&&t.altKey&&!t.metaKey){let u=r3[t.keyCode]?.[t.shiftKey?1:0];if(u)a.key=ce.ESC+u;else if(t.keyCode>=65&&t.keyCode<=90){let h=t.ctrlKey?t.keyCode-64:t.keyCode+32,f=String.fromCharCode(h);t.shiftKey&&(f=f.toUpperCase()),a.key=ce.ESC+f}else if(t.keyCode===32)a.key=ce.ESC+(t.ctrlKey?ce.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let h=t.code.slice(3,4);t.shiftKey||(h=h.toLowerCase()),a.key=ce.ESC+h,a.cancel=!0}}else i&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(a.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?a.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(a.key=ce.US),t.key==="@"&&(a.key=ce.NUL));break}return a}var li=0,a3=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new df,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new df,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((l,u)=>this._getKey(l)-this._getKey(u)),i=0,n=0,a=new Array(this._array.length+this._insertedValues.length);for(let l=0;l<a.length;l++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(a[l]=e[i],i++):a[l]=this._array[n++];this._array=a,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(li=this._search(i),li===-1)||this._getKey(this._array[li])!==i)return!1;do if(this._array[li]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(li),!0;while(++li<this._array.length&&this._getKey(this._array[li])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((l,u)=>l-u),i=0,n=new Array(this._array.length-e.length),a=0;for(let l=0;l<this._array.length;l++)e[i]===l?i++:n[a++]=this._array[l];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(li=this._search(e),!(li<0||li>=this._array.length)&&this._getKey(this._array[li])===e))do yield this._array[li];while(++li<this._array.length&&this._getKey(this._array[li])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(li=this._search(e),!(li<0||li>=this._array.length)&&this._getKey(this._array[li])===e))do i(this._array[li]);while(++li<this._array.length&&this._getKey(this._array[li])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let a=i+n>>1,l=this._getKey(this._array[a]);if(l>e)n=a-1;else if(l<e)i=a+1;else{for(;a>0&&this._getKey(this._array[a-1])===e;)a--;return a}}return i}},bp=0,E1=0,o3=class extends rt{constructor(){super(),this._decorations=new a3(t=>t?.marker.line),this._onDecorationRegistered=this._register(new ye),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ye),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Wt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new l3(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),n=e.onDispose(()=>{n.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,i){let n=0,a=0;for(let l of this._decorations.getKeyIterator(e))n=l.options.x??0,a=n+(l.options.width??1),t>=n&&t<a&&(!i||(l.options.layer??"bottom")===i)&&(yield l)}forEachDecorationAtCell(t,e,i,n){this._decorations.forEachByKey(e,a=>{bp=a.options.x??0,E1=bp+(a.options.width??1),t>=bp&&t<E1&&(!i||(a.options.layer??"bottom")===i)&&n(a)})}},l3=class extends Xa{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new ye),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ye),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Yt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Yt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},c3=1e3,u3=class{constructor(e,i=c3){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let a=performance.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){let l=a-this._lastRefreshMs,u=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},u)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},T1=20,ff=class extends rt{constructor(t,e,i,n){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new u3(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(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
22
+ `))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ve(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Wt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<T1+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
23
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===T1+1&&(this._liveRegion.textContent+=eg.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,n=i.lines.length.toString();for(let a=t;a<=e;a++){let l=i.lines.get(i.ydisp+a),u=[],h=l?.translateToString(!0,void 0,void 0,u)||"",f=(i.ydisp+a+1).toString(),d=this._rowElements[a];d&&(h.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=h,this._rowColumns.set(d,u)),d.setAttribute("aria-posinset",f),d.setAttribute("aria-setsize",n),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,n=this._rowElements[e===0?1:this._rowElements.length-2],a=i.getAttribute("aria-posinset"),l=e===0?"1":`${this._terminal.buffer.lines.length}`;if(a===l||t.relatedTarget!==n)return;let u,h;if(e===0?(u=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=i,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{let f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let a=({node:h,offset:f})=>{let d=h instanceof Text?h.parentNode:h,p=parseInt(d?.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(d);if(!v)return console.warn("columns is null. Race condition?"),null;let g=f<v.length?v[f]:v.slice(-1)[0]+1;return g>=this._terminal.cols&&(++p,g=0),{row:p,column:g}},l=a(e),u=a(i);if(!(!l||!u)){if(l.row>u.row||l.row===u.row&&l.column>=u.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(u.row-l.row)*this._terminal.cols-l.column+u.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){t.style.transform="";let e=t.getBoundingClientRect().width,i=this._rowColumns.get(t)?.slice(-1)?.[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${n/e})`}};ff=si([Ce(1,cv),Ce(2,Xn),Ce(3,Zn)],ff);var Ng=class extends rt{constructor(t,e,i,n,a){super(),this._element=t,this._mouseService=e,this._renderService=i,this._bufferService=n,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ye),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ye),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Wt(()=>{Wo(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ve(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ve(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ve(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ve(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=t.composedPath();for(let n=0;n<i.length;n++){let a=i[n];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||e.x!==this._lastBufferCell.x||e.y!==this._lastBufferCell.y)&&(this._handleHover(e),this._lastBufferCell=e)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,e){(!this._activeProviderReplies||!e)&&(this._activeProviderReplies?.forEach(n=>{n?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[n,a]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(n)&&(i=this._checkLinkProviderResult(n,t,i)):a.provideLinks(t.y,l=>{if(this._isMouseOut)return;let u=l?.map(h=>({link:h}));this._activeProviderReplies?.set(n,u),i=this._checkLinkProviderResult(n,t,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let i=new Set;for(let n=0;n<e.size;n++){let a=e.get(n);if(a)for(let l=0;l<a.length;l++){let u=a[l],h=u.link.range.start.y<t?0:u.link.range.start.x,f=u.link.range.end.y>t?this._bufferService.cols:u.link.range.end.x;for(let d=h;d<=f;d++){if(i.has(d)){a.splice(l--,1);break}i.add(d)}}}}_checkLinkProviderResult(t,e,i){if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(t),a=!1;for(let l=0;l<t;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(a=!0);if(!a&&n){let l=n.find(u=>this._linkAtPosition(u.link,e));l&&(i=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let l=0;l<this._activeProviderReplies.size;l++){let u=this._activeProviderReplies.get(l)?.find(h=>this._linkAtPosition(h.link,e));if(u){i=!0,this._handleNewLink(u);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&h3(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Wo(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(n,a),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(t,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(t,e){let i=t.range,n=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(t,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(t,e){let i=t.range.start.y*this._bufferService.cols+t.range.start.x,n=t.range.end.y*this._bufferService.cols+t.range.end.x,a=e.y*this._bufferService.cols+e.x;return i<=a&&a<=n}_positionFromMouseEvent(t,e,i){let n=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,n,a){return{x1:t,y1:e,x2:i,y2:n,cols:this._bufferService.cols,fg:a}}};Ng=si([Ce(1,uv),Ce(2,Zn),Ce(3,ds),Ce(4,WC)],Ng);function h3(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var d3=class extends s3{constructor(e={}){super(e),this._linkifier=this._register(new Ql),this.browser=lx,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ql),this._onCursorMove=this._register(new ye),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ye),this.onKey=this._onKey.event,this._onRender=this._register(new ye),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ye),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ye),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ye),this.onBell=this._onBell.event,this._onFocus=this._register(new ye),this._onBlur=this._register(new ye),this._onA11yCharEmitter=this._register(new ye),this._onA11yTabEmitter=this._register(new ye),this._onWillOpen=this._register(new ye),this._setup(),this._decorationService=this._instantiationService.createInstance(o3),this._instantiationService.setService(qu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(tL),this._instantiationService.setService(WC,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ig)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??0,i?.end??this.rows-1))),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(Zi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Zi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Zi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Zi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(Wt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,a="";switch(i.index){case 256:n="foreground",a="10";break;case 257:n="background",a="11";break;case 258:n="cursor",a="12";break;default:n="ansi",a="4;"+i.index}switch(i.type){case 0:let l=It.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ce.ESC}]${a};${ZL(l)}${ax.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(u=>u.ansi[i.index]=gi.toColor(...i.color));else{let u=n;this._themeService.modifyColors(h=>h[u]=gi.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ff,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),a=this._renderService.dimensions.css.cell.height,l=i.getWidth(n),u=this._renderService.dimensions.css.cell.width*l,h=this.buffer.y*this._renderService.dimensions.css.cell.height,f=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=h+"px",this.textarea.style.width=u+"px",this.textarea.style.height=a+"px",this.textarea.style.lineHeight=a+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ve(this.element,"copy",i=>{this.hasSelection()&&pM(i,this._selectionService)}));let e=i=>gM(i,this.textarea,this.coreService,this.optionsService);this._register(Ve(this.textarea,"paste",e)),this._register(Ve(this.element,"paste",e)),cx?this._register(Ve(this.element,"mousedown",i=>{i.button===2&&zb(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ve(this.element,"contextmenu",i=>{zb(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),vv&&this._register(Ve(this.element,"auxclick",i=>{i.button===1&&BC(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ve(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ve(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ve(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ve(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ve(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ve(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ve(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ve(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Jp.get()),dx||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(JA,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Xn,this._coreBrowserService),this._register(Ve(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(Ve(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Cg,this._document,this._helperContainer),this._instantiationService.setService(Ef,this._charSizeService),this._themeService=this._instantiationService.createInstance(Tg),this._instantiationService.setService(tc,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(uf),this._instantiationService.setService($C,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(kg,this.rows,this.screenElement)),this._instantiationService.setService(Zn,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Sg,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(xg),this._instantiationService.setService(uv,this._mouseService);let a=this._linkifier.value=this._register(this._instantiationService.createInstance(Ng,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(vg,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Eg,this.element,this.screenElement,a)),this._instantiationService.setService(kM,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(Zi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(yg,this.screenElement)),this._register(Ve(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),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(ff,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(cf,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(cf,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(wg,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(u){let h=e._mouseService.getMouseReportCoords(u,e.screenElement);if(!h)return!1;let f,d;switch(u.overrideType||u.type){case"mousemove":d=32,u.buttons===void 0?(f=3,u.button!==void 0&&(f=u.button<3?u.button:3)):f=u.buttons&1?0:u.buttons&4?1:u.buttons&2?2:3;break;case"mouseup":d=0,f=u.button<3?u.button:3;break;case"mousedown":d=1,f=u.button<3?u.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(u)===!1)return!1;let p=u.deltaY;if(p===0||e.coreMouseService.consumeWheelEvent(u,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;d=p<0?0:1,f=4;break;default:return!1}return d===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:h.col,row:h.row,x:h.x,y:h.y,button:f,action:d,ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey})}let a={mouseup:null,wheel:null,mousedrag:null,mousemove:null},l={mouseup:u=>(n(u),u.buttons||(this._document.removeEventListener("mouseup",a.mouseup),a.mousedrag&&this._document.removeEventListener("mousemove",a.mousedrag)),this.cancel(u)),wheel:u=>(n(u),this.cancel(u,!0)),mousedrag:u=>{u.buttons&&n(u)},mousemove:u=>{u.buttons||n(u)}};this._register(this.coreMouseService.onProtocolChange(u=>{u?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(u)),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()),u&8?a.mousemove||(i.addEventListener("mousemove",l.mousemove),a.mousemove=l.mousemove):(i.removeEventListener("mousemove",a.mousemove),a.mousemove=null),u&16?a.wheel||(i.addEventListener("wheel",l.wheel,{passive:!1}),a.wheel=l.wheel):(i.removeEventListener("wheel",a.wheel),a.wheel=null),u&2?a.mouseup||(a.mouseup=l.mouseup):(this._document.removeEventListener("mouseup",a.mouseup),a.mouseup=null),u&4?a.mousedrag||(a.mousedrag=l.mousedrag):(this._document.removeEventListener("mousemove",a.mousedrag),a.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ve(i,"mousedown",u=>{if(u.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(u)))return n(u),a.mouseup&&this._document.addEventListener("mouseup",a.mouseup),a.mousedrag&&this._document.addEventListener("mousemove",a.mousedrag),this.cancel(u)})),this._register(Ve(i,"wheel",u=>{if(!a.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(u)===!1)return!1;if(!this.buffer.hasScrollback){if(u.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(u,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(u,!0);let h=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(u.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(h,!0),this.cancel(u,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){OC(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=n3(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let a=this.rows-1;return this.scrollLines(n.type===2?-a:a),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ce.ETX||n.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(f3(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(_i));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${n};${i}t`);break;case 1:let a=this._renderService.dimensions.css.cell.width.toFixed(0),l=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${l};${a}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function f3(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var m3=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},_3=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new Er)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},R1=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,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(t){let e=this._buffer.lines.get(t);if(e)return new _3(e)}getNullCell(){return new Er}},p3=class extends rt{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new ye),this.onBufferChange=this._onBufferChange.event,this._normal=new R1(this._core.buffers.normal,"normal"),this._alternate=new R1(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)}},g3=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,n)=>e(i,n.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},v3=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},y3=["cols","rows"],tn=0,S3=class extends rt{constructor(t){super(),this._core=this._register(new d3(t)),this._addonManager=this._register(new m3),this._publicOptions={...this._core.options};let e=n=>this._core.options[n],i=(n,a)=>{this._checkReadonlyOptions(n),this._core.options[n]=a};for(let n in this._core.options){let a={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,a)}}_checkReadonlyOptions(t){if(y3.includes(t))throw new Error(`Option "${t}" 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 g3(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v3(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 p3(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
24
+ `,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return Jp.get()},set promptLabel(t){Jp.set(t)},get tooMuchOutput(){return eg.get()},set tooMuchOutput(t){eg.set(t)}}}_verifyIntegers(...t){for(tn of t)if(tn===1/0||isNaN(tn)||tn%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(tn of t)if(tn&&(tn===1/0||isNaN(tn)||tn%1!==0||tn<0))throw new Error("This API only accepts positive integers")}};var b3=2,w3=1,C3=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){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 e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),u={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},h=u.top+u.bottom,f=u.right+u.left,d=n-h,p=a-f-e;return{cols:Math.max(b3,Math.floor(p/t.css.cell.width)),rows:Math.max(w3,Math.floor(d/t.css.cell.height))}}};var x3=class{constructor(t,e,i,n={}){this._terminal=t,this._regex=e,this._handler=i,this._options=n}provideLinks(t,e){let i=E3.computeLink(t,this._regex,this._terminal,this._handler);e(this._addCallbacks(i))}_addCallbacks(t){return t.map(e=>(e.leave=this._options.leave,e.hover=(i,n)=>{if(this._options.hover){let{range:a}=e;this._options.hover(i,n,a)}},e))}};function k3(t){try{let e=new URL(t),i=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var E3=class Fd{static computeLink(e,i,n,a){let l=new RegExp(i.source,(i.flags||"")+"g"),[u,h]=Fd._getWindowedLineStrings(e-1,n),f=u.join(""),d,p=[];for(;d=l.exec(f);){let v=d[0];if(!k3(v))continue;let[g,y]=Fd._mapStrIdx(n,h,0,d.index),[b,C]=Fd._mapStrIdx(n,g,y,v.length);if(g===-1||y===-1||b===-1||C===-1)continue;let x={start:{x:y+1,y:g+1},end:{x:C,y:b+1}};p.push({range:x,text:v,activate:a})}return p}static _getWindowedLineStrings(e,i){let n,a=e,l=e,u=0,h="",f=[];if(n=i.buffer.active.getLine(e)){let d=n.translateToString(!0);if(n.isWrapped&&d[0]!==" "){for(u=0;(n=i.buffer.active.getLine(--a))&&u<2048&&(h=n.translateToString(!0),u+=h.length,f.push(h),!(!n.isWrapped||h.indexOf(" ")!==-1)););f.reverse()}for(f.push(d),u=0;(n=i.buffer.active.getLine(++l))&&n.isWrapped&&u<2048&&(h=n.translateToString(!0),u+=h.length,f.push(h),h.indexOf(" ")===-1););}return[f,a]}static _mapStrIdx(e,i,n,a){let l=e.buffer.active,u=l.getNullCell(),h=n;for(;a;){let f=l.getLine(i);if(!f)return[-1,-1];for(let d=h;d<f.length;++d){f.getCell(d,u);let p=u.getChars();if(u.getWidth()&&(a-=p.length||1,d===f.length-1&&p==="")){let v=l.getLine(i+1);v&&v.isWrapped&&(v.getCell(0,u),u.getWidth()===2&&(a+=1))}if(a<0)return[i,d]}i++,h=0}return[i,h]}},T3=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function R3(t,e){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var M3=class{constructor(e=R3,i={}){this._handler=e,this._options=i}activate(e){this._terminal=e;let i=this._options,n=i.urlRegex||T3;this._linkProvider=this._terminal.registerLinkProvider(new x3(this._terminal,n,this._handler,i))}dispose(){this._linkProvider?.dispose()}};var A3=(t,e,i,n)=>{for(var a=e,l=t.length-1,u;l>=0;l--)(u=t[l])&&(a=u(a)||a);return a},L3=(t,e)=>(i,n)=>e(i,n,t),D3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?M1.isErrorNoTelemetry(t)?new M1(t.message+`
25
+
26
+ `+t.stack):new Error(t.message+`
27
+
28
+ `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},O3=new D3;function wp(t){B3(t)||O3.onUnexpectedError(t)}var Pg="Canceled";function B3(t){return t instanceof N3?!0:t instanceof Error&&t.name===Pg&&t.message===Pg}var N3=class extends Error{constructor(){super(Pg),this.name=this.message}},M1=class zg extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof zg)return e;let i=new zg;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},P3;(t=>{function e(l){return l<0}t.isLessThan=e;function i(l){return l<=0}t.isLessThanOrEqual=i;function n(l){return l>0}t.isGreaterThan=n;function a(l){return l===0}t.isNeitherLessOrGreaterThan=a,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(P3||={});function z3(t,e){let i=this,n=!1,a;return function(){return n||(n=!0,e||(a=t.apply(i,arguments))),a}}var wx;(t=>{function e(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*a(E){yield E}t.single=a;function l(E){return e(E)?E:a(E)}t.wrap=l;function u(E){return E||i}t.from=u;function*h(E){for(let H=E.length-1;H>=0;H--)yield E[H]}t.reverse=h;function f(E){return!E||E[Symbol.iterator]().next().done===!0}t.isEmpty=f;function d(E){return E[Symbol.iterator]().next().value}t.first=d;function p(E,H){let U=0;for(let I of E)if(H(I,U++))return!0;return!1}t.some=p;function v(E,H){for(let U of E)if(H(U))return U}t.find=v;function*g(E,H){for(let U of E)H(U)&&(yield U)}t.filter=g;function*y(E,H){let U=0;for(let I of E)yield H(I,U++)}t.map=y;function*b(E,H){let U=0;for(let I of E)yield*H(I,U++)}t.flatMap=b;function*C(...E){for(let H of E)yield*H}t.concat=C;function x(E,H,U){let I=U;for(let N of E)I=H(I,N);return I}t.reduce=x;function*k(E,H,U=E.length){for(H<0&&(H+=E.length),U<0?U+=E.length:U>E.length&&(U=E.length);H<U;H++)yield E[H]}t.slice=k;function R(E,H=Number.POSITIVE_INFINITY){let U=[];if(H===0)return[U,E];let I=E[Symbol.iterator]();for(let N=0;N<H;N++){let F=I.next();if(F.done)return[U,t.empty()];U.push(F.value)}return[U,{[Symbol.iterator](){return I}}]}t.consume=R;async function L(E){let H=[];for await(let U of E)H.push(U);return Promise.resolve(H)}t.asyncToArray=L})(wx||={});function Cx(t){if(wx.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function xx(...t){return ss(()=>Cx(t))}function ss(t){return{dispose:z3(()=>{t()})}}var kx=class Ex{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Cx(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Ex.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};kx.DISABLE_DISPOSED_WARNING=!1;var Kl=kx,$r=class{constructor(){this._store=new Kl,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};$r.None=Object.freeze({dispose(){}});var du=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},yv=typeof process<"u"&&"title"in process,Mf=yv?"node":navigator.userAgent,I3=yv?"node":navigator.platform,H3=Mf.includes("Firefox"),U3=Mf.includes("Edge"),Tx=/^((?!chrome|android).)*safari/i.test(Mf);function F3(){if(!Tx)return 0;let t=Mf.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}I3.indexOf("Linux")>=0;var $3="",Pi=0,zi=0,Ii=0,ii=0,Sr={css:"#00000000",rgba:0},hs;(t=>{function e(a,l,u,h){return h!==void 0?`#${Ro(a)}${Ro(l)}${Ro(u)}${Ro(h)}`:`#${Ro(a)}${Ro(l)}${Ro(u)}`}t.toCss=e;function i(a,l,u,h=255){return(a<<24|l<<16|u<<8|h)>>>0}t.toRgba=i;function n(a,l,u,h){return{css:t.toCss(a,l,u,h),rgba:t.toRgba(a,l,u,h)}}t.toColor=n})(hs||={});var xu;(t=>{function e(f,d){if(ii=(d.rgba&255)/255,ii===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,v=d.rgba>>16&255,g=d.rgba>>8&255,y=f.rgba>>24&255,b=f.rgba>>16&255,C=f.rgba>>8&255;Pi=y+Math.round((p-y)*ii),zi=b+Math.round((v-b)*ii),Ii=C+Math.round((g-C)*ii);let x=hs.toCss(Pi,zi,Ii),k=hs.toRgba(Pi,zi,Ii);return{css:x,rgba:k}}t.blend=e;function i(f){return(f.rgba&255)===255}t.isOpaque=i;function n(f,d,p){let v=Io.ensureContrastRatio(f.rgba,d.rgba,p);if(v)return hs.toColor(v>>24&255,v>>16&255,v>>8&255)}t.ensureContrastRatio=n;function a(f){let d=(f.rgba|255)>>>0;return[Pi,zi,Ii]=Io.toChannels(d),{css:hs.toCss(Pi,zi,Ii),rgba:d}}t.opaque=a;function l(f,d){return ii=Math.round(d*255),[Pi,zi,Ii]=Io.toChannels(f.rgba),{css:hs.toCss(Pi,zi,Ii,ii),rgba:hs.toRgba(Pi,zi,Ii,ii)}}t.opacity=l;function u(f,d){return ii=f.rgba&255,l(f,ii*d/255)}t.multiplyOpacity=u;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}t.toColorRGB=h})(xu||={});var W3;(t=>{let e,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(e=l,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Pi=parseInt(a.slice(1,2).repeat(2),16),zi=parseInt(a.slice(2,3).repeat(2),16),Ii=parseInt(a.slice(3,4).repeat(2),16),hs.toColor(Pi,zi,Ii);case 5:return Pi=parseInt(a.slice(1,2).repeat(2),16),zi=parseInt(a.slice(2,3).repeat(2),16),Ii=parseInt(a.slice(3,4).repeat(2),16),ii=parseInt(a.slice(4,5).repeat(2),16),hs.toColor(Pi,zi,Ii,ii);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let l=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return Pi=parseInt(l[1]),zi=parseInt(l[2]),Ii=parseInt(l[3]),ii=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),hs.toColor(Pi,zi,Ii,ii);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=a,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Pi,zi,Ii,ii]=e.getImageData(0,0,1,1).data,ii!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:hs.toRgba(Pi,zi,Ii,ii),css:a}}t.toColor=n})(W3||={});var us;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,a,l){let u=n/255,h=a/255,f=l/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return d*.2126+p*.7152+v*.0722}t.relativeLuminance2=i})(us||={});var Io;(t=>{function e(u,h){if(ii=(h&255)/255,ii===1)return h;let f=h>>24&255,d=h>>16&255,p=h>>8&255,v=u>>24&255,g=u>>16&255,y=u>>8&255;return Pi=v+Math.round((f-v)*ii),zi=g+Math.round((d-g)*ii),Ii=y+Math.round((p-y)*ii),hs.toRgba(Pi,zi,Ii)}t.blend=e;function i(u,h,f){let d=us.relativeLuminance(u>>8),p=us.relativeLuminance(h>>8);if(Hn(d,p)<f){if(p<d){let y=n(u,h,f),b=Hn(d,us.relativeLuminance(y>>8));if(b<f){let C=a(u,h,f),x=Hn(d,us.relativeLuminance(C>>8));return b>x?y:C}return y}let v=a(u,h,f),g=Hn(d,us.relativeLuminance(v>>8));if(g<f){let y=n(u,h,f),b=Hn(d,us.relativeLuminance(y>>8));return g>b?v:y}return v}}t.ensureContrastRatio=i;function n(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,y=h>>16&255,b=h>>8&255,C=Hn(us.relativeLuminance2(g,y,b),us.relativeLuminance2(d,p,v));for(;C<f&&(g>0||y>0||b>0);)g-=Math.max(0,Math.ceil(g*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),C=Hn(us.relativeLuminance2(g,y,b),us.relativeLuminance2(d,p,v));return(g<<24|y<<16|b<<8|255)>>>0}t.reduceLuminance=n;function a(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,y=h>>16&255,b=h>>8&255,C=Hn(us.relativeLuminance2(g,y,b),us.relativeLuminance2(d,p,v));for(;C<f&&(g<255||y<255||b<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),C=Hn(us.relativeLuminance2(g,y,b),us.relativeLuminance2(d,p,v));return(g<<24|y<<16|b<<8|255)>>>0}t.increaseLuminance=a;function l(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}t.toChannels=l})(Io||={});function Ro(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Hn(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}function pi(t){if(!t)throw new Error("value must not be falsy");return t}function Sv(t){return 57508<=t&&t<=57558}function j3(t){return 57520<=t&&t<=57527}function V3(t){return 57344<=t&&t<=63743}function q3(t){return 9472<=t&&t<=9631}function Y3(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function K3(t,e,i,n){return e===1&&i>Math.ceil(n*1.5)&&t!==void 0&&t>255&&!Y3(t)&&!Sv(t)&&!V3(t)}function Rx(t){return Sv(t)||q3(t)}function G3(){return{css:{canvas:wd(),cell:wd()},device:{canvas:wd(),cell:wd(),char:{width:0,height:0,left:0,top:0}}}}function wd(){return{width:0,height:0}}function X3(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Xi=0,Li=0,sn=!1,Un=!1,Cd=!1,Cs,Cp=0,Z3=class{constructor(t,e,i,n,a,l){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=n,this._coreBrowserService=a,this._themeService=l,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,Li=0,Xi=0,Un=!1,sn=!1,Cd=!1,Cs=this._themeService.colors,Cp=0,t.getCode()!==0&&t.extended.underlineStyle===4){let a=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Cp=e*n%(Math.round(a)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",a=>{a.backgroundColorRGB&&(Li=a.backgroundColorRGB.rgba>>8&16777215,Un=!0),a.foregroundColorRGB&&(Xi=a.foregroundColorRGB.rgba>>8&16777215,sn=!0)}),Cd=this._selectionRenderModel.isCellSelected(this._terminal,e,i),Cd){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Li=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Li=(this.result.fg&16777215)<<8|255;break;default:Li=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Li=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Li=(this.result.bg&16777215)<<8|255;break}Li=Io.blend(Li,(this._coreBrowserService.isFocused?Cs.selectionBackgroundOpaque:Cs.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Li=(this._coreBrowserService.isFocused?Cs.selectionBackgroundOpaque:Cs.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Un=!0,Cs.selectionForeground&&(Xi=Cs.selectionForeground.rgba>>8&16777215,sn=!0),Rx(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Xi=(this._coreBrowserService.isFocused?Cs.selectionBackgroundOpaque:Cs.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Xi=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Xi=(this.result.fg&16777215)<<8|255;break;default:Xi=this._themeService.colors.foreground.rgba}Xi=Io.blend(Xi,(this._coreBrowserService.isFocused?Cs.selectionBackgroundOpaque:Cs.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}sn=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",a=>{a.backgroundColorRGB&&(Li=a.backgroundColorRGB.rgba>>8&16777215,Un=!0),a.foregroundColorRGB&&(Xi=a.foregroundColorRGB.rgba>>8&16777215,sn=!0)}),Un&&(Cd?Li=t.bg&-16777216&-134217729|Li|50331648:Li=t.bg&-16777216|Li|50331648),sn&&(Xi=t.fg&-16777216&-67108865|Xi|50331648),this.result.fg&67108864&&(Un&&!sn&&((this.result.bg&50331648)===0?Xi=this.result.fg&-134217728|Cs.background.rgba>>8&16777215&16777215|50331648:Xi=this.result.fg&-134217728|this.result.bg&67108863,sn=!0),!Un&&sn&&((this.result.fg&50331648)===0?Li=this.result.bg&-67108864|Cs.foreground.rgba>>8&16777215&16777215|50331648:Li=this.result.bg&-67108864|this.result.fg&67108863,Un=!0)),Cs=void 0,this.result.bg=Un?Li:this.result.bg,this.result.fg=sn?Xi:this.result.fg,this.result.ext&=536870911,this.result.ext|=Cp<<29&3758096384}},Q3=.5,Mx=H3||U3?"bottom":"ideographic",J3={"▀":[{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}]},eD={"░":[[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]]},tD={"─":{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:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},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:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},Hu={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{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}};Hu[""]=Hu[""];Hu[""]=Hu[""];function iD(t,e,i,n,a,l,u,h){let f=J3[e];if(f)return sD(t,f,i,n,a,l),!0;let d=eD[e];if(d)return rD(t,d,i,n,a,l),!0;let p=tD[e];if(p)return nD(t,p,i,n,a,l,h),!0;let v=Hu[e];return v?(aD(t,v,i,n,a,l,u,h),!0):!1}function sD(t,e,i,n,a,l){for(let u=0;u<e.length;u++){let h=e[u],f=a/8,d=l/8;t.fillRect(i+h.x*f,n+h.y*d,h.w*f,h.h*d)}}var A1=new Map;function rD(t,e,i,n,a,l){let u=A1.get(e);u||(u=new Map,A1.set(e,u));let h=t.fillStyle;if(typeof h!="string")throw new Error(`Unexpected fillStyle type "${h}"`);let f=u.get(h);if(!f){let d=e[0].length,p=e.length,v=t.canvas.ownerDocument.createElement("canvas");v.width=d,v.height=p;let g=pi(v.getContext("2d")),y=new ImageData(d,p),b,C,x,k;if(h.startsWith("#"))b=parseInt(h.slice(1,3),16),C=parseInt(h.slice(3,5),16),x=parseInt(h.slice(5,7),16),k=h.length>7&&parseInt(h.slice(7,9),16)||1;else if(h.startsWith("rgba"))[b,C,x,k]=h.substring(5,h.length-1).split(",").map(R=>parseFloat(R));else throw new Error(`Unexpected fillStyle color format "${h}" when drawing pattern glyph`);for(let R=0;R<p;R++)for(let L=0;L<d;L++)y.data[(R*d+L)*4]=b,y.data[(R*d+L)*4+1]=C,y.data[(R*d+L)*4+2]=x,y.data[(R*d+L)*4+3]=e[R][L]*(k*255);g.putImageData(y,0,0),f=pi(t.createPattern(v,null)),u.set(h,f)}t.fillStyle=f,t.fillRect(i,n,a,l)}function nD(t,e,i,n,a,l,u){t.strokeStyle=t.fillStyle;for(let[h,f]of Object.entries(e)){t.beginPath(),t.lineWidth=u*Number.parseInt(h);let d;if(typeof f=="function"){let p=.15/l*a;d=f(.15,p)}else d=f;for(let p of d.split(" ")){let v=p[0],g=Ax[v];if(!g){console.error(`Could not find drawing instructions for "${v}"`);continue}let y=p.substring(1).split(",");!y[0]||!y[1]||g(t,Lx(y,a,l,i,n,!0,u))}t.stroke(),t.closePath()}}function aD(t,e,i,n,a,l,u,h){let f=new Path2D;f.rect(i,n,a,l),t.clip(f),t.beginPath();let d=u/12;t.lineWidth=h*d;for(let p of e.d.split(" ")){let v=p[0],g=Ax[v];if(!g){console.error(`Could not find drawing instructions for "${v}"`);continue}let y=p.substring(1).split(",");!y[0]||!y[1]||g(t,Lx(y,a,l,i,n,!1,h,(e.leftPadding??0)*(d/2),(e.rightPadding??0)*(d/2)))}e.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function L1(t,e,i=0){return Math.max(Math.min(t,e),i)}var Ax={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function Lx(t,e,i,n,a,l,u,h=0,f=0){let d=t.map(p=>parseFloat(p)||parseInt(p));if(d.length<2)throw new Error("Too few arguments for instruction");for(let p=0;p<d.length;p+=2)d[p]*=e-h*u-f*u,l&&d[p]!==0&&(d[p]=L1(Math.round(d[p]+.5)-.5,e,0)),d[p]+=n+h*u;for(let p=1;p<d.length;p+=2)d[p]*=i,l&&d[p]!==0&&(d[p]=L1(Math.round(d[p]+.5)-.5,i,0)),d[p]+=a;return d}var D1=class{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},O1=class{constructor(){this._data=new D1}set(e,i,n,a,l){this._data.get(e,i)||this._data.set(e,i,new D1),this._data.get(e,i).set(n,a,l)}get(e,i,n,a){return this._data.get(e,i)?.get(n,a)}clear(){this._data.clear()}},Dx=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),a=t.timeRemaining(),i*1.5>a){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=a}this.clear()}},oD=class extends Dx{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},lD=class extends Dx{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},cD=!yv&&"requestIdleCallback"in window?lD:oD,jl=class Ox{constructor(){this.fg=0,this.bg=0,this.extended=new Bx}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new Ox;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Bx=class Nx{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new Nx(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},uD=globalThis.performance&&typeof globalThis.performance.now=="function",hD=class Px{static create(e){return new Px(e)}constructor(e){this._now=uD&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Yn;(t=>{t.None=()=>$r.None;function e(D,O){return v(D,()=>{},0,void 0,!0,void 0,O)}t.defer=e;function i(D){return(O,P=null,$)=>{let M=!1,A;return A=D(z=>{if(!M)return A?A.dispose():M=!0,O.call(P,z)},null,$),M&&A.dispose(),A}}t.once=i;function n(D,O,P){return d(($,M=null,A)=>D(z=>$.call(M,O(z)),null,A),P)}t.map=n;function a(D,O,P){return d(($,M=null,A)=>D(z=>{O(z),$.call(M,z)},null,A),P)}t.forEach=a;function l(D,O,P){return d(($,M=null,A)=>D(z=>O(z)&&$.call(M,z),null,A),P)}t.filter=l;function u(D){return D}t.signal=u;function h(...D){return(O,P=null,$)=>{let M=xx(...D.map(A=>A(z=>O.call(P,z))));return p(M,$)}}t.any=h;function f(D,O,P,$){let M=P;return n(D,A=>(M=O(M,A),M),$)}t.reduce=f;function d(D,O){let P,$={onWillAddFirstListener(){P=D(M.fire,M)},onDidRemoveLastListener(){P?.dispose()}},M=new Ht($);return O?.add(M),M.event}function p(D,O){return O instanceof Array?O.push(D):O&&O.add(D),D}function v(D,O,P=100,$=!1,M=!1,A,z){let q,Y,B,X=0,ie,re={leakWarningThreshold:A,onWillAddFirstListener(){q=D(he=>{X++,Y=O(Y,he),$&&!B&&(fe.fire(Y),Y=void 0),ie=()=>{let oe=Y;Y=void 0,B=void 0,(!$||X>1)&&fe.fire(oe),X=0},typeof P=="number"?(clearTimeout(B),B=setTimeout(ie,P)):B===void 0&&(B=0,queueMicrotask(ie))})},onWillRemoveListener(){M&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,q.dispose()}},fe=new Ht(re);return z?.add(fe),fe.event}t.debounce=v;function g(D,O=0,P){return t.debounce(D,($,M)=>$?($.push(M),$):[M],O,void 0,!0,void 0,P)}t.accumulate=g;function y(D,O=($,M)=>$===M,P){let $=!0,M;return l(D,A=>{let z=$||!O(A,M);return $=!1,M=A,z},P)}t.latch=y;function b(D,O,P){return[t.filter(D,O,P),t.filter(D,$=>!O($),P)]}t.split=b;function C(D,O=!1,P=[],$){let M=P.slice(),A=D(Y=>{M?M.push(Y):q.fire(Y)});$&&$.add(A);let z=()=>{M?.forEach(Y=>q.fire(Y)),M=null},q=new Ht({onWillAddFirstListener(){A||(A=D(Y=>q.fire(Y)),$&&$.add(A))},onDidAddFirstListener(){M&&(O?setTimeout(z):z())},onDidRemoveLastListener(){A&&A.dispose(),A=null}});return $&&$.add(q),q.event}t.buffer=C;function x(D,O){return(P,$,M)=>{let A=O(new R);return D(function(z){let q=A.evaluate(z);q!==k&&P.call($,q)},void 0,M)}}t.chain=x;let k=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(P=>(O(P),P)),this}filter(O){return this.steps.push(P=>O(P)?P:k),this}reduce(O,P){let $=P;return this.steps.push(M=>($=O($,M),$)),this}latch(O=(P,$)=>P===$){let P=!0,$;return this.steps.push(M=>{let A=P||!O(M,$);return P=!1,$=M,A?M:k}),this}evaluate(O){for(let P of this.steps)if(O=P(O),O===k)break;return O}}function L(D,O,P=$=>$){let $=(...q)=>z.fire(P(...q)),M=()=>D.on(O,$),A=()=>D.removeListener(O,$),z=new Ht({onWillAddFirstListener:M,onDidRemoveLastListener:A});return z.event}t.fromNodeEventEmitter=L;function E(D,O,P=$=>$){let $=(...q)=>z.fire(P(...q)),M=()=>D.addEventListener(O,$),A=()=>D.removeEventListener(O,$),z=new Ht({onWillAddFirstListener:M,onDidRemoveLastListener:A});return z.event}t.fromDOMEventEmitter=E;function H(D){return new Promise(O=>i(D)(O))}t.toPromise=H;function U(D){let O=new Ht;return D.then(P=>{O.fire(P)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}t.fromPromise=U;function I(D,O){return D(P=>O.fire(P))}t.forward=I;function N(D,O,P){return O(P),D($=>O($))}t.runAndSubscribe=N;class F{constructor(O,P){this._observable=O,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new Ht($),P&&P.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,P){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function J(D,O){return new F(D,O).emitter.event}t.fromObservable=J;function G(D){return(O,P,$)=>{let M=0,A=!1,z={beginUpdate(){M++},endUpdate(){M--,M===0&&(D.reportChanges(),A&&(A=!1,O.call(P)))},handlePossibleChange(){},handleChange(){A=!0}};D.addObserver(z),D.reportChanges();let q={dispose(){D.removeObserver(z)}};return $ instanceof Kl?$.add(q):Array.isArray($)&&$.push(q),q}}t.fromObservableLight=G})(Yn||={});var Ig=class Hg{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Hg._idPool++}`,Hg.all.add(this)}start(e){this._stopWatch=new hD,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Ig.all=new Set,Ig._idPool=0;var dD=Ig,fD=-1,zx=class Ix{constructor(e,i,n=(Ix._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[l,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(l);let f=new pD(h,l);this._errorHandler(f)}return()=>{let l=this._stacks.get(e.value)||0;this._stacks.set(e.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,a]of this._stacks)(!e||i<a)&&(e=[n,a],i=a);return e}};zx._idPool=1;var mD=zx,_D=class Hx{constructor(e){this.value=e}static create(){let e=new Error;return new Hx(e.stack??"")}print(){console.warn(this.value.split(`
29
+ `).slice(2).join(`
30
+ `))}},pD=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},gD=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},vD=0,xp=class{constructor(t){this.value=t,this.id=vD++}},yD=2,SD,Ht=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new mD(e?.onListenerError??wp,this._options?.leakWarningThreshold??fD):void 0,this._perfMon=this._options?._profName?new dD(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new gD(`${h}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||wp)(d),$r.None}if(this._disposed)return $r.None;i&&(e=e.bind(i));let a=new xp(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=_D.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof xp?(this._deliveryQueue??=new bD,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let u=ss(()=>{l?.(),this._removeListener(a)});return n instanceof Kl?n.add(u):Array.isArray(n)&&n.push(u),u},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*yD<=i.length){let l=0;for(let u=0;u<i.length;u++)i[u]?i[l++]=i[u]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=l}}_deliver(e,i){if(!e)return;let n=this._options?.onListenerError||wp;if(!n){e.value(i);return}try{e.value(i)}catch(a){n(a)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof xp)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},bD=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},B1={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}},fu=2,mu,Ha=class Ul{constructor(e,i,n){this._document=e,this._config=i,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new O1,this._cacheMapCombined=new O1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new jl,this._textureSize=512,this._onAddTextureAtlasCanvas=new Ht,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Ht,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Ux(e,this._config.deviceCellWidth*4+fu*2,this._config.deviceCellHeight+fu*2),this._tmpCtx=pi(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new cD;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let n=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,n)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Ul.maxAtlasPages&&this._pages.length>=Math.max(4,Ul.maxAtlasPages)){let i=this._pages.filter(d=>d.canvas.width*2<=(Ul.maxTextureSize||4096)).sort((d,p)=>p.canvas.width!==d.canvas.width?p.canvas.width-d.canvas.width:p.percentageUsed-d.percentageUsed),n=-1,a=0;for(let d=0;d<i.length;d++)if(i[d].canvas.width!==a)n=d,a=i[d].canvas.width;else if(d-n===3)break;let l=i.slice(n,n+4),u=l.map(d=>d.glyphs[0].texturePage).sort((d,p)=>d>p?1:-1),h=this.pages.length-l.length,f=this._mergePages(l,h);f.version++;for(let d=u.length-1;d>=0;d--)this._deletePage(u[d]);this.pages.push(f),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(f.canvas)}let e=new kp(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let n=e[0].canvas.width*2,a=new kp(this._document,n,e);for(let[l,u]of e.entries()){let h=l*u.canvas.width%n,f=Math.floor(l/2)*u.canvas.height;a.ctx.drawImage(u.canvas,h,f);for(let p of u.glyphs)p.texturePage=i,p.sizeClipSpace.x=p.size.x/n,p.sizeClipSpace.y=p.size.y/n,p.texturePosition.x+=h,p.texturePosition.y+=f,p.texturePositionClipSpace.x=p.texturePosition.x/n,p.texturePositionClipSpace.y=p.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(u.canvas);let d=this._activePages.indexOf(u);d!==-1&&this._activePages.splice(d,1)}return a}_deletePage(e){this._pages.splice(e,1);for(let i=e;i<this._pages.length;i++){let n=this._pages[i];for(let a of n.glyphs)a.texturePage--;n.version++}}getRasterizedGlyphCombinedChar(e,i,n,a,l,u){return this._getFromCacheMap(this._cacheMapCombined,e,i,n,a,l,u)}getRasterizedGlyph(e,i,n,a,l,u){return this._getFromCacheMap(this._cacheMap,e,i,n,a,l,u)}_getFromCacheMap(e,i,n,a,l,u,h){return mu=e.get(i,n,a,l),mu||(mu=this._drawToCache(i,n,a,l,u,h),e.set(i,n,a,l,mu)),mu}_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,i,n,a){if(this._config.allowTransparency)return Sr;let l;switch(e){case 16777216:case 33554432:l=this._getColorFromAnsiIndex(i);break;case 50331648:let u=jl.toColorRGB(i);l=hs.toColor(u[0],u[1],u[2]);break;default:n?l=xu.opaque(this._config.colors.foreground):l=this._config.colors.background;break}return this._config.allowTransparency||(l=xu.opaque(l)),l}_getForegroundColor(e,i,n,a,l,u,h,f,d,p){let v=this._getMinimumContrastColor(e,i,n,a,l,u,h,d,f,p);if(v)return v;let g;switch(l){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&u<8&&(u+=8),g=this._getColorFromAnsiIndex(u);break;case 50331648:let y=jl.toColorRGB(u);g=hs.toColor(y[0],y[1],y[2]);break;default:h?g=this._config.colors.background:g=this._config.colors.foreground}return this._config.allowTransparency&&(g=xu.opaque(g)),f&&(g=xu.multiplyOpacity(g,Q3)),g}_resolveBackgroundRgba(e,i,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,n,a){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&a&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,n,a,l,u,h,f,d,p){if(this._config.minimumContrastRatio===1||p)return;let v=this._getContrastCache(d),g=v.getColor(e,a);if(g!==void 0)return g||void 0;let y=this._resolveBackgroundRgba(i,n,h),b=this._resolveForegroundRgba(l,u,h,f),C=Io.ensureContrastRatio(y,b,this._config.minimumContrastRatio/(d?2:1));if(!C){v.setColor(e,a,null);return}let x=hs.toColor(C>>24&255,C>>16&255,C>>8&255);return v.setColor(e,a,x),x}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,n,a,l,u){let h=typeof e=="number"?String.fromCharCode(e):e;u&&this._tmpCanvas.parentElement!==u&&(this._tmpCanvas.style.display="none",u.append(this._tmpCanvas));let f=Math.min(this._config.deviceCellWidth*Math.max(h.length,2)+fu*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<f&&(this._tmpCanvas.width=f);let d=Math.min(this._config.deviceCellHeight+fu*4,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=a,!!this._workAttributeData.isInvisible())return B1;let p=!!this._workAttributeData.isBold(),v=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),y=!!this._workAttributeData.isItalic(),b=!!this._workAttributeData.isUnderline(),C=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline(),k=this._workAttributeData.getFgColor(),R=this._workAttributeData.getFgColorMode(),L=this._workAttributeData.getBgColor(),E=this._workAttributeData.getBgColorMode();if(v){let Y=k;k=L,L=Y;let B=R;R=E,E=B}let H=this._getBackgroundColor(E,L,v,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let U=p?this._config.fontWeightBold:this._config.fontWeight,I=y?"italic":"";this._tmpCtx.font=`${I} ${U} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=Mx;let N=h.length===1&&Sv(h.charCodeAt(0)),F=h.length===1&&j3(h.charCodeAt(0)),J=this._getForegroundColor(i,E,L,n,R,k,v,g,p,Rx(h.charCodeAt(0)));this._tmpCtx.fillStyle=J.css;let G=F?0:fu*2,D=!1;this._config.customGlyphs!==!1&&(D=iD(this._tmpCtx,h,G,G,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let O=!N,P;if(typeof e=="number"?P=this._unicodeService.wcwidth(e):P=this._unicodeService.getStringCellWidth(e),b){this._tmpCtx.save();let Y=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),B=Y%2===1?.5:0;if(this._tmpCtx.lineWidth=Y,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())O=!1,this._tmpCtx.strokeStyle=`rgb(${jl.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{O=!1;let oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&oe<8&&(oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(oe).css}this._tmpCtx.beginPath();let X=G,ie=Math.ceil(G+this._config.deviceCharHeight)-B-(l?Y*2:0),re=ie+Y,fe=ie+Y*2,he=this._workAttributeData.getUnderlineVariantOffset();for(let oe=0;oe<P;oe++){this._tmpCtx.save();let ve=X+oe*this._config.deviceCellWidth,de=X+(oe+1)*this._config.deviceCellWidth,we=ve+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(de,ie),this._tmpCtx.moveTo(ve,fe),this._tmpCtx.lineTo(de,fe);break;case 3:let Le=Y<=1?fe:Math.ceil(G+this._config.deviceCharHeight-Y/2)-B,tt=Y<=1?ie:Math.ceil(G+this._config.deviceCharHeight+Y/2)-B,Ge=new Path2D;Ge.rect(ve,ie,this._config.deviceCellWidth,fe-ie),this._tmpCtx.clip(Ge),this._tmpCtx.moveTo(ve-this._config.deviceCellWidth/2,re),this._tmpCtx.bezierCurveTo(ve-this._config.deviceCellWidth/2,tt,ve,tt,ve,re),this._tmpCtx.bezierCurveTo(ve,Le,we,Le,we,re),this._tmpCtx.bezierCurveTo(we,tt,de,tt,de,re),this._tmpCtx.bezierCurveTo(de,Le,de+this._config.deviceCellWidth/2,Le,de+this._config.deviceCellWidth/2,re);break;case 4:let xe=he===0?0:he>=Y?Y*2-he:Y-he;he>=Y||xe===0?(this._tmpCtx.setLineDash([Math.round(Y),Math.round(Y)]),this._tmpCtx.moveTo(ve+xe,ie),this._tmpCtx.lineTo(de,ie)):(this._tmpCtx.setLineDash([Math.round(Y),Math.round(Y)]),this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(ve+xe,ie),this._tmpCtx.moveTo(ve+xe+Y,ie),this._tmpCtx.lineTo(de,ie)),he=X3(de-ve,Y,he);break;case 5:let Oe=.6,ge=.3,_t=de-ve,St=Math.floor(Oe*_t),dt=Math.floor(ge*_t),ke=_t-St-dt;this._tmpCtx.setLineDash([St,dt,ke]),this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(de,ie);break;default:this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(de,ie);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!D&&this._config.fontSize>=12&&!this._config.allowTransparency&&h!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let oe=this._tmpCtx.measureText(h);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in oe&&oe.actualBoundingBoxDescent>0){this._tmpCtx.save();let ve=new Path2D;ve.rect(X,ie-Math.ceil(Y/2),this._config.deviceCellWidth*P,fe-ie+Math.ceil(Y/2)),this._tmpCtx.clip(ve),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=H.css,this._tmpCtx.strokeText(h,G,G+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){let Y=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),B=Y%2===1?.5:0;this._tmpCtx.lineWidth=Y,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(G,G+B),this._tmpCtx.lineTo(G+this._config.deviceCharWidth*P,G+B),this._tmpCtx.stroke()}if(D||this._tmpCtx.fillText(h,G,G+this._config.deviceCharHeight),h==="_"&&!this._config.allowTransparency){let Y=Ep(this._tmpCtx.getImageData(G,G,this._config.deviceCellWidth,this._config.deviceCellHeight),H,J,O);if(Y)for(let B=1;B<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(h,G,G+this._config.deviceCharHeight-B),Y=Ep(this._tmpCtx.getImageData(G,G,this._config.deviceCellWidth,this._config.deviceCellHeight),H,J,O),!!Y);B++);}if(C){let Y=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),B=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=Y,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(G,G+Math.floor(this._config.deviceCharHeight/2)-B),this._tmpCtx.lineTo(G+this._config.deviceCharWidth*P,G+Math.floor(this._config.deviceCharHeight/2)-B),this._tmpCtx.stroke()}this._tmpCtx.restore();let $=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),M;if(this._config.allowTransparency?M=wD($):M=Ep($,H,J,O),M)return B1;let A=this._findGlyphBoundingBox($,this._workBoundingBox,f,F,D,G),z,q;for(;;){if(this._activePages.length===0){let Y=this._createNewPage();z=Y,q=Y.currentRow,q.height=A.size.y;break}z=this._activePages[this._activePages.length-1],q=z.currentRow;for(let Y of this._activePages)A.size.y<=Y.currentRow.height&&(z=Y,q=Y.currentRow);for(let Y=this._activePages.length-1;Y>=0;Y--)for(let B of this._activePages[Y].fixedRows)B.height<=q.height&&A.size.y<=B.height&&(z=this._activePages[Y],q=B);if(A.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new kp(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),z=this._overflowSizePage,q=this._overflowSizePage.currentRow,q.x+A.size.x>=z.canvas.width&&(q.x=0,q.y+=q.height,q.height=0);break}if(q.y+A.size.y>=z.canvas.height||q.height>A.size.y+2){let Y=!1;if(z.currentRow.y+z.currentRow.height+A.size.y>=z.canvas.height){let B;for(let X of this._activePages)if(X.currentRow.y+X.currentRow.height+A.size.y<X.canvas.height){B=X;break}if(B)z=B;else if(Ul.maxAtlasPages&&this._pages.length>=Ul.maxAtlasPages&&q.y+A.size.y<=z.canvas.height&&q.height>=A.size.y&&q.x+A.size.x<=z.canvas.width)Y=!0;else{let X=this._createNewPage();z=X,q=X.currentRow,q.height=A.size.y,Y=!0}}Y||(z.currentRow.height>0&&z.fixedRows.push(z.currentRow),q={x:0,y:z.currentRow.y+z.currentRow.height,height:A.size.y},z.fixedRows.push(q),z.currentRow={x:0,y:q.y+q.height,height:0})}if(q.x+A.size.x<=z.canvas.width)break;q===z.currentRow?(q.x=0,q.y+=q.height,q.height=0):z.fixedRows.splice(z.fixedRows.indexOf(q),1)}return A.texturePage=this._pages.indexOf(z),A.texturePosition.x=q.x,A.texturePosition.y=q.y,A.texturePositionClipSpace.x=q.x/z.canvas.width,A.texturePositionClipSpace.y=q.y/z.canvas.height,A.sizeClipSpace.x/=z.canvas.width,A.sizeClipSpace.y/=z.canvas.height,q.height=Math.max(q.height,A.size.y),q.x+=A.size.x,z.ctx.putImageData($,A.texturePosition.x-this._workBoundingBox.left,A.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,A.size.x,A.size.y),z.addGlyph(A),z.version++,A}_findGlyphBoundingBox(e,i,n,a,l,u){i.top=0;let h=a?this._config.deviceCellHeight:this._tmpCanvas.height,f=a?this._config.deviceCellWidth:n,d=!1;for(let p=0;p<h;p++){for(let v=0;v<f;v++){let g=p*this._tmpCanvas.width*4+v*4+3;if(e.data[g]!==0){i.top=p,d=!0;break}}if(d)break}i.left=0,d=!1;for(let p=0;p<u+f;p++){for(let v=0;v<h;v++){let g=v*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.left=p,d=!0;break}}if(d)break}i.right=f,d=!1;for(let p=u+f-1;p>=u;p--){for(let v=0;v<h;v++){let g=v*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.right=p,d=!0;break}}if(d)break}i.bottom=h,d=!1;for(let p=h-1;p>=0;p--){for(let v=0;v<f;v++){let g=p*this._tmpCanvas.width*4+v*4+3;if(e.data[g]!==0){i.bottom=p,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+u+(a||l?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+u+(a||l?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},kp=class{constructor(t,e,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let n of i)this._glyphs.push(...n.glyphs),this._usedPixels+=n._usedPixels;this.canvas=Ux(t,e,e),this.ctx=pi(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.size.y}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 Ep(t,e,i,n){let a=e.rgba>>>24,l=e.rgba>>>16&255,u=e.rgba>>>8&255,h=i.rgba>>>24,f=i.rgba>>>16&255,d=i.rgba>>>8&255,p=Math.floor((Math.abs(a-h)+Math.abs(l-f)+Math.abs(u-d))/12),v=!0;for(let g=0;g<t.data.length;g+=4)t.data[g]===a&&t.data[g+1]===l&&t.data[g+2]===u||n&&Math.abs(t.data[g]-a)+Math.abs(t.data[g+1]-l)+Math.abs(t.data[g+2]-u)<p?t.data[g+3]=0:v=!1;return v}function wD(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}function Ux(t,e,i){let n=t.createElement("canvas");return n.width=e,n.height=i,n}function CD(t,e,i,n,a,l,u,h){let f={foreground:l.foreground,background:l.background,cursor:Sr,cursorAccent:Sr,selectionForeground:Sr,selectionBackgroundTransparent:Sr,selectionBackgroundOpaque:Sr,selectionInactiveBackgroundTransparent:Sr,selectionInactiveBackgroundOpaque:Sr,overviewRulerBorder:Sr,scrollbarSliderBackground:Sr,scrollbarSliderHoverBackground:Sr,scrollbarSliderActiveBackground:Sr,ansi:l.ansi.slice(),contrastCache:l.contrastCache,halfContrastCache:l.halfContrastCache};return{customGlyphs:a.customGlyphs,devicePixelRatio:u,deviceMaxTextureSize:h,letterSpacing:a.letterSpacing,lineHeight:a.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:n,fontFamily:a.fontFamily,fontSize:a.fontSize,fontWeight:a.fontWeight,fontWeightBold:a.fontWeightBold,allowTransparency:a.allowTransparency,drawBoldTextInBrightColors:a.drawBoldTextInBrightColors,minimumContrastRatio:a.minimumContrastRatio,colors:f}}function N1(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.deviceCharWidth===e.deviceCharWidth&&t.deviceCharHeight===e.deviceCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground.rgba===e.colors.foreground.rgba&&t.colors.background.rgba===e.colors.background.rgba}function xD(t){return(t&50331648)===16777216||(t&50331648)===33554432}var xr=[];function Fx(t,e,i,n,a,l,u,h,f){let d=CD(n,a,l,u,e,i,h,f);for(let g=0;g<xr.length;g++){let y=xr[g],b=y.ownedBy.indexOf(t);if(b>=0){if(N1(y.config,d))return y.atlas;y.ownedBy.length===1?(y.atlas.dispose(),xr.splice(g,1)):y.ownedBy.splice(b,1);break}}for(let g=0;g<xr.length;g++){let y=xr[g];if(N1(y.config,d))return y.ownedBy.push(t),y.atlas}let p=t._core,v={atlas:new Ha(document,d,p.unicodeService),config:d,ownedBy:[t]};return xr.push(v),v.atlas}function P1(t){for(let e=0;e<xr.length;e++){let i=xr[e].ownedBy.indexOf(t);if(i!==-1){xr[e].ownedBy.length===1?(xr[e].atlas.dispose(),xr.splice(e,1)):xr[e].ownedBy.splice(i,1);break}}}var xd=600,kD=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,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(t=xd){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=xd-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=xd-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},xd)},t)}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()}};function z1(t,e,i){let n=new e.ResizeObserver(a=>{let l=a.find(f=>f.target===t);if(!l)return;if(!("devicePixelContentBoxSize"in l)){n?.disconnect(),n=void 0;return}let u=l.devicePixelContentBoxSize[0].inlineSize,h=l.devicePixelContentBoxSize[0].blockSize;u>0&&h>0&&i(u,h)});try{n.observe(t,{box:["device-pixel-content-box"]})}catch{n.disconnect(),n=void 0}return ss(()=>n?.disconnect())}function ED(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var I1=class $x extends jl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Bx,this.combinedData=""}static fromCharData(e){let i=new $x;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ED(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=e[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Wx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function jx(t,e,i){let n=pi(t.createProgram());if(t.attachShader(n,pi(H1(t,t.VERTEX_SHADER,e))),t.attachShader(n,pi(H1(t,t.FRAGMENT_SHADER,i))),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS))return n;console.error(t.getProgramInfoLog(n)),t.deleteProgram(n)}function H1(t,e,i){let n=pi(t.createShader(e));if(t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;console.error(t.getShaderInfoLog(n)),t.deleteShader(n)}function TD(t,e){let i=Math.min(t.length*2,e),n=new Float32Array(i);for(let a=0;a<t.length;a++)n[a]=t[a];return n}var RD=class{constructor(t){this.texture=t,this.version=-1}},MD=`#version 300 es
31
+ layout (location = 0) in vec2 a_unitquad;
32
+ layout (location = 1) in vec2 a_cellpos;
33
+ layout (location = 2) in vec2 a_offset;
34
+ layout (location = 3) in vec2 a_size;
35
+ layout (location = 4) in float a_texpage;
36
+ layout (location = 5) in vec2 a_texcoord;
37
+ layout (location = 6) in vec2 a_texsize;
38
+
39
+ uniform mat4 u_projection;
40
+ uniform vec2 u_resolution;
41
+
42
+ out vec2 v_texcoord;
43
+ flat out int v_texpage;
44
+
45
+ void main() {
46
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
47
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
48
+ v_texpage = int(a_texpage);
49
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
50
+ }`;function AD(t){let e="";for(let i=1;i<t;i++)e+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
51
+ precision lowp float;
52
+
53
+ in vec2 v_texcoord;
54
+ flat in int v_texpage;
55
+
56
+ uniform sampler2D u_texture[${t}];
57
+
58
+ out vec4 outColor;
59
+
60
+ void main() {
61
+ if (v_texpage == 0) {
62
+ outColor = texture(u_texture[0], v_texcoord);
63
+ } ${e}
64
+ }`}var Ua=11,zl=Ua*Float32Array.BYTES_PER_ELEMENT,LD=2,ei=0,zt,Tp=0,_u=0,DD=class extends $r{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=n,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let a=this._gl;Ha.maxAtlasPages===void 0&&(Ha.maxAtlasPages=Math.min(32,pi(a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS))),Ha.maxTextureSize=pi(a.getParameter(a.MAX_TEXTURE_SIZE))),this._program=pi(jx(a,MD,AD(Ha.maxAtlasPages))),this._register(ss(()=>a.deleteProgram(this._program))),this._projectionLocation=pi(a.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=pi(a.getUniformLocation(this._program,"u_resolution")),this._textureLocation=pi(a.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let l=new Float32Array([0,0,1,0,0,1,1,1]),u=a.createBuffer();this._register(ss(()=>a.deleteBuffer(u))),a.bindBuffer(a.ARRAY_BUFFER,u),a.bufferData(a.ARRAY_BUFFER,l,a.STATIC_DRAW),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let h=new Uint8Array([0,1,2,3]),f=a.createBuffer();this._register(ss(()=>a.deleteBuffer(f))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,f),a.bufferData(a.ELEMENT_ARRAY_BUFFER,h,a.STATIC_DRAW),this._attributesBuffer=pi(a.createBuffer()),this._register(ss(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,2,a.FLOAT,!1,zl,0),a.vertexAttribDivisor(2,1),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,a.FLOAT,!1,zl,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(3,1),a.enableVertexAttribArray(4),a.vertexAttribPointer(4,1,a.FLOAT,!1,zl,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(4,1),a.enableVertexAttribArray(5),a.vertexAttribPointer(5,2,a.FLOAT,!1,zl,5*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(5,1),a.enableVertexAttribArray(6),a.vertexAttribPointer(6,2,a.FLOAT,!1,zl,7*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(6,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,zl,9*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.useProgram(this._program);let d=new Int32Array(Ha.maxAtlasPages);for(let p=0;p<Ha.maxAtlasPages;p++)d[p]=p;a.uniform1iv(this._textureLocation,d),a.uniformMatrix4fv(this._projectionLocation,!1,Wx),this._atlasTextures=[];for(let p=0;p<Ha.maxAtlasPages;p++){let v=new RD(pi(a.createTexture()));this._register(ss(()=>a.deleteTexture(v.texture))),a.activeTexture(a.TEXTURE0+p),a.bindTexture(a.TEXTURE_2D,v.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[p]=v}a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,n,a,l,u,h,f){this._updateCell(this._vertices.attributes,t,e,i,n,a,l,u,h,f)}_updateCell(t,e,i,n,a,l,u,h,f,d){if(ei=(i*this._terminal.cols+e)*Ua,n===0||n===void 0){t.fill(0,ei,ei+Ua-1-LD);return}this._atlas&&(h&&h.length>1?zt=this._atlas.getRasterizedGlyphCombinedChar(h,a,l,u,!1,this._terminal.element):zt=this._atlas.getRasterizedGlyph(n,a,l,u,!1,this._terminal.element),Tp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),a!==d&&zt.offset.x>Tp?(_u=zt.offset.x-Tp,t[ei]=-(zt.offset.x-_u)+this._dimensions.device.char.left,t[ei+1]=-zt.offset.y+this._dimensions.device.char.top,t[ei+2]=(zt.size.x-_u)/this._dimensions.device.canvas.width,t[ei+3]=zt.size.y/this._dimensions.device.canvas.height,t[ei+4]=zt.texturePage,t[ei+5]=zt.texturePositionClipSpace.x+_u/this._atlas.pages[zt.texturePage].canvas.width,t[ei+6]=zt.texturePositionClipSpace.y,t[ei+7]=zt.sizeClipSpace.x-_u/this._atlas.pages[zt.texturePage].canvas.width,t[ei+8]=zt.sizeClipSpace.y):(t[ei]=-zt.offset.x+this._dimensions.device.char.left,t[ei+1]=-zt.offset.y+this._dimensions.device.char.top,t[ei+2]=zt.size.x/this._dimensions.device.canvas.width,t[ei+3]=zt.size.y/this._dimensions.device.canvas.height,t[ei+4]=zt.texturePage,t[ei+5]=zt.texturePositionClipSpace.x,t[ei+6]=zt.texturePositionClipSpace.y,t[ei+7]=zt.sizeClipSpace.x,t[ei+8]=zt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&K3(n,f,zt.size.x,this._dimensions.device.cell.width)&&(t[ei+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*Ua;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==e?this._vertices.attributesBuffers[i]=new Float32Array(e):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=e,i=0;for(let n=0;n<t.rows;n++)for(let a=0;a<t.cols;a++)this._vertices.attributes[i+9]=a/t.cols,this._vertices.attributes[i+10]=n/t.rows,i+=Ua}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],n=0;for(let a=0;a<t.lineLengths.length;a++){let l=a*this._terminal.cols*Ua,u=this._vertices.attributes.subarray(l,l+t.lineLengths[a]*Ua);i.set(u,n),n+=u.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,n),e.STREAM_DRAW);for(let a=0;a<this._atlas.pages.length;a++)this._atlas.pages[a].version!==this._atlasTextures[a].version&&this._bindAtlasPageTexture(e,this._atlas,a);e.drawElementsInstanced(e.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,n/Ua)}setAtlas(t){this._atlas=t;for(let e of this._atlasTextures)e.version=-1}_bindAtlasPageTexture(t,e,i){t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[i].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.pages[i].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[i].version=e.pages[i].version}setDimensions(t){this._dimensions=t}},OD=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,e,i,n=!1){if(this.selectionStart=e,this.selectionEnd=i,!e||!i||e[0]===i[0]&&e[1]===i[1]){this.clear();return}let a=t.buffers.active.ydisp,l=e[1]-a,u=i[1]-a,h=Math.max(l,0),f=Math.min(u,t.rows-1);if(h>=t.rows||f<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=l,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=f,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e<this.endCol&&i<=this.viewportCappedEndRow:e<this.startCol&&i>=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol):!1}};function BD(){return new OD}var mf=4,$d=1,Wd=2,Rp=3,ND=2147483648,PD=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=BD()}resize(t,e){let i=t*e*mf;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},zD=`#version 300 es
65
+ layout (location = 0) in vec2 a_position;
66
+ layout (location = 1) in vec2 a_size;
67
+ layout (location = 2) in vec4 a_color;
68
+ layout (location = 3) in vec2 a_unitquad;
69
+
70
+ uniform mat4 u_projection;
71
+
72
+ out vec4 v_color;
73
+
74
+ void main() {
75
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
76
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
77
+ v_color = a_color;
78
+ }`,ID=`#version 300 es
79
+ precision lowp float;
80
+
81
+ in vec4 v_color;
82
+
83
+ out vec4 outColor;
84
+
85
+ void main() {
86
+ outColor = v_color;
87
+ }`,jn=8,Mp=jn*Float32Array.BYTES_PER_ELEMENT,HD=20*jn,U1=class{constructor(){this.attributes=new Float32Array(HD),this.count=0}},Fn=0,F1=0,$1=0,W1=0,j1=0,V1=0,q1=0,UD=class extends $r{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=n,this._vertices=new U1,this._verticesCursor=new U1;let a=this._gl;this._program=pi(jx(a,zD,ID)),this._register(ss(()=>a.deleteProgram(this._program))),this._projectionLocation=pi(a.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let l=new Float32Array([0,0,1,0,0,1,1,1]),u=a.createBuffer();this._register(ss(()=>a.deleteBuffer(u))),a.bindBuffer(a.ARRAY_BUFFER,u),a.bufferData(a.ARRAY_BUFFER,l,a.STATIC_DRAW),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let h=new Uint8Array([0,1,2,3]),f=a.createBuffer();this._register(ss(()=>a.deleteBuffer(f))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,f),a.bufferData(a.ELEMENT_ARRAY_BUFFER,h,a.STATIC_DRAW),this._attributesBuffer=pi(a.createBuffer()),this._register(ss(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,a.FLOAT,!1,Mp,0),a.vertexAttribDivisor(0,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,Mp,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,4,a.FLOAT,!1,Mp,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(2,1),this._updateCachedColors(n.colors),this._register(this._themeService.onChangeColors(d=>{this._updateCachedColors(d),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,Wx),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.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(t){let e=this._terminal,i=this._vertices,n=1,a,l,u,h,f,d,p,v,g,y,b;for(a=0;a<e.rows;a++){for(u=-1,h=0,f=0,d=!1,l=0;l<e.cols;l++)p=(a*e.cols+l)*mf,v=t.cells[p+$d],g=t.cells[p+Wd],y=!!(g&67108864),(v!==h||g!==f&&(d||y))&&((h!==0||d&&f!==0)&&(b=n++*jn,this._updateRectangle(i,b,f,h,u,l,a)),u=l,h=v,f=g,d=y);(h!==0||d&&f!==0)&&(b=n++*jn,this._updateRectangle(i,b,f,h,u,e.cols,a))}i.count=n}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let n,a=0;(i.style==="bar"||i.style==="outline")&&(n=a++*jn,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(n=a++*jn,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(n=a++*jn,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),n=a++*jn,this._addRectangleFloat(e.attributes,n,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),e.count=a}_updateRectangle(t,e,i,n,a,l,u){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Fn=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Fn=(i&16777215)<<8;break;default:Fn=this._themeService.colors.foreground.rgba}else switch(n&50331648){case 16777216:case 33554432:Fn=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:Fn=(n&16777215)<<8;break;default:Fn=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=TD(t.attributes,this._terminal.rows*this._terminal.cols*jn)),F1=a*this._dimensions.device.cell.width,$1=u*this._dimensions.device.cell.height,W1=(Fn>>24&255)/255,j1=(Fn>>16&255)/255,V1=(Fn>>8&255)/255,q1=1,this._addRectangle(t.attributes,e,F1,$1,(l-a)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,W1,j1,V1,q1)}_addRectangle(t,e,i,n,a,l,u,h,f,d){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=a/this._dimensions.device.canvas.width,t[e+3]=l/this._dimensions.device.canvas.height,t[e+4]=u,t[e+5]=h,t[e+6]=f,t[e+7]=d}_addRectangleFloat(t,e,i,n,a,l,u){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=a/this._dimensions.device.canvas.width,t[e+3]=l/this._dimensions.device.canvas.height,t[e+4]=u[0],t[e+5]=u[1],t[e+6]=u[2],t[e+7]=u[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},FD=class extends $r{constructor(t,e,i,n,a,l,u,h){super(),this._container=e,this._alpha=a,this._coreBrowserService=l,this._optionsService=u,this._themeService=h,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-${i}-layer`),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(f=>{this._refreshCharAtlas(t,f),this.reset(t)})),this._register(ss(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=pi(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,i){}handleSelectionChanged(t,e,i,n=!1){}_setTransparency(t,e){if(e===this._alpha)return;let i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Fx(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*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(t,e,i,n){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,n){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=Mx,this._clipCell(i,n,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,i){let n=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${n} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},$D=class extends FD{constructor(t,e,i,n,a,l,u){super(i,t,"link",e,!0,a,l,u),this._register(n.onShowLinkUnderline(h=>this._handleShowLinkUnderline(h))),this._register(n.onHideLinkUnderline(h=>this._handleHideLinkUnderline(h)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&xD(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},Oo=typeof window=="object"?window:globalThis,Ug=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Ht,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Ht,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Ug.INSTANCE=new Ug;var Vx=Ug;function WD(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}Vx.INSTANCE.onDidChangeZoomLevel;Vx.INSTANCE.onDidChangeFullscreen;var sc=typeof navigator=="object"?navigator.userAgent:"";sc.indexOf("Firefox")>=0;sc.indexOf("AppleWebKit")>=0;var jD=sc.indexOf("Chrome")>=0;!jD&&sc.indexOf("Safari")>=0;sc.indexOf("Electron/")>=0;sc.indexOf("Android")>=0;var Ap=!1;if(typeof Oo.matchMedia=="function"){let t=Oo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Oo.matchMedia("(display-mode: fullscreen)");Ap=t.matches,WD(Oo,t,({matches:i})=>{Ap&&e.matches||(Ap=i)})}var Vl="en",Lp=!1,qx=!1,kd,jd=Vl,Y1=Vl,VD,Wn,Ho=globalThis,qs;typeof Ho.vscode<"u"&&typeof Ho.vscode.process<"u"?qs=Ho.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(qs=process);var qD=typeof qs?.versions?.electron=="string",YD=qD&&qs?.type==="renderer";if(typeof qs=="object"){qs.platform,qs.platform,Lp=qs.platform==="linux",Lp&&qs.env.SNAP&&qs.env.SNAP_REVISION,qs.env.CI||qs.env.BUILD_ARTIFACTSTAGINGDIRECTORY,kd=Vl,jd=Vl;let t=qs.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);kd=e.userLocale,Y1=e.osLocale,jd=e.resolvedLanguage||Vl,VD=e.languagePack?.translationsConfigFile}catch{}qx=!0}else typeof navigator=="object"&&!YD?(Wn=navigator.userAgent,Wn.indexOf("Windows")>=0,Wn.indexOf("Macintosh")>=0,(Wn.indexOf("Macintosh")>=0||Wn.indexOf("iPad")>=0||Wn.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Lp=Wn.indexOf("Linux")>=0,Wn?.indexOf("Mobi")>=0,jd=globalThis._VSCODE_NLS_LANGUAGE||Vl,kd=navigator.language.toLowerCase(),Y1=kd):console.error("Unable to resolve platform.");var K1=qx,hn=Wn,Pa=jd,KD;(t=>{function e(){return Pa}t.value=e;function i(){return Pa.length===2?Pa==="en":Pa.length>=3?Pa[0]==="e"&&Pa[1]==="n"&&Pa[2]==="-":!1}t.isDefaultVariant=i;function n(){return Pa==="en"}t.isDefault=n})(KD||={});var GD=typeof Ho.postMessage=="function"&&!Ho.importScripts;(()=>{if(GD){let t=[];Ho.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,a=t.length;n<a;n++){let l=t[n];if(l.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),l.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),Ho.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var XD=!!(hn&&hn.indexOf("Chrome")>=0);hn&&hn.indexOf("Firefox")>=0;!XD&&hn&&hn.indexOf("Safari")>=0;hn&&hn.indexOf("Edg/")>=0;hn&&hn.indexOf("Android")>=0;var Il=typeof navigator=="object"?navigator:{};K1||document.queryCommandSupported&&document.queryCommandSupported("copy")||Il&&Il.clipboard&&Il.clipboard.writeText,K1||Il&&Il.clipboard&&Il.clipboard.readText;var bv=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},Dp=new bv,G1=new bv,X1=new bv;new Array(230);var ZD;(t=>{function e(h){return Dp.keyCodeToStr(h)}t.toString=e;function i(h){return Dp.strToKeyCode(h)}t.fromString=i;function n(h){return G1.keyCodeToStr(h)}t.toUserSettingsUS=n;function a(h){return X1.keyCodeToStr(h)}t.toUserSettingsGeneral=a;function l(h){return G1.strToKeyCode(h)||X1.strToKeyCode(h)}t.fromUserSettings=l;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Dp.keyCodeToStr(h)}t.toElectronAccelerator=u})(ZD||={});var Yx=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),QD;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof JD?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Yn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Yx})})(QD||={});var JD=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Yx:(this._emitter||(this._emitter=new Ht),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},eO;(t=>{async function e(n){let a,l=await Promise.all(n.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return l}t.settled=e;function i(n){return new Promise(async(a,l)=>{try{await n(a,l)}catch(u){l(u)}})}t.withAsyncBody=i})(eO||={});var Z1=class br{static fromArray(e){return new br(i=>{i.emitMany(e)})}static fromPromise(e){return new br(async i=>{i.emitMany(await e)})}static fromPromises(e){return new br(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new br(async i=>{await Promise.all(e.map(async n=>{for await(let a of n)i.emitOne(a)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Ht,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(e(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Yn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new br(async n=>{for await(let a of e)n.emitOne(i(a))})}map(e){return br.map(this,e)}static filter(e,i){return new br(async n=>{for await(let a of e)i(a)&&n.emitOne(a)})}filter(e){return br.filter(this,e)}static coalesce(e){return br.filter(e,i=>!!i)}coalesce(){return br.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return br.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Z1.EMPTY=Z1.fromArray([]);var{getWindow:tO}=(function(){let t=new Map,e={window:Oo,disposables:new Kl};t.set(Oo.vscodeWindowId,e);let i=new Ht,n=new Ht,a=new Ht;function l(u,h){return(typeof u=="number"?t.get(u):void 0)??(h?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(t.has(u.vscodeWindowId))return $r.None;let h=new Kl,f={window:u,disposables:h.add(new Kl)};return t.set(u.vscodeWindowId,f),h.add(ss(()=>{t.delete(u.vscodeWindowId),n.fire(u)})),h.add(Fg(u,sO.BEFORE_UNLOAD,()=>{a.fire(u)})),i.fire(f),h},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return t.has(u)},getWindowById:l,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let f=u;return f?.view?f.view.window:Oo},getDocument(u){return tO(u).document}}})(),iO=class{constructor(t,e,i,n){this._node=t,this._type=e,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Fg(t,e,i,n){return new iO(t,e,i,n)}var sO={BEFORE_UNLOAD:"beforeunload"},rO=class extends $r{constructor(t,e,i,n,a,l,u,h,f){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=n,this._coreService=a,this._decorationService=l,this._optionsService=u,this._themeService=h,this._cursorBlinkStateManager=new du,this._charAtlasDisposable=this._register(new du),this._observerDisposable=this._register(new du),this._model=new PD,this._workCell=new I1,this._workCell2=new I1,this._rectangleRenderer=this._register(new du),this._glyphRenderer=this._register(new du),this._onChangeTextureAtlas=this._register(new Ht),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ht),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ht),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Ht),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Ht),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let d={antialias:!1,depth:!1,preserveDrawingBuffer:f};if(this._gl=this._canvas.getContext("webgl2",d),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new Z3(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new $D(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,u,this._themeService)],this.dimensions=G3(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(u.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Fg(this._canvas,"webglcontextlost",p=>{console.log("webglcontextlost event received"),p.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(p)},3e3)})),this._register(Fg(this._canvas,"webglcontextrestored",p=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,P1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=z1(this._canvas,this._coreBrowserService.window,(p,v)=>this._setCanvasDevicePixelDimensions(p,v)),this._register(this._coreBrowserService.onWindowChange(p=>{this._observerDisposable.value=z1(this._canvas,p,(v,g)=>this._setCanvasDevicePixelDimensions(v,g))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(ss(()=>{for(let p of this._renderLayers)p.dispose();this._canvas.parentElement?.removeChild(this._canvas),P1(this._terminal)}))}get textureAtlas(){return this._charAtlas?.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(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.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`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,i){for(let n of this._renderLayers)n.handleSelectionChanged(this._terminal,t,e,i);this._model.selection.update(this._core,t,e,i),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new UD(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new DD(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=Fx(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._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=xx(Yn.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Yn.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new kD(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,n=this._workCell,a,l,u,h,f,d,p=0,v=!0,g,y,b,C,x,k,R,L,E;t=Q1(t,i.rows-1,0),e=Q1(e,i.rows-1,0);let H=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",U=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,I=U-i.buffer.ydisp,N=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),F=-1,J=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let G=!1;for(l=t;l<=e;l++)for(u=l+i.buffer.ydisp,h=i.buffer.lines.get(u),this._model.lineLengths[l]=0,b=U===u,p=0,f=this._characterJoinerService.getJoinedCharacters(u),L=0;L<i.cols;L++){if(a=this._cellColorResolver.result.bg,h.loadCell(L,n),L===0&&(a=this._cellColorResolver.result.bg),d=!1,v=L>=p,g=L,f.length>0&&L===f[0][0]&&v){y=f.shift();let D=this._model.selection.isCellSelected(this._terminal,y[0],u);for(R=y[0]+1;R<y[1];R++)v&&=D===this._model.selection.isCellSelected(this._terminal,R,u);v&&=!b||N<y[0]||N>=y[1],v?(d=!0,n=new nO(n,h.translateToString(!0,y[0],y[1]),y[1]-y[0]),g=y[1]-1):p=y[1]}if(C=n.getChars(),x=n.getCode(),R=(l*i.cols+L)*mf,this._cellColorResolver.resolve(n,L,u,this.dimensions.device.cell.width),J&&u===U&&(L===N&&(this._model.cursor={x:N,y:I,width:n.getWidth(),style:this._coreBrowserService.isFocused?H:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},F=N+n.getWidth()-1),L>=N&&L<=F&&(this._coreBrowserService.isFocused&&H==="block"||this._coreBrowserService.isFocused===!1&&i.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)),x!==0&&(this._model.lineLengths[l]=L+1),!(this._model.cells[R]===x&&this._model.cells[R+$d]===this._cellColorResolver.result.bg&&this._model.cells[R+Wd]===this._cellColorResolver.result.fg&&this._model.cells[R+Rp]===this._cellColorResolver.result.ext)&&(G=!0,C.length>1&&(x|=ND),this._model.cells[R]=x,this._model.cells[R+$d]=this._cellColorResolver.result.bg,this._model.cells[R+Wd]=this._cellColorResolver.result.fg,this._model.cells[R+Rp]=this._cellColorResolver.result.ext,k=n.getWidth(),this._glyphRenderer.value.updateCell(L,l,x,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,C,k,a),d)){for(n=this._workCell,L++;L<=g;L++)E=(l*i.cols+L)*mf,this._glyphRenderer.value.updateCell(L,l,0,0,0,0,$3,0,0),this._model.cells[E]=0,this._model.cells[E+$d]=this._cellColorResolver.result.bg,this._model.cells[E+Wd]=this._cellColorResolver.result.fg,this._model.cells[E+Rp]=this._cellColorResolver.result.ext;L--}}G&&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(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},nO=class extends jl{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Q1(t,e,i=0){return Math.max(Math.min(t,e),i)}var J1="di$target",ew="di$dependencies",Op=new Map;function dn(t){if(Op.has(t))return Op.get(t);let e=function(i,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");aO(e,i,a)};return e._id=t,Op.set(t,e),e}function aO(t,e,i){e[J1]===e?e[ew].push({id:t,index:i}):(e[ew]=[{id:t,index:i}],e[J1]=e)}dn("BufferService");dn("CoreMouseService");dn("CoreService");dn("CharsetService");dn("InstantiationService");dn("LogService");var oO=dn("OptionsService");dn("OscLinkService");dn("UnicodeService");dn("DecorationService");var lO={trace:0,debug:1,info:2,warn:3,error:4,off:5},cO="xterm.js: ",tw=class extends $r{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=lO[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)typeof t[e]=="function"&&(t[e]=t[e]())}_log(t,e,i){this._evalLazyOptionalParams(i),t.call(console,(this._optionsService.options.logger?"":cO)+e,...i)}trace(t,...e){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,e)}debug(t,...e){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,e)}info(t,...e){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,e)}warn(t,...e){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,e)}error(t,...e){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,e)}};tw=A3([L3(0,oO)],tw);var uO=class extends $r{constructor(t){if(Tx&&F3()<16){let e={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",e))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new Ht),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ht),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ht),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Ht),this.onContextLoss=this._onContextLoss.event}activate(t){let e=t._core;if(!t.element){this._register(e.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let i=e.coreService,n=e.optionsService,a=e,l=a._renderService,u=a._characterJoinerService,h=a._charSizeService,f=a._coreBrowserService,d=a._decorationService;a._logService;let p=a._themeService;this._renderer=this._register(new rO(t,u,h,f,i,d,n,p,this._preserveDrawingBuffer)),this._register(Yn.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Yn.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Yn.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Yn.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),l.setRenderer(this._renderer),this._register(ss(()=>{if(this._terminal._core._store._isDisposed)return;let v=this._terminal._core._renderService;v.setRenderer(this._terminal._core._createRenderer()),v.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};const hO=(t,e,i)=>`${i.location.protocol==="https:"?"wss":"ws"}://${i.location.host}/__tb/ws/terminal/${t}?csrf=${encodeURIComponent(e)}`,dO={background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#09090b",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"},fO=t=>{const e=t.element?.querySelector(".xterm-viewport");if(!e)return 0;const i=e.offsetWidth-e.clientWidth;return i>0?i:0},mO=t=>{if(typeof t!="string")return null;try{return JSON.parse(t)}catch{return null}},_O=(t,e,i,n={})=>{const a=n.createTerminal??(()=>new S3({allowProposedApi:!0,cursorBlink:!0,fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:12,lineHeight:1.2,theme:dO})),l=n.createFitAddon??(()=>new C3),u=n.WebSocketImpl??WebSocket,h=n.windowRef??window,f=h,d=a(),p=l(),v=new M3;let g=null,y=null,b=null,C=null,x=0;const k=6;let R=!1,L=!1,E=null;d.loadAddon(p),d.loadAddon(v),d.open(t),f.__TERMbridgeExposeTerminal&&(f.__TERMbridgeTerminal=d);let H=null,U="connecting";const I=new Set;let N=0,F=null,J=!1;const G=10,D=1e3,O=3e4,P=de=>{if(U!==de){U=de;for(const we of I)we(de)}},$=()=>{const de=D*2**N;return Math.min(de,O)},M=de=>{!L||!H||H.send(JSON.stringify(de))},A=()=>{J||(H=new u(hO(e,i,h)),H.addEventListener("open",()=>{L=!0,N=0,E=null,P("connected"),Y()}),H.addEventListener("message",de=>{const we=mO(de.data);we&&we.type==="output"&&d.write(we.data)}),H.addEventListener("close",()=>{if(L=!1,J){P("disconnected");return}if(N>=G){P("disconnected");return}P("reconnecting");const de=$();N+=1,F=window.setTimeout(()=>{F=null,A()},de)}),H.addEventListener("error",()=>{}))};A();const z=()=>{const de=p.proposeDimensions(),we=t.clientWidth||d.element?.clientWidth||0,Le=t.clientHeight||d.element?.clientHeight||0;if(!de||de.cols<1||de.rows<1||we<1||Le<1){B();return}const tt=fO(d),Ge=we/de.cols,xe=Math.ceil(tt/Ge),Oe=Math.max(1,de.cols-xe),ge=de.rows;E&&E.cols===Oe&&E.rows===ge||(E={cols:Oe,rows:ge},x=0,d.resize(Oe,ge),d.scrollToBottom(),M({type:"resize",cols:Oe,rows:ge}))},q=()=>{if(C!==null&&(clearTimeout(C),C=null),b===null){R=!1;return}R?clearTimeout(b):h.cancelAnimationFrame?.(b),b=null,R=!1},Y=()=>{q();const de=h.requestAnimationFrame;if(typeof de=="function"){R=!1,b=de(()=>{b=null,z()});return}R=!0,b=window.setTimeout(()=>{b=null,R=!1,z()},16)},B=()=>{x>=k||(x+=1,C=window.setTimeout(()=>{C=null,Y()},50))};d.onData(de=>{M({type:"input",data:de})}),h.addEventListener("resize",Y);const X=h.ResizeObserver;if(typeof X=="function"){const de=new X(()=>{Y()});y=de,de.observe(t)}if(typeof h.WebGLRenderingContext<"u")try{g=new uO,g.onContextLoss(()=>{g?.dispose(),g=null}),d.loadAddon(g)}catch{}Y();const ie=h.document?.fonts?.ready;return ie&&ie.then(()=>Y()).catch(()=>{}),{sendControl:de=>{M({type:"control",key:de})},sendInput:de=>{de&&M({type:"input",data:de})},destroy:()=>{if(J=!0,h.removeEventListener("resize",Y),y?.disconnect(),y=null,q(),F!==null&&(clearTimeout(F),F=null),I.clear(),H?.close(),g){try{g.dispose()}catch{}g=null}d.dispose()},getConnectionState:()=>U,onConnectionStateChange:de=>(I.add(de),()=>{I.delete(de)})}};const pO=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),gO=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,i,n)=>n?n.toUpperCase():i.toLowerCase()),iw=t=>{const e=gO(t);return e.charAt(0).toUpperCase()+e.slice(1)},Kx=(...t)=>t.filter((e,i,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===i).join(" ").trim(),vO=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var yO={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const SO=S.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:i=2,absoluteStrokeWidth:n,className:a="",children:l,iconNode:u,...h},f)=>S.createElement("svg",{ref:f,...yO,width:e,height:e,stroke:t,strokeWidth:n?Number(i)*24/Number(e):i,className:Kx("lucide",a),...!l&&!vO(h)&&{"aria-hidden":"true"},...h},[...u.map(([d,p])=>S.createElement(d,p)),...Array.isArray(l)?l:[l]]));const Tr=(t,e)=>{const i=S.forwardRef(({className:n,...a},l)=>S.createElement(SO,{ref:l,iconNode:e,className:Kx(`lucide-${pO(iw(t))}`,`lucide-${t}`,n),...a}));return i.displayName=iw(t),i};const bO=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],wO=Tr("arrow-down",bO);const CO=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xO=Tr("arrow-left",CO);const kO=[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]],EO=Tr("arrow-right-to-line",kO);const TO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],RO=Tr("arrow-right",TO);const MO=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],AO=Tr("arrow-up",MO);const LO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],DO=Tr("check",LO);const OO=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],BO=Tr("command",OO);const NO=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],PO=Tr("corner-down-left",NO);const zO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],IO=Tr("plus",zO);const HO=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],UO=Tr("send",HO);const FO=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$O=Tr("terminal",FO);const WO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jO=Tr("x",WO);let sw,Du,vi=typeof window<"u"&&window.document&&window.document.createElement?S.useLayoutEffect:S.useEffect,ql=t=>(e,i)=>"calc("+e+" + ("+i+" - "+e+") * "+t+")",xs=typeof window<"u"?window.navigator.userAgent:null,Vn="unknown",Kt="unknown";if(typeof window<"u"&&navigator.userAgentData){var Bp;!((Bp=navigator.userAgentData.brands)===null||Bp===void 0)&&Bp.some(t=>t.brand==="Chromium")&&(Vn="chromium"),navigator.userAgentData.platform==="Android"&&(Kt="android")}if(Kt==="unknown"&&xs?.match(/android/i)&&(Kt="android"),Vn==="unknown"&&(xs?.match(/Chrome/i)?Vn="chromium":xs?.match(/Firefox/i)?Vn="gecko":xs?.match(/Safari|iPhone/i)&&(Vn="webkit")),Vn==="webkit"){if(xs?.match(/iPhone/i))Kt="ios";else if(xs?.match(/iPad/i))Kt="ipados";else if(xs?.match(/Macintosh/i))try{document?.createEvent("TouchEvent"),Kt="ipados"}catch{Kt="macos"}}var Gx={};Gx={mapping:{Sheet:{componentName:"a",elementNames:{root:0,view:1,backdrop:2,backdropTrap:3,primaryScrollTrapRoot:4,secondaryScrollTrapRoot:5,scrollContainer:6,frontSpacer:7,backSpacer:8,detentMarker:9,contentWrapper:10,content:11,bleedingBackground:12,stickyContainer:13,sticky:14,leftEdge:15,trigger:16,handle:17,outlet:18},variationSetsNames:{openness:"A",staging:"B",opennessClosedStatus:"C",position:"D",positionCoveredStatus:"E",placement:"F",track:"G",swipeDisabled:"H",swipeOutDisabledWithDetent:"I",swipeOvershootDisabled:"J",bleedDisabled:"K",inertOutside:"L",backdropSwipeable:"M",scrollContainerShouldBePassThrough:"N",swipeTrap:"M"},variationValuesNames:{open:"a",opening:"b",closed:"c",closing:"d",none:"e",top:"f",bottom:"g",left:"h",right:"i",horizontal:"j",vertical:"k",front:"l",covered:"m",true:"o",false:"p",auto:"q",center:"r",pending:"s","flushing-to-preparing-open":"t","flushing-to-preparing-opening":"u","preparing-open":"v","preparing-opening":"x","safe-to-unmount":"y",content:"z",root:"aa","going-down":"ab","going-up":"ac",indeterminate:"ad",idle:"ae","come-back":"af",out:"ag",stepping:"ah",both:"ai",none:"aj"}},ScrollTrap:{componentName:"b",elementNames:{root:0,stabiliser:1},variationSetsNames:{active:"A",axis:"B",automaticallyDisabledForOptimisation:"C"},variationValuesNames:{true:"a",false:"b",horizontal:"e",vertical:"f",both:"g",none:"h"}},Scroll:{componentName:"c",elementNames:{root:0,view:1,scrollContainer:2,content:3,UAScrollbarMeasurer:4,spy:5,startSpacer:6,endSpacer:7},variationSetsNames:{axis:"A",contentPlacement:"B",scrollTrapX:"C",scrollTrapY:"D",scrollGestureOvershoot:"E",scrollDisabled:"F",side:"G",pageScroll:"H",overflowX:"I",overflowY:"J",skipScrollAnimation:"K",scrollAnchoring:"L",scrollSnapType:"M",scrollPadding:"N",scrollTimelineName:"O",nativeScrollbar:"P",scrollOngoing:"Q"},variationValuesNames:{true:"a",false:"b",x:"c",y:"d",both:"e",unset:"f",contain:"g",start:"h",end:"i",center:"j",auto:"k",default:"l",none:"m",mandatoryX:"n",mandatoryY:"o",proximityX:"p",proximityY:"q"}},SlideShow:{componentName:"d",elementNames:{},variationSetsNames:{},variationValuesNames:{}},VisuallyHidden:{componentName:"e",elementNames:{root:0},variationSetsNames:{},variationValuesNames:{}},SpecialWrapper:{componentName:"f",elementNames:{root:0,content:1},variationSetsNames:{},variationValuesNames:{}},Fixed:{componentName:"g",elementNames:{root:0},variationSetsNames:{},variationValuesNames:{}},SheetStack:{componentName:"h",elementNames:{root:0,outlet:1},variationSetsNames:{},variationValuesNames:{}},AutoFocusTarget:{componentName:"i",elementNames:{root:0},variationSetsNames:{},variationValuesNames:{}}}};let Af=Gx.mapping,VO=t=>{var e;return(e=Af[t].componentName)!==null&&e!==void 0?e:null},qO=(t,e)=>{var i;return(i=Af[t].elementNames[e])!==null&&i!==void 0?i:null},YO=(t,e)=>{var i;return(i=Af[t].variationSetsNames[e])!==null&&i!==void 0?i:null},KO=(t,e)=>{var i;return(i=Af[t].variationValuesNames[e])!==null&&i!==void 0?i:null},Ui=(t,e)=>S.useCallback((i,n=[],a)=>{var l,u;let h,f,d=(u=a==null||(l=a.dataSilk)===null||l===void 0?void 0:l.filter(Boolean).join(" "))!==null&&u!==void 0?u:"";{let p=VO(t);if(h=p+qO(t,i),e)for(let v=0;v<n.length;v++){let g=n[v],y=e[g],b=YO(t,g),C=KO(t,y);h+=y!=null?" "+p+b+C:""}f={className:a?.className,"data-silk":h+" "+d}}return f},[t,...e?Object.values(e):[]]),pu=new WeakMap;var GO=typeof Float32Array=="function";function Ed(t,e,i){return(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t}function rw(t,e,i){return 3*(1-3*i+3*e)*t*t+2*(3*i-6*e)*t+3*e}function XO(t){return t}var ZO=function(t,e,i,n){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw Error("bezier x values must be in [0, 1] range");if(t===e&&i===n)return XO;for(var a=GO?new Float32Array(11):Array(11),l=0;l<11;++l)a[l]=Ed(.1*l,t,i);return function(u){return u===0||u===1?u:Ed((function(h){for(var f=0,d=1;d!==10&&a[d]<=h;++d)f+=.1;var p=f+(h-a[--d])/(a[d+1]-a[d])*.1,v=rw(p,t,i);return v>=.001?(function(g,y,b,C){for(var x=0;x<4;++x){var k=rw(y,b,C);if(k===0)break;var R=Ed(y,b,C)-g;y-=R/k}return y})(h,p,t,i):v===0?p:(function(g,y,b,C,x){var k,R,L=0;do(k=Ed(R=y+(b-y)/2,C,x)-g)>0?b=R:y=R;while(Math.abs(k)>1e-7&&++L<10);return R})(h,f,f+.1,t,i)})(u),e,n)}};let _f=t=>typeof t=="string"?document.querySelector(t):t?.(),Xx=(t,e)=>Array.isArray(t)?t.includes(e):t===e,$g=t=>t?.getAttribute("data-silk-clone")==="true",QO=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),Bo=t=>t instanceof HTMLInputElement&&!QO.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable,nw=t=>t instanceof HTMLInputElement&&t.type==="color"||t instanceof HTMLSelectElement,wv=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,pf=()=>{var t;return window.innerHeight-200>((t=window.visualViewport)===null||t===void 0?void 0:t.height)};function ln({nativeEvent:t,defaultBehavior:e,handler:i}){let n=e;if(i)if(typeof i=="function"){let a={...e,nativeEvent:t,changeDefault:function(l){n={...e,...l},Object.assign(this,l)}};a.changeDefault=a.changeDefault.bind(a),i(a)}else n={...e,...i};return n}function Zx(t){return(t.startsWith("rgb(")||t.startsWith("rgba("))&&t.endsWith(")")?t.substring(t.indexOf("(")+1,t.indexOf(")")).split(",").map(n=>n.trim()).slice(0,3).map(n=>parseFloat(n)):null}let aw=t=>{let e=null;return t.startsWith("rgb(")||t.startsWith("rgba(")?e=Zx(t):t.startsWith("#")&&(e=(function(i){let n=i.replace(/^#/,""),a=n.length===3?n.split("").map(f=>f+f).join(""):n;if(!/^[0-9A-Fa-f]{6}$/.test(a))return null;let l=parseInt(a.slice(0,2),16),u=parseInt(a.slice(2,4),16),h=parseInt(a.slice(4,6),16);return[l,u,h]})(t)),e},JO=({color:t,overlays:e})=>{let i=[...t],n=e.length;for(let a=0;a<n;a++){let l=e[a],u=l.alpha;for(let h=0;h<3;h++)i[h]=(1-u)*i[h]+u*l.color[h]}return"rgb("+i.join(",")+")"},eB=t=>{S.useEffect(()=>{let e=()=>{pf()?t(!0):t(!1)};return e(),visualViewport.addEventListener("resize",e),()=>{visualViewport.removeEventListener("resize",e)}},[t])},tB=t=>t.matches('[data-silk~="0ad"]:not([data-silk~="0ai"]) *, [data-silk~="0ab"] *'),Qx=t=>{let[e,i]=S.useState(!1),n=S.useCallback(a=>{t.current&&i(!!a&&!tB(t.current))},[t]);return eB(n),e},Jx=()=>Kt==="android"&&Vn==="chromium"&&typeof window<"u"&&!window.matchMedia("(display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen)").matches,iB=()=>{var t,e,i;return typeof window<"u"&&window.navigator.standalone&&((t=document.querySelector("meta[name='viewport']"))===null||t===void 0?void 0:t.content.includes("viewport-fit=cover"))&&((e=document.querySelector("meta[name='apple-mobile-web-app-capable']"))===null||e===void 0?void 0:e.content)==="yes"&&((i=document.querySelector("meta[name='apple-mobile-web-app-status-bar-style']"))===null||i===void 0?void 0:i.content)==="black-translucent"},qa=()=>Vn==="webkit",sB=()=>typeof document<"u"?document.querySelector('meta[name="theme-color"]'):null,Gu=({genericContext:t,customContext:e,value:i,children:n})=>e?j.jsx(e.Provider,{value:i,children:j.jsx(t.Provider,{value:i,children:n})}):j.jsx(t.Provider,{value:i,children:n});Gu.displayName="CustomisableContext";function Wg(t){for(let e=0;e<t.length;e++)if(!t[e].matches('[data-silk~="0ad"]'))return t[e];return t[0]}let e5=(t,e)=>{var i;let{safelyFocusableElements:n,safelyTabbableElements:a}=Lf(e,["[data-silk~='0ac']"]),l=qe.autoFocusTargets.filter(v=>v.layerId==="any"||v.layerId===t),u=l.filter(v=>Xx(v.timing,"present")),h=n.filter(v=>u.map(g=>g.element).includes(v)),f=Wg(h),d=Wg(a);((i=f??d)!==null&&i!==void 0?i:e).focus({preventScroll:!0})},ow=(t,e,i)=>{let{focus:n}=ln({nativeEvent:null,defaultBehavior:{focus:!0},handler:i});n&&e5(t,e)},rB=(t,e,i,n)=>{if(!e.contains(document.activeElement)&&document.contains(document.activeElement))return;let{focus:a}=ln({nativeEvent:null,defaultBehavior:{focus:!0},handler:i});if(a){var l;let u=qe.autoFocusTargets.filter(g=>g.layerId==="any"||g.layerId===t),h=u.filter(g=>Xx(g.timing,"dismiss")&&!e.contains(g.element)),{safelyFocusableElements:f}=Lf(document.body),d=f.filter(g=>h.map(y=>y.element).includes(g)),p=Wg(d);((l=p??n)!==null&&l!==void 0?l:document.body).focus({preventScroll:!0})}},lw=t=>{t.parentNode!=null&&t.parentNode.removeChild(t)},cw=()=>{let t=document.createElement("div");return t.tabIndex=0,t.style.position="fixed",t.setAttribute("aria-hidden","true"),t.setAttribute("data-silk","0aa"),t},nB=t=>{let e=cw(),i=cw();return t.insertAdjacentElement("beforebegin",e),t.insertAdjacentElement("afterend",i),()=>{lw(e),lw(i)}},aB=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),Lf=(t,e=[])=>{let i=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]","[tabindex]:not([disabled])",...e],n=i.join(","),a=t?[...t.matches(n)?[t]:[],...t.querySelectorAll(n)]:[],l=[...e,"[aria-hidden='true']","[aria-hidden='true'] *","[inert]","[inert] *"],u=a.map(g=>({element:g,tabbable:g.matches(':not([hidden]):not([tabindex^="-"])'),skippable:g.matches(l.join(","))||!aB(g)})),h=u.filter(g=>!g.skippable),f=h.map(g=>g.element),d=u.filter(g=>g.tabbable),p=d.filter(g=>!g.skippable),v=p.map(g=>g.element);return{allFocusableElementsWithData:u,safelyFocusableElements:f,allTabbableElementsWithData:d,safelyTabbableElements:v}},t5=(t,e)=>{let{safelyTabbableElements:i,allTabbableElementsWithData:n,allFocusableElementsWithData:a}=Lf(t,["[data-silk~='0ac']"]),l=[...n],u=[...a];return e&&[l,u].forEach(h=>{h.unshift({element:t.previousElementSibling,tabbable:!0,skippable:!0}),h.push({element:t.nextElementSibling,tabbable:!0,skippable:!0})}),{safelyTabbableElements:i,allTabbableElementsWithGuardsWithData:l,allFocusableElementsWithGuardsWithData:u}},oB=(t,e)=>{let i;return(i=e.slice(0,t).reverse().find(n=>n.skippable===!1))||(i=e.slice(t+1-e.length).reverse().find(n=>n.skippable===!1)),i},uw=(t,e)=>{let i;return(i=e.slice(t+1).find(n=>n.skippable===!1))||(i=e.slice(0,t).find(n=>n.skippable===!1)),i},lB=({rootElements:t,e,fromElement:i,toElement:n,fallbackElement:a})=>{if(!n)return;let l=[],u=[],h=[];t.forEach(x=>{let{safelyTabbableElements:k,allTabbableElementsWithGuardsWithData:R,allFocusableElementsWithGuardsWithData:L}=t5(x,!0);l=[...l,...k],u=[...u,...R],h=[...h,...L]});let f=u.findIndex(x=>x.element===i),d=u.findIndex(x=>x.element===n),p=u[d],v=h.findIndex(x=>x.element===n),g=!!n&&t.includes(n)&&n.getAttribute("tabindex")==="-1";if(v===-1&&!g){let x=t.find(k=>k.getAttribute("tabindex")==="-1");x?.focus()}if(p?.skippable){var y,b,C;l.length?l.length===1?i===l[0]?(e.preventDefault(),e.stopPropagation(),requestAnimationFrame(()=>i.focus())):l[0].focus():f?d<f?(b=oB(d,u))===null||b===void 0||b.element.focus():(C=uw(d,u))===null||C===void 0||C.element.focus():(y=uw(d,u))===null||y===void 0||y.element.focus():a?.focus()}},i5=(t,e,i,n,a)=>{var l;if(!((l=t.target)===null||l===void 0)&&l.matches("[data-silk-clone]"))return;let u=[],h=[];i.forEach(f=>{let{safelyFocusableElements:d,safelyTabbableElements:p}=Lf(f);u=[...u,...d],h=[...h,...p]}),i.includes(t.target)||u.includes(t.target)?t.target&&a(t.target):n?n.focus():h.length?h[0].focus():e.focus()},cB=(t,e)=>{var i;if(!((i=t.relatedTarget)===null||i===void 0)&&i.matches("[data-silk-clone]"))return;let n=Vd??t.target,a=Gl??t.relatedTarget;lB({rootElements:e,e:t,fromElement:n,toElement:a}),Vd=null,Gl=null},uB=(t,e,i,n,a)=>{let l=i.find(u=>u.contains(t.target));t.key!=="Tab"||l||(t.preventDefault(),t.stopPropagation(),i5(t,e,i,n,a))},Vd=null,Gl=null,hB=({rootElements:t,viewElement:e,elementFocusedLast:i,setElementFocusedLast:n})=>{let a=[];t.forEach(d=>{a.push(nB(d))});let l=(function(d,p=document){let v=new Set(d),g=new Set,y=document.createTreeWalker(p,NodeFilter.SHOW_ELEMENT,{acceptNode:k=>(k instanceof HTMLElement&&k.dataset.liveAnnouncer==="true"&&v.add(k),k.tagName==="HEAD"||k.tagName==="SCRIPT"||v.has(k)||k.parentElement&&g.has(k.parentElement)?NodeFilter.FILTER_REJECT:k instanceof HTMLElement&&k.getAttribute("role")==="row"||d.some(R=>k.contains(R))?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT)}),b=k=>{var R;let L=(R=pu.get(k))!==null&&R!==void 0?R:0;(k.getAttribute("aria-hidden")!=="true"||L!==0)&&(L===0&&k.setAttribute("aria-hidden","true"),g.add(k),pu.set(k,L+1))},C=y.nextNode();for(;C!=null;)b(C),C=y.nextNode();let x=new MutationObserver(k=>{for(let R of k)if(R.type==="childList"&&R.addedNodes.length!==0&&![...v,...g].some(L=>L.contains(R.target)))for(let L of R.addedNodes)L instanceof HTMLElement&&L.dataset.liveAnnouncer==="true"?v.add(L):L instanceof Element&&b(L)});return x.observe(p,{childList:!0,subtree:!0}),()=>{for(let k of(x.disconnect(),g)){let R=pu.get(k);R===1?(k.removeAttribute("aria-hidden"),pu.delete(k)):R!==void 0&&pu.set(k,R-1)}}})(t,document),u=d=>cB(d,t),h=d=>i5(d,e,t,i,n),f=d=>uB(d,e,t,i,n);return document.addEventListener("keydown",f),document.addEventListener("focusout",u),document.addEventListener("focusin",h),()=>{document.removeEventListener("focusout",u),document.removeEventListener("focusin",h),document.removeEventListener("keydown",f),l(),a.forEach(d=>d())}},Df=new Set,dB=t=>{Df.add(t)},fB=t=>{Df.delete(t)},s5=(t,e,i,n)=>{let a=t[e],l=a.onClickOutside,u=a.dismissOverlayIfNotAlertDialog,h=a.viewElement,f=a.scrollContainerElement,d=a.backdropElement;if(f===n.target||d===n.target||!h?.contains(n.target)&&!i.find(p=>p.element.contains(n.target))&&(function(p){for(let v of qe.automaticLayerElements)if(v.contains(p))return!1;return!0})(n.target)){let p=!0,v=!0;if(l){let{dismiss:g,stopOverlayPropagation:y}=ln({nativeEvent:n,defaultBehavior:{dismiss:!0,stopOverlayPropagation:!0},handler:l});p=g,v=y}p&&u&&u(),e>0&&!v&&s5(t,e-1,i,n)}},jg=null,mB=(t,e,i)=>{var n;if(Df.size||!((n=t.target)===null||n===void 0)&&n.matches('[data-silk~="0ak"] *')||t.target===document.body&&jg!==document.body||!t.target||!t.target.isConnected)return;let a=e.length;s5(e,a-1,i,t),jg=null},_B=(t,e)=>{let i=a=>jg=a.target,n=a=>mB(a,t,e);return document.addEventListener("pointerdown",i,{capture:!0}),document.addEventListener("click",n,{capture:!0}),()=>{document.removeEventListener("pointerdown",i,{capture:!0}),document.removeEventListener("click",n,{capture:!0})}},r5=(t,e,i)=>{let n=t[e],a=n.onEscapeKeyDown,l=n.dismissOverlayIfNotAlertDialog,u=!0,h=!0,f=!0;if(a){let{dismiss:d,nativePreventDefault:p,stopOverlayPropagation:v}=ln({nativeEvent:i,defaultBehavior:{nativePreventDefault:!0,dismiss:!0,stopOverlayPropagation:!0},handler:a});u=p,h=d,f=v}u&&i.preventDefault(),h&&l&&l(),e>0&&!f&&r5(t,e-1,i)},pB=(t,e)=>{if(t.key!=="Escape"||Df.size)return;let i=e.length;r5(e,i-1,t)},gB=t=>{let e=i=>pB(i,t);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},vB=t=>(t.setAttribute("aria-hidden","true"),()=>t.removeAttribute("aria-hidden")),yB=t=>{let{allTabbableElementsWithGuardsWithData:e}=t5(t);e.forEach(i=>{i.element.tabIndex=-1})},SB=t=>{var e;return t instanceof HTMLInputElement&&(!!(t.type==="password"||t.type==="text"&&t.autocomplete==="username"||!((e=t.closest("form"))===null||e===void 0)&&e.querySelector('input[type="password"]'))||void 0)},bB=t=>{var e,i;let n=t.getBoundingClientRect(),a=n.height,l=(i=(e=window.visualViewport)===null||e===void 0?void 0:e.height)!==null&&i!==void 0?i:0,u=l-n.bottom;return u>-a/2&&u<a+32},Np=t=>{var e;return(e=t?.closest('[data-silk~="0ab"], [data-silk~="0ad"]'))===null||e===void 0?void 0:e.matches('[data-silk~="0ah"]')},wB=()=>{let t=a=>{let l=a.target;if(Np(l)){var u;(u=l?.closest('[data-silk~="0ah"]'))===null||u===void 0||u.focus({preventScroll:!0}),document.removeEventListener("touchstart",t,{capture:!0})}},e=a=>{let l=a.target,u=a.relatedTarget;if(!u)return document.addEventListener("touchstart",t,{capture:!0,passive:!1});if(Np(u)&&(nw(u)&&document.addEventListener("touchstart",t,{capture:!0,passive:!1}),!(!Bo(u)&&!nw(u)||$g(l))))if(!SB(u)&&Bo(l)&&bB(l)){let h=l.cloneNode(!1);h.removeAttribute("id"),h.setAttribute("data-silk-clone","true"),h.style.setProperty("position","fixed"),h.style.setProperty("left","0"),h.style.setProperty("top","0"),h.style.setProperty("transform","translateY(-3000px) scale(0)"),document.documentElement.appendChild(h),Gl=u,h?.focus({preventScroll:!0}),setTimeout(()=>{Vd=l,Gl=u,u?.focus({preventScroll:!0}),h.remove()},32)}else Gl=u,u?.focus({preventScroll:!0})},i=a=>{var l;let u=a.target;!(u!==document.activeElement||!Bo(u)||pf())&&Np(u)&&((l=u?.closest('[data-silk~="0ab"], [data-silk~="0ad"]'))===null||l===void 0||l.focus({preventScroll:!0}))},n=a=>{var l;let u=a.target;if(!u||!("setSelectionRange"in u)||!(["password","search","tel","text","url"].includes(u.type)||u instanceof HTMLTextAreaElement)||u._silk_focusedBefore===!0)return;let h=u.value.length;(l=u.setSelectionRange)===null||l===void 0||l.call(u,h,h),u._silk_focusedBefore=!0};return document.addEventListener("blur",e,{capture:!0,passive:!1}),document.addEventListener("touchstart",t,{capture:!0,passive:!0}),document.addEventListener("touchend",i,{capture:!0,passive:!0}),document.addEventListener("focusin",n),()=>{document.removeEventListener("blur",e,{capture:!0}),document.removeEventListener("touchend",i,{capture:!0}),document.removeEventListener("touchstart",t,{capture:!0}),document.removeEventListener("focusin",n)}},n5=["translate","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],a5=null,o5=t=>{a5=t},CB={sheets:[],addSheet:function(t){let e;if(!t.id)return;let i=this.findSheet(t.id);return i?(t.stackId&&(i.stackId=t.stackId),t.sendToOpennessMachine&&(i.sendToOpennessMachine=t.sendToOpennessMachine),e=i):(e={stackingIndex:-1,travelAnimations:[],aggregatedTravelCallback:function(n,a){let l=this.travelAnimations;for(let u=0,h=l.length;u<h;u++)l[u].callback(n,a)},stackingAnimations:[],aggregatedStackingCallback:function(n,a){let l=this.stackingAnimations;for(let u=0,h=l.length;u<h;u++)l[u].callback(n,a)},belowSheetsInStack:[],outlets:new Set,...t},this.sheets.push(e)),this.updateBelowSheetsInStackOfAllSheets(),e},attemptToRemoveSheet:function(t,e){let i=this.findSheet(t);if(i)if(i.outlets.size===0){var n;let a=(n=this.findSheet(t))===null||n===void 0?void 0:n.stackId;this.sheets=this.sheets.filter(l=>l.id!==t),a&&this.updateSelfAndAboveTravelProgressSumInStack(a)}else e&&e(i)},attemptToRemoveSheetOrCleanup:function(t){this.attemptToRemoveSheet(t,e=>{e.sendToOpennessMachine=null})},findSheet:function(t){return this.sheets.find(e=>e.id===t)},addOutletToSheet:function(t,e){let i=this.findSheet(t);i?i.outlets.add(e):this.addSheet({id:t,outlets:new Set([e])})},removeOutletFromSheet:function(t,e){let i=this.findSheet(t);i?.outlets.delete(e),this.attemptToRemoveSheet(t)},sheetStacks:[],addSheetStack:function(t){let e;return this.findSheetStack(t.id)||(e={stackingAnimations:[],aggregatedStackingCallback:function(n,a){let l=this.stackingAnimations;for(let u=0,h=l.length;u<h;u++)l[u].callback(n,a)},...t},this.sheetStacks.push(e)),this.updateBelowSheetsInStackOfAllSheets(),e},removeSheetStack:function(t){t&&(this.sheetStacks=this.sheetStacks.filter(e=>e.id!==t),this.removeAllOutletPersistedStylesFromStack(t))},findSheetStack:function(t){return this.sheetStacks.find(e=>e.id===t)},updateBelowSheetsInStackOfAllSheets:function(){this.sheets.forEach(t=>{let e,i=t.stackId;if(i){e=this.findSheetStack(i);let n=this.sheets.filter(l=>l.stackId===t.stackId),a=n.filter(l=>l.stackId===t.stackId&&l.stackingIndex>t.stackingIndex);e&&(a.unshift(e),e.stackingIndex=n.length-1),t.belowSheetsInStack=a,this.updateSelfAndAboveTravelProgressSumInStack(i)}})},updateSheetStackingIndex:function(t,e){let i=this.findSheet(t);i&&(i.stackingIndex=e),this.updateBelowSheetsInStackOfAllSheets()},updateSheetTravelProgress:function(t,e){let i=this.findSheet(t);i&&i.stackId&&(i.travelProgress=e,this.updateSelfAndAboveTravelProgressSumInStack(i.stackId))},updateSelfAndAboveTravelProgressSumInStack:function(t){let e=this.sheets.filter(a=>a.stackId===t).sort((a,l)=>l.stackingIndex-a.stackingIndex),i=this.findSheetStack(t);i&&e.unshift(i);let n=e.length;for(let a=0;a<n;a++){let l=e[a];l.selfAndAboveTravelProgressSum=[];for(let u=0;u<n;u++)u<=a?l.selfAndAboveTravelProgressSum[u]=0:l.selfAndAboveTravelProgressSum[u]=e.slice(a+1,u+1).reduce((h,f)=>h+f.travelProgress,0)}},addAnimationToSheetOrStack:function({type:t,sheetId:e,stackId:i,element:n,config:a}){let l=a.hasOwnProperty("properties")?a.properties:a,u=[];Object.entries(l).forEach(([v,g])=>{if(g!=="ignore"&&g&&typeof g!="string")if(typeof g=="function")if(n5.includes(v)){let y=u.findIndex(C=>C[0]==="transform"),b=C=>v+"("+g(C)+")";if(y!==-1){let C=u[y][1];u[y][1]=x=>C(x)+" "+b(x)}else u.push(["transform",b])}else if(v==="transform"){let y=u.findIndex(b=>b[0]==="transform");if(y!==-1){let b=u[y][1];u[y][1]=C=>b(C)+" "+g(C)}else u.push(["transform",g])}else u.push([v,g]);else if(v==="opacity"){let y=["opacity",({tween:b})=>b(g[0],g[1])];u.push(y)}else{if(!v.startsWith("scale")&&(!isNaN(g[0])||!isNaN(g[1])))throw Error("Keyframe values used with a 'transform' property require a unit (e.g. 'px', 'em' or '%').");let y=u.findIndex(C=>C[0]==="transform"),b=({tween:C})=>v+"("+C(g[0],g[1])+")";if(y!==-1){let C=u[y][1];u[y][1]=x=>C(x)+" "+b(x)}else u.push(["transform",b])}});let h=u.map(v=>[(v[0].startsWith("webkit")||v[0].startsWith("moz")?"-":"")+v[0].replace(/[A-Z]/g,"-$&").toLowerCase(),v[1]]),f=h.length,d={target:n,config:u,dashedPropertiesAsArray:h,callback:(v,g)=>{for(let y=0;y<f;y++){let[b,C]=h[y];n.style.setProperty(b,C({progress:v,tween:g}))}}},p=i?this.findSheetStack(i):this.findSheet(e);p&&(t==="travel"?p.travelAnimations.push(d):p.stackingAnimations.push(d))},removeAnimationFromSheetOrStack:function({sheetId:t,stackId:e,type:i,element:n}){let a=e?this.findSheetStack(e):this.findSheet(t);if(a)if(i==="travel"){let l=a.travelAnimations.filter(u=>u.target!==n);a.travelAnimations=l}else{let l=a.stackingAnimations.filter(u=>u.target!==n);a.stackingAnimations=l}},removeAllOutletPersistedStylesFromSheet:function(t){let e=this.findSheet(t);e&&[...e.travelAnimations,...e.stackingAnimations].forEach(i=>{i.dashedPropertiesAsArray.forEach(([n])=>{i.target.style.removeProperty(n)})})},removeAllOutletPersistedStylesFromStack:function(t){let e=this.findSheetStack(t);e&&e.stackingAnimations.forEach(i=>{i.dashedPropertiesAsArray.forEach(([n])=>{i.target.style.removeProperty(n)})})},getAggregatedStackingCallbackForSheetsBelow:function(t){let e,i=this.findSheet(t);return i&&(e=n=>{let a=i.belowSheetsInStack,l=a.length;for(let u=0;u<l;u++){let h=a[u],f=h.selfAndAboveTravelProgressSum[l-1]+n,d=ql(f);h.aggregatedStackingCallback(f,d)}}),e},automaticIslandElements:new Set([]),automaticLayerElements:new Set([]),automaticLayerAndIslandDetectionCleanup:null,focusContainmentRootElements:[],focusContainmentCleanup:()=>{},escapeKeyDownListenerCleanup:null,clickOutsideListenerCleanup:null,processLayersAndIslandsChangesTimeout:null,setupAutomaticLayerAndIslandDetection:function(t){let e=document.documentElement,i=document.body,n=()=>{let l,u=new Set([]),h=new Set([]),f=(function(x){let k=x.parentElement;for(;k&&k!==document.body;){if(k.parentElement===document.body)return k;k=k.parentElement}return x.parentElement===document.body?x:null})(t);l=f?f.nextElementSibling:i.firstElementChild;let d=x=>x.matches('[data-silk~="0ag"], [data-silk~="0ab"], [data-silk~="0aa"], [data-silk-clone]'),p=x=>x.tagName!=="SCRIPT";for(;l;)!d(l)&&p(l)&&u.add(l),l=l.nextElementSibling;let v=e.children;for(let x=0;x<v.length;x++){let k=v[x];k.tagName==="HEAD"||k.tagName==="BODY"||d(k)||h.add(k)}let g=new Set([...u].filter(x=>!this.automaticLayerElements.has(x))),y=new Set([...this.automaticLayerElements].filter(x=>!u.has(x)));this.automaticLayerElements=u;let b=new Set([...h].filter(x=>!this.automaticIslandElements.has(x))),C=new Set([...this.automaticIslandElements].filter(x=>!h.has(x)));this.automaticIslandElements=h,g.forEach(x=>{this.updateLayer({automatic:!0,layerId:null,viewElement:x,inertOutside:!1,onPresentAutoFocus:{focus:!1},onDismissAutoFocus:{focus:!1},dismissOverlayIfNotAlertDialog:()=>{},onClickOutside:{stopOverlayPropagation:!1},onEscapeKeyDown:{stopOverlayPropagation:!1}})}),y.forEach(x=>this.removeLayer(null,x)),b.forEach(x=>this.addIsland({element:x,automatic:!0})),C.forEach(x=>this.removeIsland(null,x))};n();let a=new MutationObserver(()=>{n()});a.observe(e,{childList:!0}),a.observe(i,{childList:!0}),this.automaticLayerAndIslandDetectionCleanup=function(){a.disconnect(),this.layers.forEach(l=>{l.automatic&&this.removeLayer(null,l.viewElement)}),this.automaticLayerElements=new Set([]),this.islands.forEach(l=>{l.automatic&&this.removeIsland(null,l.element)}),this.automaticIslandElements=new Set([]),this.automaticLayerAndIslandDetectionCleanup=null}},moveFocusIfNecessary:function(t,e,i,n,a,l){let u=!1;for(let h=0;h<e.length;h++)if(e[h].contains(document.activeElement)){u=!0;break}if(i.length){let h=i.filter(f=>!f.automatic&&!f.external);if(h.length){let f=h[h.length-1];return ow(f.layerId,f.viewElement,f.onPresentAutoFocus)}}if(a.length&&!u){let h=t[t.length-1];if(!h.external)return ow(h.layerId,h.viewElement,h.onPresentAutoFocus)}if(n.length&&n.find(f=>f.focusWasInside)){let f=n[0];if(!f.external)return rB(f.layerId,f.viewElement,f.onDismissAutoFocus,f.elementFocusedLastBeforeShowing)}if(l.length&&l.find(f=>f.focusWasInside)){let f=t[t.length-1];if(f)return e5(f.layerId,f.viewElement)}},processLayersAndIslandsChanges:function(){var t;clearTimeout(this.processLayersAndIslandsChangesTimeout);let e=()=>{let n=this.layers.length,a=new Set([]),l;if(this.layers.some(v=>v.inertOutside)){this.islands.filter(g=>!g.componentId||g.componentId.length===0).forEach(g=>a.add(g.element));for(let g=n-1;g>=0;g--){let y=this.layers[g];if(y.external&&y.inertOutside){a=new Set([]);break}a.add(y.viewElement);let b=this.islands.filter(x=>x.componentId&&y.layerContextId&&x.componentId.includes(y.layerContextId)),C=this.islands.filter(x=>x.componentId&&y.layerStackContextId&&x.componentId.includes(y.layerStackContextId));if([...b,...C].forEach(x=>{a.add(x.element)}),y.inertOutside){l=y;break}l=y}}let h=[...a],f=!(function(v,g){if(v.length!==g.length)return!1;let y=new Set;for(let b of v)y.add(b);for(let b of g)if(!y.has(b))return!1;return!0})(this.focusContainmentRootElements,h);if(this.focusContainmentRootElements=h,f){var d;this.focusContainmentCleanup(),this.focusContainmentCleanup=()=>{},(d=this.automaticLayerAndIslandDetectionCleanup)===null||d===void 0||d.call(this),l&&(this.setupAutomaticLayerAndIslandDetection(l?.viewElement),this.focusContainmentCleanup=hB({rootElements:this.focusContainmentRootElements,viewElement:l?.viewElement,elementFocusedLast:a5,setElementFocusedLast:o5}))}this.moveFocusIfNecessary(this.layers,this.focusContainmentRootElements,this.layersJustAdded,this.layersJustRemoved,this.layersJustWentToInertOutsideTrue,this.islandsJustRemoved),this.escapeKeyDownListenerCleanup&&(this.escapeKeyDownListenerCleanup(),this.escapeKeyDownListenerCleanup=null),this.clickOutsideListenerCleanup&&(this.clickOutsideListenerCleanup(),this.clickOutsideListenerCleanup=null),n>0&&(this.escapeKeyDownListenerCleanup=gB(this.layers),this.clickOutsideListenerCleanup=_B(this.layers,this.islands));let p=this.layersJustRemoved.length;if(p)for(let v=0;v<p;v++){let g=this.layersJustRemoved[v],y=g.viewElement,b=g.automatic;y&&!b&&(vB(y),yB(y))}this.islandsJustRemoved=[],this.layersJustAdded=[],this.layersJustRemoved=[],this.layersJustWentToInertOutsideTrue=[]};((t=this.layersJustAdded[this.layersJustAdded.length-1])===null||t===void 0?void 0:t.external)?e():this.processLayersAndIslandsChangesTimeout=setTimeout(e,16)},autoFocusTargets:[],addAutoFocusTarget:function({layerId:t,element:e,timing:i}){this.autoFocusTargets.push({layerId:t,element:e,timing:i})},removeAutoFocusTarget:function(t){this.autoFocusTargets=this.autoFocusTargets.filter(e=>e.element!==t)},islands:[],islandsJustRemoved:[],addIsland:function(t){var e;let i=this.islands[this.islands.length-1],n=((e=t.id)!==null&&e!==void 0?e:i)?i.id+1:0;return this.islands.push({...t,id:n}),this.processLayersAndIslandsChanges(),n},removeIsland:function(t,e){this.islands=this.islands.filter(i=>{if(t&&i.id&&i.id!==t||e&&i.element&&i.element!==e)return!0;{let n=i.element.contains(document.activeElement);return this.islandsJustRemoved.push({...i,focusWasInside:n}),!1}}),this.processLayersAndIslandsChanges()},layers:[],layersJustAdded:[],layersJustRemoved:[],layersJustWentToInertOutsideTrue:[],updateLayer:function(t){let e=t.layerId,i=t.viewElement,n=!1,a=this.layers;for(let u=0;u<a.length;u++){let h=a[u];if(e!==null?h.layerId===e:h.viewElement===i){let d={...h,...t};!h.inertOutside&&t.inertOutside&&this.layersJustWentToInertOutsideTrue.push(d),a[u]=d,n=!0;break}}if(!n){var l;let u={...t,elementFocusedLastBeforeShowing:(l=t.elementFocusedLastBeforeShowing)!==null&&l!==void 0?l:document.activeElement};a.push(u),this.layersJustAdded.push(u)}this.processLayersAndIslandsChanges()},removeLayer:function(t,e){var i;this.layers=this.layers.filter(n=>{if(t&&n.layerId&&n.layerId!==t||e&&n.viewElement&&n.viewElement!==e)return!0;{var a;let l=(a=n.viewElement)===null||a===void 0?void 0:a.contains(document.activeElement);return this.layersJustRemoved.push({...n,focusWasInside:l}),!1}}),this.layers.filter(n=>!n.automatic).length===0&&((i=this.automaticLayerAndIslandDetectionCleanup)===null||i===void 0||i.call(this)),this.processLayersAndIslandsChanges()},nativeFocusScrollPreventers:[],nativeFocusScrollPreventionCleanup:null,addNativeFocusScrollPreventer:function(t){this.nativeFocusScrollPreventers.push({id:t}),this.processNativeFocusScrollPreventersChanges()},removeNativeFocusScrollPreventer:function(t){this.nativeFocusScrollPreventers=this.nativeFocusScrollPreventers.filter(e=>e.id!==t),this.processNativeFocusScrollPreventersChanges()},processNativeFocusScrollPreventersChanges:function(){let t=this.nativeFocusScrollPreventers.length;if(qa()&&(Kt==="ios"||Kt==="ipados"))if(t)this.nativeFocusScrollPreventionCleanup||(this.nativeFocusScrollPreventionCleanup=wB());else{var e;(e=this.nativeFocusScrollPreventionCleanup)===null||e===void 0||e.call(this),this.nativeFocusScrollPreventionCleanup=null}},fixedComponents:[],addFixedComponent:function(t){this.fixedComponents.push(t)},updateFixedComponent:function(t){let e=this.fixedComponents.find(i=>i.id===t.id);e&&(t.element&&(e.element=t.element),t.initialInlineCSSTransform&&(e.initialInlineCSSTransform=t.initialInlineCSSTransform),typeof t.compensated=="boolean"&&(e.compensated=t.compensated))},removeFixedComponent:function(t){this.fixedComponents=this.fixedComponents.filter(e=>e.id!==t)},findActualFixedComponentsInsideOutlet:function(t){return this.fixedComponents.filter(e=>{if(e.element&&t)return t.contains(e.element)&&window.getComputedStyle(e.element).getPropertyValue("position")==="fixed"})},themeColorMetaTag:null,underlyingThemeColor:null,themeColorDimmingOverlays:[],storeThemeColorMetaTag:function(){if(this.themeColorMetaTag=sB(),!this.themeColorMetaTag){let t=document.createElement("meta");t.name="theme-color",t.content=window.getComputedStyle(document.body).backgroundColor,document.head.appendChild(t),this.themeColorMetaTag=t}},getAndStoreUnderlyingThemeColorAsRGBArray:function(){let t;if(this.themeColorDimmingOverlays.length>0)t=this.underlyingThemeColor;else{var e;this.themeColorMetaTag||this.storeThemeColorMetaTag();let i=(e=this.themeColorMetaTag)===null||e===void 0?void 0:e.content;(t=aw(i))||(console.warn("`themeColorDimming` prop ignored: Only `theme-color` meta tag with a value in `rgb()`, `rgba()`, or hexadecimal format is supported."),t=[0,0,0]),this.underlyingThemeColor=t}return t},updateUnderlyingThemeColor:function(t){let e=aw(t);if(!e)throw Error("The color provided to `updateThemeColor` doesn't match `rgb()`, `rgba()`, or hexadecimal format.");this.underlyingThemeColor=e,this.setActualThemeColor()},setActualThemeColor:function(){var t;this.themeColorMetaTag||this.storeThemeColorMetaTag(),(t=this.themeColorMetaTag)===null||t===void 0||t.setAttribute("content",JO({color:this.underlyingThemeColor,overlays:this.themeColorDimmingOverlays}))},findThemeColorDimmingOverlay:function(t){return this.themeColorDimmingOverlays.find(e=>e.dimmingOverlayId===t)},findIndexThemeColorDimmingOverlay:function(t){return this.themeColorDimmingOverlays.findIndex(e=>e.dimmingOverlayId===t)},updateThemeColorDimmingOverlay:function(t){let e=t;e.color&&(e={...e,color:Zx(e.color)});let i=this.findThemeColorDimmingOverlay(e.dimmingOverlayId);return i?Object.assign(i,e):(i=e,this.themeColorDimmingOverlays.push(e)),this.setActualThemeColor(),i},updateThemeColorDimmingOverlayAlphaValue:function(t,e){t.alpha=e,this.setActualThemeColor()},removeThemeColorDimmingOverlay:function(t){let e=this.findThemeColorDimmingOverlay(t);e&&(e.abortRemoval=!1,setTimeout(()=>{e?.abortRemoval||(this.themeColorDimmingOverlays=this.themeColorDimmingOverlays.filter(i=>i.dimmingOverlayId!==t),this.setActualThemeColor(),this.themeColorDimmingOverlays.length!==0||(this.underlyingThemeColor=null,this.themeColorMetaTag=null))},20))}};var qe=CB;let l5=t=>{let e=S.useRef(null);return vi(()=>{e.current=t}),S.useCallback((...i)=>{let n=e.current;return n(...i)},[])},Cv=t=>t==="layout"?vi:S.useEffect,Vg=t=>{var e=t?.lastIndexOf(":");return e===-1?"":t?.substring(e+1)},xB=t=>{let e=[],i=[],n=(a,l,{partOfInitial:u})=>{Array.isArray(a)?a.forEach(h=>n(h,l,{partOfInitial:u})):(l+=(l?".":"")+a.name,u&&i.push(l+":"+a.initial),Object.entries(a.states).forEach(([h,f])=>{let d=l+":"+h;f.machine=l,f.path=d,f.reactive=!a.silentOnly,e.push(f),f.machines&&n(f.machines,d,{partOfInitial:u&&a.initial===h})}))};return n(t,"",{partOfInitial:!0}),[i,e]},hw=(t,e)=>t.includes(":")?t:e.substring(0,e.lastIndexOf(":")+1)+t,dw=t=>{let e=t.split("."),i=[];return e.forEach((n,a)=>{let l=i[a-1],u=(l?l.full+".":"")+n,h=u.substring(0,u.lastIndexOf(":")),f=u.substring(u.lastIndexOf(":")+1);i.push({full:u,withoutState:h,state:f})}),i},kB=({checkedPoolOfStates:t,referencePoolOfStates:e,callbackOnExclusion:i,callbackOnPresent:n})=>t.filter(l=>{let u=!0;return l.forEach(h=>{e.forEach(f=>{f.forEach(d=>{h.withoutState===d.withoutState&&(h.state!==d.state?(u=!1,i?.({decomposedCheckedState:l,checkedStatePiece:h,decomposedReferenceState:f,referenceStatePiece:d})):n({decomposedCheckedState:l,checkedStatePiece:h,decomposedReferenceState:f,referenceStatePiece:d}))})})}),u}),EB=t=>{let[e,i]=xB(t);return[e,(n,a)=>{let l,u=typeof a=="string"?a:a.type,h=[];i.forEach(E=>{n.includes(E.path)&&(!a.machine||a.machine===E.machine)&&E.messages&&Object.entries(E.messages).forEach(([H,U])=>{if(H===u){if(typeof U=="string")l=H,h.push(hw(U,E.path));else for(let I of U)if(!I.guard||I.guard(n,a)){l=H,h.push(hw(I.target,E.path));break}}})});let f=n.map(E=>dw(E)),d=h.map(E=>dw(E)),p=[],v=kB({checkedPoolOfStates:f,referencePoolOfStates:d,callbackOnExclusion:({decomposedCheckedState:E})=>{p.push(E[E.length-1].full)},callbackOnPresent:({referenceStatePiece:E})=>{E.unchanged=!0}}),g=v.map(E=>E[E.length-1].full),y=[],b=[];d.forEach(E=>{E.forEach((H,U)=>{if(!H.unchanged){var I,N;U<E.length-1&&y.push(H.full);let F=i.find(J=>J.path===H.full);(I=F.machines)===null||I===void 0||(N=I.forEach)===null||N===void 0||N.call(I,J=>{let G=()=>{d.find(O=>O.find(P=>P.withoutState===`${F.path}.${J.name}`))||b.push(`${F.path}.${J.name}:${J.initial}`)};U<E.length-1?F.path+J.name!==E[U+1].withoutState&&G():G();let D=O=>{var P,$;(P=i.find(A=>A.path===O).machines)===null||P===void 0||($=P.forEach)===null||$===void 0||$.call(P,A=>{d.find(z=>z.find(q=>q.withoutState===`${F.path}.${A.name}`))||b.push(`${O}.${A.name}:${A.initial}`),D(`${O}.${A.name}:${A.initial}`)})};D(`${F.path}.${J.name}:${J.initial}`)})}})});let C=[...h,...y,...b],x=[...g,...C],k=[...p,...C],R=i.filter(E=>k.includes(E.path)),L=R.some(E=>E.reactive);return{exitedStates:p,transitionTaken:l,enteredStates:C,nextStates:x,reactive:L}}]},qd=(t,e)=>t?.toStrings().filter(i=>i?.startsWith(e)).filter(i=>{var n;return!(!((n=i?.slice(e.length))===null||n===void 0)&&n.includes("."))})[0],fw=t=>{let[e,i]=S.useMemo(()=>EB(t),[t]),n=S.useRef(),a=S.useRef([]),l=S.useRef([]),u=S.useRef([]),h=S.useRef([]),f=S.useRef(e),d=S.useRef({toStrings:()=>e,matches:b=>Uo(e,b),lastMessageTreatedRef:n,exitActionsRef:a,transitionActionsRef:l,entryActionsRef:u,selectorsRef:h}),[p,v]=S.useState({...d.current,silent:d.current}),g=S.useRef([]),y=S.useCallback(b=>{g.current.push(b);let C=x=>{let{nextStates:k,exitedStates:R,transitionTaken:L,enteredStates:E,reactive:H}=i(f.current,g.current[0]),U=f.current;if(f.current=k,a.current.forEach(I=>{R.includes(I.state)&&(typeof I.guard=="function"?I.guard(U,g.current[0]):I.guard)&&I.callback(g.current[0],I.params)}),l.current.forEach(I=>{R.includes(I.state)&&I.transition===L&&(typeof I.guard=="function"?I.guard(U,g.current[0]):I.guard)&&I.callback(g.current[0],I.params)}),u.current.forEach(I=>{E.includes(I.state)&&(typeof I.guard=="function"?I.guard(U,g.current[0]):I.guard)&&I.callback(g.current[0],I.params)}),n.current=typeof g.current[0]=="string"?{type:g.current[0]}:g.current[0],g.current.shift(),g.current.length)C(H||x);else{let I=k.slice();d.current.toStrings=()=>I,d.current.matches=N=>Uo(I,N),d.current.getValues=()=>[Vg(I.toStrings)],h.current.forEach(N=>{let F=N.current.selection;N.current.toStrings=()=>[qd(d.current,F)],N.current.matches=J=>Uo([qd(d.current,F)],J),N.current.getValues=()=>[Vg(qd(d.current,F))]}),(x||H)&&v({...d.current,silent:d.current})}};g.current.length===1&&C()},[i]);return[p,y]},TB=(t,e,i,{message:n="",delay:a=null,...l}={delay:null})=>{S.useEffect(()=>{let u;return e.matches(i)&&(u=setTimeout(()=>t({type:"",...l}),a??0)),()=>{u&&clearTimeout(u)}},[e,i,a,t,n,l])},Ur=(t,e,{shallow:i=!0}={})=>{let n=S.useMemo(()=>qd(t,e),[t,e]),a=S.useRef({lastMessageTreatedRef:t?.lastMessageTreatedRef,exitActionsRef:t?.exitActionsRef,transitionActionsRef:t?.transitionActionsRef,entryActionsRef:t?.entryActionsRef,toStrings:()=>[n],matches:u=>Uo([n],u),selection:e,getValues:()=>[Vg(n)]}),l=S.useRef(Symbol());return vi(()=>{t.selectorsRef.current.find(h=>h.id===l.current)||t.selectorsRef.current.push(a)},[]),S.useMemo(()=>({...a.current,silent:a.current}),[n])},Uo=(t,e)=>Array.isArray(e)?e.some(i=>t.includes(i))||t.some(i=>e.some(n=>i?.startsWith(n)&&i?.charAt(n.length)===".")):t.includes(e)||t.some(i=>i?.startsWith(e)&&i?.charAt(e.length)==="."),Pe=(t,e,i)=>{let{state:n,callback:a,params:l,empty:u=!1}=i,h=!i.hasOwnProperty("guard")||i.guard,f=S.useMemo(()=>l?Object.values(l):[],[l]),d=S.useMemo(()=>e.entryActionsRef,[e]),p=Cv(t==="before-paint"?"layout":"normal"),v=l5(y=>{(y?.matches&&y?.matches(n)||!y?.matches&&Uo(y,n))&&(typeof h=="function"&&h()||typeof h!="function"&&h)&&a(y.lastMessageTreatedRef.current,l)}),g=S.useRef(Symbol());p(()=>{if(!u)if(t==="immediate"){let y={id:g.current,state:n,guard:h,callback:a,params:l},b=d.current.findIndex(C=>C.id===g.current);b===-1?d.current.push(y):d.current[b]=y}else v(e)},t==="immediate"?[t,n,h,a,d,...f]:[t,v,e]),S.useEffect(()=>()=>{d.current=d.current.filter(y=>y.id!==g.current)},[])},at=(t,e)=>{let{state:i,transition:n,callback:a,params:l}=e,u=!e.hasOwnProperty("guard")||e.guard,h=S.useMemo(()=>l?Object.values(l):[],[l]),f=S.useMemo(()=>t.transitionActionsRef,[t]),d=S.useRef(Symbol());S.useEffect(()=>{let p={id:d.current,state:i,transition:n,guard:u,callback:a,params:l},v=f.current.findIndex(g=>g.id===d.current);v===-1?f.current.push(p):f.current[v]=p},[i,n,u,a,f,...h]),S.useEffect(()=>()=>{f.current=f.current.filter(p=>p.id!==d.current)},[])},za=(t,e,i)=>{let{state:n,callback:a,params:l}=i,u=!i.hasOwnProperty("guard")||i.guard,h=S.useMemo(()=>l?Object.values(l):[],[l]),f=S.useMemo(()=>e.exitActionsRef,[e]),d=Cv("normal");l5(v=>{(v?.matches&&v?.matches(n)||!v?.matches&&Uo(v,n))&&(typeof u=="function"&&u()||typeof u!="function"&&u)&&a(v.lastMessageTreatedRef.current,l)});let p=S.useRef(Symbol());d(()=>{{let v={id:p.current,state:n,guard:u,callback:a,params:l},g=f.current.findIndex(y=>y.id===p.current);g===-1?f.current.push(v):f.current[g]=v}return()=>{}},[t,n,u,a,f,...h]),S.useEffect(()=>()=>{f.current=f.current.filter(v=>v.id!==p.current)},[])},ks=(t,e,i)=>{let{state:n,callback:a,params:l,name:u}=i,h=!i.hasOwnProperty("guard")||i.guard,f=l?Object.values(l):[],d=typeof t=="string"?t:t.start,p=typeof t=="string"?t:t.update,v=S.useRef(null);Pe("immediate",e,{state:n,guard:h,callback:S.useCallback(()=>{v.current=a(null,l)},[a,l]),params:l,empty:d!=="immediate"});let g=Cv(p==="before-paint"?"layout":"normal"),y=S.useRef(!1);g(()=>{let b,C=e?.matches&&e?.matches(n)||!e?.matches&&Uo(e,n)||n==="",x=typeof h=="function"&&h()||typeof h!="function"&&h;return C&&x&&(b=d==="immediate"?y.current?a(null,l):v.current:a(null,l)),C&&!y.current&&(y.current=!0),()=>{var k;!((k=e.silent)===null||k===void 0)&&k.matches(n)||(y.current=!1,v.current=null),b?.()}},[n!==""?e:null,n,h,a,...f])},RB=t=>{let e=S.useRef({value:t}),[i,n]=S.useState({value:t,silent:e.current}),a=S.useCallback(l=>{let u=typeof l=="function"?l(e.current.value):l;e.current.value=u,n({value:u,silent:e.current})},[]);return[i,a]};function c5(...t){return e=>t.forEach(i=>{typeof i=="function"?i(e):i!=null&&(i.current=e)})}function Rs(...t){return S.useCallback(c5(...t),t)}var MB=(t,e)=>{let i=()=>{e?.()},n=l=>{l.preventDefault(),window.addEventListener("touchend",i,{once:!0})},a=t.current;return a.addEventListener("touchstart",n,{passive:!1}),()=>{a&&(a.removeEventListener("touchstart",n,{passive:!1}),window.removeEventListener("touchend",i))}};let Pp=!1,mw=0;function Vo(t){var e;if(S.useId!==void 0)return S.useId();let[i,n]=S.useState(Pp?++mw:null);return vi(()=>{i===null&&n(++mw)},[]),S.useEffect(()=>{Pp===!1&&(Pp=!0)},[]),(e=i)!==null&&e!==void 0?e:void 0}let Fi=S.forwardRef((t,e)=>{let{children:i,...n}=t,a=S.Children.toArray(i),l=a.find(LB);if(l){let u=l.props.children,h=a.map(f=>f!==l?f:S.Children.count(u)>1?S.Children.only(null):S.isValidElement(u)?u.props.children:null);return j.jsx(qg,{...n,ref:e,children:S.isValidElement(u)?S.cloneElement(u,void 0,h):null})}return j.jsx(qg,{...n,ref:e,children:i})});Fi.displayName="Slot.Root";let qg=S.forwardRef((t,e)=>{let{children:i,...n}=t,a=(function(l){var u,h;let f=(u=Object.getOwnPropertyDescriptor(l.props,"ref"))===null||u===void 0?void 0:u.get,d=f&&"isReactWarning"in f&&f.isReactWarning;return d?l.ref:(d=(f=(h=Object.getOwnPropertyDescriptor(l,"ref"))===null||h===void 0?void 0:h.get)&&"isReactWarning"in f&&f.isReactWarning)?l.props.ref:l.props.ref||l.ref})(i);return S.isValidElement(i)?S.cloneElement(i,{...(function(l,u){let h={...u};for(let f in u){let d=l[f],p=u[f];/^on[A-Z]/.test(f)?d&&p?h[f]=(...g)=>{p(...g),d(...g)}:d&&(h[f]=d):f==="style"?h[f]={...d,...p}:f==="className"&&(h[f]=[d,p].filter(Boolean).join(" "))}return{...l,...h}})(n,i.props),ref:e?c5(e,a):a}):S.Children.count(i)>1?S.Children.only(null):null});qg.displayName="Slot.Anonymous";let AB=({children:t})=>j.jsx(j.Fragment,{children:t});function LB(t){return S.isValidElement(t)&&t.type===AB}let Td=0,u5=[0,0],Yg=!1,_w=()=>{clearTimeout(sw),Yg=!0,sw=setTimeout(()=>Yg=!1,50)},pw=()=>{Yg||window.scrollTo(...u5)},h5=We.forwardRef((t,e)=>{let{asChild:i,active:n=!0,automaticallyDisabledForOptimisation:a=!0,axis:l="both",preventBodyScroll:u,children:h,"data-silk":f,className:d,...p}=t,v=f?.includes("0ae"),g=S.useRef(null),y=Rs(g,e);vi(()=>{if(u5=[window.screenX,window.scrollY],n&&u)if(Td===0){let k=window.innerWidth,R=document.documentElement.clientWidth,L=window.innerHeight,E=document.documentElement.clientHeight;document.body.style.setProperty("overflow","hidden");let H=`${k-R}px`,U=`${L-E}px`;document.querySelectorAll("[data-silk~='0al']").forEach(N=>{N.style.setProperty("--x-collapsed-scrollbar-thickness",H),N.style.setProperty("--y-collapsed-scrollbar-thickness",U)}),document.body.style.setProperty("padding-right",H),document.body.style.setProperty("padding-bottom",U),window.addEventListener("resize",_w),window.addEventListener("scroll",pw,{passive:!1}),Td++}else Td++;return()=>{if(n&&u&&--Td==0){let k=document.querySelectorAll("[data-silk~='0al']");document.body.style.removeProperty("overflow"),k.forEach(R=>{R.style.removeProperty("--x-collapsed-scrollbar-thickness"),R.style.removeProperty("--y-collapsed-scrollbar-thickness")}),document.body.style.removeProperty("padding-right"),document.body.style.removeProperty("padding-bottom"),window.removeEventListener("scroll",pw),window.removeEventListener("resize",_w)}}},[u,n]),S.useEffect(()=>{let k,R=g.current;return!v&&n&&R&&(k=new ResizeObserver(L=>{L.forEach(()=>{R.scrollTo(300,300)})})).observe(R,{box:"border-box"}),()=>{!v&&n&&R&&k&&(k.unobserve(R),k.disconnect())}},[n,v]);let b=S.useCallback(k=>{let R=k.currentTarget;R.scrollTo(300,300),Kt!=="ios"&&Kt!=="ipados"||CSS.supports("overscroll-behavior: contain")||(R.style.setProperty("overflow","hidden"),setTimeout(()=>{R.style.setProperty("overflow","auto")},10))},[]),C=i?Fi:"div",x=Ui("ScrollTrap",{active:n,automaticallyDisabledForOptimisation:a,axis:l});return j.jsx(C,{...x("root",["active","automaticallyDisabledForOptimisation","axis"],{className:d,dataSilk:[f,"0ac","0ae"]}),onScroll:v?void 0:b,...p,ref:y,children:h})});h5.displayName="Sheet.Anonymous";let d5=We.forwardRef((t,e)=>{let{asChild:i,className:n,dataSilk:a,children:l,...u}=t,h=i?Fi:"div",f=Ui("ScrollTrap",{});return j.jsx(h,{...f("stabiliser",[],{className:n,dataSilk:[a]}),...u,ref:e,children:l})});d5.displayName="Sheet.DDD";let Kn={Root:h5,Stabiliser:d5},f5=()=>{let t=Vo();return S.useCallback(i=>{i?qe.addFixedComponent({id:t,element:i}):qe.removeFixedComponent(t)},[t])},DB=We.forwardRef((t,e)=>{let{asChild:i,children:n,className:a,"data-silk":l,...u}=t,h=f5(),f=Rs(h,e),d=Ui("Fixed",{});return j.jsx(Kn.Root,{...d("root",[],{className:a,dataSilk:[l,"0al"]}),asChild:i,...u,ref:f,children:n})});DB.displayName="Fixed.Root";let OB=We.forwardRef((t,e)=>{let{asChild:i,children:n,...a}=t;return j.jsx(Kn.Stabiliser,{asChild:i,...a,ref:e,children:n})});OB.displayName="Fixed.Content";let Za=We.createContext(null);Za.displayName="Sheet.GenericContext";let Wr=We.createContext(null);Wr.displayName="Sheet.Anonymous";var BB=function(t){let e="cubic-bezier(";if(!t.startsWith(e))return null;let i=t.slice(e.length,-1),n=i.split(",").map(a=>parseFloat(a.trim()));return n.length!==4||n.some(isNaN)?null:n},NB=({mass:t,stiffness:e,damping:i,initialVelocity:n=0,fromPosition:a,toPosition:l,precision:u})=>{let h=[],f=0,d=Math.abs(l-a),p=0,v=n,g=!1,y=!1,b=-(1e-6*e),C=-(.001*i),x=u/22,k=10*u;for(;!(g&&y);){let L=b*(p-d),E=C*v,H=(L+E)/t;v+=H,p+=v,g=Math.abs(v)<=x,y=Math.abs(d-p)<=k;let U=p/d;h.push(U),f++}return{progressValuesArray:h,duration:f}};let Yd=()=>CSS.supports("transition-timing-function","linear(0, 1)")&&!qa(),PB=({origin:t=0,destination:e=1,animationConfig:i})=>{var n,a,l,u,h,f,d,p,v;let g=[],y;if(i&&i.easing&&i.easing!=="spring")if(i.easing==="linear"){y=(f=i.duration)!==null&&f!==void 0?f:250;let b=y,C=1/(b-1);for(let x=0;x<b;x++){let k=x*C;g.push(isNaN(k)?0:k)}}else{let b;y=(d=i.duration)!==null&&d!==void 0?d:250;let C=y;b=i.easing==="ease"?[.25,.1,.25,1]:i.easing==="ease-in"?[.42,0,1,1]:i.easing==="ease-out"?[0,0,.58,1]:i.easing==="ease-in-out"?[.42,0,.58,1]:i.easing.startsWith("cubic-bezier")&&(p=BB(i.easing))!==null&&p!==void 0?p:[.25,.1,.25,1];let x=ZO(...b);for(let k=0;k<=C;k++)g.push(x(k/C))}else{let b=NB({stiffness:(n=i?.stiffness)!==null&&n!==void 0?n:300,damping:(a=i?.damping)!==null&&a!==void 0?a:34,mass:(l=i?.mass)!==null&&l!==void 0?l:1,initialVelocity:(u=i?.initialVelocity)!==null&&u!==void 0?u:0,precision:(h=i?.precision)!==null&&h!==void 0?h:.1,fromPosition:t,toPosition:e});g=b.progressValuesArray,y=b.duration}return{progressValuesArray:g,easing:"linear",duration:y,delay:(v=i?.delay)!==null&&v!==void 0?v:0}},zp=(t,e)=>{let i={};return t.forEach(([n,a])=>{let l=ql(e);i[n]=a({progress:e,tween:l})}),i},gw=({type:t,progressValuesArray:e,target:i,templatesPerProperty:n,reversedStackingIndex:a,selfAndAboveTravelProgressSum:l})=>{let u=a!=null,h=f=>t==="travel"?f:u&&l?l?.[a]+f:0;return{target:i,keyframes:Yd()?[zp(n,h(e[0])),zp(n,h(e[e.length-1]))]:e.map(f=>zp(n,h(f)))}},zB=({sheetId:t,destinationDetent:e,setSegment:i,viewElement:n,scrollContainer:a,travellingElement:l,contentPlacement:u,positionToScrollTo:h,scrollAxis:f,animationConfig:d,onTravel:p,onTravelStart:v,onTravelEnd:g,runOnTravelStart:y,rAFLoopEndCallback:b,dimensions:C,trackToTravelOn:x})=>{let k,R,L=qe.findSheet(t);if(!L)return;let E=[],H=[];E=L.travelAnimations,L.belowSheetsInStack.forEach(ge=>{H.push(...ge.stackingAnimations.map(_t=>({..._t,reversedStackingIndex:L.belowSheetsInStack.length-1,selfAndAboveTravelProgressSum:ge.selfAndAboveTravelProgressSum})))}),y&&v?.();let U=!(d.hasOwnProperty("contentMove")&&!d.contentMove),I=C.current.view.travelAxis.unitless,N=C.current.content.travelAxis.unitless,F=n.getBoundingClientRect(),J=l.getBoundingClientRect(),G=u!=="center"?N:N+(I-N)/2,D=J.top-F.top,O=J.left-F.left,P=0;switch(x){case"top":P=D+G;break;case"bottom":P=D-G;break;case"left":P=O+G;break;case"right":P=O-G}let $=Math.max(Math.abs(P)/G,0),M=C.current.progressValueAtDetents[e].exact,A=M*G,z=x==="left"||x==="top"?A:-A,{progressValuesArray:q,easing:Y,duration:B,delay:X}=PB({origin:P,destination:z,animationConfig:d}),ie=M-$,re=(function(ge,_t){let St=[];for(let dt=0;dt<ge.length-1;dt+=_t)St.push(ge[dt]);return ge.length%_t!=0&&St.push(ge[ge.length-1]),St})(q,8),fe=re.map(ge=>$+ie*ge),he=[];E.length&&he?.push(...E.map(ge=>gw({type:"travel",progressValuesArray:fe,target:ge.target,templatesPerProperty:ge.config}))),H.length&&he?.push(...H.map(ge=>gw({type:"stacking",progressValuesArray:fe,target:ge.target,templatesPerProperty:ge.config,reversedStackingIndex:ge.reversedStackingIndex,selfAndAboveTravelProgressSum:ge.selfAndAboveTravelProgressSum}))),k=f==="x"?"X":"Y";let oe=ge=>({transform:"translate"+k+"("+(P-z)*(1-ge)+"px)"});R=Yd()?[oe(re[0]),oe(re[re.length-1])]:re.map(ge=>({transform:"translate"+k+"("+(P-z)*(1-ge)+"px)"}));let ve=()=>{a.scrollTo({left:f==="x"?h:0,top:f==="y"?h:0})},de=ge=>{let _t;if(!U)return ge();_t=Yd()?l.animate(R,{easing:"linear("+re.join(",")+")",duration:B,delay:X}):l.animate(R,{easing:Y,duration:B,delay:X});let St=()=>{ge(),_t.removeEventListener("finish",St)};_t.addEventListener("finish",St)},we=ge=>{if(!he.length)return ge();let _t=[],St=Yd();he?.forEach(({target:dt,keyframes:ke})=>{let pe;pe=St?dt.animate(ke,{easing:"linear("+re.join(",")+")",duration:B,delay:X}):dt.animate(ke,{easing:Y,duration:B,delay:X});let Gt=new Promise(Ne=>{let Qe=()=>{Object.entries(ke[ke.length-1]).forEach(([Ye,xt])=>{dt.style.setProperty((Ye.startsWith("webkit")||Ye.startsWith("moz")?"-":"")+Ye.replace(/[A-Z]/g,"-$&").toLowerCase(),xt)}),pe.removeEventListener("finish",Qe),Ne()};pe.addEventListener("finish",Qe)});_t.push(Gt)}),Promise.all(_t).then(()=>{ge()})},Le=null,tt=ge=>{(function _t(St,dt,ke){let pe=C.current.progressValueAtDetents,Gt=pe.length;Le||(Le=St);let Ne=St-Le,Qe=Math.floor(Ne);if(Qe<q.length){let Ye=$+ie*q[Qe];if(Ye<0)dt(Ye,[0,0]);else if(Ye>1)dt(Ye,[1,1]);else for(let xt=0;xt<Gt;xt++){let je=pe[xt],Ms=je.after;Ye>Ms&&xt+1<Gt&&Ye<pe[xt+1].before?dt(Ye,[xt,xt+1]):Ye>je.before&&Ye<Ms&&dt(Ye,[xt,xt])}requestAnimationFrame(()=>_t(document.timeline.currentTime,dt,ke))}else{let Ye=Math.min(Gt-1,e);dt(M,[Ye,Ye]),U||he?.length||b==null||b(),ke()}})(document.timeline.currentTime,(_t,St)=>{p?.({progress:_t,range:{start:St[0],end:St[1]},progressAtDetents:C.current.exactProgressValueAtDetents}),i(St)},ge)},Ge=ge=>new Promise(_t=>{ge(()=>_t())}),xe=()=>{g?.()},Oe=async()=>{await Promise.all([Ge(de),Ge(we),Ge(tt)]),xe()};requestAnimationFrame(()=>{requestAnimationFrame(()=>{(U||e!==0)&&ve(),Oe()})})},IB=({desiredDestinationDetent:t,currentDetent:e})=>typeof t=="number"?t:e,HB=({trackToTravelOn:t,destinationDetent:e,detentCountExcludingZero:i,actualSwipeOutDisabledWithDetent:n,hasOppositeTracks:a,contentPlacement:l,elementsDimensions:u,snapBackAcceleratorTravelAxisSize:h})=>{var f;if(((f=u.detentMarkers)===null||f===void 0?void 0:f.length)<=e-1)return{positionToScrollTo:null,scrollAxis:null};let d=e===0,p=e===1,v=e===i,g=t==="right"||t==="bottom",y=u.view.travelAxis.unitless,b=u.content.travelAxis.unitless,C=u.snapOutAccelerator.travelAxis.unitless,x=u.detentMarkers,k=d?0:x[e-1].accumulatedOffsets.travelAxis.unitless,R=0;if(a)v?R=y-(y-b)/2+u.snapOutAccelerator.travelAxis.unitless:d&&(R=g?0:1e4);else if(g)v?R=1e4:n&&p||d?R=0:v||n&&p||d||(R=n?x[e-1].accumulatedOffsets.travelAxis.unitless-x[0].travelAxis.unitless:k+C);else if(t==="left"||t==="top"){let L;L=n?p?2*h:v?0:h:d?C:v?h:0,R=l==="center"?e===0?b+(y-b)/2-k+L:0:b-k+L}return{positionToScrollTo:R,scrollAxis:t==="left"||t==="right"||t==="horizontal"?"x":"y"}};var UB=({destinationDetent:t,behavior:e="instant",runTravelCallbacksAndAnimations:i=!0,runOnTravelStart:n,animationConfig:a,rAFLoopEndCallback:l,trackToTravelOn:u,contentPlacement:h,onTravel:f,onTravelStart:d,onTravelEnd:p,fullTravelCallback:v,setProgrammaticScrollOngoing:g,currentDetent:y,segment:b,setSegment:C,lastProgressValue:x,dimensions:k,viewRef:R,scrollContainerRef:L,contentWrapperRef:E,sheetId:H,stackId:U,actualSwipeOutDisabledWithDetent:I,hasOppositeTracks:N,snapBackAcceleratorTravelAxisSize:F})=>{if(t===void 0&&y===null)return;let J=k.current,G=L.current;if(G&&J.content){let D=IB({desiredDestinationDetent:t,currentDetent:y}),O=k.current.detentMarkers.length,{positionToScrollTo:P,scrollAxis:$}=HB({destinationDetent:D,detentCountExcludingZero:O,trackToTravelOn:u,actualSwipeOutDisabledWithDetent:I,hasOppositeTracks:N,contentPlacement:h,snapBackAcceleratorTravelAxisSize:F,elementsDimensions:J});if(P!==null&&$!==null){if(g(!0),e==="smooth")zB({sheetId:H,destinationDetent:D,setSegment:C,viewElement:R.current,scrollContainer:G,travellingElement:E.current,positionToScrollTo:P,contentPlacement:h,scrollAxis:$,animationConfig:a,onTravel:f,onTravelStart:d,onTravelEnd:p,runOnTravelStart:n,rAFLoopEndCallback:l,dimensions:k,trackToTravelOn:u});else if(i&&n&&d?.(),$==="x"?(G.scrollTo(P,0),G.scrollLeft=P):(G.scrollTo(0,P),G.scrollTop=P),C([D,D]),i){let M=k.current.progressValueAtDetents[D].exact;v?.(M,b),p?.()}}}};let gu=t=>{let e=S.useRef(null);return vi(()=>{e.current=t}),S.useCallback((...i)=>{let n=e.current;return n(...i)},[])},FB=t=>{let e,i=()=>{t(),e=requestAnimationFrame(i)};return i(),()=>{cancelAnimationFrame(e)}},$B=(()=>{let t=!0;typeof window>"u"||CSS.supports("scroll-snap-align: start")||(t=!1);let e=!0;return typeof window>"u"||"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(e=!1),t&&e})(),gf={gentle:{stiffness:560,damping:68,mass:1.85},smooth:{stiffness:580,damping:60,mass:1.35},snappy:{stiffness:350,damping:34,mass:.9},brisk:{stiffness:350,damping:28,mass:.65},bouncy:{stiffness:240,damping:19,mass:.7},elastic:{stiffness:260,damping:20,mass:1}},Ip=(t,e)=>{var i;let n=typeof t=="string",a=n?gf[t]:(i=gf[t?.preset])!==null&&i!==void 0?i:null,l=a||t?.easing==="spring"||["ease","ease-in","ease-out","ease-in-out","linear"].includes(t?.easing);return{skip:wv,easing:"spring",...n?{}:t,...a??{},...l?{}:e}},WB=(t,e)=>t.includes("skipOpening:true")||e.skipOpening,vw=(t,e)=>!t.includes("skipOpening:true")&&!e.skipOpening,jB=(t,e)=>t.includes("skipClosing:true")||e.skipClosing,VB=(t,e)=>!t.includes("skipClosing:true")&&!e.skipClosing,yw=t=>t.includes("openness:closed.status:safe-to-unmount"),qB=()=>{let t="false",[e,i]=fw(S.useMemo(()=>[{name:"staging",initial:"none",states:{none:{messages:{OPEN:[{guard:(b,C)=>yw(b)&&vw(b,C),target:"opening"},{guard:yw,target:"open"}],OPEN_PREPARED:[{guard:vw,target:"opening"},{target:"open"}],ACTUALLY_CLOSE:[{guard:VB,target:"closing"}],ACTUALLY_STEP:"stepping",GO_DOWN:[{guard:(b,C)=>!C.skipOpening,target:"going-down"},{target:"go-down"}],GO_UP:"going-up"}},open:{messages:{NEXT:"none"}},opening:{messages:{NEXT:"none"}},stepping:{messages:{NEXT:"none"}},closing:{messages:{NEXT:"none"}},"go-down":{messages:{NEXT:"none"}},"going-down":{messages:{NEXT:"none"}},"going-up":{messages:{NEXT:"none"}}}},{name:"longRunning",initial:t,states:{false:{messages:{TO_TRUE:"true"}},true:{messages:{TO_FALSE:"false"}}}},{name:"openness",initial:"closed",states:{closed:{messages:{READY_TO_OPEN:[{guard:(b,C)=>!C.skipOpening,target:"opening"},{target:"open"}]},machines:{name:"status",initial:"safe-to-unmount",states:{pending:{messages:{OPEN:[{guard:WB,target:"openness:closed.status:flushing-to-preparing-open"},{target:"openness:closed.status:flushing-to-preparing-opening"}],"":"safe-to-unmount"}},"flushing-to-preparing-open":{messages:{"":"preparing-open"}},"flushing-to-preparing-opening":{messages:{"":"preparing-opening"}},"preparing-open":{},"preparing-opening":{},"safe-to-unmount":{}}}},opening:{messages:{NEXT:"open"}},open:{messages:{ACTUALLY_CLOSE:[{guard:jB,target:"openness:closed.status:pending"}],SWIPED_OUT:"openness:closed.status:pending",READY_TO_CLOSE:[{guard:(b,C)=>!C.skipClosing,target:"closing"}]},machines:[{name:"scroll",initial:"ended",states:{ended:{messages:{SCROLL_START:"ongoing"},machines:[{name:"afterPaintEffectsRun",initial:"false",states:{false:{messages:{OCCURRED:"true"}},true:{}}}]},ongoing:{messages:{SCROLL_END:"ended"}}}},{name:"move",initial:"ended",states:{ended:{messages:{MOVE_START:"ongoing"}},ongoing:{messages:{MOVE_END:"ended"}}}},{name:"swipe",silentOnly:!0,initial:"unstarted",states:{unstarted:{messages:{SWIPE_START:"ongoing"}},ongoing:{messages:{SWIPE_END:"ended"}},ended:{messages:{SWIPE_START:"ongoing",SWIPE_RESET:"unstarted"}}}},{name:"evaluateCloseMessage",silentOnly:!0,initial:"false",states:{false:{messages:{CLOSE:"true"}},true:{messages:{CLOSE:"false"}}}},{name:"evaluateStepMessage",silentOnly:!0,initial:"false",states:{false:{messages:{STEP:"true"}},true:{messages:{STEP:"false"}}}}]},closing:{messages:{NEXT:"openness:closed.status:pending"}}}},{name:"skipOpening",initial:"false",states:{true:{messages:{TO_FALSE:"false"}},false:{messages:{TO_TRUE:"true"}}}},{name:"skipClosing",initial:"false",states:{true:{messages:{TO_FALSE:"false"}},false:{messages:{TO_TRUE:"true"}}}},{name:"scrollContainerTouch",silentOnly:!0,initial:"ended",states:{ended:{messages:{TOUCH_START:"ongoing"}},ongoing:{messages:{TOUCH_END:"ended"}}}},{name:"backStuck",silentOnly:!0,initial:"false",states:{false:{messages:{STUCK_START:"true"}},true:{messages:{STUCK_END:"false"}}}},{name:"frontStuck",silentOnly:!0,initial:"false",states:{false:{messages:{STUCK_START:"true"}},true:{messages:{STUCK_END:"false"}}}}],[t])),[n,a]=fw(S.useMemo(()=>[{name:"active",initial:"false",states:{false:{messages:{TO_TRUE:"true"}},true:{messages:{TO_FALSE:"false"}}}},{name:"position",initial:"out",states:{out:{messages:{READY_TO_GO_FRONT:[{guard:(b,C)=>C.skipOpening,target:"position:front.status:idle"},{target:"position:front.status:opening"}]}},front:{machines:[{name:"status",initial:"opening",states:{opening:{messages:{NEXT:"idle"}},closing:{messages:{NEXT:"position:out"}},idle:{messages:{READY_TO_GO_DOWN:[{guard:(b,C)=>C.skipOpening,target:"position:covered.status:idle"},{target:"position:covered.status:going-down"}],READY_TO_GO_OUT:"closing",GO_OUT:"position:out"}}}}]},covered:{machines:[{name:"status",initial:"going-down",states:{"going-down":{messages:{NEXT:"idle"}},"going-up":{messages:{NEXT:"indeterminate"}},indeterminate:{messages:{GOTO_idle:"idle",GOTO_front:"position:front.status:idle"}},idle:{messages:{READY_TO_GO_DOWN:[{guard:(b,C)=>C.skipOpening,target:"come-back"},{target:"going-down"}],READY_TO_GO_UP:"going-up",GO_UP:"indeterminate"}},"come-back":{messages:{"":"idle"}}}}]}}}],[])),l=S.useMemo(()=>n.matches("position:out")?"out":n.matches("position:front")?"front":n.matches("position:covered")?"covered":void 0,[n]),u=S.useMemo(()=>n.matches("position:covered.status:idle")?"idle":n.matches("position:covered.status:going-down")?"going-down":n.matches("position:covered.status:going-up")?"going-up":null,[n]),h=Ur(e,"staging"),f=S.useMemo(()=>h.getValues()[0],[h]),[d,p]=RB(-1),v=Vo(),g=Vo();return S.useMemo(()=>({titleId:v,descriptionId:g,staging:f,opennessState:e,sendToOpennessMachine:i,positionState:n,sendToPositionMachine:a,layerPosition:l,layerCovered:u,stackingIndex:d,assignStackingIndex:p}),[v,g,f,e,i,n,a,l,u,d,p])},m5=We.forwardRef((t,e)=>{let i,{forComponent:n,as:a,children:l,className:u,"data-silk":h,initialState:f,onPresentAutoFocus:d,onDismissAutoFocus:p,onTravelStatusChange:v,onTravelRangeChange:g,swipeDismissal:y=!0,swipe:b=!0,snapOutAcceleration:C="auto",snapToEndDetentsAcceleration:x="auto",onTravel:k,onTravelStart:R,onTravelEnd:L,detents:E,inertOutside:H=!0,nativeEdgeSwipePrevention:U=!1,onSwipeFromEdgeToGoBackAttempt:I,onClickOutside:N,onEscapeKeyDown:F,onFocusInside:J,nativeFocusScrollPrevention:G=!0,contentPlacement:D=null,tracks:O,swipeOvershoot:P=!0,swipeTrap:$,enteringAnimationSettings:M,exitingAnimationSettings:A,steppingAnimationSettings:z,id:q,...Y}=t,B=n??Za,X=S.useContext(B)||{},{license:ie,StackContext:re,CustomSheetContext:fe,sheetRole:he,open:oe,onOpenChange:ve,elementFocusedLastBeforeShowing:de,onSafeToUnmountChange:we,setLongRunning:Le,setStaging:tt,defaultActiveDetent:Ge,activeDetent:xe,onActiveDetentChange:Oe,sheetId:ge}=X,{titleId:_t,descriptionId:St,staging:dt,opennessState:ke,sendToOpennessMachine:pe,positionState:Gt,sendToPositionMachine:Ne,layerCovered:Qe,stackingIndex:Ye,assignStackingIndex:xt}=qB(),je=Ur(ke,"staging"),{stackId:Ms,setSheetsCount:rs,updateSheetStagingDataInStack:Qn,removeSheetStagingDataInStack:Jn,updateSheetDataInStack:jr,removeSheetDataFromStack:Xs,getPreviousSheetDataInStack:ri}=re?S.useContext(re):{},{ancestorPrimarySwipeTrapActiveOnYAxis:$i}=S.useContext(Wr)||{},At=f5(),ni=S.useRef(null),Zs=Rs(ni,At,e),fn=S.useRef(null),Qs=S.useRef(null),kt=S.useRef(null),Rr=S.useRef(null),Wi=S.useRef(null),As=S.useRef(null),Mr=S.useRef(null),ea=S.useRef([]),Qi=S.useMemo(()=>E?typeof E=="string"?[E,"var(--silk-aF)"]:[...E,"var(--silk-aF)"]:["var(--silk-aF)"],[E]),Js=S.useRef(null);S.useEffect(()=>{Js.current===null&&Number.isInteger(xe)&&xe>0&&(Js.current=xe)},[]);let Ut=S.useMemo(()=>Number.isInteger(Ge)?Ge:Number.isInteger(xe)&&xe>0?xe:Js.current?Js.current:1,[xe,Ge]),{actualTrack:ze,actualPlacement:Lt}=S.useMemo(()=>{let ee={actualPlacement:null,actualTrack:null};return D&&!O?(ee.actualPlacement=D,D!=="center"?ee.actualTrack=D:ee.actualTrack="bottom"):O&&!D?Array.isArray(O)?(ee.actualPlacement="center",ee.actualTrack=O.includes("left")?"horizontal":"vertical"):(ee.actualPlacement=O,ee.actualTrack=O):O||D?O&&D&&(ee.actualPlacement=D,Array.isArray(O)?ee.actualTrack=O.includes("left")?"horizontal":"vertical":ee.actualTrack=O):(ee.actualPlacement="bottom",ee.actualTrack="bottom"),[{state:"staging:opening",configTrack:M?.track},{state:"staging:closing",configTrack:A?.track}].forEach(({state:me,configTrack:_e})=>{ke.matches(me)&&_e&&(_e==="top"&&ee.actualTrack==="bottom"||_e==="bottom"&&ee.actualTrack==="top"?ee.actualTrack="vertical":(_e==="left"&&ee.actualTrack==="right"||_e==="right"&&ee.actualTrack==="left")&&(ee.actualTrack="horizontal"))}),ee},[D,O,M?.track,A?.track,ke]);S.useMemo(()=>ze==="horizontal",[ze]);let Ko=S.useMemo(()=>ze==="vertical",[ze]);S.useEffect(()=>{if(D?.includes("top")&&O&&O!=="top"||D?.includes("bottom")&&O&&O!=="bottom"||!D?.includes("center")&&O&&O.includes("top")&&O.includes("bottom")||D?.includes("left")&&O&&O!=="left"||D?.includes("right")&&O&&O!=="right"||!D?.includes("center")&&O&&O.includes("left")&&O.includes("right"))throw Error(`'placement' prop value '${D}' cannot be used with 'tracks' prop value '${O}'.`)},[D,O]);let er=S.useMemo(()=>M?.track||(ze==="horizontal"?"right":ze==="vertical"?"bottom":ze),[M?.track,ze]),ji=S.useMemo(()=>Ip(M,gf.smooth),[M]),Se=S.useMemo(()=>Ip(A,{easing:"spring",stiffness:520,damping:44,mass:1}),[A]),ft=S.useMemo(()=>Ip(z??M,gf.smooth),[z,M]),Xe=S.useMemo(()=>he==="alertdialog"||!y,[y,he]),Fe=(ze!=="horizontal"&&ze!=="vertical"||!!Xe)&&!P,[Te,He,Ft,Bt]=S.useMemo(()=>{let ee=!1,ue=!1,me=!1,_e=!1;return b&&$B?Xe&&(E?(me=!0,ke.matches("openness:open")&&!ke.matches("staging:closing")&&(ue=!0)):ke.matches("openness:open")&&!ke.matches("staging:closing")&&(Fe===!1&&qa()?_e=!0:ee=!0)):ke.matches("openness:closed")||(ee=!0),[ee,ue,me,_e]},[b,ke,Xe,E,Fe]),tr=S.useMemo(()=>je.getValues()[0]!=="none",[je]),ir=["right","left","horizontal"].includes(ze)?"horizontal":"vertical",[Ar,Ls]=S.useState(!1),[Lr,ci]=S.useState(!1),ms=S.useMemo(()=>!H&&(H?void 0:Ar!==!0),[H,Ar]),ui=S.useMemo(()=>Fe===!0?x==="auto"?10:1:0,[Fe,x]),Ei=S.useRef(null);S.useEffect(()=>(ge&&(Ei.current=qe.addSheet({id:ge,stackId:Ms,stackingIndex:-1,sendToOpennessMachine:pe})),()=>{ge&&qe.attemptToRemoveSheetOrCleanup(ge)}),[pe,ge,Ms]),S.useEffect(()=>(G&&qe.addNativeFocusScrollPreventer(ge),()=>{G&&qe.removeNativeFocusScrollPreventer(ge)}),[G,ge]);let be=S.useMemo(()=>ri?.(ge),[ri,ge]),[mn,Xu]=S.useState(null),_s=S.useMemo(()=>k&&mn?ee=>{mn(ee),k(ee)}:k&&!mn?k:!k&&mn?mn:null,[k,mn]),sr=S.useCallback(()=>{L?.();let ee=nt.current.exactProgressValueAtDetents[mt.current[0]];Vt.current=ee,qe.updateSheetTravelProgress(ge,ee)},[L,ge]),Dr=S.useMemo(()=>{let ee;if(Ye.value>0)ee=_s?(ue,me)=>{_s({progress:ue,range:me,progressAtDetents:nt.current.exactProgressValueAtDetents});let _e=ql(ue);Ei.current.aggregatedTravelCallback(ue,_e)}:ue=>{let me=ql(ue);Ei.current.aggregatedTravelCallback(ue,me)};else{let ue=qe.getAggregatedStackingCallbackForSheetsBelow(ge);ee=ue?_s?(me,_e)=>{_s({progress:me,range:_e,progressAtDetents:nt.current.exactProgressValueAtDetents});let Ae=ql(me);Ei.current.aggregatedTravelCallback(me,Ae),ue(me,Ae)}:me=>{let _e=ql(me);Ei.current.aggregatedTravelCallback(me,_e),ue(me,_e)}:()=>{}}return ee},[Ye.value,_s,ge]),ta=S.useRef(!1),nc=S.useMemo(()=>{let ee;return ze==="bottom"||ze==="vertical"?ee="translateY(-2px)":ze==="top"?ee="translateY(2px)":ze==="right"||ze==="horizontal"?ee="translateX(-2px)":ze==="left"&&(ee="translateX(2px)"),ue=>{ue>0&&ue<1&&!ta.current?(Wi.current.style.setProperty("transform",ee),ta.current=!0):(ue>1||ue<=0)&&ta.current&&(Wi.current.style.removeProperty("transform"),ta.current=!1)}},[ze]),Go=S.useMemo(()=>Bt?ee=>nc(ee):Dr,[nc,Bt,Dr]),[Vr,_n]=S.useState("both"),rr=Qx(ni);S.useEffect(()=>{var ee,ue;let me,_e,Ae;if(typeof $=="boolean")me={x:$,y:$};else{let{x:Xt,y:yi}=$||{};me={x:Xt,y:yi}}let Be=(Kt==="ios"||Kt==="ipados")&&H&&!$i,Je=Jx();ir==="vertical"&&(_e=me.x,Ae=!!Be||!Je&&((ee=me.y)===null||ee===void 0||ee)),ir==="horizontal"&&(Ae=!!Be||me.y,_e=(ue=me.x)===null||ue===void 0||ue),Ae=!!Ae||rr,_n(_e&&!Ae?"horizontal":!_e&&Ae?"vertical":_e&&Ae?"both":"none")},[$i,H,$,rr,ir]);let nt=S.useRef({}),[ac,Pf]=S.useState(0),[oc,Zu]=S.useState(()=>()=>({top:null,bottom:null})),ia=S.useRef([]),mt=S.useRef([0,0]),Vi=S.useRef(0),jt=S.useRef(null),Xo=S.useRef(()=>{}),sa=S.useRef(!1),pn=S.useRef(!1),Zo=S.useCallback(ee=>pn.current=ee,[]),Ti=gu(({destinationDetent:ee,trackToTravelOn:ue=ze==="vertical"?"bottom":ze==="horizontal"?"right":ze,behavior:me="instant",runTravelCallbacksAndAnimations:_e=!0,runOnTravelStart:Ae=!0,animationConfig:Be,rAFLoopEndCallback:Je,travelEndCallback:Xt})=>{UB({destinationDetent:ee,behavior:me,runTravelCallbacksAndAnimations:_e,runOnTravelStart:Ae,trackToTravelOn:ue,animationConfig:Be,rAFLoopEndCallback:Je,onTravel:_s,onTravelStart:R,onTravelEnd:()=>{Xt?.(),sr()},segment:mt,fullTravelCallback:Dr,sheetId:ge,stackId:Ms,dimensions:nt,snapBackAcceleratorTravelAxisSize:ui,actualSwipeOutDisabledWithDetent:He,lastProgressValue:Vt,viewRef:ni,scrollContainerRef:kt,contentWrapperRef:Wi,currentDetent:mt.current[0]===mt.current[1]?mt.current[0]:null,setSegment:ar,setProgrammaticScrollOngoing:Zo,contentPlacement:Lt,hasOppositeTracks:ze==="horizontal"||ze==="vertical"})}),ra=S.useCallback(()=>{mt.current[0]===mt.current[1]&&Ti({runTravelCallbacksAndAnimations:!1,destinationDetent:mt.current[0]})},[ge,ze,He,Bt,ui]),zf=S.useCallback(ee=>{jr?.({sheetId:ge,sendToOpennessMachine:pe,sendToPositionMachine:Ne})},[jr,ge,pe,Ne]),lc=S.useCallback(()=>{Xs?.(ge)},[Xs,ge]),cc=S.useMemo(()=>he==="alertdialog"?()=>{}:()=>pe({type:"CLOSE"}),[pe,he]),uc=S.useCallback(()=>{qe.updateLayer({layerId:ge,layerContextId:fe,layerStackContextId:re,inertOutside:H,onPresentAutoFocus:d,onDismissAutoFocus:p,dismissOverlayIfNotAlertDialog:cc,onClickOutside:N,onEscapeKeyDown:F,viewElement:ni.current,backdropElement:Qs.current,scrollContainerElement:kt.current,elementFocusedLastBeforeShowing:de.current})},[ge,fe,re,H,d,p,cc,N,F,de]),Qu=S.useCallback(()=>{qe.removeLayer(ge)},[ge]),If=S.useCallback(()=>{let ee=_e=>["ArrowDown","ArrowUp","PageDown","PageUp","End","Home"," "].includes(_e.key),ue=_e=>{if(ee(_e)){var Ae,Be;(Ae=kt.current)===null||Ae===void 0||Ae.style.setProperty("overflow","hidden"),(Be=kt.current)===null||Be===void 0||Be.style.setProperty("scroll-snap-type","none")}},me=_e=>{if(ee(_e)){var Ae,Be;(Ae=kt.current)===null||Ae===void 0||Ae.style.removeProperty("overflow"),(Be=kt.current)===null||Be===void 0||Be.style.removeProperty("scroll-snap-type")}};return document.addEventListener("keydown",ue),document.addEventListener("keyup",me),()=>{document.removeEventListener("keydown",ue),document.removeEventListener("keyup",me)}},[]),Or=S.useCallback(()=>{xt(ee=>ee+1),qe.updateSheetStackingIndex(ge,Ye.silent.value)},[xt,Ye.silent,ge]),Ri=S.useCallback(()=>{xt(ee=>ee-1),qe.updateSheetStackingIndex(ge,Ye.silent.value)},[xt,Ye.silent,ge]),na=Ur(Gt,"active");ks("after-paint",na,{state:"active:true",callback:uc}),ks("after-paint",na,{state:"active:true",callback:If}),Pe("after-paint",na,{state:"active:false",callback:Qu});let qr=Ur(Gt,"position"),ns=Ur(Gt,"position:covered.status");at(qr,{state:"position:out",transition:"READY_TO_GO_FRONT",callback:S.useCallback(ee=>{be?.sendToPositionMachine({type:"READY_TO_GO_DOWN",skipOpening:ee.skipOpening}),Or()},[Or,be])}),at(Gt,{state:"position:front.status:opening",transition:"NEXT",callback:S.useCallback(()=>{be?.sendToPositionMachine("NEXT")},[be])}),at(Gt,{state:"position:front.status:idle",transition:"READY_TO_GO_OUT",callback:S.useCallback(()=>{be?.sendToPositionMachine("READY_TO_GO_UP")},[be])}),at(Gt,{state:"position:front.status:idle",transition:"GO_OUT",callback:S.useCallback(()=>{Dr?.(0,{start:0,end:0}),sr(),be?.sendToPositionMachine("GO_UP"),Ri()},[Dr,sr,be,Ri])}),at(Gt,{state:"position:front.status:idle",transition:"READY_TO_GO_DOWN",callback:S.useCallback(ee=>{be?.sendToPositionMachine({type:"READY_TO_GO_DOWN",skipOpening:ee.skipOpening}),Or()},[Or,be])}),at(Gt,{state:"position:front.status:closing",transition:"NEXT",callback:S.useCallback(()=>{be?.sendToPositionMachine("NEXT"),Ri()},[be,Ri])}),at(ns,{state:"position:covered.status:going-down",transition:"NEXT",callback:S.useCallback(()=>{be?.sendToPositionMachine("NEXT")},[be])}),at(ns,{state:"position:covered.status:idle",transition:"READY_TO_GO_DOWN",callback:S.useCallback(ee=>{be?.sendToPositionMachine({type:"READY_TO_GO_DOWN",skipOpening:ee.skipOpening}),Or()},[Or,be])}),at(ns,{state:"position:covered.status:idle",transition:"READY_TO_GO_UP",callback:S.useCallback(()=>{be?.sendToPositionMachine("READY_TO_GO_UP")},[be])}),at(ns,{state:"position:covered.status:idle",transition:"GO_UP",callback:S.useCallback(()=>{be?.sendToPositionMachine("GO_UP"),Ri()},[Ri,be])}),Pe("immediate",ns,{state:"position:covered.status:come-back",callback:S.useCallback(()=>Ne(""),[Ne])}),at(ns,{state:"position:covered.status:going-up",transition:"NEXT",callback:S.useCallback(()=>{be?.sendToPositionMachine("NEXT"),Ri()},[be,Ri])}),Pe("immediate",ns,{state:"position:covered.status:indeterminate",callback:S.useCallback(()=>{Ye.silent.value===0?Ne("GOTO_front"):Ne("GOTO_idle")},[Ye.silent,Ne])});let Ds=S.useCallback(()=>be?.sendToOpennessMachine({machine:"staging",type:"NEXT"}),[be]),nr=S.useCallback((ee,{newState:ue})=>{tt(ue),Qn?.({sheetId:ge,staging:ue})},[i,tt,Qn,ge]),gn=S.useCallback((ee,{newState:ue})=>{v?.(ue)},[v]),ar=S.useMemo(()=>{let ee=ue=>{Vi.current=ue[1],queueMicrotask(()=>{let me=ue[0],_e=ue[1];(me!==mt.current[0]||_e!==mt.current[1])&&(mt.current=ue,me===_e&&(jt.current===null&&Oe?Oe(_e):me===jt.current&&(jt.current=null)))})};return g&&Fe===!1?ee=ue=>{Vi.current=ue[1],queueMicrotask(()=>{let me=ue[0],_e=ue[1];(me!==mt.current[0]||_e!==mt.current[1])&&(mt.current=ue,g({start:me,end:_e}),me===_e&&(jt.current===null&&Oe?Oe(_e):me===jt.current&&(jt.current=null)))})}:Fe===!0&&(ee=Ft?ue=>{Vi.current=ue[1],queueMicrotask(()=>{let me=ue[0],_e=ue[1];if(me!==mt.current[0]||_e!==mt.current[1]){let Ae=Qi.length;He&&me===1&&_e===1?pe({machine:"backStuck",type:"STUCK_START"}):me===Ae&&_e===Ae?pe({machine:"frontStuck",type:"STUCK_START"}):ro.current?pe({machine:"frontStuck",type:"STUCK_END"}):tl.current&&pe({machine:"backStuck",type:"STUCK_END"}),mt.current=ue,g?.({start:me,end:_e}),me===_e&&(jt.current===null&&Oe?Oe(_e):me===jt.current&&(jt.current=null))}})}:ue=>{Vi.current=ue[1],queueMicrotask(()=>{let me=ue[0],_e=ue[1];if(me!==mt.current[0]||_e!==mt.current[1]){let Ae=Qi.length;me===Ae&&_e===Ae?pe({machine:"frontStuck",type:"STUCK_START"}):ro.current&&pe({machine:"frontStuck",type:"STUCK_END"}),mt.current=ue,g?.({start:me,end:_e}),me===_e&&(jt.current===null&&Oe?Oe(_e):me===jt.current&&(jt.current=null))}})}),ee},[g,Fe,Oe,Ft,He,Qi.length,pe]),Os=S.useCallback(ee=>{let ue={destinationDetent:ee==="front"?nt.current.detentMarkers.length:1,runTravelCallbacksAndAnimations:!1};if(Ti(ue),qa()){var me;(me=kt.current)===null||me===void 0||me.style.setProperty("overflow","hidden"),setTimeout(()=>{var _e;(_e=kt.current)===null||_e===void 0||_e.style.removeProperty("overflow")},CSS.supports("overscroll-behavior","none")?1:10)}sa.current=!1},[Ti]),or=S.useCallback((ee,ue)=>{let me=mt.current[0],_e=ue??null;if(_e===null){var Ae,Be;_e=(ee??"up")==="up"?(Ae=mt.current[0])<Qi.length?Ae+1:1:(Be=mt.current[0])>1?Be-1:Qi.length}return _e===0||_e===me?null:_e},[Qi]),Qo=S.useCallback(({direction:ee,detent:ue,behavior:me})=>{let _e=()=>{let Ae=or(ee,ue);Ae&&pe({type:"ACTUALLY_STEP",detent:Ae,behavior:me})};ke.silent.matches("openness:open.scroll:ended.afterPaintEffectsRun:true")?_e():pc.current=_e},[ke.silent,or,pe]),aa=S.useCallback((ee,ue)=>{jt.current=ee,Oe?.(ee),Ti({destinationDetent:ee,behavior:ue??(ft.skip?"instant":"smooth"),animationConfig:ft,travelEndCallback:()=>pe({machine:"staging",type:"NEXT"})})},[Oe,Ti,ft,pe]),Br=S.useCallback((ee,ue,me,_e)=>{let Ae;if(ee==="auto"){let Be=_e==="center"?me+(ue-me)/2:me;Ae=Vn==="chromium"?Be<=1440?70+.25*Be:.3*Be:qa()?Kt==="ios"||Kt==="ipados"?Be<=716?15+.1*Be:.12*Be:.5*Be:10}else if(typeof ee=="function"){let Be=parseInt(ee(me),10);Ae=Be<1?1:Be>me/2?me/2:Be}else ee==="initial"&&(Ae=1);return Ae},[]),Jo=S.useCallback(()=>{if(ni.current){let ee=(ue,me)=>ni.current.style.setProperty(ue,me);ee("--silk-aD",nt.current.view.travelAxis.px),ee("--silk-aE",nt.current.view.crossAxis.px),ee("--silk-aF",nt.current.content.travelAxis.px),ee("--silk-aG",nt.current.content.crossAxis.px),ee("--silk-aH",nt.current.frontSpacer.travelAxis.px),ee("--silk-aI",nt.current.backSpacer.travelAxis.px),ee("--silk-aJ",nt.current.snapOutAccelerator.travelAxis.px),ee("--silk-aK",nt.current.detentMarkers[0].travelAxis.px)}},[]),el=S.useCallback(ee=>{let ue=ni.current,me=As.current,_e=[];ea.current.forEach(Dt=>{_e.push(window.getComputedStyle(Dt))});let Ae=Dt=>parseFloat(Dt),Be=Dt=>parseInt(Dt,10),Je=Dt=>ze==="right"||ze==="left"||ze==="horizontal"?Dt==="travelAxis"?"width":"height":Dt==="travelAxis"?"height":"width",Xt=Dt=>{let lr,Kr,cr,Ji,$e,Pr;return Kr=Ae(lr=Dt.getPropertyValue(Je("travelAxis"))),cr=Be(lr),$e=Be(Ji=Dt.getPropertyValue(Je("crossAxis"))),Pr=Be(Ji),{travelAxis:{px:lr,unitless:Kr,unitlessRoundedDown:cr},crossAxis:{px:Ji,unitless:$e,unitlessRoundedDown:Pr}}},yi=()=>{let Dt,lr,Kr=window.getComputedStyle(ni.current),cr=window.getComputedStyle(As.current),Ji=0;Pf(bt=>bt+1),nt.current={view:{...Xt(Kr)},scroll:{},snapOutAccelerator:{travelAxis:{}},frontSpacer:{travelAxis:{}},backSpacer:{travelAxis:{}},content:{...Xt(cr)},detentMarkers:[..._e.map((bt,ps)=>{let Ns=Xt(bt);return ps!==_e.length-1&&(Ji+=Ns.travelAxis.unitless),{...Ns,accumulatedOffsets:{travelAxis:{px:Ji+"px",unitless:Ji,unitlessRoundedDown:null}}}})],progressValueAtDetents:[]};let $e=nt.current;$e.scroll=$e.view;let Pr=Br(C,$e.view.travelAxis.unitless,$e.content.travelAxis.unitless,Lt);$e.snapOutAccelerator.travelAxis.px=Pr+"px",$e.snapOutAccelerator.travelAxis.unitless=Pr,$e.snapOutAccelerator.travelAxis.unitlessRoundedDown=Be(Pr);let rh=$e.detentMarkers.length,ao=$e.content.travelAxis.unitless-Ji;$e.detentMarkers[rh-1]={travelAxis:{px:ao+"px",unitless:ao,unitlessRoundedDown:null},crossAxis:{px:"1px",unitless:1,unitlessRoundedDown:1},accumulatedOffsets:{travelAxis:{px:Ji+ao+"px",unitless:Ji+ao,unitlessRoundedDown:null}}};let oo=bt=>({before:bt(-2.1),exact:bt(0),after:bt(2.1)}),la=$e.content.travelAxis.unitless,bn=[oo(bt=>bt/la)],vc;$e.detentMarkers.slice(0,-1).forEach(bt=>{let ps=bt.accumulatedOffsets.travelAxis.unitless;bn.push(oo(Ns=>(ps+Ns)/la))}),bn.push(oo(bt=>(la+bt)/la)),vc=bn[Ut];let yc=ia.current.length>0?ia.current[mt.current[1]]:0,nh=(function(bt,ps){let Ns=0;for(let Gr=1;Gr<ps.length;Gr++){let Si=ps[Gr];Math.abs(Si-bt)<Math.abs(ps[Ns]-bt)&&(Ns=Gr)}return Ns})(yc??1,bn.map(bt=>bt.exact));ar([nh,nh]),$e.progressValueAtDetents=bn,$e.exactProgressValueAtDetents=bn.map(bt=>bt.exact),ia.current=$e.progressValueAtDetents.map(bt=>bt.exact),$e.progressValueAtInitialDetent=vc,Dt=Bt?ze==="horizontal"||ze==="vertical"?$e.view.travelAxis.unitless/2+1:1:He?$e.content.travelAxis.unitless-nt.current.detentMarkers[0].travelAxis.unitless+ui:ze==="horizontal"||ze==="vertical"?$e.view.travelAxis.unitless/2+$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)/2+$e.snapOutAccelerator.travelAxis.unitless:Lt==="center"?$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)/2+$e.snapOutAccelerator.travelAxis.unitless:$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)+$e.snapOutAccelerator.travelAxis.unitless,$e.frontSpacer.travelAxis.unitless=Dt,$e.frontSpacer.travelAxis.px=Dt+"px",lr=Fe===!0&&x==="auto"?$e.view.travelAxis.unitless+ui:ze==="horizontal"||ze==="vertical"?Bt?$e.view.travelAxis.unitless/2:$e.view.travelAxis.unitless/2+$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)/2+$e.snapOutAccelerator.travelAxis.unitless:$e.view.travelAxis.unitless,$e.backSpacer.travelAxis.unitless=lr,$e.backSpacer.travelAxis.px=lr+"px",Jo(),Zu(()=>()=>{let bt,ps;if(!ni.current)return{top:null,bottom:null};let Ns=ni.current.getBoundingClientRect(),Gr=Ns.top,Si=Ns.bottom,ca=Ko||ze==="top"||ze==="bottom",lo=$e.view[ca?"travelAxis":"crossAxis"].unitless,co=$e.content[ca?"travelAxis":"crossAxis"].unitless;return Lt==="left"||Lt==="right"||Lt==="center"?(bt=Gr+(lo-co)/2,ps=Si-(lo-co)/2):Lt==="top"?(bt=Gr,ps=Si-(lo-co)):Lt==="bottom"&&(bt=Gr+(lo-co),ps=Si),{top:bt,bottom:ps}})};yi();let Yr=(Dt,lr)=>{let Kr=new ResizeObserver(cr=>{cr.forEach(()=>lr())});return Kr.observe(Dt,{box:"border-box"}),Kr},Nr=()=>{yi(),Ti({runTravelCallbacksAndAnimations:!1})},as=!0,os=Yr(ue,()=>{as?as=!1:Nr()}),Sn=!0,Zt=Yr(me,()=>{Sn?(yi(),Sn=!1):Nr()});return()=>{os&&ue&&(os.unobserve(ue),os.disconnect()),Zt&&me&&(Zt.unobserve(me),Zt.disconnect())}},[ze,Br,C,Ut,Fe,Jo,ui,x,Ti,ar,Lt,He,Bt,Qi]),hc=S.useCallback(ee=>{let ue,me=0,_e=ee,Ae=0;return Be=>{ue=Be;let Je=_e-Be;return me=Je,(Je===0||Math.abs(Je)<Math.abs(Ae/2))&&ke.silent.matches("scrollContainerTouch:ongoing")&&(ue=_e-Ae/2,me=_e-ue),Math.abs(me)>=.1&&.35>Math.abs(me)&&(ue=me>=0?_e-.1:_e+.1,me=me>=0?.1:-.1),Be<=0&&(ue=0),_e=ue,Ae=me,ue}},[ke.silent]),Ja=S.useCallback(()=>{var ee;let ue,me,_e=ze==="right"||ze==="left"||ze==="horizontal"?"scrollLeft":"scrollTop",Ae=kt.current,Be=nt.current.snapOutAccelerator.travelAxis.unitless,Je=nt.current.content.travelAxis.unitless,Xt=nt.current.scroll.travelAxis.unitless,yi=hc((ee=Vt.current)!==null&&ee!==void 0?ee:nt.current.progressValueAtDetents[mt.current[1]].exact),Yr=ze==="right"||ze==="bottom",Nr=ze==="left"||ze==="top";if(Yr||Nr){let as;if(Bt)as=Nr?Zt=>1-Zt/Je:Zt=>1+Zt/Je;else if(Yr)if(Lt!=="center"){let Zt=He?nt.current.detentMarkers[0].travelAxis.unitless-ui:-Be;as=Dt=>(Dt+Zt)/Je}else{let Zt=Je+(Xt-Je)/2;as=Dt=>(Dt-Be)/Zt}else if(Nr)if(Lt!=="center")as=Zt=>(Je+ui-Zt)/Je;else{let Zt=Je+(Xt-Je)/2;as=Dt=>(Zt+ui-Dt)/Zt}let os=Fe===!0?1:10,Sn=Fe===!0&&He?nt.current.progressValueAtDetents[1].exact:0;me=()=>{ue=Ae[_e];let Zt=Math.min(Math.max(as(ue),Sn),os);return Math.min(Math.max(yi(Zt),Sn),os)}}else if(ze==="horizontal"||ze==="vertical"){let as=(Xt-Je)/2,os=Bt?0:Be+Xt-as,Sn=Je+as;me=()=>{ue=Ae[_e];let Zt=1-Math.abs(ue-os)/Sn;return Math.max(yi(Math.max(Zt,0)),0)}}return me},[ze,hc,Fe,Bt,Lt,He,ui,ac]),vn=S.useRef(),Ju=S.useCallback(()=>{let ee=kt.current,ue=()=>{pe({machine:"openness:open.move",type:"MOVE_END"});for(let _e=0;_e<nt.current.progressValueAtDetents.length;_e++){let Ae=nt.current.progressValueAtDetents[_e].exact;Vt.current>Ae-.01&&Vt.current<Ae+.01&&(pe({machine:"openness:open.scroll",type:"SCROLL_END"}),pe({machine:"openness:open.swipe",type:"SWIPE_END"}))}},me=()=>{pn.current?Zo(!1):(_c.current||pe({machine:"openness:open.scroll",type:"SCROLL_START"}),ro.current||tl.current||(il.current||pe({machine:"openness:open.swipe",type:"SWIPE_START"}),gc.current||pe({machine:"openness:open.move",type:"MOVE_START"}))),clearTimeout(vn.current),vn.current=setTimeout(ue,200)};return ee.addEventListener("scroll",me),()=>{ee.removeEventListener("scroll",me),clearTimeout(vn.current)}},[pe,Zo]),Vt=S.useRef(null),yn=S.useCallback(()=>{let ee;if(Go){let ue=nt.current.progressValueAtDetents,me=ue.length,_e=Ja();ee=FB(()=>{let Ae,Be=_e();if(Vt.current!==Be){for(let Je=0;Je<me;Je++){let Xt=ue[Je],yi=Xt.after;Be>yi&&Je+1<me&&Be<ue[Je+1].before?(Ae={start:Je,end:Je+1},ar([Je,Je+1])):Be>Xt.before&&Be<yi?(Ae={start:Je,end:Je},ar([Je,Je])):Be<=0&&(Ae={start:0,end:0},ar([0,0]))}Xo.current(Be,Ae),Vt.current=Be}})}return()=>{ee?.()}},[ar,Go,Ja]),eo=S.useCallback(ee=>{let ue=1e5,me=_e=>{ue<Math.abs(_e.deltaY)?window.removeEventListener("wheel",me,{passive:!1}):_e.preventDefault(),ue=Math.abs(_e.deltaY)};return window.addEventListener("wheel",me,{passive:!1}),setTimeout(()=>{ee("SWIPED_OUT")},100),()=>window.removeEventListener("wheel",me,{passive:!1})},[]),to=S.useCallback((ee,{send:ue})=>{let me,_e=ni.current,Ae=As.current,Be=kt.current,Je=!1,Xt=()=>Je=!0;window.addEventListener("wheel",Xt,{passive:!0,once:!0});let yi=new IntersectionObserver(function(Yr){for(let Nr of Yr)Nr.isIntersecting||(_e.style.setProperty("pointer-events","none","important"),_e.style.setProperty("opacity","0","important"),_e.style.setProperty("position","fixed","important"),_e.style.setProperty("top","-100px","important"),_e.style.setProperty("left","-100px","important"),Ae.style.setProperty("pointer-events","none","important"),Be.style.setProperty("width","1px","important"),Be.style.setProperty("height","1px","important"),Be.style.setProperty("clip-path","inset(0)","important"),requestAnimationFrame(()=>{Je?me=eo(ue):ue("SWIPED_OUT")}))},{root:_e,threshold:[0]});return yi.observe(Ae),()=>{me?.(),window.removeEventListener("wheel",Xt,{passive:!0,once:!0}),yi&&(yi.unobserve(Ae),yi.disconnect())}},[eo]),Hf=S.useRef(()=>0),dc=S.useCallback(()=>{let ee=ni.current,ue=me=>{ln({nativeEvent:me,defaultBehavior:{},handler:J})};return ee?.addEventListener("focus",ue,{capture:!0}),()=>{ee?.removeEventListener("focus",ue,{capture:!0})}},[J]),fc=S.useCallback(ee=>{kt.current.contains(ee.target)&&pe({machine:"scrollContainerTouch",type:"TOUCH_START"})},[pe]),io=S.useCallback(ee=>{kt.current.contains(ee.target)&&pe({machine:"scrollContainerTouch",type:"TOUCH_END"})},[pe]);Pe("immediate",je,{state:"staging:none",callback:nr,params:{newState:"none"}}),at(je,{state:"staging:none",transition:"OPEN",callback:S.useCallback(()=>be?.sendToOpennessMachine({machine:"staging",type:"GO_DOWN",skipOpening:ji?.skip}),[be,ji?.skip])}),at(je,{state:"staging:none",transition:"OPEN_PREPARED",callback:S.useCallback(ee=>be?.sendToOpennessMachine({machine:"staging",type:"GO_DOWN",skipOpening:ee.skipOpening}),[be])}),at(je,{state:"staging:none",transition:"GO_DOWN",callback:S.useCallback(ee=>be?.sendToOpennessMachine({machine:"staging",type:"GO_DOWN",skipOpening:ee.skipOpening}),[be])}),at(je,{state:"staging:none",transition:"ACTUALLY_CLOSE",callback:S.useCallback(()=>be?.sendToOpennessMachine({machine:"staging",type:"GO_UP"}),[be])}),at(je,{state:"staging:none",transition:"GO_UP",callback:S.useCallback(ee=>be?.sendToOpennessMachine({machine:"staging",type:"GO_UP",skipClosing:ee.skipClosing}),[be])}),Pe("immediate",je,{state:"staging:open",callback:nr,params:{newState:"open"}}),Pe("immediate",je,{state:"staging:open",callback:S.useCallback(()=>{pe({machine:"longRunning",type:"TO_TRUE"})},[pe])}),Pe("immediate",je,{state:"staging:open",callback:S.useCallback(()=>{oe||ve==null||ve(!0)},[oe,ve])}),Pe("after-paint",je,{state:"staging:open",callback:S.useCallback(()=>{requestAnimationFrame(()=>{pe({machine:"openness",type:"READY_TO_OPEN",skipOpening:!0}),pe({machine:"staging",type:"NEXT"})})},[pe])}),at(je,{state:"staging:open",transition:"NEXT",callback:Ds}),Pe("immediate",je,{state:"staging:opening",callback:nr,params:{newState:"opening"}}),Pe("immediate",je,{state:"staging:opening",callback:S.useCallback(()=>{pe({machine:"longRunning",type:"TO_TRUE"})},[pe])}),Pe("immediate",je,{state:"staging:opening",callback:S.useCallback(()=>{oe||ve==null||ve(!0)},[oe,ve])}),Pe("before-paint",je,{state:"staging:opening",callback:S.useCallback(()=>{R?.(),Dr(0,{start:0,end:0})},[Dr,R])}),Pe("after-paint",je,{state:"staging:opening",callback:S.useCallback(()=>{requestAnimationFrame(()=>{pe({machine:"openness",type:"READY_TO_OPEN",skipOpening:!1})})},[pe])}),ks("after-paint",je,{state:"staging:opening",callback:S.useCallback(()=>(dB(ge),()=>fB(ge)),[ge])}),at(je,{state:"staging:opening",transition:"NEXT",callback:Ds}),Pe("immediate",je,{state:"staging:stepping",callback:nr,params:{newState:"stepping"}}),Pe("after-paint",je,{state:"staging:stepping",callback:S.useCallback(({detent:ee,behavior:ue})=>{v?.("stepping"),aa(ee,ue)},[v,aa])}),za("immediate",je,{state:"staging:stepping",callback:S.useCallback(()=>{v?.("idleInside")},[v])}),Pe("immediate",je,{state:"staging:closing",callback:nr,params:{newState:"closing"}}),Pe("immediate",je,{state:"staging:closing",callback:S.useCallback(()=>{oe&&ve?.(!1)},[oe,ve])}),Pe("after-paint",je,{state:"staging:closing",callback:S.useCallback(()=>{pe({machine:"openness",type:"READY_TO_CLOSE"})},[pe])}),at(je,{state:"staging:closing",transition:"NEXT",callback:Ds}),Pe("immediate",je,{state:"staging:go-down",callback:nr,params:{newState:"go-down"}}),at(je,{state:"staging:go-down",transition:"NEXT",callback:Ds}),Pe("immediate",je,{state:"staging:going-down",callback:nr,params:{newState:"going-down"}}),at(je,{state:"staging:going-down",transition:"NEXT",callback:Ds}),Pe("immediate",je,{state:"staging:going-up",callback:nr,params:{newState:"going-up"}}),at(je,{state:"staging:going-up",transition:"NEXT",callback:Ds});let Mi=Ur(ke,"longRunning");Pe("immediate",Mi,{state:"longRunning:true",callback:S.useCallback(()=>{de.current===null&&(de.current=document.activeElement)},[de])}),Pe("immediate",Mi,{state:"longRunning:true",callback:S.useCallback(()=>{Le(!0),rs?.(ee=>ee+1)},[Le,rs])}),ks("before-paint",Mi,{state:"longRunning:true",callback:el}),Pe("before-paint",Mi,{state:"longRunning:true",guard:!ji.skip,callback:S.useCallback(()=>{Ti({trackToTravelOn:er,runTravelCallbacksAndAnimations:!1,destinationDetent:0})},[Ti,er])}),ks("after-paint",Mi,{state:"longRunning:true",guard:U,callback:S.useCallback(()=>MB(fn,I),[I])}),ks("after-paint",Mi,{state:"longRunning:true",callback:zf}),Pe("immediate",Mi,{state:"longRunning:false",callback:S.useCallback(()=>{Le(!1),rs?.(ee=>ee-1)},[Le,rs])}),Pe("immediate",Mi,{state:"longRunning:false",callback:S.useCallback(()=>{de.current=null},[de])}),Pe("before-paint",Mi,{state:"longRunning:false",callback:S.useCallback(()=>{qe.removeAllOutletPersistedStylesFromSheet(ge)},[ge])}),Pe("after-paint",Mi,{state:"longRunning:false",callback:lc}),ks("before-paint",na,{state:"active:true",callback:ra});let yt=Ur(ke,"openness"),Bs=Ur(ke,"openness:closed.status");Pe("immediate",yt,{state:"openness:closed",callback:gn,params:{newState:"idleOutside"}}),Pe("immediate",yt,{state:"openness:closed",callback:S.useCallback(()=>{pe({machine:"longRunning",type:"TO_FALSE"})},[pe])}),Pe("immediate",yt,{state:"openness:closed",callback:S.useCallback(()=>{oe&&ve?.(!1)},[oe,ve])}),Pe("immediate",yt,{state:"openness:closed",callback:S.useCallback(()=>{Ne({machine:"active",type:"TO_FALSE"})},[Ne])}),Pe("after-paint",yt,{state:"openness:closed",callback:S.useCallback(()=>{clearTimeout(vn.current),Vt.current=null,ar([0,0]),ta.current=!1,xt(-1),sa.current=!1},[xt,ar])}),at(yt,{state:"openness:closed",transition:"READY_TO_OPEN",callback:S.useCallback(ee=>{Ne({machine:"position",type:"READY_TO_GO_FRONT",skipOpening:ee.skipOpening})},[Ne])}),TB(pe,Bs,"openness:closed.status:pending",{delay:3e3}),za("immediate",Bs,{state:"openness:closed.status:pending",callback:S.useCallback(()=>{pe("SWIPE_RESET")},[pe])}),Pe("before-paint",Bs,{state:"openness:closed.status:flushing-to-preparing-opening",callback:S.useCallback(()=>{pe({machine:"openness:closed.status",type:""})},[pe])}),Pe("before-paint",Bs,{state:"openness:closed.status:flushing-to-preparing-open",callback:S.useCallback(()=>{pe({machine:"openness:closed.status",type:""})},[pe])}),Pe("after-paint",Bs,{state:"openness:closed.status:preparing-opening",callback:S.useCallback(()=>{pe({machine:"staging",type:"OPEN_PREPARED",skipOpening:!1})},[pe])}),Pe("after-paint",Bs,{state:"openness:closed.status:preparing-open",callback:S.useCallback(()=>{pe({machine:"staging",type:"OPEN_PREPARED",skipOpening:!0})},[pe])}),Pe("immediate",Bs,{state:"openness:closed.status:safe-to-unmount",callback:S.useCallback(()=>{we?.(!0)},[we])}),za("immediate",Bs,{state:"openness:closed.status:safe-to-unmount",callback:S.useCallback(()=>{we?.(!1)},[we])}),Pe("immediate",yt,{state:"openness:opening",callback:gn,params:{newState:"entering"}}),Pe("before-paint",yt,{state:"openness:opening",callback:S.useCallback(()=>{jt.current=Ut,Oe?.(Ut),Ti({trackToTravelOn:er,destinationDetent:Ut,behavior:"smooth",animationConfig:ji,travelEndCallback:()=>pe("NEXT"),runOnTravelStart:!1})},[er,Oe,Ti,Ut,ji,pe])}),at(yt,{state:"openness:opening",transition:"NEXT",callback:S.useCallback(()=>{Ne("NEXT"),pe({machine:"staging",type:"NEXT"})},[Ne,pe])}),Pe("immediate",yt,{state:"openness:open",callback:gn,params:{newState:"idleInside"}}),Pe("immediate",yt,{state:"openness:open",callback:S.useCallback(()=>{Ne({machine:"active",type:"TO_TRUE"})},[Ne])}),Pe("before-paint",yt,{state:"openness:open",guard:ji.skip,callback:S.useCallback(()=>{jt.current=Ut,Oe?.(Ut),Ti({trackToTravelOn:er,destinationDetent:Ut})},[Ut,Oe,Ti,er])}),ks("before-paint",yt,{state:"openness:open",callback:S.useCallback(()=>{if(qa()&&Xe){var ee;(ee=kt.current)===null||ee===void 0||ee.style.setProperty("will-change","transform"),requestAnimationFrame(()=>{var ue;return(ue=kt.current)===null||ue===void 0?void 0:ue.style.removeProperty("will-change","transform")})}},[Xe]),params:{unusedDep:ac}}),ks("before-paint",yt,{state:"openness:open",guard:!Te,callback:Ju}),Pe("after-paint",je,{state:"staging:open",guard:Fe===!0&&x==="auto",callback:S.useCallback(()=>{Ut===Qi.length?pe({machine:"frontStuck",type:"STUCK_START"}):Xe&&Ut===1&&pe({machine:"backStuck",type:"STUCK_START"})},[pe,Ut,Qi,Xe])}),ks("after-paint",yt,{state:"openness:open",guard:!Te&&!Bt&&!He,callback:to,params:{send:pe}}),ks("after-paint",yt,{state:"openness:open",callback:dc}),at(yt,{state:"openness:open",transition:"READY_TO_CLOSE",callback:S.useCallback(()=>Ne("READY_TO_GO_OUT"),[Ne])}),at(yt,{state:"openness:open",transition:"ACTUALLY_CLOSE",callback:S.useCallback(()=>{jt.current=null,Oe?.(0),R?.(),Ne("GO_OUT")},[Oe,R,Ne])}),at(yt,{state:"openness:open",transition:"SWIPED_OUT",callback:S.useCallback(()=>{var ee;(ee=kt.current)===null||ee===void 0||ee.style.setProperty("scroll-snap-type","none","important"),jt.current=null,Oe?.(0),Ne("GO_OUT")},[Oe,Ne])}),za("immediate",yt,{state:"openness:open",callback:S.useCallback(()=>{pe("SWIPE_END")},[pe])});let mc=Ur(ke,"backStuck"),tl=S.useRef(!1);at(mc,{state:"backStuck:false",transition:"STUCK_START",callback:S.useCallback(()=>tl.current=!0,[])}),at(mc,{state:"backStuck:true",transition:"STUCK_END",callback:S.useCallback(()=>tl.current=!1,[])}),at(mc,{state:"backStuck:false",transition:"STUCK_START",guard:Fe===!0&&x==="auto",callback:S.useCallback(()=>{ke.silent.matches("scrollContainerTouch:ended")&&Os("back")},[ke.silent,Os])});let so=Ur(ke,"frontStuck"),ro=S.useRef(!1);at(so,{state:"frontStuck:false",transition:"STUCK_START",callback:S.useCallback(()=>ro.current=!0,[])}),at(so,{state:"frontStuck:true",transition:"STUCK_END",callback:S.useCallback(()=>ro.current=!1,[])}),at(so,{state:"frontStuck:false",transition:"STUCK_START",guard:Fe===!0&&x==="auto",callback:S.useCallback(()=>{ke.silent.matches("openness:open")&&ke.silent.matches("scrollContainerTouch:ended")&&Os("front")},[ke.silent,Os])}),Pe("immediate",ke,{state:"scrollContainerTouch:ended",guard:Fe===!0&&x==="auto",callback:S.useCallback(()=>{sa.current&&setTimeout(()=>{requestAnimationFrame(()=>{ke.silent.matches("openness:open")&&(ke.silent.matches("backStuck:true")?Os("back"):ke.silent.matches("frontStuck:true")&&Os("front"))})},80)},[ke.silent,Os])});let oa=Ur(ke,"openness:open.scroll"),_c=S.useRef(!1);Pe("immediate",oa,{state:"openness:open.scroll:ongoing",callback:S.useCallback(()=>_c.current=!0,[])}),za("immediate",oa,{state:"openness:open.scroll:ongoing",callback:S.useCallback(()=>_c.current=!1,[])}),Pe("immediate",oa,{state:"openness:open.scroll:ongoing",callback:S.useCallback(()=>{sa.current=!0},[])}),ks({start:"immediate",update:"before-paint"},oa,{state:"openness:open.scroll:ongoing",callback:yn});let pc=S.useRef(()=>{});Pe("after-paint",oa,{state:"openness:open.scroll:ended",callback:S.useCallback(()=>{pe({machine:"openness:open.scroll:ended.afterPaintEffectsRun",type:"OCCURRED"}),pc.current(),pc.current=()=>{}},[pe])}),za("immediate",oa,{state:"openness:open.scroll:ended",callback:S.useCallback(()=>{pe({machine:"openness:open.scroll:ended.afterPaintEffectsRun",type:"RESET"})},[pe])});let gc=S.useRef(!1);Pe("immediate",ke,{state:"openness:open.move:ongoing",callback:S.useCallback(()=>{gc.current=!0,Xo.current=Go},[Go])}),za("immediate",ke,{state:"openness:open.move:ongoing",callback:S.useCallback(()=>{gc.current=!1,Xo.current=()=>{}},[])});let il=S.useRef(!1);Pe("immediate",ke,{state:"openness:open.swipe:ongoing",callback:S.useCallback(()=>il.current=!0,[])}),za("immediate",ke,{state:"openness:open.swipe:ongoing",callback:S.useCallback(()=>il.current=!1,[])}),Pe("immediate",ke,{state:"openness:open.swipe:ongoing",callback:S.useCallback(()=>R?.(),[R])}),Pe("immediate",ke,{state:"openness:open.swipe:ongoing",callback:gn,params:{newState:"stepping"}}),Pe("immediate",ke,{state:"openness:open.swipe:ended",callback:S.useCallback(()=>sr(),[sr])}),Pe("immediate",ke,{state:"openness:open.swipe:ended",guard:typeof v=="function",callback:S.useCallback(()=>{ke.silent.matches("openness:open")&&v("idleInside")},[ke.silent,v])});let eh=S.useCallback(()=>{!qr.matches("position:front")||mt.current[0]===0&&mt.current[1]===0||Xe&&mt.current[0]!==mt.current[1]?oe===!1&&ve?.(!0):pe("ACTUALLY_CLOSE")},[qr,pe,oe,ve,Xe]);at(ke,{state:"openness:open.evaluateCloseMessage:true",transition:"CLOSE",callback:eh}),at(ke,{state:"openness:open.evaluateCloseMessage:false",transition:"CLOSE",callback:eh}),at(ke,{state:"openness:open.evaluateStepMessage:true",transition:"STEP",callback:Qo}),at(ke,{state:"openness:open.evaluateStepMessage:false",transition:"STEP",callback:Qo}),Pe("immediate",yt,{state:"openness:closing",callback:gn,params:{newState:"exiting"}}),Pe("before-paint",yt,{state:"openness:closing",callback:S.useCallback(()=>{jt.current=0,Oe?.(0),Ti({trackToTravelOn:Se.track,destinationDetent:0,behavior:"smooth",animationConfig:Se,travelEndCallback:()=>pe("NEXT")})},[Oe,Ti,Se,pe])}),at(yt,{state:"openness:closing",transition:"NEXT",callback:S.useCallback(()=>{Ne("NEXT"),pe({machine:"staging",type:"NEXT"})},[Ne,pe])});let Uf=S.useCallback(()=>pe({machine:"skipOpening",type:ji.skip?"TO_TRUE":"TO_FALSE"}),[pe,ji.skip]);ks("after-paint",ke,{state:"",callback:Uf});let Ff=S.useCallback(()=>pe({machine:"skipClosing",type:Se.skip?"TO_TRUE":"TO_FALSE"}),[pe,Se.skip]);ks("after-paint",ke,{state:"",callback:Ff}),S.useEffect(()=>{oe!==void 0&&pe(oe?"OPEN":"CLOSE")},[oe,pe]);let $f=gu(()=>{lc(),Jn?.(ge),qe.removeAllOutletPersistedStylesFromSheet(ge)}),sl=S.useRef(!0),Wf=gu(()=>{oe&&ve?.(!1)});S.useEffect(()=>()=>{!sl.current&&(Wf(),nr(null,{newState:"none"}),$f(),Le(!1),Mi.silent.matches("longRunning:true")&&rs?.(ee=>ee-1))},[]),S.useEffect(()=>()=>sl.current=!1),S.useEffect(()=>{xe!==void 0&&mt.current[0]!==xe&&mt.current[1]!==xe&&jt.current!==xe&&pe({type:"STEP",activeDetent:xe})},[xe,pe]),S.useEffect(()=>{let ee=()=>{var ue;return(ue=kt.current)===null||ue===void 0?void 0:ue.scrollTo(0,0)};return window.addEventListener("unload",ee),()=>window.removeEventListener("unload",ee)},[]);let th=gu((ee,ue)=>{Ei.current&&!yt.matches("openness:closed")&&Dr(ee,ue)}),ih=gu(Qu);S.useEffect(()=>()=>{th(0,{start:0,end:0}),Ei.current&&ih(),o5(null)},[Mi.silent,rs,th,ih]);let no=Ui("Sheet",{staging:je.getValues()[0],openness:yt.getValues()[0],opennessClosedStatus:Bs.getValues()[0],position:qr.getValues()[0],positionCoveredStatus:ns.getValues()[0],placement:Lt,track:ze,swipeDisabled:Te,swipeOutDisabledWithDetent:He,swipeOvershootDisabled:Fe,swipeTrap:Vr,scrollContainerShouldBePassThrough:ms}),rl=S.useMemo(()=>!Bs.matches(["openness:closed.status:flushing-to-preparing-open","openness:closed.status:flushing-to-preparing-opening","openness:closed.status:safe-to-unmount"]),[Bs]),jf=S.useMemo(()=>yt.matches("openness:closed")&&rl,[rl,yt]),sh=S.useMemo(()=>je.matches(["staging:opening","staging:open"]),[je]),Vf=S.useMemo(()=>rl||sh,[rl,sh]),qf=S.useMemo(()=>H&&(qr.matches(["position:front","position:covered"])||dt!=="none"),[H,qr,dt]);return j.jsx(Gu,{genericContext:Za,customContext:fe,value:X,children:j.jsx(Wr.Provider,{value:{sheetContext:B,titleId:_t,descriptionId:St,styleAttributes:no,backdropRef:Qs,scrollContainerRef:kt,frontSpacerRef:Rr,contentWrapperRef:Wi,contentRef:As,backSpacerRef:Mr,detentMarkersRefs:ea,leftEdgeRef:fn,setBackdropSwipeable:Ls,setBleedingBackgroundPresent:ci,detents:Qi,longRunningState:Mi,staging:dt,layerCovered:Qe,placement:Lt,track:ze,travelAxis:ir,nativeEdgeSwipePrevention:U,bleedingBackgroundPresent:Lr,setBackdropTravelHandler:Xu,ancestorPrimarySwipeTrapActiveOnYAxis:Vr==="vertical"||Vr==="both",scrollContainerTouchStartHandler:fc,scrollContainerTouchEndHandler:io,getContentCoordinatesWhenRestingOnLastDetent:oc,getOffsetFromCurrentToNextDetent:Hf},children:Vf&&j.jsxs("div",{id:ge,...no("view",["track","staging","openness","opennessClosedStatus","scrollContainerShouldBePassThrough"],{className:u,dataSilk:[h,"0ab",G&&"0ah",tr&&"0aj",jf&&"0ak","0al"]}),ref:Zs,"aria-labelledby":_t,"aria-describedby":St,...Y,role:he,tabIndex:-1,children:[j.jsx(Kn.Root,{...no("primaryScrollTrapRoot",["track","scrollContainerShouldBePassThrough"]),active:Vr!=="none",axis:Vr,children:j.jsx(Kn.Stabiliser,{children:l})}),j.jsx(Kn.Root,{...no("secondaryScrollTrapRoot",["scrollContainerShouldBePassThrough"]),automaticallyDisabledForOptimisation:!1,preventBodyScroll:qf})]})})})});m5.displayName="Sheet.Anonymous";class rc extends We.Component{static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e){console.error(e)}render(){return this.state.hasError?j.jsx("h1",{children:"Something went wrong."}):this.props.children}constructor(e){super(e),this.state={hasError:!1}}}let _5=We.forwardRef((t,e)=>{let{asChild:i,children:n,className:a,"data-silk":l,...u}=t,h=i?Fi:"span",f=Ui("VisuallyHidden",{});return j.jsx(h,{...f("root",[],{className:a,dataSilk:[l]}),...u,ref:e,children:n})});_5.displayName="VisuallyHidden.Root";let YB={Root:_5},Of=We.createContext(null);Of.displayName="SheetStack.GenericContext";let Ou=[],KB=(t,e)=>{let i=()=>{let[n,a]=(function(h){let f=0,d=0;for(;h;)f+=h.offsetLeft,d+=h.offsetTop,h=h.offsetParent;return[f,d]})(t),l={top:a+scrollY,bottom:Math.max(t.offsetHeight-(a+scrollY+innerHeight),0),left:n+scrollX,right:Math.max(t.offsetWidth-(n+scrollX+innerWidth),0),height:innerHeight,width:innerWidth},u=l.top<=0&&l.bottom<=0&&l.left<=0&&l.right<=0?null:l;e(u)};Ou.push({element:t,callback:i}),i(),Ou.length===1&&(Du=(function(n,a){let l;return function(){clearTimeout(l),l=window.setTimeout(()=>{clearTimeout(l),n()},100)}})(()=>{Ou.forEach(n=>n.callback())}),window.addEventListener("scroll",Du),window.addEventListener("resize",Du))},GB=t=>{(Ou=Ou.filter(e=>e.element!==t)).length||(window.removeEventListener("scroll",Du),window.removeEventListener("resize",Du))},xv=(t,e)=>{let i=S.useId(),n=S.useRef(null),a=Rs(n,e),{sheetId:l,stackId:u,sheetsCount:h,travelAnimation:f,stackingAnimation:d,style:p}=t,{sheetId:v,longRunning:g}=Bf(l),[y,b]=S.useState(null),{willChangesValuesString:C,outletTransformedOnAnimation:x,nonAnimatedTravelStyles:k,nonAnimatedStackingStyles:R,clippedToViewport:L}=S.useMemo(()=>{let F=[],J={},G={},D=!1,O=!1;return[f,d].forEach((P,$)=>{if(P){let M=P.hasOwnProperty("properties")?P.properties:P;Object.entries(M).forEach(([A,z])=>{!z||(A==="clipBoundary"&&(O=!0),typeof z=="string"&&($===0?J[A]=z:G[A]=z),n5.includes(A)||A==="transform"?F.includes("transform")||(F.push("transform"),D=!0):A!=="opacity"||F.includes("opacity")||F.push("opacity"))})}}),{willChangesValuesString:F.join(", "),outletTransformedOnAnimation:D,nonAnimatedTravelStyles:J,nonAnimatedStackingStyles:G,clippedToViewport:O}},[d,f]),{modifiedTravelAnimation:E,modifiedNonAnimatedTravelStyles:H,modifiedStackingAnimation:U,modifiedNonAnimatedStackingStyles:I}=S.useMemo(()=>{let F;if(y){let{top:$,bottom:M,left:A,right:z}=y;F=`${$-.1}px ${z}px ${M}px ${A}px`}let J=($,M)=>{let A,z,q;if(!$)return[];let{top:Y,left:B,height:X,width:ie}=y||{},re=$.hasOwnProperty("properties")?$.properties:$,fe=re.clipBoundary,he=re.clipBorderRadius,oe=re.clipTransformOrigin;if(fe&&(oe||(oe="50% 50% 0"),q=oe.split(" ").map(Ge=>Ge==="top"||Ge==="left"?"0%":Ge==="bottom"||Ge==="right"?"100%":Ge).map((Ge,xe)=>{if(xe===0){let Oe=Ge;return Ge.includes("%")?Oe=Ge.replace(/\b\d+%/,ge=>parseFloat(ge)/100*ie+"px"):Ge==="0"&&(Oe="0px"),"calc("+B+"px + "+Oe+")"}if(xe===1){let Oe=Ge;return Ge.includes("%")?Oe=Ge.replace(/\b\d+%/,ge=>parseFloat(ge)/100*X+"px"):Ge==="0"&&(Oe="0px"),"calc("+Y+"px + "+Oe+")"}}).join(" ")),fe)if(fe==="layout-viewport")if(F){if(typeof he=="string")A=`inset(${F} round ${he})`;else if(Array.isArray(he)){let we=`inset(${F} round `;A=({tween:Le})=>we+Le(...he)+")"}else if(typeof he=="function"){let we=`inset(${F} round `;A=Le=>we+he(Le)+")"}else A=`inset(${F})`;z="0.001px"}else z=he??null;else if(typeof fe=="function")if(F){if(typeof he=="string")A=we=>fe(we)!=="none"?`inset(${F} round ${he})`:"none";else if(Array.isArray(he)){let we=`inset(${F} round `;A=Le=>fe(Le)!=="none"?we+Le.tween(...he)+")":"none"}else if(typeof he=="function"){let we=`inset(${F} round `;A=Le=>fe(Le)!=="none"?we+he(Le)+")":"none"}else A=we=>fe(we)!=="none"?`inset(${F})`:"none";z="0.001px"}else he&&(z=we=>{if(fe(we)==="layout-viewport")return he});else fe==="none"&&(A="none",z=he??null);else{let we={...re},Le={...M};return delete we.clipBoundary,delete we.clipBorderRadius,delete we.clipTransformOrigin,delete Le.clipBoundary,delete Le.clipBorderRadius,delete Le.clipTransformOrigin,[we,Le]}let ve={...re},de={...M};return delete ve.clipBoundary,delete ve.clipBorderRadius,delete ve.clipTransformOrigin,delete de.clipBoundary,delete de.clipBorderRadius,delete de.clipTransformOrigin,typeof A=="string"?de.clipPath=A:ve.clipPath=A,typeof z=="string"?de.borderRadius=z:ve.borderRadius=z,typeof q=="string"&&(de.transformOrigin=q),[ve,de]},[G,D]=J(f,k),[O,P]=J(d,R);return{modifiedTravelAnimation:G,modifiedNonAnimatedTravelStyles:D,modifiedStackingAnimation:O,modifiedNonAnimatedStackingStyles:P}},[y,R,k,d,f]);vi(()=>{let F=n.current,J=i&&L&&(!u&&g||u&&h>=1);if(J)return KB(F,b),()=>{J&&GB(F)}},[i,L,g,u,h]);let N=S.useMemo(()=>u?{...p,...h>=1?I:{},willChange:h>=1?C+(p?.willChange?", "+p?.willChange:""):p?.willChange}:{...p,...g?H:{},...h>=1?I:{},willChange:g?C+(p?.willChange?", "+p?.willChange:""):p?.willChange},[u,p,H,I,g,h,C]);return vi(()=>{let F,J=qe.findActualFixedComponentsInsideOutlet(n.current);if(J.length)return x&&(F=(G=>{let D=()=>{J.forEach(P=>{if(!P.element||P.compensated)return;let $=0,M=0,A=P.element.style.transform,z=window.getComputedStyle(P.element),q=z.getPropertyValue("--silk-fixed-side"),Y=z.getPropertyValue("transform");qe.updateFixedComponent({id:P.id,initialInlineCSSTransform:A,compensated:!0}),$=q.includes("bottom")?-1*(n.current.offsetHeight-(scrollY+window.innerHeight)):scrollY,M=q.includes("right")?-1*(n.current.offsetWidth-(scrollX+window.innerWidth)):scrollX,(Math.abs($)!==0||Math.abs(M)!==0)&&P.element.style.setProperty("transform",(Y!=="none"?Y+" ":"")+"translateX("+M+"px) translateY("+$+"px)")})},O=()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D),J.forEach(P=>{P.element&&P.compensated&&(P.initialInlineCSSTransform?(P.element.style.setProperty("transform",P.initialInlineCSSTransform),qe.updateFixedComponent({id:P.id,initialInlineCSSTransform:void 0,compensated:!1})):(P.element.style.removeProperty("transform"),qe.updateFixedComponent({id:P.id,compensated:!1})))})};return G?(D(),window.addEventListener("resize",D),window.addEventListener("scroll",D)):O(),O})(u?h>0:g)),F},[g,i,x,h,u]),vi(()=>(qe.addOutletToSheet(v,i),()=>qe.removeOutletFromSheet(v,i)),[i,v]),vi(()=>{let F=n.current;return E&&qe.addAnimationToSheetOrStack({sheetId:v,type:"travel",element:F,config:E}),U&&qe.addAnimationToSheetOrStack({sheetId:u?null:v,stackId:u,type:"stacking",element:F,config:U}),()=>{E&&qe.removeAnimationFromSheetOrStack({sheetId:v,type:"travel",element:F}),U&&qe.removeAnimationFromSheetOrStack({sheetId:u?null:v,stackId:u,type:"stacking",element:F})}},[v,u,E,U]),{ref:n,outletId:i,styleValue:N,composedRef:a}},Bf=t=>S.useContext(t??Za)||{};rc.displayName="Sheet.ErrorBoundary",Fi.displayName="Sheet.Slot.Root";let Yo=We.forwardRef((t,e)=>{let{asChild:i,forComponent:n,travelAnimation:a,stackingAnimation:l,style:u,className:h,...f}=t,{staging:d,StackContext:p}=Bf(n),v=p??We.createContext(null),{sheetsCount:g}=S.useContext(v)||{},{styleValue:y,composedRef:b}=xv({sheetId:n,sheetsCount:g,travelAnimation:a,stackingAnimation:l,style:u},e),C=S.useMemo(()=>d!=="none",[d]),x=i?Fi:"div",k=Ui("Sheet",{});return j.jsx(x,{style:y,...k("outlet",[],{className:h,dataSilk:[C&&"0aj"]}),...f,ref:b})});Yo.displayName="Sheet.Outlet";let kv=We.forwardRef(({asChild:t,...e},i)=>{let n=t?Fi:"button",{forComponent:a,className:l,"data-silk":u,onPress:h,onClick:f,children:d,action:p="present",travelAnimation:v,stackingAnimation:g,...y}=e,{sheetRole:b,sheetId:C,open:x,onOpenChange:k,elementFocusedLastBeforeShowing:R}=Bf(a),L=qe.findSheet(C),E=S.useRef(null),H=Rs(E,i),U=S.useMemo(()=>(b==="dialog"||b==="alertdialog")&&p==="present"?"dialog":void 0,[p,b]),I=S.useMemo(()=>p==="present"||p==="dismiss"?x:void 0,[p,x]),N=Ui("Sheet",{});return j.jsx(Yo,{forComponent:a,asChild:!0,travelAnimation:v,stackingAnimation:g,children:j.jsx(n,{...N("trigger",[],{className:l,dataSilk:[u]}),onClick:F=>{var J,G;let{forceFocus:D,runAction:O}=ln({nativeEvent:F,defaultBehavior:{forceFocus:!0,runAction:!0},handler:h});D&&((J=E.current)===null||J===void 0||J.focus({preventScroll:!0})),O&&(p==="present"?(R.current=E.current,k(!0)):p==="dismiss"?k(!1):(p==="step"||p.type==="step")&&(L==null||(G=L.sendToOpennessMachine)===null||G===void 0||G.call(L,{type:"STEP",direction:p==="step"?"up":p.direction,detent:p==="step"?null:p.detent}))),f?.(F)},"aria-haspopup":U,"aria-controls":C,"aria-expanded":I,ref:H,...y,children:d})})});kv.displayName="Sheet.Trigger";let p5=We.forwardRef((t,e)=>{let{children:i,className:n,action:a="step",...l}=t,{detents:u}=S.useContext(Wr)||{},h=u.length===1&&a!=="dismiss",f=Ui("Sheet",{});return j.jsx(kv,{...f("handle",[],{className:n}),action:a,disabled:h,...l,ref:e,children:j.jsx(YB.Root,{children:i??(a==="dismiss"?"Dismiss":"Cycle")})})});p5.displayName="Sheet.Handle";let g5=t=>{var e;let[i,n]=S.useState(!1);return S.useEffect(()=>(n(!0),()=>n(!1)),[]),i?jw.createPortal(t.children,(e=t.container)!==null&&e!==void 0?e:document.body):null};g5.displayName="Sheet.Portal";let XB=({rootRef:t})=>(S.useEffect(()=>{let e=t.current;if(!e)return;getComputedStyle(e).getPropertyValue("--silk-aY").trim()!=="1"&&console.warn("The CSS styles for Silk are not found. Please refer to the documentation on how to import them.")},[t]),null),v5=We.forwardRef((t,e)=>{let{className:i,"data-silk":n,license:a,sheetRole:l,componentId:u,forComponent:h,defaultPresented:f,presented:d,onPresentedChange:p,defaultActiveDetent:v,activeDetent:g,onActiveDetentChange:y,onSafeToUnmountChange:b,...C}=t,x=S.useRef(null),k=Rs(x,e),R=f!=null&&f,[L,E]=S.useState(R),H=d!==void 0&&p!==void 0,U=S.useMemo(()=>H?d:L,[H,d,L]),I=S.useMemo(()=>H?p:E,[H,p,E]),N=S.useRef(null),[F,J]=S.useState(!R),G=S.useCallback(Y=>{b?.(Y),J(Y)},[b]),[D,O]=S.useState(U),[P,$]=S.useState("none"),M=h==="closest"?Of:h,A=Vo(),z={license:a,StackContext:M,CustomSheetContext:u,sheetId:A,sheetRole:l,open:U,onOpenChange:I,onSafeToUnmountChange:G,defaultActiveDetent:v,activeDetent:g,onActiveDetentChange:y,safeToUnmount:F,longRunning:D,setLongRunning:O,staging:P,setStaging:$,elementFocusedLastBeforeShowing:N,...C},q=Ui("Sheet");return j.jsxs(rc,{children:[j.jsx(XB,{rootRef:x}),j.jsx(Gu,{genericContext:Za,customContext:u,value:z,children:j.jsx(Yo,{...q("root",[],{className:i,dataSilk:[n]}),ref:k,...C})})]})});v5.displayName="Sheet.Root";let y5=We.forwardRef((t,e)=>{let{forComponent:i}=t,{open:n,safeToUnmount:a}=Bf(i);return(n||!a)&&j.jsx(m5,{...t,ref:e})});y5.displayName="Sheet.View";let S5=We.forwardRef(({asChild:t,swipeable:e=!0,...i},n)=>{let{longRunningState:a,backdropRef:l,styleAttributes:u,setBackdropSwipeable:h,setBackdropTravelHandler:f}=S.useContext(Wr)||{},{className:d,"data-silk":p,children:v,travelAnimation:g,stackingAnimation:y,themeColorDimming:b=!1,...C}=i,x=Rs(l,n);S.useEffect(()=>(h(e),()=>{h(!1)}),[h,e]);let k=S.useMemo(()=>({opacity:({progress:U})=>Math.min(.33*U,.33),...g}),[g]),[R,L]=S.useState(k),E=Vo(),H=S.useRef(0);return vi(()=>{let U=!1,I=()=>{U&&qe.removeThemeColorDimmingOverlay(E)};if(a.matches("longRunning:true")){let N;if(!(U=!!(qa()&&!iB()&&b==="auto"&&k.opacity&&qe.getAndStoreUnderlyingThemeColorAsRGBArray())))return;let{opacity:F,...J}=k;if(L({opacity:"ignore",...J}),Array.isArray(F)){let[G,D]=F;N=({progress:O})=>G+(D-G)*O}else typeof F=="function"&&(N=F,L({opacity:"ignore",...J}));if(N&&l&&f){let G=window.getComputedStyle(l.current).backgroundColor,D=qe.updateThemeColorDimmingOverlay({abortRemoval:!0,dimmingOverlayId:E,color:G,alpha:H.current}),O=P=>{var $;let M=N(P);qe.updateThemeColorDimmingOverlayAlphaValue(D,M),($=l.current)===null||$===void 0||$.style.setProperty("opacity",M),H.current=M};f(()=>O)}}return a.matches("longRunning:false")&&I(),()=>{I()}},[a,E,l,f,b,g,k]),j.jsx(Yo,{...u("backdrop",["scrollContainerShouldBePassThrough"],{className:d,dataSilk:[p]}),travelAnimation:R,stackingAnimation:y,...C,ref:x,asChild:t,children:v})});S5.displayName="Sheet.Backdrop";let b5=We.forwardRef((t,e)=>{var i;let{asChild:n,children:a,className:l,"data-silk":u,travelAnimation:h,stackingAnimation:f,style:d,...p}=t,v=n?Fi:"div",{StackContext:g}=S.useContext(Za)||{},y=g??We.createContext(null),{sheetsCount:b}=S.useContext(y)||{},{styleValue:C,composedRef:x}=xv({sheetId:Za,sheetsCount:b,travelAnimation:h,stackingAnimation:f,style:d},e),{scrollContainerRef:k,frontSpacerRef:R,contentWrapperRef:L,contentRef:E,backSpacerRef:H,detentMarkersRefs:U,leftEdgeRef:I,nativeEdgeSwipePrevention:N,scrollContainerTouchStartHandler:F,scrollContainerTouchEndHandler:J,styleAttributes:G,detents:D,bleedingBackgroundPresent:O}=S.useContext(Wr)||{},P=Rs(E,x);return j.jsxs("div",{...G("scrollContainer",["track","swipeDisabled","swipeOvershootDisabled","staging","positionCoveredStatus","scrollContainerShouldBePassThrough","swipeTrap"],{dataSilk:["0ac"]}),ref:k,onTouchStart:F,onTouchEnd:J,children:[j.jsx("div",{...G("frontSpacer",["track"]),ref:R}),j.jsxs("div",{...G("contentWrapper",["placement","track","swipeOvershootDisabled","swipeOutDisabledWithDetent","staging","position"]),ref:L,children:[j.jsx(v,{...G("content",["track","placement","scrollContainerShouldBePassThrough"],{className:l,dataSilk:[u,O&&"0af"]}),style:C,...p,ref:P,children:a}),N&&j.jsx("div",{...G("leftEdge",["track"]),ref:I})]}),j.jsx("div",{...G("backSpacer",["track"]),ref:H,children:D.map(($,M)=>j.jsx("div",{ref:A=>{U.current.length>D.length&&(U.current=U.current.slice(0,D.length)),U.current[M]=A},...G("detentMarker",["track","swipeOutDisabledWithDetent"]),style:{"--silk-aA":(i=D[M-1])!==null&&i!==void 0?i:"0px","--silk-aB":$,"--silk-aC":M}},M))})]})});b5.displayName="Sheet.Content";let w5=We.forwardRef(({asChild:t,...e},i)=>{let{className:n,"data-silk":a,...l}=e,{staging:u,placement:h,track:f,setBleedingBackgroundPresent:d}=S.useContext(Wr)||{};S.useEffect(()=>(d(!0),()=>{d(!1)}),[d]);let p=f==="horizontal"||f==="vertical",v=Ui("Sheet",{staging:u,placement:h,track:f,bleedDisabled:p});return j.jsx(Yo,{asChild:t,...v("bleedingBackground",["staging","placement","track","bleedDisabled"],{className:n,dataSilk:[a]}),...l,ref:i})});w5.displayName="Sheet.BleedingBackground";let ZB=We.forwardRef((t,e)=>{let{className:i,"data-silk":n,...a}=t,{travelAxis:l}=S.useContext(Wr)||{},u=S.useMemo(()=>l==="vertical"?"horizontal":"vertical",[l]),[h,f]=S.useState(!1);S.useEffect(()=>f(qa()),[]);let d=Ui("SpecialWrapper");return j.jsx(Kn.Root,{...d("root",[],{className:i,dataSilk:[n]}),active:h,axis:u,...a,ref:e})});ZB.displayName="Sheet.SpecialWrapper.Root";let QB=We.forwardRef((t,e)=>j.jsx(Kn.Stabiliser,{...t,ref:e}));QB.displayName="Sheet.SpecialWrapper.Content";let JB=We.forwardRef((t,e)=>{let{asChild:i,travelAnimation:n,stackingAnimation:a,...l}=t,u=i?Fi:"h2",{titleId:h}=S.useContext(Wr);return j.jsx(Yo,{asChild:!0,travelAnimation:n,stackingAnimation:a,children:j.jsx(u,{id:h,ref:e,...l})})});JB.displayName="Sheet.Title";let e6=We.forwardRef((t,e)=>{let{asChild:i,travelAnimation:n,stackingAnimation:a,...l}=t,{descriptionId:u}=S.useContext(Wr),h=i?Fi:"p";return j.jsx(Yo,{asChild:!0,travelAnimation:n,stackingAnimation:a,children:j.jsx(h,{id:u,...l,ref:e})})});e6.displayName="Sheet.Description";let Qa={Root:v5,Trigger:kv,View:y5,Backdrop:S5,Content:b5,BleedingBackground:w5,Handle:p5,Portal:g5};rc.displayName="SheetStack.ErrorBoundary";let t6=We.forwardRef((t,e)=>{let{componentId:i,className:n,"data-silk":a,asChild:l,...u}=t,h=S.useId();vi(()=>(qe.addSheetStack({id:h}),()=>qe.removeSheetStack(h)),[h]);let[f,d]=S.useState([]),p=S.useCallback(I=>{d(N=>{let F,J=N.findIndex(G=>G.sheetId===I.sheetId);return J!==-1?(F=[...N])[J]=I:F=[...N,I],F})},[]),v=S.useCallback(I=>{d(N=>N.filter(F=>F.sheetId!==I))},[]),g=S.useCallback(I=>{let N=f.findIndex(F=>F.sheetId===I);return N===-1?f[f.length-1]:f[N-1]},[f]),[y,b]=S.useState(0);vi(()=>{y===0&&qe.removeAllOutletPersistedStylesFromStack(h)},[y,h]);let[C,x]=S.useState([]),k=S.useCallback(I=>{x(N=>{let F=N.findIndex(J=>J.sheetId===I.sheetId);if(F===-1)return[...N,I];{let J=[...N];return J[F]=I,J}})},[]),R=S.useCallback(I=>{x(N=>N.filter(F=>F.sheetId!==I))},[]),L=S.useMemo(()=>C.some(I=>I.staging!=="none")?"not-none":"none",[C]),E=S.useMemo(()=>({stackId:h,sheetsCount:y,setSheetsCount:b,updateSheetStagingDataInStack:k,removeSheetStagingDataInStack:R,sheetsInStackMergedStaging:L,updateSheetDataInStack:p,removeSheetDataFromStack:v,getPreviousSheetDataInStack:g}),[h,y,k,R,L,p,v,g]),H=l?Fi:"div",U=Ui("SheetStack");return j.jsx(rc,{children:j.jsx(Gu,{genericContext:Of,customContext:i,value:E,children:j.jsx(H,{...U("root",[],{className:n,dataSilk:[a]}),ref:e,...u})})})});t6.displayName="SheetStack.Root";let i6=We.forwardRef((t,e)=>{let{forComponent:i="closest",asChild:n,stackingAnimation:a,style:l,className:u,...h}=t,f=i==="closest"?Of:i,{stackId:d,sheetsCount:p,sheetsInStackMergedStaging:v}=S.useContext(f);vi(()=>{qe.addSheetStack({id:d})},[d]);let{styleValue:g,composedRef:y}=xv({sheetsCount:p,stackId:d,stackingAnimation:a,style:l},e),b=S.useMemo(()=>v!=="none",[v]),C=Ui("SheetStack",{}),x=n?Fi:"div";return j.jsx(x,{style:g,...C("outlet",[],{className:u,dataSilk:[b&&"0aj"]}),...h,ref:y})});i6.displayName="SheetStack.Outlet";let Ev=We.createContext(null);Ev.displayName="Scroll.GenericContext";let Nf=We.createContext({contentRef:null});Nf.displayName="Scroll.Anonymous";let C5=t=>S.useContext(t??Ev)||{},s6=Kt==="android"?102:54,Hp=wv||Kt==="android"?"instant":"smooth",r6=(t,e,i=300)=>{let n,a=t.scrollTop,l=()=>{clearTimeout(n),t.removeEventListener("scroll",u),e()},u=()=>{let h=t.scrollTop;if(h>a){l();return}a=h,clearTimeout(n),n=setTimeout(l,i)};n=setTimeout(l,i),t.addEventListener("scroll",u)},Up=t=>{if(!t)return{top:0,bottom:0};let e=t.getBoundingClientRect(),i=window.getComputedStyle(t),n=e.top+parseFloat(i.borderTopWidth),a=e.bottom-parseFloat(i.borderBottomWidth);return{top:n,bottom:a}},Sw=()=>{let t=window.visualViewport.height,e=window.visualViewport.offsetTop;return{top:e,bottom:e+t}},n6=(t,e)=>Math.abs(Math.min(t+e,0)),a6=(t,e)=>Math.max(t-e,0),bw=(t,e,i)=>{t.style.setProperty("height",e+"px"),i.current=e},o6=({scrollContainer:t,elementTop:e,elementBottom:i,behavior:n,scrollMarginTop:a,scrollMarginBottom:l,scrollPortTop:u,scrollPortBottom:h,visualViewportTop:f,visualViewportBottom:d,beforeScrollCallback:p})=>{if(!t)return;let v=e-Math.max(u,f),g=Math.min(h,d)-i;if(v<a){let y=Math.max(-t.scrollTop,v-a);y!==0&&(p(),t.scrollBy({top:y,behavior:n}))}else if(g<l){let y=t.scrollHeight-t.clientHeight-t.scrollTop,b=Math.min(y,l-g);b!==0&&(p(),t.scrollBy({top:b,behavior:n}))}};rc.displayName="Scroll.ErrorBoundary";let l6=We.forwardRef((t,e)=>{let{asChild:i,className:n,componentId:a,componentRef:l,"data-silk":u,...h}=t,f=i?Fi:"div",d=S.useRef(()=>{}),p=S.useCallback((...C)=>{let x=d.current;return x(...C)},[]),v=S.useRef(()=>{}),g=S.useCallback((...C)=>{let x=v.current;return x(...C)},[]),y=S.useMemo(()=>({componentRef:l,scrollToRef:d,scrollTo:p,scrollByRef:v,scrollBy:g}),[l,g,p]),b=Ui("Scroll",{});return j.jsx(rc,{children:j.jsx(Gu,{genericContext:Ev,customContext:a,value:y,children:j.jsx(f,{...b("root",[],{className:n,dataSilk:[u]}),...h,ref:e})})})});l6.displayName="Scroll.Root";let Rd=null,x5=()=>{let t=S.useRef(null);vi(()=>{Rd===null&&t.current&&(Rd=t.current.offsetWidth-t.current.clientWidth,document.body.style.setProperty("--ua-scrollbar-thickness",Rd+"px"))},[]);let e=Ui("Scroll"),i=j.jsx("div",{...e("UAScrollbarMeasurer"),ref:t});return Rd===null?typeof window<"u"?jw.createPortal(i,document.body):j.jsx(j.Fragment,{children:i}):null};x5.displayName="Scroll.Anonymous";let Md=(t,e,i,n=!1)=>typeof t=="boolean"?t:typeof t?.[e]=="boolean"?t[e]:typeof t?.[i]=="boolean"?t[i]:n,c6=We.forwardRef((t,e)=>{let{asChild:i,children:n,className:a,"data-silk":l,forComponent:u,axis:h="y",pageScroll:f=!1,nativePageScrollReplacement:d=!1,safeArea:p="visual-viewport",scrollGestureTrap:v=!1,scrollGestureOvershoot:g=!0,scrollGesture:y="auto",onScrollStart:b,onScroll:C,onScrollEnd:x,onFocusInside:k,nativeFocusScrollPrevention:R=!0,scrollAnimationSettings:L={skip:"auto"},scrollAnchoring:E=!0,scrollSnapType:H="none",scrollPadding:U="auto",scrollTimelineName:I="none",nativeScrollbar:N=!0,...F}=t,[J,G,D,O]=S.useMemo(()=>{let Se=Md(v,"xStart","x"),ft=Md(v,"xEnd","x"),Xe=Md(v,"yStart","y"),Fe=Md(v,"yEnd","y"),Te=Se,He=ft,Ft=Xe,Bt=Fe;return h==="y"?He=Te=Se!==ft||Se:Bt=Ft=Xe!==Fe||Xe,[Te,He,Ft,Bt]},[v,h]),P=S.useMemo(()=>J!==G,[G,J]),$=S.useMemo(()=>D!==O,[O,D]),M=S.useMemo(()=>{if(H==="proximity"){if(h==="y")return"proximityY";if(h==="x")return"proximityX"}else{if(H!=="mandatory")return"none";if(h==="y")return"mandatoryY";if(h==="x")return"mandatoryX"}},[h,H]),A=i?Fi:"div",z=S.useRef(null),q=Rs(z,e),Y=S.useRef(null),B=S.useRef(null),X=S.useRef(null),ie=S.useRef(null),re=S.useRef(null),fe=S.useRef(null),he=Vo(),{componentRef:oe,scrollToRef:ve,scrollByRef:de}=C5(u)||{},{getContentCoordinatesWhenRestingOnLastDetent:we,contentRef:Le}=S.useContext(Wr)||{},tt=S.useMemo(()=>y===!1||y!=="auto",[y]),[Ge,xe]=S.useState(!1),[Oe,ge]=S.useState(!1);vi(()=>{f&&(Se=>{let ft="data-silk-native-page-scroll-replaced",Xe=document.documentElement.getAttribute(ft);if(!f&&Xe!=="true")return;let Fe=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone;if(Se!==!0&&(Se!=="auto"||(Kt==="android"||Kt==="ios"||Kt==="ipados")&&!Fe)){var He,Ft;ge(!1);let Bt=new Event("silk-page-scroll-data-change");if(document.dispatchEvent(Bt),Xe==="false")return;let tr=(Ft=(He=Y.current)===null||He===void 0?void 0:He.scrollTop)!==null&&Ft!==void 0?Ft:0;document.documentElement.setAttribute(ft,"false"),Xe==="true"&&window.scrollTo(0,tr)}else{ge(!0),Y.current;let Bt=new Event("silk-page-scroll-data-change");if(document.dispatchEvent(Bt),Xe==="true")return;let tr=window.pageYOffset;if(document.documentElement.setAttribute(ft,"true"),!Y.current)return;Y.current.scrollTop=tr}})(d)},[f,d]);let[_t,St]=S.useState(!0),[dt,ke]=S.useState(!0);vi(()=>{let Se=Y.current,ft=B.current,Xe=X.current,Fe=ie.current,Te=new ResizeObserver(()=>{Se&&(h==="y"&&Se.scrollHeight>Se.clientHeight?St(!0):St(!1),h==="x"&&Se.scrollWidth>Se.clientWidth?ke(!0):ke(!1))});return Se&&ft&&Xe&&Fe&&(Te.observe(Se,{box:"border-box"}),Te.observe(ft,{box:"border-box"}),Te.observe(Xe,{box:"border-box"}),Te.observe(Fe,{box:"border-box"})),()=>{Te&&Te.disconnect()}},[h,tt]);let[pe,Gt]=S.useState(!1);vi(()=>{Gt(_t||dt?!0:()=>!1)},[_t,dt]);let[Ne,Qe]=S.useState(!1);S.useEffect(()=>{Qe(Jx())},[]);let Ye=S.useRef(!1),xt=S.useRef(!1),je=P||$,[Ms,rs]=S.useState(J),[Qn,Jn]=S.useState(D);S.useEffect(()=>{let Se;if(je){let ft=re.current,Xe=fe.current;if(!ft||!Xe)return;(Se=new IntersectionObserver(Fe=>{for(let Te of Fe)Te.target===ft?Te.isIntersecting?(Ye.current=!0,h==="x"?rs(J):Jn(D)):Ye.current=!1:Te.target===Xe&&(Te.isIntersecting?(xt.current=!0,h==="x"?rs(G):Jn(O)):xt.current=!1),Ye.current&&xt.current&&(h==="x"?rs(!1):Jn(!1))},{root:Y.current,rootMargin:"0px",threshold:[1]})).observe(ft),Se.observe(Xe)}return()=>{Se&&Se.disconnect()}},[G,J,O,D,h,je]);let jr=S.useRef(!1),Xs=S.useRef(),ri=S.useRef(""),$i=S.useRef(void 0);S.useEffect(()=>{let Se=Y.current;if(!Se)return;let ft=Fe=>{Ut.current=!1,ln({nativeEvent:Fe,defaultBehavior:{},handler:x});let Te=document.activeElement;(Kt=="ios"||Kt=="ipados")&&Te&&Bo(Te)&&($i.current===void 0&&(ri.current=Te.style.getPropertyValue("opacity"),Te.style.setProperty("opacity","0.9999","important")),clearTimeout($i.current),$i.current=void 0,$i.current=setTimeout(()=>{ri.current===""?Te.style.removeProperty("opacity"):Te.style.setProperty("opacity",ri.current),$i.current=void 0},55))},Xe=Fe=>{if(!jr.current){let{dismissKeyboard:Te}=ln({nativeEvent:Fe,defaultBehavior:{dismissKeyboard:!1},handler:b});Te&&!jr.current&&!Ut.current&&pf()&&Se.focus({preventScroll:!0})}clearTimeout(Xs.current),Xs.current=setTimeout(()=>{jr.current=!1,xe(!1),"onscrollend"in window||ft(null)},90),jr.current=!0,xe(!0)};return Se.addEventListener("scroll",Xe),"onscrollend"in window&&Se.addEventListener("scrollend",ft),()=>{Se.removeEventListener("scroll",Xe),"onscrollend"in window&&Se.removeEventListener("scrollend",ft)}},[x,b]),S.useEffect(()=>(R&&qe.addNativeFocusScrollPreventer(he),()=>{R&&qe.removeNativeFocusScrollPreventer(he)}),[R,he]);let At=S.useMemo(()=>f&&!Oe,[Oe,f]),ni=S.useMemo(()=>h==="y"?At?()=>window.scrollY:()=>{var Se;return(Se=Y.current)===null||Se===void 0?void 0:Se.scrollTop}:At?()=>window.scrollX:()=>{var Se;return(Se=Y.current)===null||Se===void 0?void 0:Se.scrollLeft},[h,At]),Zs=S.useMemo(()=>h==="y"?At?()=>document.body.scrollHeight-window.innerHeight:()=>{let Se=Y.current;return Se?.scrollHeight-Se?.offsetHeight}:At?()=>document.body.scrollWidth-window.innerWidth:()=>{let Se=Y.current;return Se?.scrollWidth-Se?.offsetWidth},[h,At]),fn=S.useCallback(()=>ni()/Zs(),[ni,Zs]),Qs=S.useCallback(Se=>{C?.({progress:fn(),distance:ni(),availableDistance:Zs(),nativeEvent:Se})},[fn,ni,Zs,C]);S.useEffect(()=>(At&&C&&document.addEventListener("scroll",Qs),()=>{At&&C&&document.removeEventListener("scroll",Qs)}),[At,C,Qs]);let kt=S.useCallback((Se,{progress:ft,distance:Xe,animationSettings:Fe={skip:"default"}})=>{let Te=Xe??(ft??NaN)*Zs();if(isNaN(Te))return;let He=Fe?.skip,Ft=At?window:Y.current;Ft?.[Se==="to"?"scrollTo":"scrollBy"]({[h==="y"?"top":"left"]:Te,behavior:He===!0?"instant":He===!1?"smooth":He==="default"?"auto":wv?"instant":"smooth"})},[h,Zs,At]),Rr=S.useCallback(Se=>kt("to",Se),[kt]),Wi=S.useCallback(Se=>kt("by",Se),[kt]);S.useEffect(()=>{ve.current=Rr,de.current=Wi},[Wi,de,Rr,ve]),S.useImperativeHandle(oe,()=>({getProgress:fn,getDistance:ni,getAvailableDistance:Zs,scrollTo:Rr,scrollBy:Wi}),[Zs,ni,fn,Rr,Wi]);let As=S.useRef(!1),Mr=S.useRef(),ea=S.useRef(),Qi=S.useRef(0),Js=S.useRef(0),Ut=S.useRef(!1),ze=S.useCallback(({scrollIntoPlace:Se=!0,scrollBehavior:ft,safeViewport:Xe="visual-viewport"})=>{let Fe,Te;if(!Y.current||!B.current||!ie.current||!X.current||h!=="y"||Xe==="none"||Le?.current&&we().top===null||!Le?.current&&we)return;if(Le?.current){let{top:ci,bottom:ms}=Up(Y.current),ui=Le.current.getBoundingClientRect(),Ei=ui.top,be=ui.bottom;Fe=we().top+(ci-Ei),Te=we().bottom-(be-ms)}else{let{top:ci,bottom:ms}=Up(Y.current);Fe=ci,Te=ms}let{top:He,bottom:Ft}=Sw(),Bt=Math.min(Te,Xe==="visual-viewport"?Ft:window.innerHeight),tr=n6(Fe,Xe==="visual-viewport"?He:0),ir=a6(Te,Xe==="visual-viewport"?Ft:window.innerHeight);if(1>Math.abs(Qi.current-tr)&&1>Math.abs(Js.current-ir))return;let Ar=-1*(Bt-ie.current.getBoundingClientRect().top),Ls=Y.current.offsetHeight-B.current.offsetHeight>=0,Lr=()=>{bw(X.current,tr,Qi),bw(ie.current,ir,Js)};if(ft==="smooth"&&(Ar<0||Ls)?Se&&(Ut.current=!0,Ls?Y.current.scrollTo({top:0,behavior:ft}):Y.current.scrollBy({top:Ar,behavior:ft}),Js.current=ir,r6(Y.current,()=>{Y.current&&Ls&&Y.current.scrollTo({top:0,behavior:"instant"}),Lr()})):Lr(),!Se)return{spacersHeightSetter:Lr,verticalScrollOffsetRequired:Ar}},[h,we,Le]),Lt=S.useCallback(()=>ze({scrollBehavior:Hp,safeViewport:p}),[p,ze]);vi(()=>{Lt()},[Lt]),S.useEffect(()=>{let Se=Y.current,ft=Te=>{clearTimeout(Mr.current),clearTimeout(ea.current);let He=Te.target;if(He===Se)return;let{scrollIntoView:Ft}=ln({nativeEvent:Te,defaultBehavior:{scrollIntoView:!0},handler:k});if(!Bo(He)||$g(He))return;let Bt=He.getBoundingClientRect().top-0,tr=He.getBoundingClientRect().bottom-0,{top:ir,bottom:Ar}=Up(Y.current),Ls=ir-0,Lr=Ar-0,ci=()=>{if(clearTimeout(Mr.current),clearTimeout(ea.current),!pf())return;As.current=!0;let{top:ms,bottom:ui}=Sw(),{spacersHeightSetter:Ei=()=>{}}=ze({scrollIntoPlace:!1,scrollBehavior:"smooth",safeViewport:p})||{};Ei(),Ft&&o6({scrollContainer:Y.current,behavior:Hp,scrollMarginTop:64,scrollMarginBottom:s6,elementTop:Bt,elementBottom:tr,scrollPortTop:Ls,scrollPortBottom:Lr,visualViewportTop:ms,visualViewportBottom:ui,beforeScrollCallback:()=>Ut.current=!0}),visualViewport.removeEventListener("resize",ci)};As.current?(ci(),visualViewport.addEventListener("resize",ci),Mr.current=setTimeout(()=>{visualViewport.removeEventListener("resize",ci)},900)):(visualViewport.addEventListener("resize",ci),ea.current=setTimeout(()=>{visualViewport.removeEventListener("resize",ci),ci()},900))},Xe=Te=>{let He=Te.target;!Bo(He)||$g(He)||Bo(Te.relatedTarget)||(As.current=!1,ze({scrollBehavior:Hp,safeViewport:p==="none"?"none":"layout-viewport"}))},Fe=()=>{var Te;(Te=Y.current)===null||Te===void 0||Te.removeEventListener("scroll",Lt),setTimeout(()=>{Lt(),setTimeout(()=>{var He;(He=Y.current)===null||He===void 0||He.addEventListener("scroll",Lt,{once:!0})},200)},1),setTimeout(()=>Lt,350)};return Se?.addEventListener("focus",ft,{capture:!0}),Se?.addEventListener("blur",Xe,{capture:!0}),visualViewport.addEventListener("resize",Fe),Se?.addEventListener("scroll",Lt,{once:!0}),()=>{Se?.removeEventListener("focus",ft,{capture:!0}),Se?.removeEventListener("blur",Xe,{capture:!0}),visualViewport.removeEventListener("resize",Fe),Se?.removeEventListener("scroll",Lt)}},[k,p,ze,Lt]);let Ko=Qx(Y),er=S.useMemo(()=>f&&!Oe,[Oe,f]),ji=Ui("Scroll",{axis:h,scrollTrapX:Ms,scrollTrapY:!Ne&&Qn||Ko&&!er,scrollGestureOvershoot:g,scrollDisabled:tt,pageScroll:f,nativePageScrollReplacement:d,overflowX:dt,overflowY:_t,skipScrollAnimation:L?.skip,scrollAnchoring:E,scrollSnapType:M,nativeScrollbar:N,scrollOngoing:Ge});return j.jsxs(Nf.Provider,{value:{contentRef:B,axis:h,styleAttributes:ji,nativeFocusScrollPrevention:R,swipeTrapIncapable:er,focusable:pe,pageScroll:f,nativePageScrollReplacement:d,scrollContainerRef:Y,swipeTrapObserverRequired:je,startScrollSpyRef:re,endScrollSpyRef:fe,startSpacerRef:X,endSpacerRef:ie,scrollHandler:Qs,scrollPadding:U,scrollTimelineName:I},children:[f&&d!==!0&&j.jsx("style",{dangerouslySetInnerHTML:{__html:`
88
+ html[data-silk-native-page-scroll-replaced="false"] > body {
89
+ scroll-padding: ${U};
90
+ scroll-timeline-axis: ${I} ${h};
91
+ }
92
+ `}}),f&&d===!0&&j.jsx("script",{id:"silk-scroll-nativePageScrollReplacement-true",dangerouslySetInnerHTML:{__html:`
93
+ document.documentElement.setAttribute("data-silk-native-page-scroll-replaced", "true");
94
+ `}}),f&&d===!1&&j.jsx("script",{id:"silk-scroll-nativePageScrollReplacement-false",dangerouslySetInnerHTML:{__html:`
95
+ document.documentElement.setAttribute("data-silk-native-page-scroll-replaced", "false");
96
+ `}}),f&&d==="auto"&&j.jsx("script",{id:"silk-scroll-nativePageScrollReplacement-auto",dangerouslySetInnerHTML:{__html:`
97
+ const standalone =
98
+ window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone;
99
+ const mobile = window.navigator.userAgent?.match(/android|iPhone|iPad/i);
100
+
101
+ document.documentElement.setAttribute("data-standalone", !!standalone);
102
+ document.documentElement.setAttribute("data-silk-native-page-scroll-replaced", !(mobile && !standalone));
103
+ `}}),j.jsx(x5,{}),j.jsx(A,{...ji("view",["axis","pageScroll","skipScrollAnimation","scrollOngoing"],{className:a,dataSilk:[l]}),...F,ref:q,children:n})]})});c6.displayName="Scroll.View";let Kg=We.forwardRef(({side:t,...e},i)=>{let{axis:n}=S.useContext(Nf)||{},a=Ui("Scroll",{side:t,axis:n});return j.jsx("div",{...a("spy",["side","axis"]),ref:i,...e})});Kg.displayName="Scroll.Anonymous";let u6=We.forwardRef((t,e)=>{let{asChild:i,className:n,"data-silk":a,...l}=t,u=i?Fi:"div",{contentRef:h,styleAttributes:f,nativeFocusScrollPrevention:d,swipeTrapIncapable:p,focusable:v,axis:g,pageScroll:y,nativePageScrollReplacement:b,scrollContainerRef:C,swipeTrapObserverRequired:x,startScrollSpyRef:k,endScrollSpyRef:R,startSpacerRef:L,endSpacerRef:E,scrollHandler:H,scrollPadding:U,scrollTimelineName:I}=S.useContext(Nf)||{},N=Rs(h,e);return j.jsxs("div",{...f("scrollContainer",["axis","pageScroll","scrollTrapX","scrollTrapY","scrollGestureOvershoot","scrollDisabled","overflowX","overflowY","skipScrollAnimation","scrollAnchoring","scrollSnapType","nativeScrollbar"],{dataSilk:[a,"0ad",d&&"0ah",p&&"0ai"]}),style:{scrollPadding:U,scrollTimeline:I+" "+g},tabIndex:v?0:d?-1:void 0,role:y&&!b?void 0:"region",onScroll:H,ref:C,children:[x&&j.jsx(Kg,{side:"start",ref:k}),g==="y"&&j.jsx("div",{ref:L,...f("startSpacer",["axis","pageScroll"])}),j.jsx(u,{...f("content",["axis","scrollTrapX","scrollTrapY","overflowX","overflowY"],{className:n,dataSilk:[a]}),...l,ref:N}),g==="y"&&j.jsx("div",{ref:E,...f("endSpacer",["axis","pageScroll"])}),x&&j.jsx(Kg,{side:"end",ref:R})]})});u6.displayName="Scroll.Content";let h6=We.forwardRef(({asChild:t,...e},i)=>{let n=t?Fi:"button",{forComponent:a,onPress:l,onClick:u,children:h,action:f,...d}=e,{type:p,...v}=f||{},{scrollTo:g,scrollBy:y}=C5(a),b=S.useRef(null),C=Rs(b,i);return j.jsx(n,{onClick:x=>{var k;let{forceFocus:R,runAction:L}=ln({nativeEvent:x,defaultBehavior:{forceFocus:!0,runAction:!0},handler:l});if(R&&((k=b.current)===null||k===void 0||k.focus({preventScroll:!0})),L){if(p==="scroll-to")return g(v);if(p==="scroll-by")return y(v)}u?.(x)},ref:C,...d,children:h})});h6.displayName="Sheet.Trigger";let d6=t=>S.useContext(t??Za)||{},f6=We.forwardRef((t,e)=>{let{asChild:i,className:n,"data-silk":a,timing:l,forComponent:u,tabIndex:h,...f}=t,d=i?Fi:"div",{sheetId:p}=u?d6(u):{},v=p??"any",g=S.useCallback(L=>{qe.addAutoFocusTarget({layerId:v,element:L,timing:l})},[v,l]),y=S.useCallback(L=>{qe.removeAutoFocusTarget(L)},[]),b=S.useRef(null),C=S.useCallback(L=>{L?g(L):y(b.current),b.current=L},[g,y]),x=S.useRef(!0);S.useEffect(()=>(b.current&&!x.current&&g(b.current),x.current=!1,()=>{b.current&&y(b.current)}),[g,y]);let k=Rs(C,e),R=Ui("AutoFocusTarget",{});return j.jsx(d,{...R("root",[],{className:n,dataSilk:[a]}),...i||Number.isInteger(h)?{}:{tabIndex:-1},...f,ref:k})});f6.displayName="AutoFocusTarget.Root";let m6=We.forwardRef((t,e)=>{let{asChild:i,disabled:n=!1,children:a,contentGetter:l,forComponent:u,...h}=t,f=S.useRef(null),d=Rs(f,e),p=S.useMemo(()=>!!a,[a]);return S.useEffect(()=>{let v,g;if(!n){let y,b=!1;if(p&&f.current?y=f.current:l&&(y=_f(l))&&(b=!0),y){let C=Array.isArray(u)?u:u?[u]:[];v=qe.addIsland({componentId:C,element:y}),b&&(g=new MutationObserver(()=>{_f(l)||(qe.removeIsland(v),g.disconnect())})).observe(y.parentElement,{childList:!0})}}return()=>{n||(qe.removeIsland(v),g?.disconnect())}},[e,n,p,l,u]),a?j.jsx(Kn.Root,{active:!n,asChild:i,"data-silk":"0ag",...h,ref:d,children:a}):null});m6.displayName="Island.Root";let _6=We.forwardRef((t,e)=>{let{asChild:i,children:n,...a}=t;return j.jsx(Kn.Stabiliser,{asChild:i,...a,ref:e,children:n})});_6.displayName="Island.Content";let p6=We.forwardRef(({asChild:t,children:e,contentGetter:i,disabled:n=!1,selfManagedInertOutside:a=!0,...l},u)=>{let h=Vo(),f=S.useRef(null),d=Rs(f,u),p=t?Fi:"div",v=S.useMemo(()=>!!e,[e]);return vi(()=>{let g;if(!n&&h){let y,b=!1;v&&f.current?y=f.current:i&&(y=_f(i))&&(b=!0),y&&(qe.updateLayer({external:!0,layerId:h,viewElement:y,inertOutside:a,onPresentAutoFocus:{focus:!1},onDismissAutoFocus:{focus:!1},defaultClickOutsideAction:()=>{},defaultEscapeKeyDownAction:()=>{}}),b&&(g=new MutationObserver(()=>{_f(i)||(qe.removeLayer(h),g.disconnect())})).observe(y.parentElement,{childList:!0}))}return()=>{!n&&h&&(qe.removeLayer(h),g?.disconnect())}},[v,i,n,h,a]),j.jsx(p,{ref:d,...l,children:e})});p6.displayName="ExternalOverlay.Root";const k5=We.forwardRef(({children:t,license:e="commercial",...i},n)=>j.jsx(Qa.Root,{license:e,...i,ref:n,children:t}));k5.displayName="BottomSheet.Root";const E5=We.forwardRef(({children:t,className:e,...i},n)=>j.jsx(Qa.View,{className:`BottomSheet-view ${e??""}`.trim(),nativeEdgeSwipePrevention:!0,...i,ref:n,children:t}));E5.displayName="BottomSheet.View";const T5=We.forwardRef(({className:t,...e},i)=>j.jsx(Qa.Backdrop,{className:`BottomSheet-backdrop ${t??""}`.trim(),themeColorDimming:!1,...e,ref:i}));T5.displayName="BottomSheet.Backdrop";const R5=We.forwardRef(({children:t,className:e,...i},n)=>j.jsxs(Qa.Content,{className:`BottomSheet-content ${e??""}`.trim(),...i,ref:n,children:[j.jsx(Qa.BleedingBackground,{className:"BottomSheet-bleedingBackground"}),t]}));R5.displayName="BottomSheet.Content";const M5=We.forwardRef(({className:t,...e},i)=>j.jsx(Qa.Handle,{className:`BottomSheet-handle ${t??""}`.trim(),action:"dismiss",...e,ref:i}));M5.displayName="BottomSheet.Handle";const g6=Qa.Portal,v6=Qa.Trigger,Ia={Root:k5,Portal:g6,View:E5,Backdrop:T5,Content:R5,Trigger:v6,Handle:M5},y6=t=>{const e=t.status==="running"?"Running":"Closed",i=t.source==="tmux"?"Tmux":"Mock";return`${e} - ${i}`},S6=({terminals:t,activeTerminalId:e,listState:i,onSelectTerminal:n})=>{const a=i==="loading"?"Loading terminals":i==="error"?"Unable to load terminals":i==="empty"?"No terminals available":null;return j.jsxs(Ia.Root,{children:[j.jsx(Ia.Trigger,{asChild:!0,children:j.jsx(Od,{type:"button",variant:"secondary",size:"icon","aria-label":"Terminals",className:"h-11 w-11 rounded-full bg-input/50",children:j.jsx($O,{className:"size-4","aria-hidden":"true"})})}),j.jsx(Ia.Portal,{children:j.jsxs(Ia.View,{children:[j.jsx(Ia.Backdrop,{}),j.jsxs(Ia.Content,{className:"px-4 pb-[calc(env(safe-area-inset-bottom,0px)+16px)] pt-3",children:[j.jsx("div",{className:"flex items-center justify-center pb-3",children:j.jsx(Ia.Handle,{})}),j.jsxs("div",{className:"flex items-center justify-between px-1 pb-4",children:[j.jsxs("div",{className:"space-y-1",children:[j.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Terminals"}),j.jsx("p",{className:"text-sm font-medium text-foreground",children:"Select a session"})]}),i==="ready"?j.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.length," total"]}):null]}),j.jsx("div",{className:"no-scrollbar max-h-[min(55vh,360px)] space-y-2 overflow-y-auto px-1",children:a?j.jsx("div",{className:"rounded-2xl border border-border/60 bg-background/70 px-4 py-5 text-sm text-muted-foreground",children:a}):t.map(l=>{const u=l.id===e,h=l.label||l.id;return j.jsx(Ia.Trigger,{asChild:!0,action:"dismiss",children:j.jsx("button",{type:"button","aria-label":`Open ${h}`,"aria-current":u?"page":void 0,className:`w-full rounded-2xl border px-4 py-3 text-left transition ${u?"border-primary/60 bg-primary/10 text-foreground":"border-transparent bg-background/70 text-foreground hover:bg-background/90"}`,onClick:()=>n(l.id),children:j.jsxs("div",{className:"flex items-center justify-between gap-3",children:[j.jsxs("div",{className:"min-w-0",children:[j.jsx("span",{className:"text-sm font-medium",children:h}),j.jsx("div",{className:"pt-1 text-xs text-muted-foreground",children:y6(l)})]}),u?j.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-primary",children:j.jsx(DO,{className:"size-6","aria-hidden":"true"})}):null]})})},l.id)})})]})]})})]})},b6=({clientRef:t,terminals:e,activeTerminalId:i,listState:n,onSelectTerminal:a})=>{const l=S.useRef(null),[u,h]=S.useState(""),[f,d]=S.useState(!1),[p,v]=S.useState(!1),[g,y]=S.useState(!1);S.useEffect(()=>{if(!f){v(!1),y(!1);return}const k=l.current,R=()=>{const U=k.scrollWidth-k.clientWidth,I=k.scrollLeft>0,N=k.scrollLeft<U-1;v(I),y(U>0&&N)};R();const L=()=>R();k.addEventListener("scroll",L,{passive:!0});const E=window.ResizeObserver,H=typeof E=="function"?new E(R):null;return H?.observe(k),window.addEventListener("resize",R),()=>{k.removeEventListener("scroll",L),H?.disconnect(),window.removeEventListener("resize",R)}},[f]);const b=S.useMemo(()=>[{id:"enter",label:"Enter",kind:"input",data:"\r",icon:PO},{id:"up",label:"Up",kind:"control",key:"up",icon:AO},{id:"down",label:"Down",kind:"control",key:"down",icon:wO},{id:"left",label:"Left",kind:"control",key:"left",icon:xO},{id:"right",label:"Right",kind:"control",key:"right",icon:RO},{id:"tab",label:"Tab",kind:"control",key:"tab",icon:EO},{id:"esc",label:"Esc",kind:"control",key:"esc",icon:jO},{id:"ctrl-c",label:"Ctrl+C",kind:"control",key:"ctrl_c",icon:BO}],[]),C=()=>{const k=t.current;k&&(u&&k.sendInput(u),k.sendInput("\r"),h(""))},x=k=>{const R=t.current;if(R){if(k.kind==="input"){R.sendInput(k.data);return}R.sendControl(k.key)}};return j.jsxs("div",{className:"min-w-0",children:[f?j.jsx("div",{className:"pt-3",children:j.jsxs("div",{className:"relative",children:[j.jsx("div",{className:"h-auto",children:j.jsx("div",{ref:l,id:"terminal-actions","data-testid":"terminal-actions-scroll",className:"no-scrollbar flex h-full w-full items-center gap-2 overflow-x-auto px-3 snap-x snap-mandatory scroll-px-3",children:b.map(k=>{const R=k.icon;return j.jsxs(Od,{type:"button",variant:"secondary",size:"sm","aria-label":k.label,className:"bg-input/50 snap-start whitespace-nowrap px-3 py-2",onClick:()=>x(k),children:[j.jsx(R,{className:"size-4","aria-hidden":"true"}),j.jsx("span",{children:k.label})]},k.id)})})}),p?j.jsx("div",{"data-testid":"terminal-actions-gradient-left",className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-16 bg-gradient-to-r from-background to-transparent"}):null,g?j.jsx("div",{"data-testid":"terminal-actions-gradient-right",className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-16 bg-gradient-to-l from-background to-transparent"}):null]})}):null,j.jsx("div",{className:"px-3 py-3",children:j.jsxs("div",{className:"flex w-full min-w-0 items-center gap-3",children:[j.jsx(Od,{type:"button",variant:"secondary",size:"icon","aria-label":"Add","aria-expanded":f,"aria-controls":"terminal-actions",className:"h-11 w-11 rounded-full bg-input/50",onClick:()=>d(k=>!k),children:j.jsx(IO,{className:`size-4 transition-transform duration-200 ${f?"rotate-45":""}`})}),j.jsxs("div",{className:"relative flex-1 min-w-0",children:[j.jsx(OR,{placeholder:"Message","aria-label":"Message",className:"h-11 rounded-full border-none bg-input/50 pl-4 pr-8",value:u,onChange:k=>h(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),C())}}),j.jsx(Od,{type:"button",variant:"default",size:"sm","aria-label":"Send",className:"absolute right-1 top-1/2 h-9 w-9 -translate-y-1/2 rounded-full",onClick:C,children:j.jsx(UO,{className:"size-4"})})]}),j.jsx("div",{className:"-ml-1 flex-shrink-0",children:j.jsx(S6,{terminals:e,activeTerminalId:i,listState:n,onSelectTerminal:a})})]})})]})},w6=({activeView:t,onViewChange:e})=>j.jsx(lM,{value:t,onValueChange:i=>e(i),className:"px-3 py-2",children:j.jsxs(uM,{className:"w-full",children:[j.jsx(Ob,{value:"terminal",className:"flex-1",children:"Terminal"}),j.jsx(Ob,{value:"preview",className:"flex-1",children:"Preview"})]})}),A5=({terminalId:t,onSelectTerminal:e})=>{const i=S.useRef(null),n=S.useRef(null),[a,l]=S.useState("loading"),[u,h]=S.useState([]),[f,d]=S.useState(null),[p,v]=S.useState("connecting"),[g,y]=S.useState(null),[b,C]=S.useState(null),[x,k]=S.useState("terminal");S.useEffect(()=>{let I=!0;return(async()=>{try{const[F,J,G]=await Promise.all([fetch("/__tb/api/terminals"),fetch("/__tb/api/csrf"),fetch("/__tb/api/config")]);if(!F.ok||!J.ok||!G.ok)throw new Error("api request failed");const[D,O,P]=await Promise.all([F.json(),J.json(),G.json()]),$=D.terminals;if(!I)return;if(h($),d(O.csrfToken),y(P.proxyPort),C(P.devProxyUrl),$.length===0){l("empty");return}l("ready")}catch{I&&l("error")}})(),()=>{I=!1}},[]);const R=S.useMemo(()=>a!=="ready"||!t?null:u.some(I=>I.id===t)?t:null,[a,t,u]);S.useEffect(()=>{if(a!=="ready"||u.length===0||(t?u.some(F=>F.id===t):!1))return;const N=u[0]?.id;N&&e&&e(N)},[a,u,t,e]),S.useEffect(()=>{if(a!=="ready"||!R||!f||!i.current)return;v("connecting");const I=_O(i.current,R,f);n.current=I;const N=I.onConnectionStateChange(F=>{v(F)});return()=>{N(),n.current=null,I.destroy()}},[a,R,f]);const L=a==="loading"?"Loading terminal":a==="empty"?"No terminals available":a==="error"?"Unable to load terminals":R?null:"Loading terminal",E=e??(()=>{}),H=R?j.jsx("span",{className:`absolute right-2 top-2 z-10 inline-block h-2 w-2 rounded-full ${p==="connected"?"bg-green-500":p==="reconnecting"?"animate-pulse bg-yellow-500":p==="connecting"?"animate-pulse bg-blue-400":"bg-red-500"}`,"data-testid":"connection-indicator","data-state":p,"aria-label":p}):null,U=g!==null;return j.jsxs("div",{className:`relative grid h-full w-full grid-cols-1 bg-background text-foreground ${U?"grid-rows-[auto_minmax(0,1fr)_auto]":"grid-rows-[minmax(0,1fr)_auto]"}`,children:[U?j.jsx(w6,{activeView:x,onViewChange:k}):null,L&&x==="terminal"?j.jsx("div",{className:"terminal-status absolute inset-0 z-20 flex items-center justify-center bg-background/85 text-xs font-medium text-muted-foreground",role:"status",children:L}):null,x==="terminal"?H:null,j.jsxs("div",{className:"min-h-0 min-w-0 relative",children:[U?j.jsx("iframe",{src:b??"/",title:"Preview",className:`h-full w-full border-0 ${x==="preview"?"":"invisible absolute inset-0"}`,sandbox:"allow-same-origin allow-scripts allow-forms allow-popups","data-testid":"preview-iframe"}):null,j.jsx("div",{ref:i,className:`terminal-host h-full w-full ${x==="preview"?"invisible absolute inset-0":""}`,"data-testid":"terminal-host"})]}),j.jsx(b6,{clientRef:n,terminals:u,activeTerminalId:R,listState:a,onSelectTerminal:E})]})},C6=()=>{const t=Fu(),e=S.useCallback(i=>{t({to:"/terminal/$terminalId",params:{terminalId:i}})},[t]);return j.jsx(A5,{terminalId:null,onSelectTerminal:e})},x6=()=>{const t=Fu(),{terminalId:e}=wf({from:"/terminal/$terminalId"}),i=S.useCallback(n=>{t({to:"/terminal/$terminalId",params:{terminalId:n}})},[t]);return j.jsx(A5,{terminalId:e,onSelectTerminal:i})},Tv=PE({component:()=>j.jsx(Kw,{})}),k6=rv({getParentRoute:()=>Tv,path:"/",component:C6}),E6=rv({getParentRoute:()=>Tv,path:"/terminal/$terminalId",component:x6}),T6=Tv.addChildren([k6,E6]),R6=VE({routeTree:T6,basepath:"/__tb/app"}),L5="termbridge.theme",M6=()=>{if(typeof window>"u")return null;const t=window.localStorage.getItem(L5);return t==="light"||t==="dark"||t==="system"?t:null},A6=t=>{typeof window>"u"||window.localStorage.setItem(L5,t)},L6=()=>(hM({getStoredTheme:M6,setStoredTheme:A6}),j.jsx(KE,{router:R6})),D6=t=>{lk.createRoot(t).render(j.jsx(L6,{}))},ww=document.getElementById("root");ww&&D6(ww);