Files
sencho/backend/public/assets/index-DQZd4c74.js
T
SaelixCode 5fe416f941 feat: add frontend index.html and Vite logo; enhance system stats API with network metrics
- Created a new index.html file for the frontend with theme handling and linked assets.
- Added a Vite logo SVG to the public directory.
- Updated the system stats API to include network statistics (rxBytes, txBytes, rxSec, txSec).
- Enhanced the EditorLayout component to display network I/O rates for containers.
- Modified HomeDashboard to show host network statistics with appropriate formatting.
2026-02-26 14:43:45 -05:00

97 lines
797 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function jE(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const c=Object.getOwnPropertyDescriptor(n,a);c&&Object.defineProperty(e,a,c.get?c:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(a){if(a.ep)return;a.ep=!0;const c=r(a);fetch(a.href,c)}})();function pS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Of={exports:{}},il={};var hy;function HE(){if(hy)return il;hy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,c){var u=null;if(c!==void 0&&(u=""+c),a.key!==void 0&&(u=""+a.key),"key"in a){c={};for(var f in a)f!=="key"&&(c[f]=a[f])}else c=a;return a=c.ref,{$$typeof:e,type:n,key:u,ref:a!==void 0?a:null,props:c}}return il.Fragment=t,il.jsx=r,il.jsxs=r,il}var dy;function PE(){return dy||(dy=1,Of.exports=HE()),Of.exports}var v=PE(),Bf={exports:{}},ke={};var fy;function UE(){if(fy)return ke;fy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),S=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=S&&D[S]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,k={};function T(D,O,q){this.props=D,this.context=O,this.refs=k,this.updater=q||x}T.prototype.isReactComponent={},T.prototype.setState=function(D,O){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,O,"setState")},T.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function $(){}$.prototype=T.prototype;function z(D,O,q){this.props=D,this.context=O,this.refs=k,this.updater=q||x}var A=z.prototype=new $;A.constructor=z,C(A,T.prototype),A.isPureReactComponent=!0;var j=Array.isArray;function P(){}var F={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function re(D,O,q){var Q=q.ref;return{$$typeof:e,type:D,key:O,ref:Q!==void 0?Q:null,props:q}}function le(D,O){return re(D.type,O,D.props)}function ce(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function W(D){var O={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(q){return O[q]})}var M=/\/+/g;function H(D,O){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):O.toString(36)}function N(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(P,P):(D.status="pending",D.then(function(O){D.status==="pending"&&(D.status="fulfilled",D.value=O)},function(O){D.status==="pending"&&(D.status="rejected",D.reason=O)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function R(D,O,q,Q,X){var ae=typeof D;(ae==="undefined"||ae==="boolean")&&(D=null);var de=!1;if(D===null)de=!0;else switch(ae){case"bigint":case"string":case"number":de=!0;break;case"object":switch(D.$$typeof){case e:case t:de=!0;break;case g:return de=D._init,R(de(D._payload),O,q,Q,X)}}if(de)return X=X(D),de=Q===""?"."+H(D,0):Q,j(X)?(q="",de!=null&&(q=de.replace(M,"$&/")+"/"),R(X,O,q,"",function(Je){return Je})):X!=null&&(ce(X)&&(X=le(X,q+(X.key==null||D&&D.key===X.key?"":(""+X.key).replace(M,"$&/")+"/")+de)),O.push(X)),1;de=0;var _e=Q===""?".":Q+":";if(j(D))for(var me=0;me<D.length;me++)Q=D[me],ae=_e+H(Q,me),de+=R(Q,O,q,ae,X);else if(me=w(D),typeof me=="function")for(D=me.call(D),me=0;!(Q=D.next()).done;)Q=Q.value,ae=_e+H(Q,me++),de+=R(Q,O,q,ae,X);else if(ae==="object"){if(typeof D.then=="function")return R(N(D),O,q,Q,X);throw O=String(D),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return de}function L(D,O,q){if(D==null)return D;var Q=[],X=0;return R(D,Q,"","",function(ae){return O.call(q,ae,X++)}),Q}function U(D){if(D._status===-1){var O=D._result;O=O(),O.then(function(q){(D._status===0||D._status===-1)&&(D._status=1,D._result=q)},function(q){(D._status===0||D._status===-1)&&(D._status=2,D._result=q)}),D._status===-1&&(D._status=0,D._result=O)}if(D._status===1)return D._result.default;throw D._result}var se=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},ee={map:L,forEach:function(D,O,q){L(D,function(){O.apply(this,arguments)},q)},count:function(D){var O=0;return L(D,function(){O++}),O},toArray:function(D){return L(D,function(O){return O})||[]},only:function(D){if(!ce(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return ke.Activity=_,ke.Children=ee,ke.Component=T,ke.Fragment=r,ke.Profiler=a,ke.PureComponent=z,ke.StrictMode=n,ke.Suspense=m,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,ke.__COMPILER_RUNTIME={__proto__:null,c:function(D){return F.H.useMemoCache(D)}},ke.cache=function(D){return function(){return D.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(D,O,q){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Q=C({},D.props),X=D.key;if(O!=null)for(ae in O.key!==void 0&&(X=""+O.key),O)!G.call(O,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&O.ref===void 0||(Q[ae]=O[ae]);var ae=arguments.length-2;if(ae===1)Q.children=q;else if(1<ae){for(var de=Array(ae),_e=0;_e<ae;_e++)de[_e]=arguments[_e+2];Q.children=de}return re(D.type,X,Q)},ke.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:c,_context:D},D},ke.createElement=function(D,O,q){var Q,X={},ae=null;if(O!=null)for(Q in O.key!==void 0&&(ae=""+O.key),O)G.call(O,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(X[Q]=O[Q]);var de=arguments.length-2;if(de===1)X.children=q;else if(1<de){for(var _e=Array(de),me=0;me<de;me++)_e[me]=arguments[me+2];X.children=_e}if(D&&D.defaultProps)for(Q in de=D.defaultProps,de)X[Q]===void 0&&(X[Q]=de[Q]);return re(D,ae,X)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(D){return{$$typeof:f,render:D}},ke.isValidElement=ce,ke.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:U}},ke.memo=function(D,O){return{$$typeof:d,type:D,compare:O===void 0?null:O}},ke.startTransition=function(D){var O=F.T,q={};F.T=q;try{var Q=D(),X=F.S;X!==null&&X(q,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(P,se)}catch(ae){se(ae)}finally{O!==null&&q.types!==null&&(O.types=q.types),F.T=O}},ke.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},ke.use=function(D){return F.H.use(D)},ke.useActionState=function(D,O,q){return F.H.useActionState(D,O,q)},ke.useCallback=function(D,O){return F.H.useCallback(D,O)},ke.useContext=function(D){return F.H.useContext(D)},ke.useDebugValue=function(){},ke.useDeferredValue=function(D,O){return F.H.useDeferredValue(D,O)},ke.useEffect=function(D,O){return F.H.useEffect(D,O)},ke.useEffectEvent=function(D){return F.H.useEffectEvent(D)},ke.useId=function(){return F.H.useId()},ke.useImperativeHandle=function(D,O,q){return F.H.useImperativeHandle(D,O,q)},ke.useInsertionEffect=function(D,O){return F.H.useInsertionEffect(D,O)},ke.useLayoutEffect=function(D,O){return F.H.useLayoutEffect(D,O)},ke.useMemo=function(D,O){return F.H.useMemo(D,O)},ke.useOptimistic=function(D,O){return F.H.useOptimistic(D,O)},ke.useReducer=function(D,O,q){return F.H.useReducer(D,O,q)},ke.useRef=function(D){return F.H.useRef(D)},ke.useState=function(D){return F.H.useState(D)},ke.useSyncExternalStore=function(D,O,q){return F.H.useSyncExternalStore(D,O,q)},ke.useTransition=function(){return F.H.useTransition()},ke.version="19.2.4",ke}var my;function wp(){return my||(my=1,Bf.exports=UE()),Bf.exports}var y=wp();const ue=pS(y),xp=jE({__proto__:null,default:ue},[y]);var Lf={exports:{}},rl={},zf={exports:{}},jf={};var py;function IE(){return py||(py=1,(function(e){function t(R,L){var U=R.length;R.push(L);e:for(;0<U;){var se=U-1>>>1,ee=R[se];if(0<a(ee,L))R[se]=L,R[U]=ee,U=se;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var L=R[0],U=R.pop();if(U!==L){R[0]=U;e:for(var se=0,ee=R.length,D=ee>>>1;se<D;){var O=2*(se+1)-1,q=R[O],Q=O+1,X=R[Q];if(0>a(q,U))Q<ee&&0>a(X,q)?(R[se]=X,R[Q]=U,se=Q):(R[se]=q,R[O]=U,se=O);else if(Q<ee&&0>a(X,U))R[se]=X,R[Q]=U,se=Q;else break e}}return L}function a(R,L){var U=R.sortIndex-L.sortIndex;return U!==0?U:R.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],d=[],g=1,_=null,S=3,w=!1,x=!1,C=!1,k=!1,T=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function A(R){for(var L=r(d);L!==null;){if(L.callback===null)n(d);else if(L.startTime<=R)n(d),L.sortIndex=L.expirationTime,t(m,L);else break;L=r(d)}}function j(R){if(C=!1,A(R),!x)if(r(m)!==null)x=!0,P||(P=!0,W());else{var L=r(d);L!==null&&N(j,L.startTime-R)}}var P=!1,F=-1,G=5,re=-1;function le(){return k?!0:!(e.unstable_now()-re<G)}function ce(){if(k=!1,P){var R=e.unstable_now();re=R;var L=!0;try{e:{x=!1,C&&(C=!1,$(F),F=-1),w=!0;var U=S;try{t:{for(A(R),_=r(m);_!==null&&!(_.expirationTime>R&&le());){var se=_.callback;if(typeof se=="function"){_.callback=null,S=_.priorityLevel;var ee=se(_.expirationTime<=R);if(R=e.unstable_now(),typeof ee=="function"){_.callback=ee,A(R),L=!0;break t}_===r(m)&&n(m),A(R)}else n(m);_=r(m)}if(_!==null)L=!0;else{var D=r(d);D!==null&&N(j,D.startTime-R),L=!1}}break e}finally{_=null,S=U,w=!1}L=void 0}}finally{L?W():P=!1}}}var W;if(typeof z=="function")W=function(){z(ce)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,H=M.port2;M.port1.onmessage=ce,W=function(){H.postMessage(null)}}else W=function(){T(ce,0)};function N(R,L){F=T(function(){R(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(R){switch(S){case 1:case 2:case 3:var L=3;break;default:L=S}var U=S;S=L;try{return R()}finally{S=U}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var U=S;S=R;try{return L()}finally{S=U}},e.unstable_scheduleCallback=function(R,L,U){var se=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?se+U:se):U=se,R){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=U+ee,R={id:g++,callback:L,priorityLevel:R,startTime:U,expirationTime:ee,sortIndex:-1},U>se?(R.sortIndex=U,t(d,R),r(m)===null&&R===r(d)&&(C?($(F),F=-1):C=!0,N(j,U-se))):(R.sortIndex=ee,t(m,R),x||w||(x=!0,P||(P=!0,W()))),R},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(R){var L=S;return function(){var U=S;S=L;try{return R.apply(this,arguments)}finally{S=U}}}})(jf)),jf}var _y;function $E(){return _y||(_y=1,zf.exports=IE()),zf.exports}var Hf={exports:{}},ci={};var gy;function FE(){if(gy)return ci;gy=1;var e=wp();function t(m){var d="https://react.dev/errors/"+m;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function c(m,d,g){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:_==null?null:""+_,children:m,containerInfo:d,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,d){if(m==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ci.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,ci.createPortal=function(m,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return c(m,d,null,g)},ci.flushSync=function(m){var d=u.T,g=n.p;try{if(u.T=null,n.p=2,m)return m()}finally{u.T=d,n.p=g,n.d.f()}},ci.preconnect=function(m,d){typeof m=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(m,d))},ci.prefetchDNS=function(m){typeof m=="string"&&n.d.D(m)},ci.preinit=function(m,d){if(typeof m=="string"&&d&&typeof d.as=="string"){var g=d.as,_=f(g,d.crossOrigin),S=typeof d.integrity=="string"?d.integrity:void 0,w=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?n.d.S(m,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:_,integrity:S,fetchPriority:w}):g==="script"&&n.d.X(m,{crossOrigin:_,integrity:S,fetchPriority:w,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ci.preinitModule=function(m,d){if(typeof m=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=f(d.as,d.crossOrigin);n.d.M(m,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&n.d.M(m)},ci.preload=function(m,d){if(typeof m=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,_=f(g,d.crossOrigin);n.d.L(m,g,{crossOrigin:_,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})}},ci.preloadModule=function(m,d){if(typeof m=="string")if(d){var g=f(d.as,d.crossOrigin);n.d.m(m,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else n.d.m(m)},ci.requestFormReset=function(m){n.d.r(m)},ci.unstable_batchedUpdates=function(m,d){return m(d)},ci.useFormState=function(m,d,g){return u.H.useFormState(m,d,g)},ci.useFormStatus=function(){return u.H.useHostTransitionStatus()},ci.version="19.2.4",ci}var vy;function _S(){if(vy)return Hf.exports;vy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Hf.exports=FE(),Hf.exports}var yy;function WE(){if(yy)return rl;yy=1;var e=$E(),t=wp(),r=_S();function n(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function c(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function m(i){if(c(i)!==i)throw Error(n(188))}function d(i){var s=i.alternate;if(!s){if(s=c(i),s===null)throw Error(n(188));return s!==i?null:i}for(var o=i,l=s;;){var h=o.return;if(h===null)break;var p=h.alternate;if(p===null){if(l=h.return,l!==null){o=l;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===o)return m(h),i;if(p===l)return m(h),s;p=p.sibling}throw Error(n(188))}if(o.return!==l.return)o=h,l=p;else{for(var b=!1,E=h.child;E;){if(E===o){b=!0,o=h,l=p;break}if(E===l){b=!0,l=h,o=p;break}E=E.sibling}if(!b){for(E=p.child;E;){if(E===o){b=!0,o=p,l=h;break}if(E===l){b=!0,l=p,o=h;break}E=E.sibling}if(!b)throw Error(n(189))}}if(o.alternate!==l)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?i:s}function g(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=g(i),s!==null)return s;i=i.sibling}return null}var _=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),z=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function W(i){return i===null||typeof i!="object"?null:(i=ce&&i[ce]||i["@@iterator"],typeof i=="function"?i:null)}var M=Symbol.for("react.client.reference");function H(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===M?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case T:return"Profiler";case k:return"StrictMode";case j:return"Suspense";case P:return"SuspenseList";case re:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case z:return i.displayName||"Context";case $:return(i._context.displayName||"Context")+".Consumer";case A:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case F:return s=i.displayName||null,s!==null?s:H(i.type)||"Memo";case G:s=i._payload,i=i._init;try{return H(i(s))}catch{}}return null}var N=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},se=[],ee=-1;function D(i){return{current:i}}function O(i){0>ee||(i.current=se[ee],se[ee]=null,ee--)}function q(i,s){ee++,se[ee]=i.current,i.current=s}var Q=D(null),X=D(null),ae=D(null),de=D(null);function _e(i,s){switch(q(ae,s),q(X,i),q(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?B0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=B0(s),i=L0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}O(Q),q(Q,i)}function me(){O(Q),O(X),O(ae)}function Je(i){i.memoizedState!==null&&q(de,i);var s=Q.current,o=L0(s,i.type);s!==o&&(q(X,i),q(Q,o))}function ot(i){X.current===i&&(O(Q),O(X)),de.current===i&&(O(de),Qa._currentValue=U)}var Ke,Re;function mt(i){if(Ke===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);Ke=s&&s[1]||"",Re=-1<o.stack.indexOf(`
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Ke+i+Re}var vi=!1;function Yr(i,s){if(!i||vi)return"";vi=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(s){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(J){var Z=J}Reflect.construct(i,[],ne)}else{try{ne.call()}catch(J){Z=J}i.call(ne.prototype)}}else{try{throw Error()}catch(J){Z=J}(ne=i())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(J){if(J&&Z&&typeof J.stack=="string")return[J.stack,Z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=l.DetermineComponentFrameRoot(),b=p[0],E=p[1];if(b&&E){var B=b.split(`
`),K=E.split(`
`);for(h=l=0;l<B.length&&!B[l].includes("DetermineComponentFrameRoot");)l++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(l===B.length||h===K.length)for(l=B.length-1,h=K.length-1;1<=l&&0<=h&&B[l]!==K[h];)h--;for(;1<=l&&0<=h;l--,h--)if(B[l]!==K[h]){if(l!==1||h!==1)do if(l--,h--,0>h||B[l]!==K[h]){var te=`
`+B[l].replace(" at new "," at ");return i.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",i.displayName)),te}while(1<=l&&0<=h);break}}}finally{vi=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?mt(o):""}function Kr(i,s){switch(i.tag){case 26:case 27:case 5:return mt(i.type);case 16:return mt("Lazy");case 13:return i.child!==s&&s!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return Yr(i.type,!1);case 11:return Yr(i.type.render,!1);case 1:return Yr(i.type,!0);case 31:return mt("Activity");default:return""}}function bn(i){try{var s="",o=null;do s+=Kr(i,o),o=i,i=i.return;while(i);return s}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var di=Object.prototype.hasOwnProperty,Sn=e.unstable_scheduleCallback,wn=e.unstable_cancelCallback,Jt=e.unstable_shouldYield,Cr=e.unstable_requestPaint,ei=e.unstable_now,da=e.unstable_getCurrentPriorityLevel,Gr=e.unstable_ImmediatePriority,to=e.unstable_UserBlockingPriority,Xr=e.unstable_NormalPriority,hr=e.unstable_LowPriority,dr=e.unstable_IdlePriority,io=e.log,fr=e.unstable_setDisableYieldValue,Zr=null,Pt=null;function Di(i){if(typeof io=="function"&&fr(i),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(Zr,i)}catch{}}var Ut=Math.clz32?Math.clz32:Se,ro=Math.log,he=Math.LN2;function Se(i){return i>>>=0,i===0?32:31-(ro(i)/he|0)|0}var Te=256,Me=262144,lt=4194304;function Ye(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function xe(i,s,o){var l=i.pendingLanes;if(l===0)return 0;var h=0,p=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var E=l&134217727;return E!==0?(l=E&~p,l!==0?h=Ye(l):(b&=E,b!==0?h=Ye(b):o||(o=E&~i,o!==0&&(h=Ye(o))))):(E=l&~p,E!==0?h=Ye(E):b!==0?h=Ye(b):o||(o=l&~i,o!==0&&(h=Ye(o)))),h===0?0:s!==0&&s!==h&&(s&p)===0&&(p=h&-h,o=s&-s,p>=o||p===32&&(o&4194048)!==0)?s:h}function Ge(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function gt(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 It(){var i=lt;return lt<<=1,(lt&62914560)===0&&(lt=4194304),i}function Er(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function st(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function $t(i,s,o,l,h,p){var b=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var E=i.entanglements,B=i.expirationTimes,K=i.hiddenUpdates;for(o=b&~o;0<o;){var te=31-Ut(o),ne=1<<te;E[te]=0,B[te]=-1;var Z=K[te];if(Z!==null)for(K[te]=null,te=0;te<Z.length;te++){var J=Z[te];J!==null&&(J.lane&=-536870913)}o&=~ne}l!==0&&Mi(i,l,0),p!==0&&h===0&&i.tag!==0&&(i.suspendedLanes|=p&~(b&~s))}function Mi(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-Ut(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&261930}function Ot(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-Ut(o),h=1<<l;h&s|i[l]&s&&(i[l]|=s),o&=~h}}function li(i,s){var o=s&-s;return o=(o&42)!==0?1:Ms(o),(o&(i.suspendedLanes|s))!==0?0:o}function Ms(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Ni(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function wh(){var i=L.p;return i!==0?i:(i=window.event,i===void 0?32:sy(i.type))}function b_(i,s){var o=L.p;try{return L.p=i,s()}finally{L.p=o}}var Ns=Math.random().toString(36).slice(2),ti="__reactFiber$"+Ns,yi="__reactProps$"+Ns,so="__reactContainer$"+Ns,xh="__reactEvents$"+Ns,RC="__reactListeners$"+Ns,kC="__reactHandles$"+Ns,S_="__reactResources$"+Ns,fa="__reactMarker$"+Ns;function Ch(i){delete i[ti],delete i[yi],delete i[xh],delete i[RC],delete i[kC]}function no(i){var s=i[ti];if(s)return s;for(var o=i.parentNode;o;){if(s=o[so]||o[ti]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=$0(i);i!==null;){if(o=i[ti])return o;i=$0(i)}return s}i=o,o=i.parentNode}return null}function oo(i){if(i=i[ti]||i[so]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function ma(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(n(33))}function ao(i){var s=i[S_];return s||(s=i[S_]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Ft(i){i[fa]=!0}var w_=new Set,x_={};function xn(i,s){lo(i,s),lo(i+"Capture",s)}function lo(i,s){for(x_[i]=s,i=0;i<s.length;i++)w_.add(s[i])}var TC=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]*$"),C_={},E_={};function AC(i){return di.call(E_,i)?!0:di.call(C_,i)?!1:TC.test(i)?E_[i]=!0:(C_[i]=!0,!1)}function Il(i,s,o){if(AC(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var l=s.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function $l(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function Qr(i,s,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+l)}}function Yi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function R_(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function DC(i,s,o){var l=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,p=l.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return h.call(this)},set:function(b){o=""+b,p.call(this,b)}}),Object.defineProperty(i,s,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(b){o=""+b},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Eh(i){if(!i._valueTracker){var s=R_(i)?"checked":"value";i._valueTracker=DC(i,s,""+i[s])}}function k_(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=R_(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function Fl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var MC=/[\n"\\]/g;function Ki(i){return i.replace(MC,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Rh(i,s,o,l,h,p,b,E){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),s!=null?b==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Yi(s)):i.value!==""+Yi(s)&&(i.value=""+Yi(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?kh(i,b,Yi(s)):o!=null?kh(i,b,Yi(o)):l!=null&&i.removeAttribute("value"),h==null&&p!=null&&(i.defaultChecked=!!p),h!=null&&(i.checked=h&&typeof h!="function"&&typeof h!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.name=""+Yi(E):i.removeAttribute("name")}function T_(i,s,o,l,h,p,b,E){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(i.type=p),s!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){Eh(i);return}o=o!=null?""+Yi(o):"",s=s!=null?""+Yi(s):o,E||s===i.value||(i.value=s),i.defaultValue=s}l=l??h,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=E?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b),Eh(i)}function kh(i,s,o){s==="number"&&Fl(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function co(i,s,o,l){if(i=i.options,s){s={};for(var h=0;h<o.length;h++)s["$"+o[h]]=!0;for(o=0;o<i.length;o++)h=s.hasOwnProperty("$"+i[o].value),i[o].selected!==h&&(i[o].selected=h),h&&l&&(i[o].defaultSelected=!0)}else{for(o=""+Yi(o),s=null,h=0;h<i.length;h++){if(i[h].value===o){i[h].selected=!0,l&&(i[h].defaultSelected=!0);return}s!==null||i[h].disabled||(s=i[h])}s!==null&&(s.selected=!0)}}function A_(i,s,o){if(s!=null&&(s=""+Yi(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+Yi(o):""}function D_(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(n(92));if(N(l)){if(1<l.length)throw Error(n(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=Yi(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l),Eh(i)}function uo(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var NC=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 M_(i,s,o){var l=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":l?i.setProperty(s,o):typeof o!="number"||o===0||NC.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function N_(i,s,o){if(s!=null&&typeof s!="object")throw Error(n(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||s!=null&&s.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var h in s)l=s[h],s.hasOwnProperty(h)&&o[h]!==l&&M_(i,h,l)}else for(var p in s)s.hasOwnProperty(p)&&M_(i,p,s[p])}function Th(i){if(i.indexOf("-")===-1)return!1;switch(i){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 OC=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"]]),BC=/^[\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 Wl(i){return BC.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Jr(){}var Ah=null;function Dh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ho=null,fo=null;function O_(i){var s=oo(i);if(s&&(i=s.stateNode)){var o=i[yi]||null;e:switch(i=s.stateNode,s.type){case"input":if(Rh(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Ki(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var h=l[yi]||null;if(!h)throw Error(n(90));Rh(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<o.length;s++)l=o[s],l.form===i.form&&k_(l)}break e;case"textarea":A_(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&co(i,!!o.multiple,s,!1)}}}var Mh=!1;function B_(i,s,o){if(Mh)return i(s,o);Mh=!0;try{var l=i(s);return l}finally{if(Mh=!1,(ho!==null||fo!==null)&&(Mc(),ho&&(s=ho,i=fo,fo=ho=null,O_(s),i)))for(s=0;s<i.length;s++)O_(i[s])}}function pa(i,s){var o=i.stateNode;if(o===null)return null;var l=o[yi]||null;if(l===null)return null;o=l[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(n(231,s,typeof o));return o}var es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nh=!1;if(es)try{var _a={};Object.defineProperty(_a,"passive",{get:function(){Nh=!0}}),window.addEventListener("test",_a,_a),window.removeEventListener("test",_a,_a)}catch{Nh=!1}var Os=null,Oh=null,ql=null;function L_(){if(ql)return ql;var i,s=Oh,o=s.length,l,h="value"in Os?Os.value:Os.textContent,p=h.length;for(i=0;i<o&&s[i]===h[i];i++);var b=o-i;for(l=1;l<=b&&s[o-l]===h[p-l];l++);return ql=h.slice(i,1<l?1-l:void 0)}function Vl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Yl(){return!0}function z_(){return!1}function bi(i){function s(o,l,h,p,b){this._reactName=o,this._targetInst=h,this.type=l,this.nativeEvent=p,this.target=b,this.currentTarget=null;for(var E in i)i.hasOwnProperty(E)&&(o=i[E],this[E]=o?o(p):p[E]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Yl:z_,this.isPropagationStopped=z_,this}return _(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Yl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Yl)},persist:function(){},isPersistent:Yl}),s}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kl=bi(Cn),ga=_({},Cn,{view:0,detail:0}),LC=bi(ga),Bh,Lh,va,Gl=_({},ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jh,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==va&&(va&&i.type==="mousemove"?(Bh=i.screenX-va.screenX,Lh=i.screenY-va.screenY):Lh=Bh=0,va=i),Bh)},movementY:function(i){return"movementY"in i?i.movementY:Lh}}),j_=bi(Gl),zC=_({},Gl,{dataTransfer:0}),jC=bi(zC),HC=_({},ga,{relatedTarget:0}),zh=bi(HC),PC=_({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0}),UC=bi(PC),IC=_({},Cn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),$C=bi(IC),FC=_({},Cn,{data:0}),H_=bi(FC),WC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qC={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"},VC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YC(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=VC[i])?!!s[i]:!1}function jh(){return YC}var KC=_({},ga,{key:function(i){if(i.key){var s=WC[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Vl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?qC[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jh,charCode:function(i){return i.type==="keypress"?Vl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Vl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),GC=bi(KC),XC=_({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),P_=bi(XC),ZC=_({},ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jh}),QC=bi(ZC),JC=_({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0}),e2=bi(JC),t2=_({},Gl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),i2=bi(t2),r2=_({},Cn,{newState:0,oldState:0}),s2=bi(r2),n2=[9,13,27,32],Hh=es&&"CompositionEvent"in window,ya=null;es&&"documentMode"in document&&(ya=document.documentMode);var o2=es&&"TextEvent"in window&&!ya,U_=es&&(!Hh||ya&&8<ya&&11>=ya),I_=" ",$_=!1;function F_(i,s){switch(i){case"keyup":return n2.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var mo=!1;function a2(i,s){switch(i){case"compositionend":return W_(s);case"keypress":return s.which!==32?null:($_=!0,I_);case"textInput":return i=s.data,i===I_&&$_?null:i;default:return null}}function l2(i,s){if(mo)return i==="compositionend"||!Hh&&F_(i,s)?(i=L_(),ql=Oh=Os=null,mo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return U_&&s.locale!=="ko"?null:s.data;default:return null}}var c2={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 q_(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!c2[i.type]:s==="textarea"}function V_(i,s,o,l){ho?fo?fo.push(l):fo=[l]:ho=l,s=Hc(s,"onChange"),0<s.length&&(o=new Kl("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var ba=null,Sa=null;function u2(i){T0(i,0)}function Xl(i){var s=ma(i);if(k_(s))return i}function Y_(i,s){if(i==="change")return s}var K_=!1;if(es){var Ph;if(es){var Uh="oninput"in document;if(!Uh){var G_=document.createElement("div");G_.setAttribute("oninput","return;"),Uh=typeof G_.oninput=="function"}Ph=Uh}else Ph=!1;K_=Ph&&(!document.documentMode||9<document.documentMode)}function X_(){ba&&(ba.detachEvent("onpropertychange",Z_),Sa=ba=null)}function Z_(i){if(i.propertyName==="value"&&Xl(Sa)){var s=[];V_(s,Sa,i,Dh(i)),B_(u2,s)}}function h2(i,s,o){i==="focusin"?(X_(),ba=s,Sa=o,ba.attachEvent("onpropertychange",Z_)):i==="focusout"&&X_()}function d2(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Xl(Sa)}function f2(i,s){if(i==="click")return Xl(s)}function m2(i,s){if(i==="input"||i==="change")return Xl(s)}function p2(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Oi=typeof Object.is=="function"?Object.is:p2;function wa(i,s){if(Oi(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),l=Object.keys(s);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var h=o[l];if(!di.call(s,h)||!Oi(i[h],s[h]))return!1}return!0}function Q_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function J_(i,s){var o=Q_(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=s&&l>=s)return{node:o,offset:s-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Q_(o)}}function eg(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?eg(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function tg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Fl(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Fl(i.document)}return s}function Ih(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var _2=es&&"documentMode"in document&&11>=document.documentMode,po=null,$h=null,xa=null,Fh=!1;function ig(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Fh||po==null||po!==Fl(l)||(l=po,"selectionStart"in l&&Ih(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),xa&&wa(xa,l)||(xa=l,l=Hc($h,"onSelect"),0<l.length&&(s=new Kl("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=po)))}function En(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var _o={animationend:En("Animation","AnimationEnd"),animationiteration:En("Animation","AnimationIteration"),animationstart:En("Animation","AnimationStart"),transitionrun:En("Transition","TransitionRun"),transitionstart:En("Transition","TransitionStart"),transitioncancel:En("Transition","TransitionCancel"),transitionend:En("Transition","TransitionEnd")},Wh={},rg={};es&&(rg=document.createElement("div").style,"AnimationEvent"in window||(delete _o.animationend.animation,delete _o.animationiteration.animation,delete _o.animationstart.animation),"TransitionEvent"in window||delete _o.transitionend.transition);function Rn(i){if(Wh[i])return Wh[i];if(!_o[i])return i;var s=_o[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in rg)return Wh[i]=s[o];return i}var sg=Rn("animationend"),ng=Rn("animationiteration"),og=Rn("animationstart"),g2=Rn("transitionrun"),v2=Rn("transitionstart"),y2=Rn("transitioncancel"),ag=Rn("transitionend"),lg=new Map,qh="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(" ");qh.push("scrollEnd");function mr(i,s){lg.set(i,s),xn(s,[i])}var Zl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Gi=[],go=0,Vh=0;function Ql(){for(var i=go,s=Vh=go=0;s<i;){var o=Gi[s];Gi[s++]=null;var l=Gi[s];Gi[s++]=null;var h=Gi[s];Gi[s++]=null;var p=Gi[s];if(Gi[s++]=null,l!==null&&h!==null){var b=l.pending;b===null?h.next=h:(h.next=b.next,b.next=h),l.pending=h}p!==0&&cg(o,h,p)}}function Jl(i,s,o,l){Gi[go++]=i,Gi[go++]=s,Gi[go++]=o,Gi[go++]=l,Vh|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Yh(i,s,o,l){return Jl(i,s,o,l),ec(i)}function kn(i,s){return Jl(i,null,null,s),ec(i)}function cg(i,s,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var h=!1,p=i.return;p!==null;)p.childLanes|=o,l=p.alternate,l!==null&&(l.childLanes|=o),p.tag===22&&(i=p.stateNode,i===null||i._visibility&1||(h=!0)),i=p,p=p.return;return i.tag===3?(p=i.stateNode,h&&s!==null&&(h=31-Ut(o),i=p.hiddenUpdates,l=i[h],l===null?i[h]=[s]:l.push(s),s.lane=o|536870912),p):null}function ec(i){if(50<qa)throw qa=0,rf=null,Error(n(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var vo={};function b2(i,s,o,l){this.tag=i,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=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bi(i,s,o,l){return new b2(i,s,o,l)}function Kh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ts(i,s){var o=i.alternate;return o===null?(o=Bi(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function ug(i,s){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function tc(i,s,o,l,h,p){var b=0;if(l=i,typeof i=="function")Kh(i)&&(b=1);else if(typeof i=="string")b=EE(i,o,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case re:return i=Bi(31,o,s,h),i.elementType=re,i.lanes=p,i;case C:return Tn(o.children,h,p,s);case k:b=8,h|=24;break;case T:return i=Bi(12,o,s,h|2),i.elementType=T,i.lanes=p,i;case j:return i=Bi(13,o,s,h),i.elementType=j,i.lanes=p,i;case P:return i=Bi(19,o,s,h),i.elementType=P,i.lanes=p,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case z:b=10;break e;case $:b=9;break e;case A:b=11;break e;case F:b=14;break e;case G:b=16,l=null;break e}b=29,o=Error(n(130,i===null?"null":typeof i,"")),l=null}return s=Bi(b,o,s,h),s.elementType=i,s.type=l,s.lanes=p,s}function Tn(i,s,o,l){return i=Bi(7,i,l,s),i.lanes=o,i}function Gh(i,s,o){return i=Bi(6,i,null,s),i.lanes=o,i}function hg(i){var s=Bi(18,null,null,0);return s.stateNode=i,s}function Xh(i,s,o){return s=Bi(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var dg=new WeakMap;function Xi(i,s){if(typeof i=="object"&&i!==null){var o=dg.get(i);return o!==void 0?o:(s={value:i,source:s,stack:bn(s)},dg.set(i,s),s)}return{value:i,source:s,stack:bn(s)}}var yo=[],bo=0,ic=null,Ca=0,Zi=[],Qi=0,Bs=null,Rr=1,kr="";function is(i,s){yo[bo++]=Ca,yo[bo++]=ic,ic=i,Ca=s}function fg(i,s,o){Zi[Qi++]=Rr,Zi[Qi++]=kr,Zi[Qi++]=Bs,Bs=i;var l=Rr;i=kr;var h=32-Ut(l)-1;l&=~(1<<h),o+=1;var p=32-Ut(s)+h;if(30<p){var b=h-h%5;p=(l&(1<<b)-1).toString(32),l>>=b,h-=b,Rr=1<<32-Ut(s)+h|o<<h|l,kr=p+i}else Rr=1<<p|o<<h|l,kr=i}function Zh(i){i.return!==null&&(is(i,1),fg(i,1,0))}function Qh(i){for(;i===ic;)ic=yo[--bo],yo[bo]=null,Ca=yo[--bo],yo[bo]=null;for(;i===Bs;)Bs=Zi[--Qi],Zi[Qi]=null,kr=Zi[--Qi],Zi[Qi]=null,Rr=Zi[--Qi],Zi[Qi]=null}function mg(i,s){Zi[Qi++]=Rr,Zi[Qi++]=kr,Zi[Qi++]=Bs,Rr=s.id,kr=s.overflow,Bs=i}var ii=null,ct=null,Ue=!1,Ls=null,Ji=!1,Jh=Error(n(519));function zs(i){var s=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ea(Xi(s,i)),Jh}function pg(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[ti]=i,s[yi]=l,o){case"dialog":je("cancel",s),je("close",s);break;case"iframe":case"object":case"embed":je("load",s);break;case"video":case"audio":for(o=0;o<Ya.length;o++)je(Ya[o],s);break;case"source":je("error",s);break;case"img":case"image":case"link":je("error",s),je("load",s);break;case"details":je("toggle",s);break;case"input":je("invalid",s),T_(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":je("invalid",s);break;case"textarea":je("invalid",s),D_(s,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||N0(s.textContent,o)?(l.popover!=null&&(je("beforetoggle",s),je("toggle",s)),l.onScroll!=null&&je("scroll",s),l.onScrollEnd!=null&&je("scrollend",s),l.onClick!=null&&(s.onclick=Jr),s=!0):s=!1,s||zs(i,!0)}function _g(i){for(ii=i.return;ii;)switch(ii.tag){case 5:case 31:case 13:Ji=!1;return;case 27:case 3:Ji=!0;return;default:ii=ii.return}}function So(i){if(i!==ii)return!1;if(!Ue)return _g(i),Ue=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||vf(i.type,i.memoizedProps)),o=!o),o&&ct&&zs(i),_g(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));ct=I0(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));ct=I0(i)}else s===27?(s=ct,Xs(i.type)?(i=xf,xf=null,ct=i):ct=s):ct=ii?tr(i.stateNode.nextSibling):null;return!0}function An(){ct=ii=null,Ue=!1}function ed(){var i=Ls;return i!==null&&(Ci===null?Ci=i:Ci.push.apply(Ci,i),Ls=null),i}function Ea(i){Ls===null?Ls=[i]:Ls.push(i)}var td=D(null),Dn=null,rs=null;function js(i,s,o){q(td,s._currentValue),s._currentValue=o}function ss(i){i._currentValue=td.current,O(td)}function id(i,s,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),i===o)break;i=i.return}}function rd(i,s,o,l){var h=i.child;for(h!==null&&(h.return=i);h!==null;){var p=h.dependencies;if(p!==null){var b=h.child;p=p.firstContext;e:for(;p!==null;){var E=p;p=h;for(var B=0;B<s.length;B++)if(E.context===s[B]){p.lanes|=o,E=p.alternate,E!==null&&(E.lanes|=o),id(p.return,o,i),l||(b=null);break e}p=E.next}}else if(h.tag===18){if(b=h.return,b===null)throw Error(n(341));b.lanes|=o,p=b.alternate,p!==null&&(p.lanes|=o),id(b,o,i),b=null}else b=h.child;if(b!==null)b.return=h;else for(b=h;b!==null;){if(b===i){b=null;break}if(h=b.sibling,h!==null){h.return=b.return,b=h;break}b=b.return}h=b}}function wo(i,s,o,l){i=null;for(var h=s,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var b=h.alternate;if(b===null)throw Error(n(387));if(b=b.memoizedProps,b!==null){var E=h.type;Oi(h.pendingProps.value,b.value)||(i!==null?i.push(E):i=[E])}}else if(h===de.current){if(b=h.alternate,b===null)throw Error(n(387));b.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(i!==null?i.push(Qa):i=[Qa])}h=h.return}i!==null&&rd(s,i,o,l),s.flags|=262144}function rc(i){for(i=i.firstContext;i!==null;){if(!Oi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Mn(i){Dn=i,rs=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ri(i){return gg(Dn,i)}function sc(i,s){return Dn===null&&Mn(i),gg(i,s)}function gg(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},rs===null){if(i===null)throw Error(n(308));rs=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else rs=rs.next=s;return o}var S2=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},w2=e.unstable_scheduleCallback,x2=e.unstable_NormalPriority,kt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sd(){return{controller:new S2,data:new Map,refCount:0}}function Ra(i){i.refCount--,i.refCount===0&&w2(x2,function(){i.controller.abort()})}var ka=null,nd=0,xo=0,Co=null;function C2(i,s){if(ka===null){var o=ka=[];nd=0,xo=cf(),Co={status:"pending",value:void 0,then:function(l){o.push(l)}}}return nd++,s.then(vg,vg),s}function vg(){if(--nd===0&&ka!==null){Co!==null&&(Co.status="fulfilled");var i=ka;ka=null,xo=0,Co=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function E2(i,s){var o=[],l={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return i.then(function(){l.status="fulfilled",l.value=s;for(var h=0;h<o.length;h++)(0,o[h])(s)},function(h){for(l.status="rejected",l.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),l}var yg=R.S;R.S=function(i,s){i0=ei(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&C2(i,s),yg!==null&&yg(i,s)};var Nn=D(null);function od(){var i=Nn.current;return i!==null?i:nt.pooledCache}function nc(i,s){s===null?q(Nn,Nn.current):q(Nn,s.pool)}function bg(){var i=od();return i===null?null:{parent:kt._currentValue,pool:i}}var Eo=Error(n(460)),ad=Error(n(474)),oc=Error(n(542)),ac={then:function(){}};function Sg(i){return i=i.status,i==="fulfilled"||i==="rejected"}function wg(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(Jr,Jr),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Cg(i),i;default:if(typeof s.status=="string")s.then(Jr,Jr);else{if(i=nt,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=s,i.status="pending",i.then(function(l){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=l}},function(l){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=l}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Cg(i),i}throw Bn=s,Eo}}function On(i){try{var s=i._init;return s(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Bn=o,Eo):o}}var Bn=null;function xg(){if(Bn===null)throw Error(n(459));var i=Bn;return Bn=null,i}function Cg(i){if(i===Eo||i===oc)throw Error(n(483))}var Ro=null,Ta=0;function lc(i){var s=Ta;return Ta+=1,Ro===null&&(Ro=[]),wg(Ro,i,s)}function Aa(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function cc(i,s){throw s.$$typeof===S?Error(n(525)):(i=Object.prototype.toString.call(s),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Eg(i){function s(V,I){if(i){var Y=V.deletions;Y===null?(V.deletions=[I],V.flags|=16):Y.push(I)}}function o(V,I){if(!i)return null;for(;I!==null;)s(V,I),I=I.sibling;return null}function l(V){for(var I=new Map;V!==null;)V.key!==null?I.set(V.key,V):I.set(V.index,V),V=V.sibling;return I}function h(V,I){return V=ts(V,I),V.index=0,V.sibling=null,V}function p(V,I,Y){return V.index=Y,i?(Y=V.alternate,Y!==null?(Y=Y.index,Y<I?(V.flags|=67108866,I):Y):(V.flags|=67108866,I)):(V.flags|=1048576,I)}function b(V){return i&&V.alternate===null&&(V.flags|=67108866),V}function E(V,I,Y,ie){return I===null||I.tag!==6?(I=Gh(Y,V.mode,ie),I.return=V,I):(I=h(I,Y),I.return=V,I)}function B(V,I,Y,ie){var we=Y.type;return we===C?te(V,I,Y.props.children,ie,Y.key):I!==null&&(I.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===G&&On(we)===I.type)?(I=h(I,Y.props),Aa(I,Y),I.return=V,I):(I=tc(Y.type,Y.key,Y.props,null,V.mode,ie),Aa(I,Y),I.return=V,I)}function K(V,I,Y,ie){return I===null||I.tag!==4||I.stateNode.containerInfo!==Y.containerInfo||I.stateNode.implementation!==Y.implementation?(I=Xh(Y,V.mode,ie),I.return=V,I):(I=h(I,Y.children||[]),I.return=V,I)}function te(V,I,Y,ie,we){return I===null||I.tag!==7?(I=Tn(Y,V.mode,ie,we),I.return=V,I):(I=h(I,Y),I.return=V,I)}function ne(V,I,Y){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Gh(""+I,V.mode,Y),I.return=V,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case w:return Y=tc(I.type,I.key,I.props,null,V.mode,Y),Aa(Y,I),Y.return=V,Y;case x:return I=Xh(I,V.mode,Y),I.return=V,I;case G:return I=On(I),ne(V,I,Y)}if(N(I)||W(I))return I=Tn(I,V.mode,Y,null),I.return=V,I;if(typeof I.then=="function")return ne(V,lc(I),Y);if(I.$$typeof===z)return ne(V,sc(V,I),Y);cc(V,I)}return null}function Z(V,I,Y,ie){var we=I!==null?I.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return we!==null?null:E(V,I,""+Y,ie);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===we?B(V,I,Y,ie):null;case x:return Y.key===we?K(V,I,Y,ie):null;case G:return Y=On(Y),Z(V,I,Y,ie)}if(N(Y)||W(Y))return we!==null?null:te(V,I,Y,ie,null);if(typeof Y.then=="function")return Z(V,I,lc(Y),ie);if(Y.$$typeof===z)return Z(V,I,sc(V,Y),ie);cc(V,Y)}return null}function J(V,I,Y,ie,we){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return V=V.get(Y)||null,E(I,V,""+ie,we);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case w:return V=V.get(ie.key===null?Y:ie.key)||null,B(I,V,ie,we);case x:return V=V.get(ie.key===null?Y:ie.key)||null,K(I,V,ie,we);case G:return ie=On(ie),J(V,I,Y,ie,we)}if(N(ie)||W(ie))return V=V.get(Y)||null,te(I,V,ie,we,null);if(typeof ie.then=="function")return J(V,I,Y,lc(ie),we);if(ie.$$typeof===z)return J(V,I,Y,sc(I,ie),we);cc(I,ie)}return null}function ge(V,I,Y,ie){for(var we=null,Fe=null,be=I,De=I=0,Pe=null;be!==null&&De<Y.length;De++){be.index>De?(Pe=be,be=null):Pe=be.sibling;var We=Z(V,be,Y[De],ie);if(We===null){be===null&&(be=Pe);break}i&&be&&We.alternate===null&&s(V,be),I=p(We,I,De),Fe===null?we=We:Fe.sibling=We,Fe=We,be=Pe}if(De===Y.length)return o(V,be),Ue&&is(V,De),we;if(be===null){for(;De<Y.length;De++)be=ne(V,Y[De],ie),be!==null&&(I=p(be,I,De),Fe===null?we=be:Fe.sibling=be,Fe=be);return Ue&&is(V,De),we}for(be=l(be);De<Y.length;De++)Pe=J(be,V,De,Y[De],ie),Pe!==null&&(i&&Pe.alternate!==null&&be.delete(Pe.key===null?De:Pe.key),I=p(Pe,I,De),Fe===null?we=Pe:Fe.sibling=Pe,Fe=Pe);return i&&be.forEach(function(tn){return s(V,tn)}),Ue&&is(V,De),we}function Ce(V,I,Y,ie){if(Y==null)throw Error(n(151));for(var we=null,Fe=null,be=I,De=I=0,Pe=null,We=Y.next();be!==null&&!We.done;De++,We=Y.next()){be.index>De?(Pe=be,be=null):Pe=be.sibling;var tn=Z(V,be,We.value,ie);if(tn===null){be===null&&(be=Pe);break}i&&be&&tn.alternate===null&&s(V,be),I=p(tn,I,De),Fe===null?we=tn:Fe.sibling=tn,Fe=tn,be=Pe}if(We.done)return o(V,be),Ue&&is(V,De),we;if(be===null){for(;!We.done;De++,We=Y.next())We=ne(V,We.value,ie),We!==null&&(I=p(We,I,De),Fe===null?we=We:Fe.sibling=We,Fe=We);return Ue&&is(V,De),we}for(be=l(be);!We.done;De++,We=Y.next())We=J(be,V,De,We.value,ie),We!==null&&(i&&We.alternate!==null&&be.delete(We.key===null?De:We.key),I=p(We,I,De),Fe===null?we=We:Fe.sibling=We,Fe=We);return i&&be.forEach(function(zE){return s(V,zE)}),Ue&&is(V,De),we}function it(V,I,Y,ie){if(typeof Y=="object"&&Y!==null&&Y.type===C&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var we=Y.key;I!==null;){if(I.key===we){if(we=Y.type,we===C){if(I.tag===7){o(V,I.sibling),ie=h(I,Y.props.children),ie.return=V,V=ie;break e}}else if(I.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===G&&On(we)===I.type){o(V,I.sibling),ie=h(I,Y.props),Aa(ie,Y),ie.return=V,V=ie;break e}o(V,I);break}else s(V,I);I=I.sibling}Y.type===C?(ie=Tn(Y.props.children,V.mode,ie,Y.key),ie.return=V,V=ie):(ie=tc(Y.type,Y.key,Y.props,null,V.mode,ie),Aa(ie,Y),ie.return=V,V=ie)}return b(V);case x:e:{for(we=Y.key;I!==null;){if(I.key===we)if(I.tag===4&&I.stateNode.containerInfo===Y.containerInfo&&I.stateNode.implementation===Y.implementation){o(V,I.sibling),ie=h(I,Y.children||[]),ie.return=V,V=ie;break e}else{o(V,I);break}else s(V,I);I=I.sibling}ie=Xh(Y,V.mode,ie),ie.return=V,V=ie}return b(V);case G:return Y=On(Y),it(V,I,Y,ie)}if(N(Y))return ge(V,I,Y,ie);if(W(Y)){if(we=W(Y),typeof we!="function")throw Error(n(150));return Y=we.call(Y),Ce(V,I,Y,ie)}if(typeof Y.then=="function")return it(V,I,lc(Y),ie);if(Y.$$typeof===z)return it(V,I,sc(V,Y),ie);cc(V,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,I!==null&&I.tag===6?(o(V,I.sibling),ie=h(I,Y),ie.return=V,V=ie):(o(V,I),ie=Gh(Y,V.mode,ie),ie.return=V,V=ie),b(V)):o(V,I)}return function(V,I,Y,ie){try{Ta=0;var we=it(V,I,Y,ie);return Ro=null,we}catch(be){if(be===Eo||be===oc)throw be;var Fe=Bi(29,be,null,V.mode);return Fe.lanes=ie,Fe.return=V,Fe}}}var Ln=Eg(!0),Rg=Eg(!1),Hs=!1;function ld(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cd(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ps(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Us(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(qe&2)!==0){var h=l.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),l.pending=s,s=ec(i),cg(i,null,o),s}return Jl(i,l,s,o),ec(i)}function Da(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Ot(i,o)}}function ud(i,s){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var h=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var b={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?h=p=b:p=p.next=b,o=o.next}while(o!==null);p===null?h=p=s:p=p.next=s}else h=p=s;o={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var hd=!1;function Ma(){if(hd){var i=Co;if(i!==null)throw i}}function Na(i,s,o,l){hd=!1;var h=i.updateQueue;Hs=!1;var p=h.firstBaseUpdate,b=h.lastBaseUpdate,E=h.shared.pending;if(E!==null){h.shared.pending=null;var B=E,K=B.next;B.next=null,b===null?p=K:b.next=K,b=B;var te=i.alternate;te!==null&&(te=te.updateQueue,E=te.lastBaseUpdate,E!==b&&(E===null?te.firstBaseUpdate=K:E.next=K,te.lastBaseUpdate=B))}if(p!==null){var ne=h.baseState;b=0,te=K=B=null,E=p;do{var Z=E.lane&-536870913,J=Z!==E.lane;if(J?(He&Z)===Z:(l&Z)===Z){Z!==0&&Z===xo&&(hd=!0),te!==null&&(te=te.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ge=i,Ce=E;Z=s;var it=o;switch(Ce.tag){case 1:if(ge=Ce.payload,typeof ge=="function"){ne=ge.call(it,ne,Z);break e}ne=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ce.payload,Z=typeof ge=="function"?ge.call(it,ne,Z):ge,Z==null)break e;ne=_({},ne,Z);break e;case 2:Hs=!0}}Z=E.callback,Z!==null&&(i.flags|=64,J&&(i.flags|=8192),J=h.callbacks,J===null?h.callbacks=[Z]:J.push(Z))}else J={lane:Z,tag:E.tag,payload:E.payload,callback:E.callback,next:null},te===null?(K=te=J,B=ne):te=te.next=J,b|=Z;if(E=E.next,E===null){if(E=h.shared.pending,E===null)break;J=E,E=J.next,J.next=null,h.lastBaseUpdate=J,h.shared.pending=null}}while(!0);te===null&&(B=ne),h.baseState=B,h.firstBaseUpdate=K,h.lastBaseUpdate=te,p===null&&(h.shared.lanes=0),qs|=b,i.lanes=b,i.memoizedState=ne}}function kg(i,s){if(typeof i!="function")throw Error(n(191,i));i.call(s)}function Tg(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)kg(o[i],s)}var ko=D(null),uc=D(0);function Ag(i,s){i=fs,q(uc,i),q(ko,s),fs=i|s.baseLanes}function dd(){q(uc,fs),q(ko,ko.current)}function fd(){fs=uc.current,O(ko),O(uc)}var Li=D(null),er=null;function Is(i){var s=i.alternate;q(Ct,Ct.current&1),q(Li,i),er===null&&(s===null||ko.current!==null||s.memoizedState!==null)&&(er=i)}function md(i){q(Ct,Ct.current),q(Li,i),er===null&&(er=i)}function Dg(i){i.tag===22?(q(Ct,Ct.current),q(Li,i),er===null&&(er=i)):$s()}function $s(){q(Ct,Ct.current),q(Li,Li.current)}function zi(i){O(Li),er===i&&(er=null),O(Ct)}var Ct=D(0);function hc(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Sf(o)||wf(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ns=0,Ae=null,et=null,Tt=null,dc=!1,To=!1,zn=!1,fc=0,Oa=0,Ao=null,R2=0;function vt(){throw Error(n(321))}function pd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!Oi(i[o],s[o]))return!1;return!0}function _d(i,s,o,l,h,p){return ns=p,Ae=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,R.H=i===null||i.memoizedState===null?fv:Md,zn=!1,p=o(l,h),zn=!1,To&&(p=Ng(s,o,l,h)),Mg(i),p}function Mg(i){R.H=za;var s=et!==null&&et.next!==null;if(ns=0,Tt=et=Ae=null,dc=!1,Oa=0,Ao=null,s)throw Error(n(300));i===null||At||(i=i.dependencies,i!==null&&rc(i)&&(At=!0))}function Ng(i,s,o,l){Ae=i;var h=0;do{if(To&&(Ao=null),Oa=0,To=!1,25<=h)throw Error(n(301));if(h+=1,Tt=et=null,i.updateQueue!=null){var p=i.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}R.H=mv,p=s(o,l)}while(To);return p}function k2(){var i=R.H,s=i.useState()[0];return s=typeof s.then=="function"?Ba(s):s,i=i.useState()[0],(et!==null?et.memoizedState:null)!==i&&(Ae.flags|=1024),s}function gd(){var i=fc!==0;return fc=0,i}function vd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function yd(i){if(dc){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}dc=!1}ns=0,Tt=et=Ae=null,To=!1,Oa=fc=0,Ao=null}function fi(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ae.memoizedState=Tt=i:Tt=Tt.next=i,Tt}function Et(){if(et===null){var i=Ae.alternate;i=i!==null?i.memoizedState:null}else i=et.next;var s=Tt===null?Ae.memoizedState:Tt.next;if(s!==null)Tt=s,et=i;else{if(i===null)throw Ae.alternate===null?Error(n(467)):Error(n(310));et=i,i={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},Tt===null?Ae.memoizedState=Tt=i:Tt=Tt.next=i}return Tt}function mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ba(i){var s=Oa;return Oa+=1,Ao===null&&(Ao=[]),i=wg(Ao,i,s),s=Ae,(Tt===null?s.memoizedState:Tt.next)===null&&(s=s.alternate,R.H=s===null||s.memoizedState===null?fv:Md),i}function pc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ba(i);if(i.$$typeof===z)return ri(i)}throw Error(n(438,String(i)))}function bd(i){var s=null,o=Ae.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=Ae.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(s={data:l.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=mc(),Ae.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),l=0;l<i;l++)o[l]=le;return s.index++,o}function os(i,s){return typeof s=="function"?s(i):s}function _c(i){var s=Et();return Sd(s,et,i)}function Sd(i,s,o){var l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=o;var h=i.baseQueue,p=l.pending;if(p!==null){if(h!==null){var b=h.next;h.next=p.next,p.next=b}s.baseQueue=h=p,l.pending=null}if(p=i.baseState,h===null)i.memoizedState=p;else{s=h.next;var E=b=null,B=null,K=s,te=!1;do{var ne=K.lane&-536870913;if(ne!==K.lane?(He&ne)===ne:(ns&ne)===ne){var Z=K.revertLane;if(Z===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ne===xo&&(te=!0);else if((ns&Z)===Z){K=K.next,Z===xo&&(te=!0);continue}else ne={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},B===null?(E=B=ne,b=p):B=B.next=ne,Ae.lanes|=Z,qs|=Z;ne=K.action,zn&&o(p,ne),p=K.hasEagerState?K.eagerState:o(p,ne)}else Z={lane:ne,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},B===null?(E=B=Z,b=p):B=B.next=Z,Ae.lanes|=ne,qs|=ne;K=K.next}while(K!==null&&K!==s);if(B===null?b=p:B.next=E,!Oi(p,i.memoizedState)&&(At=!0,te&&(o=Co,o!==null)))throw o;i.memoizedState=p,i.baseState=b,i.baseQueue=B,l.lastRenderedState=p}return h===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function wd(i){var s=Et(),o=s.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=i;var l=o.dispatch,h=o.pending,p=s.memoizedState;if(h!==null){o.pending=null;var b=h=h.next;do p=i(p,b.action),b=b.next;while(b!==h);Oi(p,s.memoizedState)||(At=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),o.lastRenderedState=p}return[p,l]}function Og(i,s,o){var l=Ae,h=Et(),p=Ue;if(p){if(o===void 0)throw Error(n(407));o=o()}else o=s();var b=!Oi((et||h).memoizedState,o);if(b&&(h.memoizedState=o,At=!0),h=h.queue,Ed(zg.bind(null,l,h,i),[i]),h.getSnapshot!==s||b||Tt!==null&&Tt.memoizedState.tag&1){if(l.flags|=2048,Do(9,{destroy:void 0},Lg.bind(null,l,h,o,s),null),nt===null)throw Error(n(349));p||(ns&127)!==0||Bg(l,s,o)}return o}function Bg(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=Ae.updateQueue,s===null?(s=mc(),Ae.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function Lg(i,s,o,l){s.value=o,s.getSnapshot=l,jg(s)&&Hg(i)}function zg(i,s,o){return o(function(){jg(s)&&Hg(i)})}function jg(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!Oi(i,o)}catch{return!0}}function Hg(i){var s=kn(i,2);s!==null&&Ei(s,i,2)}function xd(i){var s=fi();if(typeof i=="function"){var o=i;if(i=o(),zn){Di(!0);try{o()}finally{Di(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:i},s}function Pg(i,s,o,l){return i.baseState=o,Sd(i,et,typeof l=="function"?l:os)}function T2(i,s,o,l,h){if(yc(i))throw Error(n(485));if(i=s.action,i!==null){var p={payload:h,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){p.listeners.push(b)}};R.T!==null?o(!0):p.isTransition=!1,l(p),o=s.pending,o===null?(p.next=s.pending=p,Ug(s,p)):(p.next=o.next,s.pending=o.next=p)}}function Ug(i,s){var o=s.action,l=s.payload,h=i.state;if(s.isTransition){var p=R.T,b={};R.T=b;try{var E=o(h,l),B=R.S;B!==null&&B(b,E),Ig(i,s,E)}catch(K){Cd(i,s,K)}finally{p!==null&&b.types!==null&&(p.types=b.types),R.T=p}}else try{p=o(h,l),Ig(i,s,p)}catch(K){Cd(i,s,K)}}function Ig(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){$g(i,s,l)},function(l){return Cd(i,s,l)}):$g(i,s,o)}function $g(i,s,o){s.status="fulfilled",s.value=o,Fg(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Ug(i,o)))}function Cd(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,Fg(s),s=s.next;while(s!==l)}i.action=null}function Fg(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Wg(i,s){return s}function qg(i,s){if(Ue){var o=nt.formState;if(o!==null){e:{var l=Ae;if(Ue){if(ct){t:{for(var h=ct,p=Ji;h.nodeType!==8;){if(!p){h=null;break t}if(h=tr(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){ct=tr(h.nextSibling),l=h.data==="F!";break e}}zs(l)}l=!1}l&&(s=o[0])}}return o=fi(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wg,lastRenderedState:s},o.queue=l,o=uv.bind(null,Ae,l),l.dispatch=o,l=xd(!1),p=Dd.bind(null,Ae,!1,l.queue),l=fi(),h={state:s,dispatch:null,action:i,pending:null},l.queue=h,o=T2.bind(null,Ae,h,p,o),h.dispatch=o,l.memoizedState=i,[s,o,!1]}function Vg(i){var s=Et();return Yg(s,et,i)}function Yg(i,s,o){if(s=Sd(i,s,Wg)[0],i=_c(os)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=Ba(s)}catch(b){throw b===Eo?oc:b}else l=s;s=Et();var h=s.queue,p=h.dispatch;return o!==s.memoizedState&&(Ae.flags|=2048,Do(9,{destroy:void 0},A2.bind(null,h,o),null)),[l,p,i]}function A2(i,s){i.action=s}function Kg(i){var s=Et(),o=et;if(o!==null)return Yg(s,o,i);Et(),s=s.memoizedState,o=Et();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function Do(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=Ae.updateQueue,s===null&&(s=mc(),Ae.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,s.lastEffect=i),i}function Gg(){return Et().memoizedState}function gc(i,s,o,l){var h=fi();Ae.flags|=i,h.memoizedState=Do(1|s,{destroy:void 0},o,l===void 0?null:l)}function vc(i,s,o,l){var h=Et();l=l===void 0?null:l;var p=h.memoizedState.inst;et!==null&&l!==null&&pd(l,et.memoizedState.deps)?h.memoizedState=Do(s,p,o,l):(Ae.flags|=i,h.memoizedState=Do(1|s,p,o,l))}function Xg(i,s){gc(8390656,8,i,s)}function Ed(i,s){vc(2048,8,i,s)}function D2(i){Ae.flags|=4;var s=Ae.updateQueue;if(s===null)s=mc(),Ae.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function Zg(i){var s=Et().memoizedState;return D2({ref:s,nextImpl:i}),function(){if((qe&2)!==0)throw Error(n(440));return s.impl.apply(void 0,arguments)}}function Qg(i,s){return vc(4,2,i,s)}function Jg(i,s){return vc(4,4,i,s)}function ev(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function tv(i,s,o){o=o!=null?o.concat([i]):null,vc(4,4,ev.bind(null,s,i),o)}function Rd(){}function iv(i,s){var o=Et();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&pd(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function rv(i,s){var o=Et();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&pd(s,l[1]))return l[0];if(l=i(),zn){Di(!0);try{i()}finally{Di(!1)}}return o.memoizedState=[l,s],l}function kd(i,s,o){return o===void 0||(ns&1073741824)!==0&&(He&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=s0(),Ae.lanes|=i,qs|=i,o)}function sv(i,s,o,l){return Oi(o,s)?o:ko.current!==null?(i=kd(i,o,l),Oi(i,s)||(At=!0),i):(ns&42)===0||(ns&1073741824)!==0&&(He&261930)===0?(At=!0,i.memoizedState=o):(i=s0(),Ae.lanes|=i,qs|=i,s)}function nv(i,s,o,l,h){var p=L.p;L.p=p!==0&&8>p?p:8;var b=R.T,E={};R.T=E,Dd(i,!1,s,o);try{var B=h(),K=R.S;if(K!==null&&K(E,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var te=E2(B,l);La(i,s,te,Pi(i))}else La(i,s,l,Pi(i))}catch(ne){La(i,s,{then:function(){},status:"rejected",reason:ne},Pi())}finally{L.p=p,b!==null&&E.types!==null&&(b.types=E.types),R.T=b}}function M2(){}function Td(i,s,o,l){if(i.tag!==5)throw Error(n(476));var h=ov(i).queue;nv(i,h,s,U,o===null?M2:function(){return av(i),o(l)})}function ov(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:U},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function av(i){var s=ov(i);s.next===null&&(s=i.alternate.memoizedState),La(i,s.next.queue,{},Pi())}function Ad(){return ri(Qa)}function lv(){return Et().memoizedState}function cv(){return Et().memoizedState}function N2(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=Pi();i=Ps(o);var l=Us(s,i,o);l!==null&&(Ei(l,s,o),Da(l,s,o)),s={cache:sd()},i.payload=s;return}s=s.return}}function O2(i,s,o){var l=Pi();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},yc(i)?hv(s,o):(o=Yh(i,s,o,l),o!==null&&(Ei(o,i,l),dv(o,s,l)))}function uv(i,s,o){var l=Pi();La(i,s,o,l)}function La(i,s,o,l){var h={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(yc(i))hv(s,h);else{var p=i.alternate;if(i.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var b=s.lastRenderedState,E=p(b,o);if(h.hasEagerState=!0,h.eagerState=E,Oi(E,b))return Jl(i,s,h,0),nt===null&&Ql(),!1}catch{}if(o=Yh(i,s,h,l),o!==null)return Ei(o,i,l),dv(o,s,l),!0}return!1}function Dd(i,s,o,l){if(l={lane:2,revertLane:cf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},yc(i)){if(s)throw Error(n(479))}else s=Yh(i,o,l,2),s!==null&&Ei(s,i,2)}function yc(i){var s=i.alternate;return i===Ae||s!==null&&s===Ae}function hv(i,s){To=dc=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function dv(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Ot(i,o)}}var za={readContext:ri,use:pc,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};za.useEffectEvent=vt;var fv={readContext:ri,use:pc,useCallback:function(i,s){return fi().memoizedState=[i,s===void 0?null:s],i},useContext:ri,useEffect:Xg,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,gc(4194308,4,ev.bind(null,s,i),o)},useLayoutEffect:function(i,s){return gc(4194308,4,i,s)},useInsertionEffect:function(i,s){gc(4,2,i,s)},useMemo:function(i,s){var o=fi();s=s===void 0?null:s;var l=i();if(zn){Di(!0);try{i()}finally{Di(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=fi();if(o!==void 0){var h=o(s);if(zn){Di(!0);try{o(s)}finally{Di(!1)}}}else h=s;return l.memoizedState=l.baseState=h,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:h},l.queue=i,i=i.dispatch=O2.bind(null,Ae,i),[l.memoizedState,i]},useRef:function(i){var s=fi();return i={current:i},s.memoizedState=i},useState:function(i){i=xd(i);var s=i.queue,o=uv.bind(null,Ae,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Rd,useDeferredValue:function(i,s){var o=fi();return kd(o,i,s)},useTransition:function(){var i=xd(!1);return i=nv.bind(null,Ae,i.queue,!0,!1),fi().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=Ae,h=fi();if(Ue){if(o===void 0)throw Error(n(407));o=o()}else{if(o=s(),nt===null)throw Error(n(349));(He&127)!==0||Bg(l,s,o)}h.memoizedState=o;var p={value:o,getSnapshot:s};return h.queue=p,Xg(zg.bind(null,l,p,i),[i]),l.flags|=2048,Do(9,{destroy:void 0},Lg.bind(null,l,p,o,s),null),o},useId:function(){var i=fi(),s=nt.identifierPrefix;if(Ue){var o=kr,l=Rr;o=(l&~(1<<32-Ut(l)-1)).toString(32)+o,s="_"+s+"R_"+o,o=fc++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=R2++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Ad,useFormState:qg,useActionState:qg,useOptimistic:function(i){var s=fi();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Dd.bind(null,Ae,!0,o),o.dispatch=s,[i,s]},useMemoCache:bd,useCacheRefresh:function(){return fi().memoizedState=N2.bind(null,Ae)},useEffectEvent:function(i){var s=fi(),o={impl:i};return s.memoizedState=o,function(){if((qe&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}},Md={readContext:ri,use:pc,useCallback:iv,useContext:ri,useEffect:Ed,useImperativeHandle:tv,useInsertionEffect:Qg,useLayoutEffect:Jg,useMemo:rv,useReducer:_c,useRef:Gg,useState:function(){return _c(os)},useDebugValue:Rd,useDeferredValue:function(i,s){var o=Et();return sv(o,et.memoizedState,i,s)},useTransition:function(){var i=_c(os)[0],s=Et().memoizedState;return[typeof i=="boolean"?i:Ba(i),s]},useSyncExternalStore:Og,useId:lv,useHostTransitionStatus:Ad,useFormState:Vg,useActionState:Vg,useOptimistic:function(i,s){var o=Et();return Pg(o,et,i,s)},useMemoCache:bd,useCacheRefresh:cv};Md.useEffectEvent=Zg;var mv={readContext:ri,use:pc,useCallback:iv,useContext:ri,useEffect:Ed,useImperativeHandle:tv,useInsertionEffect:Qg,useLayoutEffect:Jg,useMemo:rv,useReducer:wd,useRef:Gg,useState:function(){return wd(os)},useDebugValue:Rd,useDeferredValue:function(i,s){var o=Et();return et===null?kd(o,i,s):sv(o,et.memoizedState,i,s)},useTransition:function(){var i=wd(os)[0],s=Et().memoizedState;return[typeof i=="boolean"?i:Ba(i),s]},useSyncExternalStore:Og,useId:lv,useHostTransitionStatus:Ad,useFormState:Kg,useActionState:Kg,useOptimistic:function(i,s){var o=Et();return et!==null?Pg(o,et,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:bd,useCacheRefresh:cv};mv.useEffectEvent=Zg;function Nd(i,s,o,l){s=i.memoizedState,o=o(l,s),o=o==null?s:_({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var Od={enqueueSetState:function(i,s,o){i=i._reactInternals;var l=Pi(),h=Ps(l);h.payload=s,o!=null&&(h.callback=o),s=Us(i,h,l),s!==null&&(Ei(s,i,l),Da(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=Pi(),h=Ps(l);h.tag=1,h.payload=s,o!=null&&(h.callback=o),s=Us(i,h,l),s!==null&&(Ei(s,i,l),Da(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=Pi(),l=Ps(o);l.tag=2,s!=null&&(l.callback=s),s=Us(i,l,o),s!==null&&(Ei(s,i,o),Da(s,i,o))}};function pv(i,s,o,l,h,p,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,p,b):s.prototype&&s.prototype.isPureReactComponent?!wa(o,l)||!wa(h,p):!0}function _v(i,s,o,l){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,l),s.state!==i&&Od.enqueueReplaceState(s,s.state,null)}function jn(i,s){var o=s;if("ref"in s){o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}if(i=i.defaultProps){o===s&&(o=_({},o));for(var h in i)o[h]===void 0&&(o[h]=i[h])}return o}function gv(i){Zl(i)}function vv(i){console.error(i)}function yv(i){Zl(i)}function bc(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function bv(i,s,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Bd(i,s,o){return o=Ps(o),o.tag=3,o.payload={element:null},o.callback=function(){bc(i,s)},o}function Sv(i){return i=Ps(i),i.tag=3,i}function wv(i,s,o,l){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var p=l.value;i.payload=function(){return h(p)},i.callback=function(){bv(s,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){bv(s,o,l),typeof h!="function"&&(Vs===null?Vs=new Set([this]):Vs.add(this));var E=l.stack;this.componentDidCatch(l.value,{componentStack:E!==null?E:""})})}function B2(i,s,o,l,h){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&wo(s,o,h,!0),o=Li.current,o!==null){switch(o.tag){case 31:case 13:return er===null?Nc():o.alternate===null&&yt===0&&(yt=3),o.flags&=-257,o.flags|=65536,o.lanes=h,l===ac?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),of(i,l,h)),!1;case 22:return o.flags|=65536,l===ac?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([l]):o.add(l)),of(i,l,h)),!1}throw Error(n(435,o.tag))}return of(i,l,h),Nc(),!1}if(Ue)return s=Li.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,l!==Jh&&(i=Error(n(422),{cause:l}),Ea(Xi(i,o)))):(l!==Jh&&(s=Error(n(423),{cause:l}),Ea(Xi(s,o))),i=i.current.alternate,i.flags|=65536,h&=-h,i.lanes|=h,l=Xi(l,o),h=Bd(i.stateNode,l,h),ud(i,h),yt!==4&&(yt=2)),!1;var p=Error(n(520),{cause:l});if(p=Xi(p,o),Wa===null?Wa=[p]:Wa.push(p),yt!==4&&(yt=2),s===null)return!0;l=Xi(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=h&-h,o.lanes|=i,i=Bd(o.stateNode,l,i),ud(o,i),!1;case 1:if(s=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Vs===null||!Vs.has(p))))return o.flags|=65536,h&=-h,o.lanes|=h,h=Sv(h),wv(h,i,o,l),ud(o,h),!1}o=o.return}while(o!==null);return!1}var Ld=Error(n(461)),At=!1;function si(i,s,o,l){s.child=i===null?Rg(s,null,o,l):Ln(s,i.child,o,l)}function xv(i,s,o,l,h){o=o.render;var p=s.ref;if("ref"in l){var b={};for(var E in l)E!=="ref"&&(b[E]=l[E])}else b=l;return Mn(s),l=_d(i,s,o,b,p,h),E=gd(),i!==null&&!At?(vd(i,s,h),as(i,s,h)):(Ue&&E&&Zh(s),s.flags|=1,si(i,s,l,h),s.child)}function Cv(i,s,o,l,h){if(i===null){var p=o.type;return typeof p=="function"&&!Kh(p)&&p.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=p,Ev(i,s,p,l,h)):(i=tc(o.type,null,l,s,s.mode,h),i.ref=s.ref,i.return=s,s.child=i)}if(p=i.child,!Fd(i,h)){var b=p.memoizedProps;if(o=o.compare,o=o!==null?o:wa,o(b,l)&&i.ref===s.ref)return as(i,s,h)}return s.flags|=1,i=ts(p,l),i.ref=s.ref,i.return=s,s.child=i}function Ev(i,s,o,l,h){if(i!==null){var p=i.memoizedProps;if(wa(p,l)&&i.ref===s.ref)if(At=!1,s.pendingProps=l=p,Fd(i,h))(i.flags&131072)!==0&&(At=!0);else return s.lanes=i.lanes,as(i,s,h)}return zd(i,s,o,l,h)}function Rv(i,s,o,l){var h=l.children,p=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|o:o,i!==null){for(l=s.child=i.child,h=0;l!==null;)h=h|l.lanes|l.childLanes,l=l.sibling;l=h&~p}else l=0,s.child=null;return kv(i,s,p,o,l)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&nc(s,p!==null?p.cachePool:null),p!==null?Ag(s,p):dd(),Dg(s);else return l=s.lanes=536870912,kv(i,s,p!==null?p.baseLanes|o:o,o,l)}else p!==null?(nc(s,p.cachePool),Ag(s,p),$s(),s.memoizedState=null):(i!==null&&nc(s,null),dd(),$s());return si(i,s,h,o),s.child}function ja(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function kv(i,s,o,l,h){var p=od();return p=p===null?null:{parent:kt._currentValue,pool:p},s.memoizedState={baseLanes:o,cachePool:p},i!==null&&nc(s,null),dd(),Dg(s),i!==null&&wo(i,s,l,!0),s.childLanes=h,null}function Sc(i,s){return s=xc({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Tv(i,s,o){return Ln(s,i.child,null,o),i=Sc(s,s.pendingProps),i.flags|=2,zi(s),s.memoizedState=null,i}function L2(i,s,o){var l=s.pendingProps,h=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Ue){if(l.mode==="hidden")return i=Sc(s,l),s.lanes=536870912,ja(null,i);if(md(s),(i=ct)?(i=U0(i,Ji),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Bs!==null?{id:Rr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},o=hg(i),o.return=s,s.child=o,ii=s,ct=null)):i=null,i===null)throw zs(s);return s.lanes=536870912,null}return Sc(s,l)}var p=i.memoizedState;if(p!==null){var b=p.dehydrated;if(md(s),h)if(s.flags&256)s.flags&=-257,s=Tv(i,s,o);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(n(558));else if(At||wo(i,s,o,!1),h=(o&i.childLanes)!==0,At||h){if(l=nt,l!==null&&(b=li(l,o),b!==0&&b!==p.retryLane))throw p.retryLane=b,kn(i,b),Ei(l,i,b),Ld;Nc(),s=Tv(i,s,o)}else i=p.treeContext,ct=tr(b.nextSibling),ii=s,Ue=!0,Ls=null,Ji=!1,i!==null&&mg(s,i),s=Sc(s,l),s.flags|=4096;return s}return i=ts(i.child,{mode:l.mode,children:l.children}),i.ref=s.ref,s.child=i,i.return=s,i}function wc(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(n(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function zd(i,s,o,l,h){return Mn(s),o=_d(i,s,o,l,void 0,h),l=gd(),i!==null&&!At?(vd(i,s,h),as(i,s,h)):(Ue&&l&&Zh(s),s.flags|=1,si(i,s,o,h),s.child)}function Av(i,s,o,l,h,p){return Mn(s),s.updateQueue=null,o=Ng(s,l,o,h),Mg(i),l=gd(),i!==null&&!At?(vd(i,s,p),as(i,s,p)):(Ue&&l&&Zh(s),s.flags|=1,si(i,s,o,p),s.child)}function Dv(i,s,o,l,h){if(Mn(s),s.stateNode===null){var p=vo,b=o.contextType;typeof b=="object"&&b!==null&&(p=ri(b)),p=new o(l,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Od,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=l,p.state=s.memoizedState,p.refs={},ld(s),b=o.contextType,p.context=typeof b=="object"&&b!==null?ri(b):vo,p.state=s.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(Nd(s,o,b,l),p.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(b=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),b!==p.state&&Od.enqueueReplaceState(p,p.state,null),Na(s,l,p,h),Ma(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){p=s.stateNode;var E=s.memoizedProps,B=jn(o,E);p.props=B;var K=p.context,te=o.contextType;b=vo,typeof te=="object"&&te!==null&&(b=ri(te));var ne=o.getDerivedStateFromProps;te=typeof ne=="function"||typeof p.getSnapshotBeforeUpdate=="function",E=s.pendingProps!==E,te||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(E||K!==b)&&_v(s,p,l,b),Hs=!1;var Z=s.memoizedState;p.state=Z,Na(s,l,p,h),Ma(),K=s.memoizedState,E||Z!==K||Hs?(typeof ne=="function"&&(Nd(s,o,ne,l),K=s.memoizedState),(B=Hs||pv(s,o,B,l,Z,K,b))?(te||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=K),p.props=l,p.state=K,p.context=b,l=B):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{p=s.stateNode,cd(i,s),b=s.memoizedProps,te=jn(o,b),p.props=te,ne=s.pendingProps,Z=p.context,K=o.contextType,B=vo,typeof K=="object"&&K!==null&&(B=ri(K)),E=o.getDerivedStateFromProps,(K=typeof E=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(b!==ne||Z!==B)&&_v(s,p,l,B),Hs=!1,Z=s.memoizedState,p.state=Z,Na(s,l,p,h),Ma();var J=s.memoizedState;b!==ne||Z!==J||Hs||i!==null&&i.dependencies!==null&&rc(i.dependencies)?(typeof E=="function"&&(Nd(s,o,E,l),J=s.memoizedState),(te=Hs||pv(s,o,te,l,Z,J,B)||i!==null&&i.dependencies!==null&&rc(i.dependencies))?(K||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,J,B),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,J,B)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||b===i.memoizedProps&&Z===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&Z===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=J),p.props=l,p.state=J,p.context=B,l=te):(typeof p.componentDidUpdate!="function"||b===i.memoizedProps&&Z===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&Z===i.memoizedState||(s.flags|=1024),l=!1)}return p=l,wc(i,s),l=(s.flags&128)!==0,p||l?(p=s.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,i!==null&&l?(s.child=Ln(s,i.child,null,h),s.child=Ln(s,null,o,h)):si(i,s,o,h),s.memoizedState=p.state,i=s.child):i=as(i,s,h),i}function Mv(i,s,o,l){return An(),s.flags|=256,si(i,s,o,l),s.child}var jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hd(i){return{baseLanes:i,cachePool:bg()}}function Pd(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=Hi),i}function Nv(i,s,o){var l=s.pendingProps,h=!1,p=(s.flags&128)!==0,b;if((b=p)||(b=i!==null&&i.memoizedState===null?!1:(Ct.current&2)!==0),b&&(h=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ue){if(h?Is(s):$s(),(i=ct)?(i=U0(i,Ji),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Bs!==null?{id:Rr,overflow:kr}:null,retryLane:536870912,hydrationErrors:null},o=hg(i),o.return=s,s.child=o,ii=s,ct=null)):i=null,i===null)throw zs(s);return wf(i)?s.lanes=32:s.lanes=536870912,null}var E=l.children;return l=l.fallback,h?($s(),h=s.mode,E=xc({mode:"hidden",children:E},h),l=Tn(l,h,o,null),E.return=s,l.return=s,E.sibling=l,s.child=E,l=s.child,l.memoizedState=Hd(o),l.childLanes=Pd(i,b,o),s.memoizedState=jd,ja(null,l)):(Is(s),Ud(s,E))}var B=i.memoizedState;if(B!==null&&(E=B.dehydrated,E!==null)){if(p)s.flags&256?(Is(s),s.flags&=-257,s=Id(i,s,o)):s.memoizedState!==null?($s(),s.child=i.child,s.flags|=128,s=null):($s(),E=l.fallback,h=s.mode,l=xc({mode:"visible",children:l.children},h),E=Tn(E,h,o,null),E.flags|=2,l.return=s,E.return=s,l.sibling=E,s.child=l,Ln(s,i.child,null,o),l=s.child,l.memoizedState=Hd(o),l.childLanes=Pd(i,b,o),s.memoizedState=jd,s=ja(null,l));else if(Is(s),wf(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var K=b.dgst;b=K,l=Error(n(419)),l.stack="",l.digest=b,Ea({value:l,source:null,stack:null}),s=Id(i,s,o)}else if(At||wo(i,s,o,!1),b=(o&i.childLanes)!==0,At||b){if(b=nt,b!==null&&(l=li(b,o),l!==0&&l!==B.retryLane))throw B.retryLane=l,kn(i,l),Ei(b,i,l),Ld;Sf(E)||Nc(),s=Id(i,s,o)}else Sf(E)?(s.flags|=192,s.child=i.child,s=null):(i=B.treeContext,ct=tr(E.nextSibling),ii=s,Ue=!0,Ls=null,Ji=!1,i!==null&&mg(s,i),s=Ud(s,l.children),s.flags|=4096);return s}return h?($s(),E=l.fallback,h=s.mode,B=i.child,K=B.sibling,l=ts(B,{mode:"hidden",children:l.children}),l.subtreeFlags=B.subtreeFlags&65011712,K!==null?E=ts(K,E):(E=Tn(E,h,o,null),E.flags|=2),E.return=s,l.return=s,l.sibling=E,s.child=l,ja(null,l),l=s.child,E=i.child.memoizedState,E===null?E=Hd(o):(h=E.cachePool,h!==null?(B=kt._currentValue,h=h.parent!==B?{parent:B,pool:B}:h):h=bg(),E={baseLanes:E.baseLanes|o,cachePool:h}),l.memoizedState=E,l.childLanes=Pd(i,b,o),s.memoizedState=jd,ja(i.child,l)):(Is(s),o=i.child,i=o.sibling,o=ts(o,{mode:"visible",children:l.children}),o.return=s,o.sibling=null,i!==null&&(b=s.deletions,b===null?(s.deletions=[i],s.flags|=16):b.push(i)),s.child=o,s.memoizedState=null,o)}function Ud(i,s){return s=xc({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function xc(i,s){return i=Bi(22,i,null,s),i.lanes=0,i}function Id(i,s,o){return Ln(s,i.child,null,o),i=Ud(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Ov(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),id(i.return,s,o)}function $d(i,s,o,l,h,p){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:h,treeForkCount:p}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=l,b.tail=o,b.tailMode=h,b.treeForkCount=p)}function Bv(i,s,o){var l=s.pendingProps,h=l.revealOrder,p=l.tail;l=l.children;var b=Ct.current,E=(b&2)!==0;if(E?(b=b&1|2,s.flags|=128):b&=1,q(Ct,b),si(i,s,l,o),l=Ue?Ca:0,!E&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ov(i,o,s);else if(i.tag===19)Ov(i,o,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(h){case"forwards":for(o=s.child,h=null;o!==null;)i=o.alternate,i!==null&&hc(i)===null&&(h=o),o=o.sibling;o=h,o===null?(h=s.child,s.child=null):(h=o.sibling,o.sibling=null),$d(s,!1,h,o,p,l);break;case"backwards":case"unstable_legacy-backwards":for(o=null,h=s.child,s.child=null;h!==null;){if(i=h.alternate,i!==null&&hc(i)===null){s.child=h;break}i=h.sibling,h.sibling=o,o=h,h=i}$d(s,!0,o,null,p,l);break;case"together":$d(s,!1,null,null,void 0,l);break;default:s.memoizedState=null}return s.child}function as(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),qs|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(wo(i,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(n(153));if(s.child!==null){for(i=s.child,o=ts(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=ts(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function Fd(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&rc(i)))}function z2(i,s,o){switch(s.tag){case 3:_e(s,s.stateNode.containerInfo),js(s,kt,i.memoizedState.cache),An();break;case 27:case 5:Je(s);break;case 4:_e(s,s.stateNode.containerInfo);break;case 10:js(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,md(s),null;break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(Is(s),s.flags|=128,null):(o&s.child.childLanes)!==0?Nv(i,s,o):(Is(s),i=as(i,s,o),i!==null?i.sibling:null);Is(s);break;case 19:var h=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(wo(i,s,o,!1),l=(o&s.childLanes)!==0),h){if(l)return Bv(i,s,o);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),q(Ct,Ct.current),l)break;return null;case 22:return s.lanes=0,Rv(i,s,o,s.pendingProps);case 24:js(s,kt,i.memoizedState.cache)}return as(i,s,o)}function Lv(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)At=!0;else{if(!Fd(i,o)&&(s.flags&128)===0)return At=!1,z2(i,s,o);At=(i.flags&131072)!==0}else At=!1,Ue&&(s.flags&1048576)!==0&&fg(s,Ca,s.index);switch(s.lanes=0,s.tag){case 16:e:{var l=s.pendingProps;if(i=On(s.elementType),s.type=i,typeof i=="function")Kh(i)?(l=jn(i,l),s.tag=1,s=Dv(null,s,i,l,o)):(s.tag=0,s=zd(null,s,i,l,o));else{if(i!=null){var h=i.$$typeof;if(h===A){s.tag=11,s=xv(null,s,i,l,o);break e}else if(h===F){s.tag=14,s=Cv(null,s,i,l,o);break e}}throw s=H(i)||i,Error(n(306,s,""))}}return s;case 0:return zd(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,h=jn(l,s.pendingProps),Dv(i,s,l,h,o);case 3:e:{if(_e(s,s.stateNode.containerInfo),i===null)throw Error(n(387));l=s.pendingProps;var p=s.memoizedState;h=p.element,cd(i,s),Na(s,l,null,o);var b=s.memoizedState;if(l=b.cache,js(s,kt,l),l!==p.cache&&rd(s,[kt],o,!0),Ma(),l=b.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:b.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=Mv(i,s,l,o);break e}else if(l!==h){h=Xi(Error(n(424)),s),Ea(h),s=Mv(i,s,l,o);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,ct=tr(i.firstChild),ii=s,Ue=!0,Ls=null,Ji=!0,o=Rg(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(An(),l===h){s=as(i,s,o);break e}si(i,s,l,o)}s=s.child}return s;case 26:return wc(i,s),i===null?(o=V0(s.type,null,s.pendingProps,null))?s.memoizedState=o:Ue||(o=s.type,i=s.pendingProps,l=Pc(ae.current).createElement(o),l[ti]=s,l[yi]=i,ni(l,o,i),Ft(l),s.stateNode=l):s.memoizedState=V0(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Je(s),i===null&&Ue&&(l=s.stateNode=F0(s.type,s.pendingProps,ae.current),ii=s,Ji=!0,h=ct,Xs(s.type)?(xf=h,ct=tr(l.firstChild)):ct=h),si(i,s,s.pendingProps.children,o),wc(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ue&&((h=l=ct)&&(l=dE(l,s.type,s.pendingProps,Ji),l!==null?(s.stateNode=l,ii=s,ct=tr(l.firstChild),Ji=!1,h=!0):h=!1),h||zs(s)),Je(s),h=s.type,p=s.pendingProps,b=i!==null?i.memoizedProps:null,l=p.children,vf(h,p)?l=null:b!==null&&vf(h,b)&&(s.flags|=32),s.memoizedState!==null&&(h=_d(i,s,k2,null,null,o),Qa._currentValue=h),wc(i,s),si(i,s,l,o),s.child;case 6:return i===null&&Ue&&((i=o=ct)&&(o=fE(o,s.pendingProps,Ji),o!==null?(s.stateNode=o,ii=s,ct=null,i=!0):i=!1),i||zs(s)),null;case 13:return Nv(i,s,o);case 4:return _e(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=Ln(s,null,l,o):si(i,s,l,o),s.child;case 11:return xv(i,s,s.type,s.pendingProps,o);case 7:return si(i,s,s.pendingProps,o),s.child;case 8:return si(i,s,s.pendingProps.children,o),s.child;case 12:return si(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,js(s,s.type,l.value),si(i,s,l.children,o),s.child;case 9:return h=s.type._context,l=s.pendingProps.children,Mn(s),h=ri(h),l=l(h),s.flags|=1,si(i,s,l,o),s.child;case 14:return Cv(i,s,s.type,s.pendingProps,o);case 15:return Ev(i,s,s.type,s.pendingProps,o);case 19:return Bv(i,s,o);case 31:return L2(i,s,o);case 22:return Rv(i,s,o,s.pendingProps);case 24:return Mn(s),l=ri(kt),i===null?(h=od(),h===null&&(h=nt,p=sd(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=o),h=p),s.memoizedState={parent:l,cache:h},ld(s),js(s,kt,h)):((i.lanes&o)!==0&&(cd(i,s),Na(s,null,null,o),Ma()),h=i.memoizedState,p=s.memoizedState,h.parent!==l?(h={parent:l,cache:l},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),js(s,kt,l)):(l=p.cache,js(s,kt,l),l!==h.cache&&rd(s,[kt],o,!0))),si(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(n(156,s.tag))}function ls(i){i.flags|=4}function Wd(i,s,o,l,h){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(h&335544128)===h)if(i.stateNode.complete)i.flags|=8192;else if(l0())i.flags|=8192;else throw Bn=ac,ad}else i.flags&=-16777217}function zv(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Z0(s))if(l0())i.flags|=8192;else throw Bn=ac,ad}function Cc(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?It():536870912,i.lanes|=s,Bo|=s)}function Ha(i,s){if(!Ue)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function ut(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(s)for(var h=i.child;h!==null;)o|=h.lanes|h.childLanes,l|=h.subtreeFlags&65011712,l|=h.flags&65011712,h.return=i,h=h.sibling;else for(h=i.child;h!==null;)o|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=i,h=h.sibling;return i.subtreeFlags|=l,i.childLanes=o,s}function j2(i,s,o){var l=s.pendingProps;switch(Qh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(s),null;case 1:return ut(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),ss(kt),me(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(So(s)?ls(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ed())),ut(s),null;case 26:var h=s.type,p=s.memoizedState;return i===null?(ls(s),p!==null?(ut(s),zv(s,p)):(ut(s),Wd(s,h,null,l,o))):p?p!==i.memoizedState?(ls(s),ut(s),zv(s,p)):(ut(s),s.flags&=-16777217):(i=i.memoizedProps,i!==l&&ls(s),ut(s),Wd(s,h,i,l,o)),null;case 27:if(ot(s),o=ae.current,h=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&ls(s);else{if(!l){if(s.stateNode===null)throw Error(n(166));return ut(s),null}i=Q.current,So(s)?pg(s):(i=F0(h,l,o),s.stateNode=i,ls(s))}return ut(s),null;case 5:if(ot(s),h=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&ls(s);else{if(!l){if(s.stateNode===null)throw Error(n(166));return ut(s),null}if(p=Q.current,So(s))pg(s);else{var b=Pc(ae.current);switch(p){case 1:p=b.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=b.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=b.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=b.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=b.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof l.is=="string"?b.createElement("select",{is:l.is}):b.createElement("select"),l.multiple?p.multiple=!0:l.size&&(p.size=l.size);break;default:p=typeof l.is=="string"?b.createElement(h,{is:l.is}):b.createElement(h)}}p[ti]=s,p[yi]=l;e:for(b=s.child;b!==null;){if(b.tag===5||b.tag===6)p.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===s)break e;for(;b.sibling===null;){if(b.return===null||b.return===s)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}s.stateNode=p;e:switch(ni(p,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&ls(s)}}return ut(s),Wd(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,o),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&ls(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(n(166));if(i=ae.current,So(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,h=ii,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}i[ti]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||N0(i.nodeValue,o)),i||zs(s,!0)}else i=Pc(i).createTextNode(l),i[ti]=s,s.stateNode=i}return ut(s),null;case 31:if(o=s.memoizedState,i===null||i.memoizedState!==null){if(l=So(s),o!==null){if(i===null){if(!l)throw Error(n(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[ti]=s}else An(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;ut(s),i=!1}else o=ed(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return s.flags&256?(zi(s),s):(zi(s),null);if((s.flags&128)!==0)throw Error(n(558))}return ut(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(h=So(s),l!==null&&l.dehydrated!==null){if(i===null){if(!h)throw Error(n(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(n(317));h[ti]=s}else An(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;ut(s),h=!1}else h=ed(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(zi(s),s):(zi(s),null)}return zi(s),(s.flags&128)!==0?(s.lanes=o,s):(o=l!==null,i=i!==null&&i.memoizedState!==null,o&&(l=s.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==h&&(l.flags|=2048)),o!==i&&o&&(s.child.flags|=8192),Cc(s,s.updateQueue),ut(s),null);case 4:return me(),i===null&&ff(s.stateNode.containerInfo),ut(s),null;case 10:return ss(s.type),ut(s),null;case 19:if(O(Ct),l=s.memoizedState,l===null)return ut(s),null;if(h=(s.flags&128)!==0,p=l.rendering,p===null)if(h)Ha(l,!1);else{if(yt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(p=hc(i),p!==null){for(s.flags|=128,Ha(l,!1),i=p.updateQueue,s.updateQueue=i,Cc(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)ug(o,i),o=o.sibling;return q(Ct,Ct.current&1|2),Ue&&is(s,l.treeForkCount),s.child}i=i.sibling}l.tail!==null&&ei()>Ac&&(s.flags|=128,h=!0,Ha(l,!1),s.lanes=4194304)}else{if(!h)if(i=hc(p),i!==null){if(s.flags|=128,h=!0,i=i.updateQueue,s.updateQueue=i,Cc(s,i),Ha(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!Ue)return ut(s),null}else 2*ei()-l.renderingStartTime>Ac&&o!==536870912&&(s.flags|=128,h=!0,Ha(l,!1),s.lanes=4194304);l.isBackwards?(p.sibling=s.child,s.child=p):(i=l.last,i!==null?i.sibling=p:s.child=p,l.last=p)}return l.tail!==null?(i=l.tail,l.rendering=i,l.tail=i.sibling,l.renderingStartTime=ei(),i.sibling=null,o=Ct.current,q(Ct,h?o&1|2:o&1),Ue&&is(s,l.treeForkCount),i):(ut(s),null);case 22:case 23:return zi(s),fd(),l=s.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(o&536870912)!==0&&(s.flags&128)===0&&(ut(s),s.subtreeFlags&6&&(s.flags|=8192)):ut(s),o=s.updateQueue,o!==null&&Cc(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==o&&(s.flags|=2048),i!==null&&O(Nn),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),ss(kt),ut(s),null;case 25:return null;case 30:return null}throw Error(n(156,s.tag))}function H2(i,s){switch(Qh(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return ss(kt),me(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ot(s),null;case 31:if(s.memoizedState!==null){if(zi(s),s.alternate===null)throw Error(n(340));An()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(zi(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(n(340));An()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return O(Ct),null;case 4:return me(),null;case 10:return ss(s.type),null;case 22:case 23:return zi(s),fd(),i!==null&&O(Nn),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return ss(kt),null;case 25:return null;default:return null}}function jv(i,s){switch(Qh(s),s.tag){case 3:ss(kt),me();break;case 26:case 27:case 5:ot(s);break;case 4:me();break;case 31:s.memoizedState!==null&&zi(s);break;case 13:zi(s);break;case 19:O(Ct);break;case 10:ss(s.type);break;case 22:case 23:zi(s),fd(),i!==null&&O(Nn);break;case 24:ss(kt)}}function Pa(i,s){try{var o=s.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var h=l.next;o=h;do{if((o.tag&i)===i){l=void 0;var p=o.create,b=o.inst;l=p(),b.destroy=l}o=o.next}while(o!==h)}}catch(E){Ze(s,s.return,E)}}function Fs(i,s,o){try{var l=s.updateQueue,h=l!==null?l.lastEffect:null;if(h!==null){var p=h.next;l=p;do{if((l.tag&i)===i){var b=l.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,h=s;var B=o,K=E;try{K()}catch(te){Ze(h,B,te)}}}l=l.next}while(l!==p)}}catch(te){Ze(s,s.return,te)}}function Hv(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Tg(s,o)}catch(l){Ze(i,i.return,l)}}}function Pv(i,s,o){o.props=jn(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ze(i,s,l)}}function Ua(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(h){Ze(i,s,h)}}function Tr(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(h){Ze(i,s,h)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){Ze(i,s,h)}else o.current=null}function Uv(i){var s=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(h){Ze(i,i.return,h)}}function qd(i,s,o){try{var l=i.stateNode;oE(l,i.type,o,s),l[yi]=s}catch(h){Ze(i,i.return,h)}}function Iv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Xs(i.type)||i.tag===4}function Vd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Iv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Xs(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Yd(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Jr));else if(l!==4&&(l===27&&Xs(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(Yd(i,s,o),i=i.sibling;i!==null;)Yd(i,s,o),i=i.sibling}function Ec(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(l!==4&&(l===27&&Xs(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Ec(i,s,o),i=i.sibling;i!==null;)Ec(i,s,o),i=i.sibling}function $v(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);ni(s,l,o),s[ti]=i,s[yi]=o}catch(p){Ze(i,i.return,p)}}var cs=!1,Dt=!1,Kd=!1,Fv=typeof WeakSet=="function"?WeakSet:Set,Wt=null;function P2(i,s){if(i=i.containerInfo,_f=Vc,i=tg(i),Ih(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var h=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var b=0,E=-1,B=-1,K=0,te=0,ne=i,Z=null;t:for(;;){for(var J;ne!==o||h!==0&&ne.nodeType!==3||(E=b+h),ne!==p||l!==0&&ne.nodeType!==3||(B=b+l),ne.nodeType===3&&(b+=ne.nodeValue.length),(J=ne.firstChild)!==null;)Z=ne,ne=J;for(;;){if(ne===i)break t;if(Z===o&&++K===h&&(E=b),Z===p&&++te===l&&(B=b),(J=ne.nextSibling)!==null)break;ne=Z,Z=ne.parentNode}ne=J}o=E===-1||B===-1?null:{start:E,end:B}}else o=null}o=o||{start:0,end:0}}else o=null;for(gf={focusedElem:i,selectionRange:o},Vc=!1,Wt=s;Wt!==null;)if(s=Wt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Wt=i;else for(;Wt!==null;){switch(s=Wt,p=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)h=i[o],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&p!==null){i=void 0,o=s,h=p.memoizedProps,p=p.memoizedState,l=o.stateNode;try{var ge=jn(o.type,h);i=l.getSnapshotBeforeUpdate(ge,p),l.__reactInternalSnapshotBeforeUpdate=i}catch(Ce){Ze(o,o.return,Ce)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)bf(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":bf(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(n(163))}if(i=s.sibling,i!==null){i.return=s.return,Wt=i;break}Wt=s.return}}function Wv(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:hs(i,o),l&4&&Pa(5,o);break;case 1:if(hs(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(b){Ze(o,o.return,b)}else{var h=jn(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(h,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ze(o,o.return,b)}}l&64&&Hv(o),l&512&&Ua(o,o.return);break;case 3:if(hs(i,o),l&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Tg(i,s)}catch(b){Ze(o,o.return,b)}}break;case 27:s===null&&l&4&&$v(o);case 26:case 5:hs(i,o),s===null&&l&4&&Uv(o),l&512&&Ua(o,o.return);break;case 12:hs(i,o);break;case 31:hs(i,o),l&4&&Yv(i,o);break;case 13:hs(i,o),l&4&&Kv(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=K2.bind(null,o),mE(i,o))));break;case 22:if(l=o.memoizedState!==null||cs,!l){s=s!==null&&s.memoizedState!==null||Dt,h=cs;var p=Dt;cs=l,(Dt=s)&&!p?ds(i,o,(o.subtreeFlags&8772)!==0):hs(i,o),cs=h,Dt=p}break;case 30:break;default:hs(i,o)}}function qv(i){var s=i.alternate;s!==null&&(i.alternate=null,qv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Ch(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var dt=null,Si=!1;function us(i,s,o){for(o=o.child;o!==null;)Vv(i,s,o),o=o.sibling}function Vv(i,s,o){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Zr,o)}catch{}switch(o.tag){case 26:Dt||Tr(o,s),us(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Dt||Tr(o,s);var l=dt,h=Si;Xs(o.type)&&(dt=o.stateNode,Si=!1),us(i,s,o),Ga(o.stateNode),dt=l,Si=h;break;case 5:Dt||Tr(o,s);case 6:if(l=dt,h=Si,dt=null,us(i,s,o),dt=l,Si=h,dt!==null)if(Si)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(o.stateNode)}catch(p){Ze(o,s,p)}else try{dt.removeChild(o.stateNode)}catch(p){Ze(o,s,p)}break;case 18:dt!==null&&(Si?(i=dt,H0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),$o(i)):H0(dt,o.stateNode));break;case 4:l=dt,h=Si,dt=o.stateNode.containerInfo,Si=!0,us(i,s,o),dt=l,Si=h;break;case 0:case 11:case 14:case 15:Fs(2,o,s),Dt||Fs(4,o,s),us(i,s,o);break;case 1:Dt||(Tr(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&Pv(o,s,l)),us(i,s,o);break;case 21:us(i,s,o);break;case 22:Dt=(l=Dt)||o.memoizedState!==null,us(i,s,o),Dt=l;break;default:us(i,s,o)}}function Yv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{$o(i)}catch(o){Ze(s,s.return,o)}}}function Kv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{$o(i)}catch(o){Ze(s,s.return,o)}}function U2(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Fv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Fv),s;default:throw Error(n(435,i.tag))}}function Rc(i,s){var o=U2(i);s.forEach(function(l){if(!o.has(l)){o.add(l);var h=G2.bind(null,i,l);l.then(h,h)}})}function wi(i,s){var o=s.deletions;if(o!==null)for(var l=0;l<o.length;l++){var h=o[l],p=i,b=s,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(Xs(E.type)){dt=E.stateNode,Si=!1;break e}break;case 5:dt=E.stateNode,Si=!1;break e;case 3:case 4:dt=E.stateNode.containerInfo,Si=!0;break e}E=E.return}if(dt===null)throw Error(n(160));Vv(p,b,h),dt=null,Si=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Gv(s,i),s=s.sibling}var pr=null;function Gv(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:wi(s,i),xi(i),l&4&&(Fs(3,i,i.return),Pa(3,i),Fs(5,i,i.return));break;case 1:wi(s,i),xi(i),l&512&&(Dt||o===null||Tr(o,o.return)),l&64&&cs&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var h=pr;if(wi(s,i),xi(i),l&512&&(Dt||o===null||Tr(o,o.return)),l&4){var p=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,h=h.ownerDocument||h;t:switch(l){case"title":p=h.getElementsByTagName("title")[0],(!p||p[fa]||p[ti]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(l),h.head.insertBefore(p,h.querySelector("head > title"))),ni(p,l,o),p[ti]=i,Ft(p),l=p;break e;case"link":var b=G0("link","href",h).get(l+(o.href||""));if(b){for(var E=0;E<b.length;E++)if(p=b[E],p.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){b.splice(E,1);break t}}p=h.createElement(l),ni(p,l,o),h.head.appendChild(p);break;case"meta":if(b=G0("meta","content",h).get(l+(o.content||""))){for(E=0;E<b.length;E++)if(p=b[E],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){b.splice(E,1);break t}}p=h.createElement(l),ni(p,l,o),h.head.appendChild(p);break;default:throw Error(n(468,l))}p[ti]=i,Ft(p),l=p}i.stateNode=l}else X0(h,i.type,i.stateNode);else i.stateNode=K0(h,l,i.memoizedProps);else p!==l?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,l===null?X0(h,i.type,i.stateNode):K0(h,l,i.memoizedProps)):l===null&&i.stateNode!==null&&qd(i,i.memoizedProps,o.memoizedProps)}break;case 27:wi(s,i),xi(i),l&512&&(Dt||o===null||Tr(o,o.return)),o!==null&&l&4&&qd(i,i.memoizedProps,o.memoizedProps);break;case 5:if(wi(s,i),xi(i),l&512&&(Dt||o===null||Tr(o,o.return)),i.flags&32){h=i.stateNode;try{uo(h,"")}catch(ge){Ze(i,i.return,ge)}}l&4&&i.stateNode!=null&&(h=i.memoizedProps,qd(i,h,o!==null?o.memoizedProps:h)),l&1024&&(Kd=!0);break;case 6:if(wi(s,i),xi(i),l&4){if(i.stateNode===null)throw Error(n(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(ge){Ze(i,i.return,ge)}}break;case 3:if($c=null,h=pr,pr=Uc(s.containerInfo),wi(s,i),pr=h,xi(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{$o(s.containerInfo)}catch(ge){Ze(i,i.return,ge)}Kd&&(Kd=!1,Xv(i));break;case 4:l=pr,pr=Uc(i.stateNode.containerInfo),wi(s,i),xi(i),pr=l;break;case 12:wi(s,i),xi(i);break;case 31:wi(s,i),xi(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Rc(i,l)));break;case 13:wi(s,i),xi(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Tc=ei()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Rc(i,l)));break;case 22:h=i.memoizedState!==null;var B=o!==null&&o.memoizedState!==null,K=cs,te=Dt;if(cs=K||h,Dt=te||B,wi(s,i),Dt=te,cs=K,xi(i),l&8192)e:for(s=i.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(o===null||B||cs||Dt||Hn(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){B=o=s;try{if(p=B.stateNode,h)b=p.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=B.stateNode;var ne=B.memoizedProps.style,Z=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;E.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ge){Ze(B,B.return,ge)}}}else if(s.tag===6){if(o===null){B=s;try{B.stateNode.nodeValue=h?"":B.memoizedProps}catch(ge){Ze(B,B.return,ge)}}}else if(s.tag===18){if(o===null){B=s;try{var J=B.stateNode;h?P0(J,!0):P0(B.stateNode,!1)}catch(ge){Ze(B,B.return,ge)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Rc(i,o))));break;case 19:wi(s,i),xi(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Rc(i,l)));break;case 30:break;case 21:break;default:wi(s,i),xi(i)}}function xi(i){var s=i.flags;if(s&2){try{for(var o,l=i.return;l!==null;){if(Iv(l)){o=l;break}l=l.return}if(o==null)throw Error(n(160));switch(o.tag){case 27:var h=o.stateNode,p=Vd(i);Ec(i,p,h);break;case 5:var b=o.stateNode;o.flags&32&&(uo(b,""),o.flags&=-33);var E=Vd(i);Ec(i,E,b);break;case 3:case 4:var B=o.stateNode.containerInfo,K=Vd(i);Yd(i,K,B);break;default:throw Error(n(161))}}catch(te){Ze(i,i.return,te)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Xv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Xv(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function hs(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Wv(i,s.alternate,s),s=s.sibling}function Hn(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Fs(4,s,s.return),Hn(s);break;case 1:Tr(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Pv(s,s.return,o),Hn(s);break;case 27:Ga(s.stateNode);case 26:case 5:Tr(s,s.return),Hn(s);break;case 22:s.memoizedState===null&&Hn(s);break;case 30:Hn(s);break;default:Hn(s)}i=i.sibling}}function ds(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var l=s.alternate,h=i,p=s,b=p.flags;switch(p.tag){case 0:case 11:case 15:ds(h,p,o),Pa(4,p);break;case 1:if(ds(h,p,o),l=p,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(K){Ze(l,l.return,K)}if(l=p,h=l.updateQueue,h!==null){var E=l.stateNode;try{var B=h.shared.hiddenCallbacks;if(B!==null)for(h.shared.hiddenCallbacks=null,h=0;h<B.length;h++)kg(B[h],E)}catch(K){Ze(l,l.return,K)}}o&&b&64&&Hv(p),Ua(p,p.return);break;case 27:$v(p);case 26:case 5:ds(h,p,o),o&&l===null&&b&4&&Uv(p),Ua(p,p.return);break;case 12:ds(h,p,o);break;case 31:ds(h,p,o),o&&b&4&&Yv(h,p);break;case 13:ds(h,p,o),o&&b&4&&Kv(h,p);break;case 22:p.memoizedState===null&&ds(h,p,o),Ua(p,p.return);break;case 30:break;default:ds(h,p,o)}s=s.sibling}}function Gd(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Ra(o))}function Xd(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Ra(i))}function _r(i,s,o,l){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Zv(i,s,o,l),s=s.sibling}function Zv(i,s,o,l){var h=s.flags;switch(s.tag){case 0:case 11:case 15:_r(i,s,o,l),h&2048&&Pa(9,s);break;case 1:_r(i,s,o,l);break;case 3:_r(i,s,o,l),h&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Ra(i)));break;case 12:if(h&2048){_r(i,s,o,l),i=s.stateNode;try{var p=s.memoizedProps,b=p.id,E=p.onPostCommit;typeof E=="function"&&E(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(B){Ze(s,s.return,B)}}else _r(i,s,o,l);break;case 31:_r(i,s,o,l);break;case 13:_r(i,s,o,l);break;case 23:break;case 22:p=s.stateNode,b=s.alternate,s.memoizedState!==null?p._visibility&2?_r(i,s,o,l):Ia(i,s):p._visibility&2?_r(i,s,o,l):(p._visibility|=2,Mo(i,s,o,l,(s.subtreeFlags&10256)!==0||!1)),h&2048&&Gd(b,s);break;case 24:_r(i,s,o,l),h&2048&&Xd(s.alternate,s);break;default:_r(i,s,o,l)}}function Mo(i,s,o,l,h){for(h=h&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=i,b=s,E=o,B=l,K=b.flags;switch(b.tag){case 0:case 11:case 15:Mo(p,b,E,B,h),Pa(8,b);break;case 23:break;case 22:var te=b.stateNode;b.memoizedState!==null?te._visibility&2?Mo(p,b,E,B,h):Ia(p,b):(te._visibility|=2,Mo(p,b,E,B,h)),h&&K&2048&&Gd(b.alternate,b);break;case 24:Mo(p,b,E,B,h),h&&K&2048&&Xd(b.alternate,b);break;default:Mo(p,b,E,B,h)}s=s.sibling}}function Ia(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,l=s,h=l.flags;switch(l.tag){case 22:Ia(o,l),h&2048&&Gd(l.alternate,l);break;case 24:Ia(o,l),h&2048&&Xd(l.alternate,l);break;default:Ia(o,l)}s=s.sibling}}var $a=8192;function No(i,s,o){if(i.subtreeFlags&$a)for(i=i.child;i!==null;)Qv(i,s,o),i=i.sibling}function Qv(i,s,o){switch(i.tag){case 26:No(i,s,o),i.flags&$a&&i.memoizedState!==null&&RE(o,pr,i.memoizedState,i.memoizedProps);break;case 5:No(i,s,o);break;case 3:case 4:var l=pr;pr=Uc(i.stateNode.containerInfo),No(i,s,o),pr=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=$a,$a=16777216,No(i,s,o),$a=l):No(i,s,o));break;default:No(i,s,o)}}function Jv(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Fa(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];Wt=l,t0(l,i)}Jv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)e0(i),i=i.sibling}function e0(i){switch(i.tag){case 0:case 11:case 15:Fa(i),i.flags&2048&&Fs(9,i,i.return);break;case 3:Fa(i);break;case 12:Fa(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,kc(i)):Fa(i);break;default:Fa(i)}}function kc(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];Wt=l,t0(l,i)}Jv(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Fs(8,s,s.return),kc(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,kc(s));break;default:kc(s)}i=i.sibling}}function t0(i,s){for(;Wt!==null;){var o=Wt;switch(o.tag){case 0:case 11:case 15:Fs(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ra(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,Wt=l;else e:for(o=i;Wt!==null;){l=Wt;var h=l.sibling,p=l.return;if(qv(l),l===o){Wt=null;break e}if(h!==null){h.return=p,Wt=h;break e}Wt=p}}}var I2={getCacheForType:function(i){var s=ri(kt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return ri(kt).controller.signal}},$2=typeof WeakMap=="function"?WeakMap:Map,qe=0,nt=null,ze=null,He=0,Xe=0,ji=null,Ws=!1,Oo=!1,Zd=!1,fs=0,yt=0,qs=0,Pn=0,Qd=0,Hi=0,Bo=0,Wa=null,Ci=null,Jd=!1,Tc=0,i0=0,Ac=1/0,Dc=null,Vs=null,Bt=0,Ys=null,Lo=null,ms=0,ef=0,tf=null,r0=null,qa=0,rf=null;function Pi(){return(qe&2)!==0&&He!==0?He&-He:R.T!==null?cf():wh()}function s0(){if(Hi===0)if((He&536870912)===0||Ue){var i=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Hi=i}else Hi=536870912;return i=Li.current,i!==null&&(i.flags|=32),Hi}function Ei(i,s,o){(i===nt&&(Xe===2||Xe===9)||i.cancelPendingCommit!==null)&&(zo(i,0),Ks(i,He,Hi,!1)),st(i,o),((qe&2)===0||i!==nt)&&(i===nt&&((qe&2)===0&&(Pn|=o),yt===4&&Ks(i,He,Hi,!1)),Ar(i))}function n0(i,s,o){if((qe&6)!==0)throw Error(n(327));var l=!o&&(s&127)===0&&(s&i.expiredLanes)===0||Ge(i,s),h=l?q2(i,s):nf(i,s,!0),p=l;do{if(h===0){Oo&&!l&&Ks(i,s,0,!1);break}else{if(o=i.current.alternate,p&&!F2(o)){h=nf(i,s,!1),p=!1;continue}if(h===2){if(p=s,i.errorRecoveryDisabledLanes&p)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){s=b;e:{var E=i;h=Wa;var B=E.current.memoizedState.isDehydrated;if(B&&(zo(E,b).flags|=256),b=nf(E,b,!1),b!==2){if(Zd&&!B){E.errorRecoveryDisabledLanes|=p,Pn|=p,h=4;break e}p=Ci,Ci=h,p!==null&&(Ci===null?Ci=p:Ci.push.apply(Ci,p))}h=b}if(p=!1,h!==2)continue}}if(h===1){zo(i,0),Ks(i,s,0,!0);break}e:{switch(l=i,p=h,p){case 0:case 1:throw Error(n(345));case 4:if((s&4194048)!==s)break;case 6:Ks(l,s,Hi,!Ws);break e;case 2:Ci=null;break;case 3:case 5:break;default:throw Error(n(329))}if((s&62914560)===s&&(h=Tc+300-ei(),10<h)){if(Ks(l,s,Hi,!Ws),xe(l,0,!0)!==0)break e;ms=s,l.timeoutHandle=z0(o0.bind(null,l,o,Ci,Dc,Jd,s,Hi,Pn,Bo,Ws,p,"Throttled",-0,0),h);break e}o0(l,o,Ci,Dc,Jd,s,Hi,Pn,Bo,Ws,p,null,-0,0)}}break}while(!0);Ar(i)}function o0(i,s,o,l,h,p,b,E,B,K,te,ne,Z,J){if(i.timeoutHandle=-1,ne=s.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jr},Qv(s,p,ne);var ge=(p&62914560)===p?Tc-ei():(p&4194048)===p?i0-ei():0;if(ge=kE(ne,ge),ge!==null){ms=p,i.cancelPendingCommit=ge(m0.bind(null,i,s,p,o,l,h,b,E,B,te,ne,null,Z,J)),Ks(i,p,b,!K);return}}m0(i,s,p,o,l,h,b,E,B)}function F2(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var h=o[l],p=h.getSnapshot;h=h.value;try{if(!Oi(p(),h))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ks(i,s,o,l){s&=~Qd,s&=~Pn,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var h=s;0<h;){var p=31-Ut(h),b=1<<p;l[p]=-1,h&=~b}o!==0&&Mi(i,o,s)}function Mc(){return(qe&6)===0?(Va(0),!1):!0}function sf(){if(ze!==null){if(Xe===0)var i=ze.return;else i=ze,rs=Dn=null,yd(i),Ro=null,Ta=0,i=ze;for(;i!==null;)jv(i.alternate,i),i=i.return;ze=null}}function zo(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,cE(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),ms=0,sf(),nt=i,ze=o=ts(i.current,null),He=s,Xe=0,ji=null,Ws=!1,Oo=Ge(i,s),Zd=!1,Bo=Hi=Qd=Pn=qs=yt=0,Ci=Wa=null,Jd=!1,(s&8)!==0&&(s|=s&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=s;0<l;){var h=31-Ut(l),p=1<<h;s|=i[h],l&=~p}return fs=s,Ql(),o}function a0(i,s){Ae=null,R.H=za,s===Eo||s===oc?(s=xg(),Xe=3):s===ad?(s=xg(),Xe=4):Xe=s===Ld?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ji=s,ze===null&&(yt=1,bc(i,Xi(s,i.current)))}function l0(){var i=Li.current;return i===null?!0:(He&4194048)===He?er===null:(He&62914560)===He||(He&536870912)!==0?i===er:!1}function c0(){var i=R.H;return R.H=za,i===null?za:i}function u0(){var i=R.A;return R.A=I2,i}function Nc(){yt=4,Ws||(He&4194048)!==He&&Li.current!==null||(Oo=!0),(qs&134217727)===0&&(Pn&134217727)===0||nt===null||Ks(nt,He,Hi,!1)}function nf(i,s,o){var l=qe;qe|=2;var h=c0(),p=u0();(nt!==i||He!==s)&&(Dc=null,zo(i,s)),s=!1;var b=yt;e:do try{if(Xe!==0&&ze!==null){var E=ze,B=ji;switch(Xe){case 8:sf(),b=6;break e;case 3:case 2:case 9:case 6:Li.current===null&&(s=!0);var K=Xe;if(Xe=0,ji=null,jo(i,E,B,K),o&&Oo){b=0;break e}break;default:K=Xe,Xe=0,ji=null,jo(i,E,B,K)}}W2(),b=yt;break}catch(te){a0(i,te)}while(!0);return s&&i.shellSuspendCounter++,rs=Dn=null,qe=l,R.H=h,R.A=p,ze===null&&(nt=null,He=0,Ql()),b}function W2(){for(;ze!==null;)h0(ze)}function q2(i,s){var o=qe;qe|=2;var l=c0(),h=u0();nt!==i||He!==s?(Dc=null,Ac=ei()+500,zo(i,s)):Oo=Ge(i,s);e:do try{if(Xe!==0&&ze!==null){s=ze;var p=ji;t:switch(Xe){case 1:Xe=0,ji=null,jo(i,s,p,1);break;case 2:case 9:if(Sg(p)){Xe=0,ji=null,d0(s);break}s=function(){Xe!==2&&Xe!==9||nt!==i||(Xe=7),Ar(i)},p.then(s,s);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:Sg(p)?(Xe=0,ji=null,d0(s)):(Xe=0,ji=null,jo(i,s,p,7));break;case 5:var b=null;switch(ze.tag){case 26:b=ze.memoizedState;case 5:case 27:var E=ze;if(b?Z0(b):E.stateNode.complete){Xe=0,ji=null;var B=E.sibling;if(B!==null)ze=B;else{var K=E.return;K!==null?(ze=K,Oc(K)):ze=null}break t}}Xe=0,ji=null,jo(i,s,p,5);break;case 6:Xe=0,ji=null,jo(i,s,p,6);break;case 8:sf(),yt=6;break e;default:throw Error(n(462))}}V2();break}catch(te){a0(i,te)}while(!0);return rs=Dn=null,R.H=l,R.A=h,qe=o,ze!==null?0:(nt=null,He=0,Ql(),yt)}function V2(){for(;ze!==null&&!Jt();)h0(ze)}function h0(i){var s=Lv(i.alternate,i,fs);i.memoizedProps=i.pendingProps,s===null?Oc(i):ze=s}function d0(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=Av(o,s,s.pendingProps,s.type,void 0,He);break;case 11:s=Av(o,s,s.pendingProps,s.type.render,s.ref,He);break;case 5:yd(s);default:jv(o,s),s=ze=ug(s,fs),s=Lv(o,s,fs)}i.memoizedProps=i.pendingProps,s===null?Oc(i):ze=s}function jo(i,s,o,l){rs=Dn=null,yd(s),Ro=null,Ta=0;var h=s.return;try{if(B2(i,h,s,o,He)){yt=1,bc(i,Xi(o,i.current)),ze=null;return}}catch(p){if(h!==null)throw ze=h,p;yt=1,bc(i,Xi(o,i.current)),ze=null;return}s.flags&32768?(Ue||l===1?i=!0:Oo||(He&536870912)!==0?i=!1:(Ws=i=!0,(l===2||l===9||l===3||l===6)&&(l=Li.current,l!==null&&l.tag===13&&(l.flags|=16384))),f0(s,i)):Oc(s)}function Oc(i){var s=i;do{if((s.flags&32768)!==0){f0(s,Ws);return}i=s.return;var o=j2(s.alternate,s,fs);if(o!==null){ze=o;return}if(s=s.sibling,s!==null){ze=s;return}ze=s=i}while(s!==null);yt===0&&(yt=5)}function f0(i,s){do{var o=H2(i.alternate,i);if(o!==null){o.flags&=32767,ze=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){ze=i;return}ze=i=o}while(i!==null);yt=6,ze=null}function m0(i,s,o,l,h,p,b,E,B){i.cancelPendingCommit=null;do Bc();while(Bt!==0);if((qe&6)!==0)throw Error(n(327));if(s!==null){if(s===i.current)throw Error(n(177));if(p=s.lanes|s.childLanes,p|=Vh,$t(i,o,p,b,E,B),i===nt&&(ze=nt=null,He=0),Lo=s,Ys=i,ms=o,ef=p,tf=h,r0=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,X2(Xr,function(){return y0(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=R.T,R.T=null,h=L.p,L.p=2,b=qe,qe|=4;try{P2(i,s,o)}finally{qe=b,L.p=h,R.T=l}}Bt=1,p0(),_0(),g0()}}function p0(){if(Bt===1){Bt=0;var i=Ys,s=Lo,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=R.T,R.T=null;var l=L.p;L.p=2;var h=qe;qe|=4;try{Gv(s,i);var p=gf,b=tg(i.containerInfo),E=p.focusedElem,B=p.selectionRange;if(b!==E&&E&&E.ownerDocument&&eg(E.ownerDocument.documentElement,E)){if(B!==null&&Ih(E)){var K=B.start,te=B.end;if(te===void 0&&(te=K),"selectionStart"in E)E.selectionStart=K,E.selectionEnd=Math.min(te,E.value.length);else{var ne=E.ownerDocument||document,Z=ne&&ne.defaultView||window;if(Z.getSelection){var J=Z.getSelection(),ge=E.textContent.length,Ce=Math.min(B.start,ge),it=B.end===void 0?Ce:Math.min(B.end,ge);!J.extend&&Ce>it&&(b=it,it=Ce,Ce=b);var V=J_(E,Ce),I=J_(E,it);if(V&&I&&(J.rangeCount!==1||J.anchorNode!==V.node||J.anchorOffset!==V.offset||J.focusNode!==I.node||J.focusOffset!==I.offset)){var Y=ne.createRange();Y.setStart(V.node,V.offset),J.removeAllRanges(),Ce>it?(J.addRange(Y),J.extend(I.node,I.offset)):(Y.setEnd(I.node,I.offset),J.addRange(Y))}}}}for(ne=[],J=E;J=J.parentNode;)J.nodeType===1&&ne.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ne.length;E++){var ie=ne[E];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Vc=!!_f,gf=_f=null}finally{qe=h,L.p=l,R.T=o}}i.current=s,Bt=2}}function _0(){if(Bt===2){Bt=0;var i=Ys,s=Lo,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=R.T,R.T=null;var l=L.p;L.p=2;var h=qe;qe|=4;try{Wv(i,s.alternate,s)}finally{qe=h,L.p=l,R.T=o}}Bt=3}}function g0(){if(Bt===4||Bt===3){Bt=0,Cr();var i=Ys,s=Lo,o=ms,l=r0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Bt=5:(Bt=0,Lo=Ys=null,v0(i,i.pendingLanes));var h=i.pendingLanes;if(h===0&&(Vs=null),Ni(o),s=s.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(Zr,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=R.T,h=L.p,L.p=2,R.T=null;try{for(var p=i.onRecoverableError,b=0;b<l.length;b++){var E=l[b];p(E.value,{componentStack:E.stack})}}finally{R.T=s,L.p=h}}(ms&3)!==0&&Bc(),Ar(i),h=i.pendingLanes,(o&261930)!==0&&(h&42)!==0?i===rf?qa++:(qa=0,rf=i):qa=0,Va(0)}}function v0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Ra(s)))}function Bc(){return p0(),_0(),g0(),y0()}function y0(){if(Bt!==5)return!1;var i=Ys,s=ef;ef=0;var o=Ni(ms),l=R.T,h=L.p;try{L.p=32>o?32:o,R.T=null,o=tf,tf=null;var p=Ys,b=ms;if(Bt=0,Lo=Ys=null,ms=0,(qe&6)!==0)throw Error(n(331));var E=qe;if(qe|=4,e0(p.current),Zv(p,p.current,b,o),qe=E,Va(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(Zr,p)}catch{}return!0}finally{L.p=h,R.T=l,v0(i,s)}}function b0(i,s,o){s=Xi(o,s),s=Bd(i.stateNode,s,2),i=Us(i,s,2),i!==null&&(st(i,2),Ar(i))}function Ze(i,s,o){if(i.tag===3)b0(i,i,o);else for(;s!==null;){if(s.tag===3){b0(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Vs===null||!Vs.has(l))){i=Xi(o,i),o=Sv(2),l=Us(s,o,2),l!==null&&(wv(o,l,s,i),st(l,2),Ar(l));break}}s=s.return}}function of(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new $2;var h=new Set;l.set(s,h)}else h=l.get(s),h===void 0&&(h=new Set,l.set(s,h));h.has(o)||(Zd=!0,h.add(o),i=Y2.bind(null,i,s,o),s.then(i,i))}function Y2(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,nt===i&&(He&o)===o&&(yt===4||yt===3&&(He&62914560)===He&&300>ei()-Tc?(qe&2)===0&&zo(i,0):Qd|=o,Bo===He&&(Bo=0)),Ar(i)}function S0(i,s){s===0&&(s=It()),i=kn(i,s),i!==null&&(st(i,s),Ar(i))}function K2(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),S0(i,o)}function G2(i,s){var o=0;switch(i.tag){case 31:case 13:var l=i.stateNode,h=i.memoizedState;h!==null&&(o=h.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(n(314))}l!==null&&l.delete(s),S0(i,o)}function X2(i,s){return Sn(i,s)}var Lc=null,Ho=null,af=!1,zc=!1,lf=!1,Gs=0;function Ar(i){i!==Ho&&i.next===null&&(Ho===null?Lc=Ho=i:Ho=Ho.next=i),zc=!0,af||(af=!0,Q2())}function Va(i,s){if(!lf&&zc){lf=!0;do for(var o=!1,l=Lc;l!==null;){if(i!==0){var h=l.pendingLanes;if(h===0)var p=0;else{var b=l.suspendedLanes,E=l.pingedLanes;p=(1<<31-Ut(42|i)+1)-1,p&=h&~(b&~E),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(o=!0,E0(l,p))}else p=He,p=xe(l,l===nt?p:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(p&3)===0||Ge(l,p)||(o=!0,E0(l,p));l=l.next}while(o);lf=!1}}function Z2(){w0()}function w0(){zc=af=!1;var i=0;Gs!==0&&lE()&&(i=Gs);for(var s=ei(),o=null,l=Lc;l!==null;){var h=l.next,p=x0(l,s);p===0?(l.next=null,o===null?Lc=h:o.next=h,h===null&&(Ho=o)):(o=l,(i!==0||(p&3)!==0)&&(zc=!0)),l=h}Bt!==0&&Bt!==5||Va(i),Gs!==0&&(Gs=0)}function x0(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,h=i.expirationTimes,p=i.pendingLanes&-62914561;0<p;){var b=31-Ut(p),E=1<<b,B=h[b];B===-1?((E&o)===0||(E&l)!==0)&&(h[b]=gt(E,s)):B<=s&&(i.expiredLanes|=E),p&=~E}if(s=nt,o=He,o=xe(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(Xe===2||Xe===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&wn(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||Ge(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&wn(l),Ni(o)){case 2:case 8:o=to;break;case 32:o=Xr;break;case 268435456:o=dr;break;default:o=Xr}return l=C0.bind(null,i),o=Sn(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&wn(l),i.callbackPriority=2,i.callbackNode=null,2}function C0(i,s){if(Bt!==0&&Bt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Bc()&&i.callbackNode!==o)return null;var l=He;return l=xe(i,i===nt?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(n0(i,l,s),x0(i,ei()),i.callbackNode!=null&&i.callbackNode===o?C0.bind(null,i):null)}function E0(i,s){if(Bc())return null;n0(i,s,!0)}function Q2(){uE(function(){(qe&6)!==0?Sn(Gr,Z2):w0()})}function cf(){if(Gs===0){var i=xo;i===0&&(i=Te,Te<<=1,(Te&261888)===0&&(Te=256)),Gs=i}return Gs}function R0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Wl(""+i)}function k0(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function J2(i,s,o,l,h){if(s==="submit"&&o&&o.stateNode===h){var p=R0((h[yi]||null).action),b=l.submitter;b&&(s=(s=b[yi]||null)?R0(s.formAction):b.getAttribute("formAction"),s!==null&&(p=s,b=null));var E=new Kl("action","action",null,l,h);i.push({event:E,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Gs!==0){var B=b?k0(h,b):new FormData(h);Td(o,{pending:!0,data:B,method:h.method,action:p},null,B)}}else typeof p=="function"&&(E.preventDefault(),B=b?k0(h,b):new FormData(h),Td(o,{pending:!0,data:B,method:h.method,action:p},p,B))},currentTarget:h}]})}}for(var uf=0;uf<qh.length;uf++){var hf=qh[uf],eE=hf.toLowerCase(),tE=hf[0].toUpperCase()+hf.slice(1);mr(eE,"on"+tE)}mr(sg,"onAnimationEnd"),mr(ng,"onAnimationIteration"),mr(og,"onAnimationStart"),mr("dblclick","onDoubleClick"),mr("focusin","onFocus"),mr("focusout","onBlur"),mr(g2,"onTransitionRun"),mr(v2,"onTransitionStart"),mr(y2,"onTransitionCancel"),mr(ag,"onTransitionEnd"),lo("onMouseEnter",["mouseout","mouseover"]),lo("onMouseLeave",["mouseout","mouseover"]),lo("onPointerEnter",["pointerout","pointerover"]),lo("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ya="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(" "),iE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ya));function T0(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],h=l.event;l=l.listeners;e:{var p=void 0;if(s)for(var b=l.length-1;0<=b;b--){var E=l[b],B=E.instance,K=E.currentTarget;if(E=E.listener,B!==p&&h.isPropagationStopped())break e;p=E,h.currentTarget=K;try{p(h)}catch(te){Zl(te)}h.currentTarget=null,p=B}else for(b=0;b<l.length;b++){if(E=l[b],B=E.instance,K=E.currentTarget,E=E.listener,B!==p&&h.isPropagationStopped())break e;p=E,h.currentTarget=K;try{p(h)}catch(te){Zl(te)}h.currentTarget=null,p=B}}}}function je(i,s){var o=s[xh];o===void 0&&(o=s[xh]=new Set);var l=i+"__bubble";o.has(l)||(A0(s,i,2,!1),o.add(l))}function df(i,s,o){var l=0;s&&(l|=4),A0(o,i,l,s)}var jc="_reactListening"+Math.random().toString(36).slice(2);function ff(i){if(!i[jc]){i[jc]=!0,w_.forEach(function(o){o!=="selectionchange"&&(iE.has(o)||df(o,!1,i),df(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[jc]||(s[jc]=!0,df("selectionchange",!1,s))}}function A0(i,s,o,l){switch(sy(s)){case 2:var h=DE;break;case 8:h=ME;break;default:h=Tf}o=h.bind(null,s,o,i),h=void 0,!Nh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),l?h!==void 0?i.addEventListener(s,o,{capture:!0,passive:h}):i.addEventListener(s,o,!0):h!==void 0?i.addEventListener(s,o,{passive:h}):i.addEventListener(s,o,!1)}function mf(i,s,o,l,h){var p=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var E=l.stateNode.containerInfo;if(E===h)break;if(b===4)for(b=l.return;b!==null;){var B=b.tag;if((B===3||B===4)&&b.stateNode.containerInfo===h)return;b=b.return}for(;E!==null;){if(b=no(E),b===null)return;if(B=b.tag,B===5||B===6||B===26||B===27){l=p=b;continue e}E=E.parentNode}}l=l.return}B_(function(){var K=p,te=Dh(o),ne=[];e:{var Z=lg.get(i);if(Z!==void 0){var J=Kl,ge=i;switch(i){case"keypress":if(Vl(o)===0)break e;case"keydown":case"keyup":J=GC;break;case"focusin":ge="focus",J=zh;break;case"focusout":ge="blur",J=zh;break;case"beforeblur":case"afterblur":J=zh;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":J=j_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=jC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=QC;break;case sg:case ng:case og:J=UC;break;case ag:J=e2;break;case"scroll":case"scrollend":J=LC;break;case"wheel":J=i2;break;case"copy":case"cut":case"paste":J=$C;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=P_;break;case"toggle":case"beforetoggle":J=s2}var Ce=(s&4)!==0,it=!Ce&&(i==="scroll"||i==="scrollend"),V=Ce?Z!==null?Z+"Capture":null:Z;Ce=[];for(var I=K,Y;I!==null;){var ie=I;if(Y=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Y===null||V===null||(ie=pa(I,V),ie!=null&&Ce.push(Ka(I,ie,Y))),it)break;I=I.return}0<Ce.length&&(Z=new J(Z,ge,null,o,te),ne.push({event:Z,listeners:Ce}))}}if((s&7)===0){e:{if(Z=i==="mouseover"||i==="pointerover",J=i==="mouseout"||i==="pointerout",Z&&o!==Ah&&(ge=o.relatedTarget||o.fromElement)&&(no(ge)||ge[so]))break e;if((J||Z)&&(Z=te.window===te?te:(Z=te.ownerDocument)?Z.defaultView||Z.parentWindow:window,J?(ge=o.relatedTarget||o.toElement,J=K,ge=ge?no(ge):null,ge!==null&&(it=c(ge),Ce=ge.tag,ge!==it||Ce!==5&&Ce!==27&&Ce!==6)&&(ge=null)):(J=null,ge=K),J!==ge)){if(Ce=j_,ie="onMouseLeave",V="onMouseEnter",I="mouse",(i==="pointerout"||i==="pointerover")&&(Ce=P_,ie="onPointerLeave",V="onPointerEnter",I="pointer"),it=J==null?Z:ma(J),Y=ge==null?Z:ma(ge),Z=new Ce(ie,I+"leave",J,o,te),Z.target=it,Z.relatedTarget=Y,ie=null,no(te)===K&&(Ce=new Ce(V,I+"enter",ge,o,te),Ce.target=Y,Ce.relatedTarget=it,ie=Ce),it=ie,J&&ge)t:{for(Ce=rE,V=J,I=ge,Y=0,ie=V;ie;ie=Ce(ie))Y++;ie=0;for(var we=I;we;we=Ce(we))ie++;for(;0<Y-ie;)V=Ce(V),Y--;for(;0<ie-Y;)I=Ce(I),ie--;for(;Y--;){if(V===I||I!==null&&V===I.alternate){Ce=V;break t}V=Ce(V),I=Ce(I)}Ce=null}else Ce=null;J!==null&&D0(ne,Z,J,Ce,!1),ge!==null&&it!==null&&D0(ne,it,ge,Ce,!0)}}e:{if(Z=K?ma(K):window,J=Z.nodeName&&Z.nodeName.toLowerCase(),J==="select"||J==="input"&&Z.type==="file")var Fe=Y_;else if(q_(Z))if(K_)Fe=m2;else{Fe=d2;var be=h2}else J=Z.nodeName,!J||J.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?K&&Th(K.elementType)&&(Fe=Y_):Fe=f2;if(Fe&&(Fe=Fe(i,K))){V_(ne,Fe,o,te);break e}be&&be(i,Z,K),i==="focusout"&&K&&Z.type==="number"&&K.memoizedProps.value!=null&&kh(Z,"number",Z.value)}switch(be=K?ma(K):window,i){case"focusin":(q_(be)||be.contentEditable==="true")&&(po=be,$h=K,xa=null);break;case"focusout":xa=$h=po=null;break;case"mousedown":Fh=!0;break;case"contextmenu":case"mouseup":case"dragend":Fh=!1,ig(ne,o,te);break;case"selectionchange":if(_2)break;case"keydown":case"keyup":ig(ne,o,te)}var De;if(Hh)e:{switch(i){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else mo?F_(i,o)&&(Pe="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(Pe="onCompositionStart");Pe&&(U_&&o.locale!=="ko"&&(mo||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&mo&&(De=L_()):(Os=te,Oh="value"in Os?Os.value:Os.textContent,mo=!0)),be=Hc(K,Pe),0<be.length&&(Pe=new H_(Pe,i,null,o,te),ne.push({event:Pe,listeners:be}),De?Pe.data=De:(De=W_(o),De!==null&&(Pe.data=De)))),(De=o2?a2(i,o):l2(i,o))&&(Pe=Hc(K,"onBeforeInput"),0<Pe.length&&(be=new H_("onBeforeInput","beforeinput",null,o,te),ne.push({event:be,listeners:Pe}),be.data=De)),J2(ne,i,K,o,te)}T0(ne,s)})}function Ka(i,s,o){return{instance:i,listener:s,currentTarget:o}}function Hc(i,s){for(var o=s+"Capture",l=[];i!==null;){var h=i,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=pa(i,o),h!=null&&l.unshift(Ka(i,h,p)),h=pa(i,s),h!=null&&l.push(Ka(i,h,p))),i.tag===3)return l;i=i.return}return[]}function rE(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function D0(i,s,o,l,h){for(var p=s._reactName,b=[];o!==null&&o!==l;){var E=o,B=E.alternate,K=E.stateNode;if(E=E.tag,B!==null&&B===l)break;E!==5&&E!==26&&E!==27||K===null||(B=K,h?(K=pa(o,p),K!=null&&b.unshift(Ka(o,K,B))):h||(K=pa(o,p),K!=null&&b.push(Ka(o,K,B)))),o=o.return}b.length!==0&&i.push({event:s,listeners:b})}var sE=/\r\n?/g,nE=/\u0000|\uFFFD/g;function M0(i){return(typeof i=="string"?i:""+i).replace(sE,`
`).replace(nE,"")}function N0(i,s){return s=M0(s),M0(i)===s}function tt(i,s,o,l,h,p){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||uo(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&uo(i,""+l);break;case"className":$l(i,"class",l);break;case"tabIndex":$l(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":$l(i,o,l);break;case"style":N_(i,l,p);break;case"data":if(s!=="object"){$l(i,"data",l);break}case"src":case"href":if(l===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Wl(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.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 p=="function"&&(o==="formAction"?(s!=="input"&&tt(i,s,"name",h.name,h,null),tt(i,s,"formEncType",h.formEncType,h,null),tt(i,s,"formMethod",h.formMethod,h,null),tt(i,s,"formTarget",h.formTarget,h,null)):(tt(i,s,"encType",h.encType,h,null),tt(i,s,"method",h.method,h,null),tt(i,s,"target",h.target,h,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Wl(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=Jr);break;case"onScroll":l!=null&&je("scroll",i);break;case"onScrollEnd":l!=null&&je("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(n(61));if(o=l.__html,o!=null){if(h.children!=null)throw Error(n(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=Wl(""+l),i.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":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.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":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":je("beforetoggle",i),je("toggle",i),Il(i,"popover",l);break;case"xlinkActuate":Qr(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qr(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qr(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qr(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qr(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qr(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qr(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Il(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=OC.get(o)||o,Il(i,o,l))}}function pf(i,s,o,l,h,p){switch(o){case"style":N_(i,l,p);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(n(61));if(o=l.__html,o!=null){if(h.children!=null)throw Error(n(60));i.innerHTML=o}}break;case"children":typeof l=="string"?uo(i,l):(typeof l=="number"||typeof l=="bigint")&&uo(i,""+l);break;case"onScroll":l!=null&&je("scroll",i);break;case"onScrollEnd":l!=null&&je("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Jr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!x_.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),s=o.slice(2,h?o.length-7:void 0),p=i[yi]||null,p=p!=null?p[o]:null,typeof p=="function"&&i.removeEventListener(s,p,h),typeof l=="function")){typeof p!="function"&&p!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,l,h);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):Il(i,o,l)}}}function ni(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",i),je("load",i);var l=!1,h=!1,p;for(p in o)if(o.hasOwnProperty(p)){var b=o[p];if(b!=null)switch(p){case"src":l=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,s));default:tt(i,s,p,b,o,null)}}h&&tt(i,s,"srcSet",o.srcSet,o,null),l&&tt(i,s,"src",o.src,o,null);return;case"input":je("invalid",i);var E=p=b=h=null,B=null,K=null;for(l in o)if(o.hasOwnProperty(l)){var te=o[l];if(te!=null)switch(l){case"name":h=te;break;case"type":b=te;break;case"checked":B=te;break;case"defaultChecked":K=te;break;case"value":p=te;break;case"defaultValue":E=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(n(137,s));break;default:tt(i,s,l,te,o,null)}}T_(i,p,E,B,K,b,h,!1);return;case"select":je("invalid",i),l=b=p=null;for(h in o)if(o.hasOwnProperty(h)&&(E=o[h],E!=null))switch(h){case"value":p=E;break;case"defaultValue":b=E;break;case"multiple":l=E;default:tt(i,s,h,E,o,null)}s=p,o=b,i.multiple=!!l,s!=null?co(i,!!l,s,!1):o!=null&&co(i,!!l,o,!0);return;case"textarea":je("invalid",i),p=h=l=null;for(b in o)if(o.hasOwnProperty(b)&&(E=o[b],E!=null))switch(b){case"value":l=E;break;case"defaultValue":h=E;break;case"children":p=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(n(91));break;default:tt(i,s,b,E,o,null)}D_(i,l,h,p);return;case"option":for(B in o)o.hasOwnProperty(B)&&(l=o[B],l!=null)&&(B==="selected"?i.selected=l&&typeof l!="function"&&typeof l!="symbol":tt(i,s,B,l,o,null));return;case"dialog":je("beforetoggle",i),je("toggle",i),je("cancel",i),je("close",i);break;case"iframe":case"object":je("load",i);break;case"video":case"audio":for(l=0;l<Ya.length;l++)je(Ya[l],i);break;case"image":je("error",i),je("load",i);break;case"details":je("toggle",i);break;case"embed":case"source":case"link":je("error",i),je("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in o)if(o.hasOwnProperty(K)&&(l=o[K],l!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,s));default:tt(i,s,K,l,o,null)}return;default:if(Th(s)){for(te in o)o.hasOwnProperty(te)&&(l=o[te],l!==void 0&&pf(i,s,te,l,o,void 0));return}}for(E in o)o.hasOwnProperty(E)&&(l=o[E],l!=null&&tt(i,s,E,l,o,null))}function oE(i,s,o,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,b=null,E=null,B=null,K=null,te=null;for(J in o){var ne=o[J];if(o.hasOwnProperty(J)&&ne!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":B=ne;default:l.hasOwnProperty(J)||tt(i,s,J,null,l,ne)}}for(var Z in l){var J=l[Z];if(ne=o[Z],l.hasOwnProperty(Z)&&(J!=null||ne!=null))switch(Z){case"type":p=J;break;case"name":h=J;break;case"checked":K=J;break;case"defaultChecked":te=J;break;case"value":b=J;break;case"defaultValue":E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(n(137,s));break;default:J!==ne&&tt(i,s,Z,J,l,ne)}}Rh(i,b,E,B,K,te,p,h);return;case"select":J=b=E=Z=null;for(p in o)if(B=o[p],o.hasOwnProperty(p)&&B!=null)switch(p){case"value":break;case"multiple":J=B;default:l.hasOwnProperty(p)||tt(i,s,p,null,l,B)}for(h in l)if(p=l[h],B=o[h],l.hasOwnProperty(h)&&(p!=null||B!=null))switch(h){case"value":Z=p;break;case"defaultValue":E=p;break;case"multiple":b=p;default:p!==B&&tt(i,s,h,p,l,B)}s=E,o=b,l=J,Z!=null?co(i,!!o,Z,!1):!!l!=!!o&&(s!=null?co(i,!!o,s,!0):co(i,!!o,o?[]:"",!1));return;case"textarea":J=Z=null;for(E in o)if(h=o[E],o.hasOwnProperty(E)&&h!=null&&!l.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:tt(i,s,E,null,l,h)}for(b in l)if(h=l[b],p=o[b],l.hasOwnProperty(b)&&(h!=null||p!=null))switch(b){case"value":Z=h;break;case"defaultValue":J=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(n(91));break;default:h!==p&&tt(i,s,b,h,l,p)}A_(i,Z,J);return;case"option":for(var ge in o)Z=o[ge],o.hasOwnProperty(ge)&&Z!=null&&!l.hasOwnProperty(ge)&&(ge==="selected"?i.selected=!1:tt(i,s,ge,null,l,Z));for(B in l)Z=l[B],J=o[B],l.hasOwnProperty(B)&&Z!==J&&(Z!=null||J!=null)&&(B==="selected"?i.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":tt(i,s,B,Z,l,J));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in o)Z=o[Ce],o.hasOwnProperty(Ce)&&Z!=null&&!l.hasOwnProperty(Ce)&&tt(i,s,Ce,null,l,Z);for(K in l)if(Z=l[K],J=o[K],l.hasOwnProperty(K)&&Z!==J&&(Z!=null||J!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(n(137,s));break;default:tt(i,s,K,Z,l,J)}return;default:if(Th(s)){for(var it in o)Z=o[it],o.hasOwnProperty(it)&&Z!==void 0&&!l.hasOwnProperty(it)&&pf(i,s,it,void 0,l,Z);for(te in l)Z=l[te],J=o[te],!l.hasOwnProperty(te)||Z===J||Z===void 0&&J===void 0||pf(i,s,te,Z,l,J);return}}for(var V in o)Z=o[V],o.hasOwnProperty(V)&&Z!=null&&!l.hasOwnProperty(V)&&tt(i,s,V,null,l,Z);for(ne in l)Z=l[ne],J=o[ne],!l.hasOwnProperty(ne)||Z===J||Z==null&&J==null||tt(i,s,ne,Z,l,J)}function O0(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aE(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var h=o[l],p=h.transferSize,b=h.initiatorType,E=h.duration;if(p&&E&&O0(b)){for(b=0,E=h.responseEnd,l+=1;l<o.length;l++){var B=o[l],K=B.startTime;if(K>E)break;var te=B.transferSize,ne=B.initiatorType;te&&O0(ne)&&(B=B.responseEnd,b+=te*(B<E?1:(E-K)/(B-K)))}if(--l,s+=8*(p+b)/(h.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var _f=null,gf=null;function Pc(i){return i.nodeType===9?i:i.ownerDocument}function B0(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function L0(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function vf(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var yf=null;function lE(){var i=window.event;return i&&i.type==="popstate"?i===yf?!1:(yf=i,!0):(yf=null,!1)}var z0=typeof setTimeout=="function"?setTimeout:void 0,cE=typeof clearTimeout=="function"?clearTimeout:void 0,j0=typeof Promise=="function"?Promise:void 0,uE=typeof queueMicrotask=="function"?queueMicrotask:typeof j0<"u"?function(i){return j0.resolve(null).then(i).catch(hE)}:z0;function hE(i){setTimeout(function(){throw i})}function Xs(i){return i==="head"}function H0(i,s){var o=s,l=0;do{var h=o.nextSibling;if(i.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"||o==="/&"){if(l===0){i.removeChild(h),$o(s);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")Ga(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,Ga(o);for(var p=o.firstChild;p;){var b=p.nextSibling,E=p.nodeName;p[fa]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&p.rel.toLowerCase()==="stylesheet"||o.removeChild(p),p=b}}else o==="body"&&Ga(i.ownerDocument.body);o=h}while(o);$o(s)}function P0(i,s){var o=i;i=0;do{var l=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=l}while(o)}function bf(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":bf(o),Ch(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function dE(i,s,o,l){for(;i.nodeType===1;){var h=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[fa])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(p=i.getAttribute("rel"),p==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(p!==h.rel||i.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||i.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||i.getAttribute("title")!==(h.title==null?null:h.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(p=i.getAttribute("src"),(p!==(h.src==null?null:h.src)||i.getAttribute("type")!==(h.type==null?null:h.type)||i.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&i.getAttribute("name")===p)return i}else return i;if(i=tr(i.nextSibling),i===null)break}return null}function fE(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=tr(i.nextSibling),i===null))return null;return i}function U0(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=tr(i.nextSibling),i===null))return null;return i}function Sf(i){return i.data==="$?"||i.data==="$~"}function wf(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function mE(i,s){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||o.readyState!=="loading")s();else{var l=function(){s(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function tr(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var xf=null;function I0(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return tr(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function $0(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return i;s--}else o!=="/$"&&o!=="/&"||s++}i=i.previousSibling}return null}function F0(i,s,o){switch(s=Pc(o),i){case"html":if(i=s.documentElement,!i)throw Error(n(452));return i;case"head":if(i=s.head,!i)throw Error(n(453));return i;case"body":if(i=s.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function Ga(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Ch(i)}var ir=new Map,W0=new Set;function Uc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ps=L.d;L.d={f:pE,r:_E,D:gE,C:vE,L:yE,m:bE,X:wE,S:SE,M:xE};function pE(){var i=ps.f(),s=Mc();return i||s}function _E(i){var s=oo(i);s!==null&&s.tag===5&&s.type==="form"?av(s):ps.r(i)}var Po=typeof document>"u"?null:document;function q0(i,s,o){var l=Po;if(l&&typeof s=="string"&&s){var h=Ki(s);h='link[rel="'+i+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),W0.has(h)||(W0.add(h),i={rel:i,crossOrigin:o,href:s},l.querySelector(h)===null&&(s=l.createElement("link"),ni(s,"link",i),Ft(s),l.head.appendChild(s)))}}function gE(i){ps.D(i),q0("dns-prefetch",i,null)}function vE(i,s){ps.C(i,s),q0("preconnect",i,s)}function yE(i,s,o){ps.L(i,s,o);var l=Po;if(l&&i&&s){var h='link[rel="preload"][as="'+Ki(s)+'"]';s==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Ki(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Ki(o.imageSizes)+'"]')):h+='[href="'+Ki(i)+'"]';var p=h;switch(s){case"style":p=Uo(i);break;case"script":p=Io(i)}ir.has(p)||(i=_({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),ir.set(p,i),l.querySelector(h)!==null||s==="style"&&l.querySelector(Xa(p))||s==="script"&&l.querySelector(Za(p))||(s=l.createElement("link"),ni(s,"link",i),Ft(s),l.head.appendChild(s)))}}function bE(i,s){ps.m(i,s);var o=Po;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+Ki(l)+'"][href="'+Ki(i)+'"]',p=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Io(i)}if(!ir.has(p)&&(i=_({rel:"modulepreload",href:i},s),ir.set(p,i),o.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Za(p)))return}l=o.createElement("link"),ni(l,"link",i),Ft(l),o.head.appendChild(l)}}}function SE(i,s,o){ps.S(i,s,o);var l=Po;if(l&&i){var h=ao(l).hoistableStyles,p=Uo(i);s=s||"default";var b=h.get(p);if(!b){var E={loading:0,preload:null};if(b=l.querySelector(Xa(p)))E.loading=5;else{i=_({rel:"stylesheet",href:i,"data-precedence":s},o),(o=ir.get(p))&&Cf(i,o);var B=b=l.createElement("link");Ft(B),ni(B,"link",i),B._p=new Promise(function(K,te){B.onload=K,B.onerror=te}),B.addEventListener("load",function(){E.loading|=1}),B.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ic(b,s,l)}b={type:"stylesheet",instance:b,count:1,state:E},h.set(p,b)}}}function wE(i,s){ps.X(i,s);var o=Po;if(o&&i){var l=ao(o).hoistableScripts,h=Io(i),p=l.get(h);p||(p=o.querySelector(Za(h)),p||(i=_({src:i,async:!0},s),(s=ir.get(h))&&Ef(i,s),p=o.createElement("script"),Ft(p),ni(p,"link",i),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(h,p))}}function xE(i,s){ps.M(i,s);var o=Po;if(o&&i){var l=ao(o).hoistableScripts,h=Io(i),p=l.get(h);p||(p=o.querySelector(Za(h)),p||(i=_({src:i,async:!0,type:"module"},s),(s=ir.get(h))&&Ef(i,s),p=o.createElement("script"),Ft(p),ni(p,"link",i),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(h,p))}}function V0(i,s,o,l){var h=(h=ae.current)?Uc(h):null;if(!h)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=Uo(o.href),o=ao(h).hoistableStyles,l=o.get(s),l||(l={type:"style",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=Uo(o.href);var p=ao(h).hoistableStyles,b=p.get(i);if(b||(h=h.ownerDocument||h,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(i,b),(p=h.querySelector(Xa(i)))&&!p._p&&(b.instance=p,b.state.loading=5),ir.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},ir.set(i,o),p||CE(h,i,o,b.state))),s&&l===null)throw Error(n(528,""));return b}if(s&&l!==null)throw Error(n(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Io(o),o=ao(h).hoistableScripts,l=o.get(s),l||(l={type:"script",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function Uo(i){return'href="'+Ki(i)+'"'}function Xa(i){return'link[rel="stylesheet"]['+i+"]"}function Y0(i){return _({},i,{"data-precedence":i.precedence,precedence:null})}function CE(i,s,o,l){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=i.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),ni(s,"link",o),Ft(s),i.head.appendChild(s))}function Io(i){return'[src="'+Ki(i)+'"]'}function Za(i){return"script[async]"+i}function K0(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var l=i.querySelector('style[data-href~="'+Ki(o.href)+'"]');if(l)return s.instance=l,Ft(l),l;var h=_({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),Ft(l),ni(l,"style",h),Ic(l,o.precedence,i),s.instance=l;case"stylesheet":h=Uo(o.href);var p=i.querySelector(Xa(h));if(p)return s.state.loading|=4,s.instance=p,Ft(p),p;l=Y0(o),(h=ir.get(h))&&Cf(l,h),p=(i.ownerDocument||i).createElement("link"),Ft(p);var b=p;return b._p=new Promise(function(E,B){b.onload=E,b.onerror=B}),ni(p,"link",l),s.state.loading|=4,Ic(p,o.precedence,i),s.instance=p;case"script":return p=Io(o.src),(h=i.querySelector(Za(p)))?(s.instance=h,Ft(h),h):(l=o,(h=ir.get(p))&&(l=_({},o),Ef(l,h)),i=i.ownerDocument||i,h=i.createElement("script"),Ft(h),ni(h,"link",l),i.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(n(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,Ic(l,o.precedence,i));return s.instance}function Ic(i,s,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,p=h,b=0;b<l.length;b++){var E=l[b];if(E.dataset.precedence===s)p=E;else if(p!==h)break}p?p.parentNode.insertBefore(i,p.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function Cf(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Ef(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var $c=null;function G0(i,s,o){if($c===null){var l=new Map,h=$c=new Map;h.set(o,l)}else h=$c,l=h.get(o),l||(l=new Map,h.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),h=0;h<o.length;h++){var p=o[h];if(!(p[fa]||p[ti]||i==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var b=p.getAttribute(s)||"";b=i+b;var E=l.get(b);E?E.push(p):l.set(b,[p])}}return l}function X0(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function EE(i,s,o){if(o===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Z0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function RE(i,s,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var h=Uo(l.href),p=s.querySelector(Xa(h));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Fc.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=p,Ft(p);return}p=s.ownerDocument||s,l=Y0(l),(h=ir.get(h))&&Cf(l,h),p=p.createElement("link"),Ft(p);var b=p;b._p=new Promise(function(E,B){b.onload=E,b.onerror=B}),ni(p,"link",l),o.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Fc.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var Rf=0;function kE(i,s){return i.stylesheets&&i.count===0&&qc(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var l=setTimeout(function(){if(i.stylesheets&&qc(i,i.stylesheets),i.unsuspend){var p=i.unsuspend;i.unsuspend=null,p()}},6e4+s);0<i.imgBytes&&Rf===0&&(Rf=62500*aE());var h=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&qc(i,i.stylesheets),i.unsuspend)){var p=i.unsuspend;i.unsuspend=null,p()}},(i.imgBytes>Rf?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function Fc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Wc=null;function qc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Wc=new Map,s.forEach(TE,i),Wc=null,Fc.call(i))}function TE(i,s){if(!(s.state.loading&4)){var o=Wc.get(i);if(o)var l=o.get(null);else{o=new Map,Wc.set(i,o);for(var h=i.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var b=h[p];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(o.set(b.dataset.precedence,b),l=b)}l&&o.set(null,l)}h=s.instance,b=h.getAttribute("data-precedence"),p=o.get(b)||l,p===l&&o.set(null,h),o.set(b,h),this.count++,l=Fc.bind(this),h.addEventListener("load",l),h.addEventListener("error",l),p?p.parentNode.insertBefore(h,p.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(h,i.firstChild)),s.state.loading|=4}}var Qa={$$typeof:z,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function AE(i,s,o,l,h,p,b,E,B){this.tag=1,this.containerInfo=i,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=Er(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Er(0),this.hiddenUpdates=Er(null),this.identifierPrefix=l,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Q0(i,s,o,l,h,p,b,E,B,K,te,ne){return i=new AE(i,s,o,b,B,K,te,ne,E),s=1,p===!0&&(s|=24),p=Bi(3,null,null,s),i.current=p,p.stateNode=i,s=sd(),s.refCount++,i.pooledCache=s,s.refCount++,p.memoizedState={element:l,isDehydrated:o,cache:s},ld(p),i}function J0(i){return i?(i=vo,i):vo}function ey(i,s,o,l,h,p){h=J0(h),l.context===null?l.context=h:l.pendingContext=h,l=Ps(s),l.payload={element:o},p=p===void 0?null:p,p!==null&&(l.callback=p),o=Us(i,l,s),o!==null&&(Ei(o,i,s),Da(o,i,s))}function ty(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function kf(i,s){ty(i,s),(i=i.alternate)&&ty(i,s)}function iy(i){if(i.tag===13||i.tag===31){var s=kn(i,67108864);s!==null&&Ei(s,i,67108864),kf(i,67108864)}}function ry(i){if(i.tag===13||i.tag===31){var s=Pi();s=Ms(s);var o=kn(i,s);o!==null&&Ei(o,i,s),kf(i,s)}}var Vc=!0;function DE(i,s,o,l){var h=R.T;R.T=null;var p=L.p;try{L.p=2,Tf(i,s,o,l)}finally{L.p=p,R.T=h}}function ME(i,s,o,l){var h=R.T;R.T=null;var p=L.p;try{L.p=8,Tf(i,s,o,l)}finally{L.p=p,R.T=h}}function Tf(i,s,o,l){if(Vc){var h=Af(l);if(h===null)mf(i,s,l,Yc,o),ny(i,l);else if(OE(h,i,s,o,l))l.stopPropagation();else if(ny(i,l),s&4&&-1<NE.indexOf(i)){for(;h!==null;){var p=oo(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var b=Ye(p.pendingLanes);if(b!==0){var E=p;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var B=1<<31-Ut(b);E.entanglements[1]|=B,b&=~B}Ar(p),(qe&6)===0&&(Ac=ei()+500,Va(0))}}break;case 31:case 13:E=kn(p,2),E!==null&&Ei(E,p,2),Mc(),kf(p,2)}if(p=Af(l),p===null&&mf(i,s,l,Yc,o),p===h)break;h=p}h!==null&&l.stopPropagation()}else mf(i,s,l,null,o)}}function Af(i){return i=Dh(i),Df(i)}var Yc=null;function Df(i){if(Yc=null,i=no(i),i!==null){var s=c(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=u(s),i!==null)return i;i=null}else if(o===31){if(i=f(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Yc=i,null}function sy(i){switch(i){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(da()){case Gr:return 2;case to:return 8;case Xr:case hr:return 32;case dr:return 268435456;default:return 32}default:return 32}}var Mf=!1,Zs=null,Qs=null,Js=null,Ja=new Map,el=new Map,en=[],NE="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 ny(i,s){switch(i){case"focusin":case"focusout":Zs=null;break;case"dragenter":case"dragleave":Qs=null;break;case"mouseover":case"mouseout":Js=null;break;case"pointerover":case"pointerout":Ja.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":el.delete(s.pointerId)}}function tl(i,s,o,l,h,p){return i===null||i.nativeEvent!==p?(i={blockedOn:s,domEventName:o,eventSystemFlags:l,nativeEvent:p,targetContainers:[h]},s!==null&&(s=oo(s),s!==null&&iy(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),i)}function OE(i,s,o,l,h){switch(s){case"focusin":return Zs=tl(Zs,i,s,o,l,h),!0;case"dragenter":return Qs=tl(Qs,i,s,o,l,h),!0;case"mouseover":return Js=tl(Js,i,s,o,l,h),!0;case"pointerover":var p=h.pointerId;return Ja.set(p,tl(Ja.get(p)||null,i,s,o,l,h)),!0;case"gotpointercapture":return p=h.pointerId,el.set(p,tl(el.get(p)||null,i,s,o,l,h)),!0}return!1}function oy(i){var s=no(i.target);if(s!==null){var o=c(s);if(o!==null){if(s=o.tag,s===13){if(s=u(o),s!==null){i.blockedOn=s,b_(i.priority,function(){ry(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,b_(i.priority,function(){ry(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Kc(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=Af(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);Ah=l,o.target.dispatchEvent(l),Ah=null}else return s=oo(o),s!==null&&iy(s),i.blockedOn=o,!1;s.shift()}return!0}function ay(i,s,o){Kc(i)&&o.delete(s)}function BE(){Mf=!1,Zs!==null&&Kc(Zs)&&(Zs=null),Qs!==null&&Kc(Qs)&&(Qs=null),Js!==null&&Kc(Js)&&(Js=null),Ja.forEach(ay),el.forEach(ay)}function Gc(i,s){i.blockedOn===s&&(i.blockedOn=null,Mf||(Mf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,BE)))}var Xc=null;function ly(i){Xc!==i&&(Xc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Xc===i&&(Xc=null);for(var s=0;s<i.length;s+=3){var o=i[s],l=i[s+1],h=i[s+2];if(typeof l!="function"){if(Df(l||o)===null)continue;break}var p=oo(o);p!==null&&(i.splice(s,3),s-=3,Td(p,{pending:!0,data:h,method:o.method,action:l},l,h))}}))}function $o(i){function s(B){return Gc(B,i)}Zs!==null&&Gc(Zs,i),Qs!==null&&Gc(Qs,i),Js!==null&&Gc(Js,i),Ja.forEach(s),el.forEach(s);for(var o=0;o<en.length;o++){var l=en[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<en.length&&(o=en[0],o.blockedOn===null);)oy(o),o.blockedOn===null&&en.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var h=o[l],p=o[l+1],b=h[yi]||null;if(typeof p=="function")b||ly(o);else if(b){var E=null;if(p&&p.hasAttribute("formAction")){if(h=p,b=p[yi]||null)E=b.formAction;else if(Df(h)!==null)continue}else E=b.action;typeof E=="function"?o[l+1]=E:(o.splice(l,3),l-=3),ly(o)}}}function cy(){function i(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(b){return h=b})},focusReset:"manual",scroll:"manual"})}function s(){h!==null&&(h(),h=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,h=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),h!==null&&(h(),h=null)}}}function Nf(i){this._internalRoot=i}Zc.prototype.render=Nf.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(n(409));var o=s.current,l=Pi();ey(o,l,i,s,null,null)},Zc.prototype.unmount=Nf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;ey(i.current,2,null,i,null,null),Mc(),s[so]=null}};function Zc(i){this._internalRoot=i}Zc.prototype.unstable_scheduleHydration=function(i){if(i){var s=wh();i={blockedOn:null,target:i,priority:s};for(var o=0;o<en.length&&s!==0&&s<en[o].priority;o++);en.splice(o,0,i),o===0&&oy(i)}};var uy=t.version;if(uy!=="19.2.4")throw Error(n(527,uy,"19.2.4"));L.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=d(s),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var LE={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qc.isDisabled&&Qc.supportsFiber)try{Zr=Qc.inject(LE),Pt=Qc}catch{}}return rl.createRoot=function(i,s){if(!a(i))throw Error(n(299));var o=!1,l="",h=gv,p=vv,b=yv;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(b=s.onRecoverableError)),s=Q0(i,1,!1,null,null,o,l,null,h,p,b,cy),i[so]=s.current,ff(i),new Nf(s)},rl.hydrateRoot=function(i,s,o){if(!a(i))throw Error(n(299));var l=!1,h="",p=gv,b=vv,E=yv,B=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError),o.formState!==void 0&&(B=o.formState)),s=Q0(i,1,!0,s,o??null,l,h,B,p,b,E,cy),s.context=J0(null),o=s.current,l=Pi(),l=Ms(l),h=Ps(l),h.callback=null,Us(o,h,l),o=l,s.current.lanes=o,st(s,o),Ar(s),i[so]=s.current,ff(i),new Zc(s)},rl.version="19.2.4",rl}var by;function qE(){if(by)return Lf.exports;by=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Lf.exports=WE(),Lf.exports}var VE=qE();const gS=y.createContext(void 0);function YE({children:e}){const[t,r]=y.useState("loading"),n=async()=>{try{if((await(await fetch("/api/auth/status",{credentials:"include"})).json()).needsSetup){r("needsSetup");return}(await fetch("/api/auth/check",{credentials:"include"})).ok?r("authenticated"):r("notAuthenticated")}catch{r("notAuthenticated")}};y.useEffect(()=>{n()},[]);const a=async(f,m)=>{try{const d=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:f,password:m})}),g=await d.json();return d.ok&&g.success?(r("authenticated"),{success:!0}):{success:!1,error:g.error||"Login failed"}}catch{return{success:!1,error:"Network error. Please try again."}}},c=async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch(f){console.error("Logout error:",f)}finally{r("notAuthenticated")}},u=()=>{r("authenticated")};return v.jsx(gS.Provider,{value:{appStatus:t,isAuthenticated:t==="authenticated",needsSetup:t==="needsSetup",login:a,logout:c,completeSetup:u,checkAuth:n},children:e})}function Cp(){const e=y.useContext(gS);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}function vS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=vS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function yS(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=vS(e))&&(n&&(n+=" "),n+=t);return n}const KE=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},GE=(e,t)=>({classGroupId:e,validator:t}),bS=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Mu="-",Sy=[],XE="arbitrary..",ZE=e=>{const t=JE(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return QE(u);const f=u.split(Mu),m=f[0]===""&&f.length>1?1:0;return SS(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=n[u],d=r[u];return m?d?KE(d,m):m:d||Sy}return r[u]||Sy}}},SS=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const a=e[t],c=r.nextPart.get(a);if(c){const d=SS(e,t+1,c);if(d)return d}const u=r.validators;if(u===null)return;const f=t===0?e.join(Mu):e.slice(t).join(Mu),m=u.length;for(let d=0;d<m;d++){const g=u[d];if(g.validator(f))return g.classGroupId}},QE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?XE+n:void 0})(),JE=e=>{const{theme:t,classGroups:r}=e;return eR(r,t)},eR=(e,t)=>{const r=bS();for(const n in e){const a=e[n];Ep(a,r,n,t)}return r},Ep=(e,t,r,n)=>{const a=e.length;for(let c=0;c<a;c++){const u=e[c];tR(u,t,r,n)}},tR=(e,t,r,n)=>{if(typeof e=="string"){iR(e,t,r);return}if(typeof e=="function"){rR(e,t,r,n);return}sR(e,t,r,n)},iR=(e,t,r)=>{const n=e===""?t:wS(t,e);n.classGroupId=r},rR=(e,t,r,n)=>{if(nR(e)){Ep(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(GE(r,e))},sR=(e,t,r,n)=>{const a=Object.entries(e),c=a.length;for(let u=0;u<c;u++){const[f,m]=a[u];Ep(m,wS(t,f),r,n)}},wS=(e,t)=>{let r=e;const n=t.split(Mu),a=n.length;for(let c=0;c<a;c++){const u=n[c];let f=r.nextPart.get(u);f||(f=bS(),r.nextPart.set(u,f)),r=f}return r},nR=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,oR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(c,u)=>{r[c]=u,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(c){let u=r[c];if(u!==void 0)return u;if((u=n[c])!==void 0)return a(c,u),u},set(c,u){c in r?r[c]=u:a(c,u)}}},ym="!",wy=":",aR=[],xy=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),lR=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const c=[];let u=0,f=0,m=0,d;const g=a.length;for(let C=0;C<g;C++){const k=a[C];if(u===0&&f===0){if(k===wy){c.push(a.slice(m,C)),m=C+1;continue}if(k==="/"){d=C;continue}}k==="["?u++:k==="]"?u--:k==="("?f++:k===")"&&f--}const _=c.length===0?a:a.slice(m);let S=_,w=!1;_.endsWith(ym)?(S=_.slice(0,-1),w=!0):_.startsWith(ym)&&(S=_.slice(1),w=!0);const x=d&&d>m?d-m:void 0;return xy(c,w,S,x)};if(t){const a=t+wy,c=n;n=u=>u.startsWith(a)?c(u.slice(a.length)):xy(aR,!1,u,void 0,!0)}if(r){const a=n;n=c=>r({className:c,parseClassName:a})}return n},cR=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let c=0;c<r.length;c++){const u=r[c],f=u[0]==="[",m=t.has(u);f||m?(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}},uR=e=>({cache:oR(e.cacheSize),parseClassName:lR(e),sortModifiers:cR(e),...ZE(e)}),hR=/\s+/,dR=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:c}=t,u=[],f=e.trim().split(hR);let m="";for(let d=f.length-1;d>=0;d-=1){const g=f[d],{isExternal:_,modifiers:S,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:C}=r(g);if(_){m=g+(m.length>0?" "+m:m);continue}let k=!!C,T=n(k?x.substring(0,C):x);if(!T){if(!k){m=g+(m.length>0?" "+m:m);continue}if(T=n(x),!T){m=g+(m.length>0?" "+m:m);continue}k=!1}const $=S.length===0?"":S.length===1?S[0]:c(S).join(":"),z=w?$+ym:$,A=z+T;if(u.indexOf(A)>-1)continue;u.push(A);const j=a(T,k);for(let P=0;P<j.length;++P){const F=j[P];u.push(z+F)}m=g+(m.length>0?" "+m:m)}return m},fR=(...e)=>{let t=0,r,n,a="";for(;t<e.length;)(r=e[t++])&&(n=xS(r))&&(a&&(a+=" "),a+=n);return a},xS=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=xS(e[n]))&&(r&&(r+=" "),r+=t);return r},mR=(e,...t)=>{let r,n,a,c;const u=m=>{const d=t.reduce((g,_)=>_(g),e());return r=uR(d),n=r.cache.get,a=r.cache.set,c=f,f(m)},f=m=>{const d=n(m);if(d)return d;const g=dR(m,r);return a(m,g),g};return c=u,(...m)=>c(fR(...m))},pR=[],Lt=e=>{const t=r=>r[e]||pR;return t.isThemeGetter=!0,t},CS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ES=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_R=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vR=/\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$/,yR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rn=e=>_R.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),sn=e=>!!e&&Number.isInteger(Number(e)),Pf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),_s=e=>gR.test(e),RS=()=>!0,wR=e=>vR.test(e)&&!yR.test(e),Rp=()=>!1,xR=e=>bR.test(e),CR=e=>SR.test(e),ER=e=>!ve(e)&&!ye(e),RR=e=>vn(e,AS,Rp),ve=e=>CS.test(e),Un=e=>vn(e,DS,wR),Cy=e=>vn(e,BR,Oe),kR=e=>vn(e,NS,RS),TR=e=>vn(e,MS,Rp),Ey=e=>vn(e,kS,Rp),AR=e=>vn(e,TS,CR),Jc=e=>vn(e,OS,xR),ye=e=>ES.test(e),sl=e=>Jn(e,DS),DR=e=>Jn(e,MS),Ry=e=>Jn(e,kS),MR=e=>Jn(e,AS),NR=e=>Jn(e,TS),eu=e=>Jn(e,OS,!0),OR=e=>Jn(e,NS,!0),vn=(e,t,r)=>{const n=CS.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Jn=(e,t,r=!1)=>{const n=ES.exec(e);return n?n[1]?t(n[1]):r:!1},kS=e=>e==="position"||e==="percentage",TS=e=>e==="image"||e==="url",AS=e=>e==="length"||e==="size"||e==="bg-size",DS=e=>e==="length",BR=e=>e==="number",MS=e=>e==="family-name",NS=e=>e==="number"||e==="weight",OS=e=>e==="shadow",LR=()=>{const e=Lt("color"),t=Lt("font"),r=Lt("text"),n=Lt("font-weight"),a=Lt("tracking"),c=Lt("leading"),u=Lt("breakpoint"),f=Lt("container"),m=Lt("spacing"),d=Lt("radius"),g=Lt("shadow"),_=Lt("inset-shadow"),S=Lt("text-shadow"),w=Lt("drop-shadow"),x=Lt("blur"),C=Lt("perspective"),k=Lt("aspect"),T=Lt("ease"),$=Lt("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...A(),ye,ve],P=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],G=()=>[ye,ve,m],re=()=>[rn,"full","auto",...G()],le=()=>[sn,"none","subgrid",ye,ve],ce=()=>["auto",{span:["full",sn,ye,ve]},sn,ye,ve],W=()=>[sn,"auto",ye,ve],M=()=>["auto","min","max","fr",ye,ve],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...G()],L=()=>[rn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],U=()=>[rn,"screen","full","dvw","lvw","svw","min","max","fit",...G()],se=()=>[rn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],ee=()=>[e,ye,ve],D=()=>[...A(),Ry,Ey,{position:[ye,ve]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",MR,RR,{size:[ye,ve]}],Q=()=>[Pf,sl,Un],X=()=>["","none","full",d,ye,ve],ae=()=>["",Oe,sl,Un],de=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Oe,Pf,Ry,Ey],Je=()=>["","none",x,ye,ve],ot=()=>["none",Oe,ye,ve],Ke=()=>["none",Oe,ye,ve],Re=()=>[Oe,ye,ve],mt=()=>[rn,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_s],breakpoint:[_s],color:[RS],container:[_s],"drop-shadow":[_s],ease:["in","out","in-out"],font:[ER],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_s],shadow:[_s],spacing:["px",Oe],text:[_s],"text-shadow":[_s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rn,ve,ye,k]}],container:["container"],columns:[{columns:[Oe,ve,ye,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:j()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[sn,"auto",ye,ve]}],basis:[{basis:[rn,"full","auto",f,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,rn,"auto","initial","none",ve]}],grow:[{grow:["",Oe,ye,ve]}],shrink:[{shrink:["",Oe,ye,ve]}],order:[{order:[sn,"first","last","none",ye,ve]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[f,"screen",...L()]}],"min-w":[{"min-w":[f,"screen","none",...L()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",r,sl,Un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,OR,kR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Pf,ve]}],"font-family":[{font:[DR,TR,t]}],"font-features":[{"font-features":[ve]}],"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,ye,ve]}],"line-clamp":[{"line-clamp":[Oe,"none",ye,Cy]}],leading:[{leading:[c,...G()]}],"list-image":[{"list-image":["none",ye,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ye,Un]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[Oe,"auto",ye,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,ve]}],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",ye,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sn,ye,ve],radial:["",ye,ve],conic:[sn,ye,ve]},NR,AR]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ye,ve]}],"outline-w":[{outline:["",Oe,sl,Un]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",g,eu,Jc]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",_,eu,Jc]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[Oe,Un]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",S,eu,Jc]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[Oe,ye,ve]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[ye,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ve]}],filter:[{filter:["","none",ye,ve]}],blur:[{blur:Je()}],brightness:[{brightness:[Oe,ye,ve]}],contrast:[{contrast:[Oe,ye,ve]}],"drop-shadow":[{"drop-shadow":["","none",w,eu,Jc]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",Oe,ye,ve]}],"hue-rotate":[{"hue-rotate":[Oe,ye,ve]}],invert:[{invert:["",Oe,ye,ve]}],saturate:[{saturate:[Oe,ye,ve]}],sepia:[{sepia:["",Oe,ye,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ve]}],"backdrop-blur":[{"backdrop-blur":Je()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ye,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ye,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ye,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ye,ve]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ye,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ye,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ye,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ye,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ye,ve]}],ease:[{ease:["linear","initial",T,ye,ve]}],delay:[{delay:[Oe,ye,ve]}],animate:[{animate:["none",$,ye,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ye,ve]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ot()}],"rotate-x":[{"rotate-x":ot()}],"rotate-y":[{"rotate-y":ot()}],"rotate-z":[{"rotate-z":ot()}],scale:[{scale:Ke()}],"scale-x":[{"scale-x":Ke()}],"scale-y":[{"scale-y":Ke()}],"scale-z":[{"scale-z":Ke()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[ye,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:mt()}],"translate-x":[{"translate-x":mt()}],"translate-y":[{"translate-y":mt()}],"translate-z":[{"translate-z":mt()}],"translate-none":["translate-none"],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"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",ye,ve]}],"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":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",ye,ve]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[Oe,sl,Un,Cy]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},zR=mR(LR);function Le(...e){return zR(yS(e))}function ky(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ir(...e){return t=>{let r=!1;const n=e.map(a=>{const c=ky(a,t);return!r&&typeof c=="function"&&(r=!0),c});if(r)return()=>{for(let a=0;a<n.length;a++){const c=n[a];typeof c=="function"?c():ky(e[a],null)}}}}function wt(...e){return y.useCallback(Ir(...e),e)}var jR=Symbol.for("react.lazy"),Nu=xp[" use ".trim().toString()];function HR(e){return typeof e=="object"&&e!==null&&"then"in e}function BS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===jR&&"_payload"in e&&HR(e._payload)}function LS(e){const t=UR(e),r=y.forwardRef((n,a)=>{let{children:c,...u}=n;BS(c)&&typeof Nu=="function"&&(c=Nu(c._payload));const f=y.Children.toArray(c),m=f.find($R);if(m){const d=m.props.children,g=f.map(_=>_===m?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:_);return v.jsx(t,{...u,ref:a,children:y.isValidElement(d)?y.cloneElement(d,void 0,g):null})}return v.jsx(t,{...u,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}var PR=LS("Slot");function UR(e){const t=y.forwardRef((r,n)=>{let{children:a,...c}=r;if(BS(a)&&typeof Nu=="function"&&(a=Nu(a._payload)),y.isValidElement(a)){const u=WR(a),f=FR(c,a.props);return a.type!==y.Fragment&&(f.ref=n?Ir(n,u):u),y.cloneElement(a,f)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IR=Symbol("radix.slottable");function $R(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IR}function FR(e,t){const r={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?r[n]=(...f)=>{const m=c(...f);return a(...f),m}:a&&(r[n]=a):n==="style"?r[n]={...a,...c}:n==="className"&&(r[n]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function WR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const Ty=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ay=yS,kp=(e,t)=>r=>{var n;if(t?.variants==null)return Ay(e,r?.class,r?.className);const{variants:a,defaultVariants:c}=t,u=Object.keys(a).map(d=>{const g=r?.[d],_=c?.[d];if(g===null)return null;const S=Ty(g)||Ty(_);return a[d][S]}),f=r&&Object.entries(r).reduce((d,g)=>{let[_,S]=g;return S===void 0||(d[_]=S),d},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,g)=>{let{class:_,className:S,...w}=g;return Object.entries(w).every(x=>{let[C,k]=x;return Array.isArray(k)?k.includes({...c,...f}[C]):{...c,...f}[C]===k})?[...d,_,S]:d},[]);return Ay(e,u,m,r?.class,r?.className)},Tp=kp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ie=y.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},c)=>{const u=n?PR:"button";return v.jsx(u,{className:Le(Tp({variant:t,size:r,className:e})),ref:c,...a})});Ie.displayName="Button";const or=y.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:Le("rounded-xl border bg-card text-card-foreground shadow",e),...t}));or.displayName="Card";const gr=y.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:Le("flex flex-col space-y-1.5 p-6",e),...t}));gr.displayName="CardHeader";const vr=y.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:Le("font-semibold leading-none tracking-tight",e),...t}));vr.displayName="CardTitle";const Ap=y.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));Ap.displayName="CardDescription";const yr=y.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:Le("p-6 pt-0",e),...t}));yr.displayName="CardContent";const qR=y.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:Le("flex items-center p-6 pt-0",e),...t}));qR.displayName="CardFooter";const xs=y.forwardRef(({className:e,type:t,...r},n)=>v.jsx("input",{type:t,className:Le("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));xs.displayName="Input";var Dp=_S();const zS=pS(Dp);var VR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],YR=VR.reduce((e,t)=>{const r=LS(`Primitive.${t}`),n=y.forwardRef((a,c)=>{const{asChild:u,...f}=a,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(m,{...f,ref:c})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),KR="Label",jS=y.forwardRef((e,t)=>v.jsx(YR.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));jS.displayName=KR;var HS=jS;const GR=kp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Cs=y.forwardRef(({className:e,...t},r)=>v.jsx(HS,{ref:r,className:Le(GR(),e),...t}));Cs.displayName=HS.displayName;function XR({className:e,...t}){const{login:r}=Cp(),[n,a]=y.useState(""),[c,u]=y.useState(""),[f,m]=y.useState(""),[d,g]=y.useState(!1),_=async S=>{S.preventDefault(),m(""),g(!0);const w=await r(n,c);w.success||m(w.error||"Login failed"),g(!1)};return v.jsx("div",{className:Le("flex flex-col gap-6",e),...t,children:v.jsxs(or,{children:[v.jsxs(gr,{children:[v.jsx(vr,{className:"text-2xl",children:"Sencho"}),v.jsx(Ap,{children:"Enter your credentials to access the dashboard"})]}),v.jsx(yr,{children:v.jsx("form",{onSubmit:_,children:v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Cs,{htmlFor:"username",children:"Username"}),v.jsx(xs,{id:"username",type:"text",placeholder:"admin",required:!0,value:n,onChange:S=>a(S.target.value)})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Cs,{htmlFor:"password",children:"Password"}),v.jsx(xs,{id:"password",type:"password",required:!0,value:c,onChange:S=>u(S.target.value)})]}),f&&v.jsx("div",{className:"text-sm text-red-500 text-center",children:f}),v.jsx(Ie,{type:"submit",className:"w-full",disabled:d,children:d?"Logging in...":"Login"})]})})})]})})}function ZR({onComplete:e,className:t,...r}){const[n,a]=y.useState(""),[c,u]=y.useState(""),[f,m]=y.useState(""),[d,g]=y.useState(""),[_,S]=y.useState(!1),w=async x=>{if(x.preventDefault(),g(""),c!==f){g("Passwords do not match");return}if(n.length<3){g("Username must be at least 3 characters");return}if(c.length<6){g("Password must be at least 6 characters");return}S(!0);try{const C=await fetch("/api/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:n,password:c,confirmPassword:f})}),k=await C.json();C.ok&&k.success?e():g(k.error||"Setup failed")}catch{g("Network error. Please try again.")}finally{S(!1)}};return v.jsx("div",{className:Le("flex flex-col gap-6",t),...r,children:v.jsxs(or,{children:[v.jsxs(gr,{children:[v.jsx(vr,{className:"text-2xl",children:"Welcome to Sencho"}),v.jsx(Ap,{children:"Create your admin account to get started"})]}),v.jsx(yr,{children:v.jsx("form",{onSubmit:w,children:v.jsxs("div",{className:"flex flex-col gap-6",children:[v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Cs,{htmlFor:"username",children:"Username"}),v.jsx(xs,{id:"username",type:"text",placeholder:"admin",required:!0,value:n,onChange:x=>a(x.target.value)})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Cs,{htmlFor:"password",children:"Password"}),v.jsx(xs,{id:"password",type:"password",required:!0,value:c,onChange:x=>u(x.target.value)})]}),v.jsxs("div",{className:"grid gap-2",children:[v.jsx(Cs,{htmlFor:"confirmPassword",children:"Confirm Password"}),v.jsx(xs,{id:"confirmPassword",type:"password",required:!0,value:f,onChange:x=>m(x.target.value)})]}),d&&v.jsx("div",{className:"text-sm text-red-500 text-center",children:d}),v.jsx(Ie,{type:"submit",className:"w-full",disabled:_,children:_?"Setting up...":"Complete Setup"})]})})})]})})}function Dy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function QR(e){if(Array.isArray(e))return e}function JR(e,t,r){return(t=ok(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ek(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,c,u,f=[],m=!0,d=!1;try{if(c=(r=r.call(e)).next,t!==0)for(;!(m=(n=c.call(r)).done)&&(f.push(n.value),f.length!==t);m=!0);}catch(g){d=!0,a=g}finally{try{if(!m&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(d)throw a}}return f}}function tk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function My(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ny(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?My(Object(r),!0).forEach(function(n){JR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):My(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ik(e,t){if(e==null)return{};var r,n,a=rk(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function rk(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function sk(e,t){return QR(e)||ek(e,t)||ak(e,t)||tk()}function nk(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ok(e){var t=nk(e,"string");return typeof t=="symbol"?t:t+""}function ak(e,t){if(e){if(typeof e=="string")return Dy(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dy(e,t):void 0}}function lk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function By(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oy(Object(r),!0).forEach(function(n){lk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ck(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(a,c){return c(a)},n)}}function dl(e){return function t(){for(var r=this,n=arguments.length,a=new Array(n),c=0;c<n;c++)a[c]=arguments[c];return a.length>=e.length?e.apply(this,a):function(){for(var u=arguments.length,f=new Array(u),m=0;m<u;m++)f[m]=arguments[m];return t.apply(r,[].concat(a,f))}}}function Ou(e){return{}.toString.call(e).includes("Object")}function uk(e){return!Object.keys(e).length}function wl(e){return typeof e=="function"}function hk(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dk(e,t){return Ou(t)||dn("changeType"),Object.keys(t).some(function(r){return!hk(e,r)})&&dn("changeField"),t}function fk(e){wl(e)||dn("selectorType")}function mk(e){wl(e)||Ou(e)||dn("handlerType"),Ou(e)&&Object.values(e).some(function(t){return!wl(t)})&&dn("handlersType")}function pk(e){e||dn("initialIsRequired"),Ou(e)||dn("initialType"),uk(e)&&dn("initialContent")}function _k(e,t){throw new Error(e[t]||e.default)}var gk={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},dn=dl(_k)(gk),tu={changes:dk,selector:fk,handler:mk,initial:pk};function vk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};tu.initial(e),tu.handler(t);var r={current:e},n=dl(Sk)(r,t),a=dl(bk)(r),c=dl(tu.changes)(e),u=dl(yk)(r);function f(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return tu.selector(d),d(r.current)}function m(d){ck(n,a,c,u)(d)}return[f,m]}function yk(e,t){return wl(t)?t(e.current):t}function bk(e,t){return e.current=By(By({},e.current),t),t}function Sk(e,t,r){return wl(t)?t(e.current):Object.keys(r).forEach(function(n){var a;return(a=t[n])===null||a===void 0?void 0:a.call(t,e.current[n])}),r}var wk={create:vk},xk={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Ck(e){return function t(){for(var r=this,n=arguments.length,a=new Array(n),c=0;c<n;c++)a[c]=arguments[c];return a.length>=e.length?e.apply(this,a):function(){for(var u=arguments.length,f=new Array(u),m=0;m<u;m++)f[m]=arguments[m];return t.apply(r,[].concat(a,f))}}}function Ek(e){return{}.toString.call(e).includes("Object")}function Rk(e){return e||Ly("configIsRequired"),Ek(e)||Ly("configType"),e.urls?(kk(),{paths:{vs:e.urls.monacoBase}}):e}function kk(){console.warn(PS.deprecation)}function Tk(e,t){throw new Error(e[t]||e.default)}var PS={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
You are using deprecated way of configuration.
Instead of using
monaco.config({ urls: { monacoBase: '...' } })
use
monaco.config({ paths: { vs: '...' } })
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
`},Ly=Ck(Tk)(PS),Ak={config:Rk},Dk=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(a){return r.reduceRight(function(c,u){return u(c)},a)}};function US(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],US(e[r],t[r]))}),Ny(Ny({},e),t)}var Mk={type:"cancelation",msg:"operation is manually canceled"};function Uf(e){var t=!1,r=new Promise(function(n,a){e.then(function(c){return t?a(Mk):n(c)}),e.catch(a)});return r.cancel=function(){return t=!0},r}var Nk=["monaco"],Ok=wk.create({config:xk,isInitialized:!1,resolve:null,reject:null,monaco:null}),IS=sk(Ok,2),Al=IS[0],th=IS[1];function Bk(e){var t=Ak.config(e),r=t.monaco,n=ik(t,Nk);th(function(a){return{config:US(a.config,n),monaco:r}})}function Lk(){var e=Al(function(t){var r=t.monaco,n=t.isInitialized,a=t.resolve;return{monaco:r,isInitialized:n,resolve:a}});if(!e.isInitialized){if(th({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Uf(If);if(window.monaco&&window.monaco.editor)return $S(window.monaco),e.resolve(window.monaco),Uf(If);Dk(zk,Hk)(Pk)}return Uf(If)}function zk(e){return document.body.appendChild(e)}function jk(e){var t=document.createElement("script");return e&&(t.src=e),t}function Hk(e){var t=Al(function(n){var a=n.config,c=n.reject;return{config:a,reject:c}}),r=jk("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function Pk(){var e=Al(function(r){var n=r.config,a=r.resolve,c=r.reject;return{config:n,resolve:a,reject:c}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var n=r.m||r;$S(n),e.resolve(n)},function(r){e.reject(r)})}function $S(e){Al().monaco||th({monaco:e})}function Uk(){return Al(function(e){var t=e.monaco;return t})}var If=new Promise(function(e,t){return th({resolve:e,reject:t})}),FS={config:Bk,init:Lk,__getMonacoInstance:Uk},Ik={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},$f=Ik,$k={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Fk=$k;function Wk({children:e}){return ue.createElement("div",{style:Fk.container},e)}var qk=Wk,Vk=qk;function Yk({width:e,height:t,isEditorReady:r,loading:n,_ref:a,className:c,wrapperProps:u}){return ue.createElement("section",{style:{...$f.wrapper,width:e,height:t},...u},!r&&ue.createElement(Vk,null,n),ue.createElement("div",{ref:a,style:{...$f.fullWidth,...!r&&$f.hide},className:c}))}var Kk=Yk,WS=y.memo(Kk);function Gk(e){y.useEffect(e,[])}var qS=Gk;function Xk(e,t,r=!0){let n=y.useRef(!0);y.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var Wi=Xk;function yl(){}function Zo(e,t,r,n){return Zk(e,n)||Qk(e,t,r,n)}function Zk(e,t){return e.editor.getModel(VS(e,t))}function Qk(e,t,r,n){return e.editor.createModel(t,r,n?VS(e,n):void 0)}function VS(e,t){return e.Uri.parse(t)}function Jk({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:c,modifiedModelPath:u,keepCurrentOriginalModel:f=!1,keepCurrentModifiedModel:m=!1,theme:d="light",loading:g="Loading...",options:_={},height:S="100%",width:w="100%",className:x,wrapperProps:C={},beforeMount:k=yl,onMount:T=yl}){let[$,z]=y.useState(!1),[A,j]=y.useState(!0),P=y.useRef(null),F=y.useRef(null),G=y.useRef(null),re=y.useRef(T),le=y.useRef(k),ce=y.useRef(!1);qS(()=>{let N=FS.init();return N.then(R=>(F.current=R)&&j(!1)).catch(R=>R?.type!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>P.current?H():N.cancel()}),Wi(()=>{if(P.current&&F.current){let N=P.current.getOriginalEditor(),R=Zo(F.current,e||"",n||r||"text",c||"");R!==N.getModel()&&N.setModel(R)}},[c],$),Wi(()=>{if(P.current&&F.current){let N=P.current.getModifiedEditor(),R=Zo(F.current,t||"",a||r||"text",u||"");R!==N.getModel()&&N.setModel(R)}},[u],$),Wi(()=>{let N=P.current.getModifiedEditor();N.getOption(F.current.editor.EditorOption.readOnly)?N.setValue(t||""):t!==N.getValue()&&(N.executeEdits("",[{range:N.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),N.pushUndoStop())},[t],$),Wi(()=>{P.current?.getModel()?.original.setValue(e||"")},[e],$),Wi(()=>{let{original:N,modified:R}=P.current.getModel();F.current.editor.setModelLanguage(N,n||r||"text"),F.current.editor.setModelLanguage(R,a||r||"text")},[r,n,a],$),Wi(()=>{F.current?.editor.setTheme(d)},[d],$),Wi(()=>{P.current?.updateOptions(_)},[_],$);let W=y.useCallback(()=>{if(!F.current)return;le.current(F.current);let N=Zo(F.current,e||"",n||r||"text",c||""),R=Zo(F.current,t||"",a||r||"text",u||"");P.current?.setModel({original:N,modified:R})},[r,t,a,e,n,c,u]),M=y.useCallback(()=>{!ce.current&&G.current&&(P.current=F.current.editor.createDiffEditor(G.current,{automaticLayout:!0,..._}),W(),F.current?.editor.setTheme(d),z(!0),ce.current=!0)},[_,d,W]);y.useEffect(()=>{$&&re.current(P.current,F.current)},[$]),y.useEffect(()=>{!A&&!$&&M()},[A,$,M]);function H(){let N=P.current?.getModel();f||N?.original?.dispose(),m||N?.modified?.dispose(),P.current?.dispose()}return ue.createElement(WS,{width:w,height:S,isEditorReady:$,loading:g,_ref:G,className:x,wrapperProps:C})}var eT=Jk;y.memo(eT);function tT(e){let t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}var iT=tT,iu=new Map;function rT({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:c,theme:u="light",line:f,loading:m="Loading...",options:d={},overrideServices:g={},saveViewState:_=!0,keepCurrentModel:S=!1,width:w="100%",height:x="100%",className:C,wrapperProps:k={},beforeMount:T=yl,onMount:$=yl,onChange:z,onValidate:A=yl}){let[j,P]=y.useState(!1),[F,G]=y.useState(!0),re=y.useRef(null),le=y.useRef(null),ce=y.useRef(null),W=y.useRef($),M=y.useRef(T),H=y.useRef(),N=y.useRef(n),R=iT(c),L=y.useRef(!1),U=y.useRef(!1);qS(()=>{let D=FS.init();return D.then(O=>(re.current=O)&&G(!1)).catch(O=>O?.type!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>le.current?ee():D.cancel()}),Wi(()=>{let D=Zo(re.current,e||n||"",t||a||"",c||r||"");D!==le.current?.getModel()&&(_&&iu.set(R,le.current?.saveViewState()),le.current?.setModel(D),_&&le.current?.restoreViewState(iu.get(c)))},[c],j),Wi(()=>{le.current?.updateOptions(d)},[d],j),Wi(()=>{!le.current||n===void 0||(le.current.getOption(re.current.editor.EditorOption.readOnly)?le.current.setValue(n):n!==le.current.getValue()&&(U.current=!0,le.current.executeEdits("",[{range:le.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),le.current.pushUndoStop(),U.current=!1))},[n],j),Wi(()=>{let D=le.current?.getModel();D&&a&&re.current?.editor.setModelLanguage(D,a)},[a],j),Wi(()=>{f!==void 0&&le.current?.revealLine(f)},[f],j),Wi(()=>{re.current?.editor.setTheme(u)},[u],j);let se=y.useCallback(()=>{if(!(!ce.current||!re.current)&&!L.current){M.current(re.current);let D=c||r,O=Zo(re.current,n||e||"",t||a||"",D||"");le.current=re.current?.editor.create(ce.current,{model:O,automaticLayout:!0,...d},g),_&&le.current.restoreViewState(iu.get(D)),re.current.editor.setTheme(u),f!==void 0&&le.current.revealLine(f),P(!0),L.current=!0}},[e,t,r,n,a,c,d,g,_,u,f]);y.useEffect(()=>{j&&W.current(le.current,re.current)},[j]),y.useEffect(()=>{!F&&!j&&se()},[F,j,se]),N.current=n,y.useEffect(()=>{j&&z&&(H.current?.dispose(),H.current=le.current?.onDidChangeModelContent(D=>{U.current||z(le.current.getValue(),D)}))},[j,z]),y.useEffect(()=>{if(j){let D=re.current.editor.onDidChangeMarkers(O=>{let q=le.current.getModel()?.uri;if(q&&O.find(Q=>Q.path===q.path)){let Q=re.current.editor.getModelMarkers({resource:q});A?.(Q)}});return()=>{D?.dispose()}}return()=>{}},[j,A]);function ee(){H.current?.dispose(),S?_&&iu.set(c,le.current.saveViewState()):le.current.getModel()?.dispose(),le.current.dispose()}return ue.createElement(WS,{width:w,height:x,isEditorReady:j,loading:m,_ref:ce,className:C,wrapperProps:k})}var sT=rT,nT=y.memo(sT),oT=nT;var YS=Object.defineProperty,aT=Object.getOwnPropertyDescriptor,lT=(e,t)=>{for(var r in t)YS(e,r,{get:t[r],enumerable:!0})},xt=(e,t,r,n)=>{for(var a=n>1?void 0:n?aT(t,r):t,c=e.length-1,u;c>=0;c--)(u=e[c])&&(a=(n?u(t,r,a):u(a))||a);return n&&a&&YS(t,r,a),a},pe=(e,t)=>(r,n)=>t(r,n,e),zy="Terminal input",bm={get:()=>zy,set:e=>zy=e},jy="Too much output to announce, navigate to rows manually to read",Sm={get:()=>jy,set:e=>jy=e};function cT(e){return e.replace(/\r?\n/g,"\r")}function uT(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function hT(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function dT(e,t,r,n){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");KS(a,t,r,n)}}function KS(e,t,r,n){e=cT(e),e=uT(e,r.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function GS(e,t,r){let n=r.getBoundingClientRect(),a=e.clientX-n.left-10,c=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.zIndex="1000",t.focus()}function Hy(e,t,r,n,a){GS(e,t,r),a&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function un(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ih(e,t=0,r=e.length){let n="";for(let a=t;a<r;++a){let c=e[a];c>65535?(c-=65536,n+=String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):n+=String.fromCharCode(c)}return n}var fT=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let n=0,a=0;if(this._interim){let c=e.charCodeAt(a++);56320<=c&&c<=57343?t[n++]=(this._interim-55296)*1024+c-56320+65536:(t[n++]=this._interim,t[n++]=c),this._interim=0}for(let c=a;c<r;++c){let u=e.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=r)return this._interim=u,n;let f=e.charCodeAt(c);56320<=f&&f<=57343?t[n++]=(u-55296)*1024+f-56320+65536:(t[n++]=u,t[n++]=f);continue}u!==65279&&(t[n++]=u)}return n}},mT=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let n=0,a,c,u,f,m=0,d=0;if(this.interim[0]){let S=!1,w=this.interim[0];w&=(w&224)===192?31:(w&240)===224?15:7;let x=0,C;for(;(C=this.interim[++x]&63)&&x<4;)w<<=6,w|=C;let k=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,T=k-x;for(;d<T;){if(d>=r)return 0;if(C=e[d++],(C&192)!==128){d--,S=!0;break}else this.interim[x++]=C,w<<=6,w|=C&63}S||(k===2?w<128?d--:t[n++]=w:k===3?w<2048||w>=55296&&w<=57343||w===65279||(t[n++]=w):w<65536||w>1114111||(t[n++]=w)),this.interim.fill(0)}let g=r-4,_=d;for(;_<r;){for(;_<g&&!((a=e[_])&128)&&!((c=e[_+1])&128)&&!((u=e[_+2])&128)&&!((f=e[_+3])&128);)t[n++]=a,t[n++]=c,t[n++]=u,t[n++]=f,_+=4;if(a=e[_++],a<128)t[n++]=a;else if((a&224)===192){if(_>=r)return this.interim[0]=a,n;if(c=e[_++],(c&192)!==128){_--;continue}if(m=(a&31)<<6|c&63,m<128){_--;continue}t[n++]=m}else if((a&240)===224){if(_>=r)return this.interim[0]=a,n;if(c=e[_++],(c&192)!==128){_--;continue}if(_>=r)return this.interim[0]=a,this.interim[1]=c,n;if(u=e[_++],(u&192)!==128){_--;continue}if(m=(a&15)<<12|(c&63)<<6|u&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[n++]=m}else if((a&248)===240){if(_>=r)return this.interim[0]=a,n;if(c=e[_++],(c&192)!==128){_--;continue}if(_>=r)return this.interim[0]=a,this.interim[1]=c,n;if(u=e[_++],(u&192)!==128){_--;continue}if(_>=r)return this.interim[0]=a,this.interim[1]=c,this.interim[2]=u,n;if(f=e[_++],(f&192)!==128){_--;continue}if(m=(a&7)<<18|(c&63)<<12|(u&63)<<6|f&63,m<65536||m>1114111)continue;t[n++]=m}}return n}},XS="",hn=" ",Dl=class ZS{constructor(){this.fg=0,this.bg=0,this.extended=new Bu}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new ZS;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},Bu=class QS{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new QS(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},lr=class JS extends Dl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Bu,this.combinedData=""}static fromCharData(t){let r=new JS;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?un(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Py="di$target",wm="di$dependencies",Ff=new Map;function pT(e){return e[wm]||[]}function Qt(e){if(Ff.has(e))return Ff.get(e);let t=function(r,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_T(t,r,a)};return t._id=e,Ff.set(e,t),t}function _T(e,t,r){t[Py]===t?t[wm].push({id:e,index:r}):(t[wm]=[{id:e,index:r}],t[Py]=t)}var _i=Qt("BufferService"),e1=Qt("CoreMouseService"),eo=Qt("CoreService"),gT=Qt("CharsetService"),Mp=Qt("InstantiationService"),t1=Qt("LogService"),gi=Qt("OptionsService"),i1=Qt("OscLinkService"),vT=Qt("UnicodeService"),Ml=Qt("DecorationService"),xm=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let n=[],a=this._optionsService.rawOptions.linkHandler,c=new lr,u=r.getTrimmedLength(),f=-1,m=-1,d=!1;for(let g=0;g<u;g++)if(!(m===-1&&!r.hasContent(g))){if(r.loadCell(g,c),c.hasExtendedAttrs()&&c.extended.urlId)if(m===-1){m=g,f=c.extended.urlId;continue}else d=c.extended.urlId!==f;else m!==-1&&(d=!0);if(d||m!==-1&&g===u-1){let _=this._oscLinkService.getLinkData(f)?.uri;if(_){let S={start:{x:m+1,y:e},end:{x:g+(!d&&g===u-1?1:0),y:e}},w=!1;if(!a?.allowNonHttpProtocols)try{let x=new URL(_);["http:","https:"].includes(x.protocol)||(w=!0)}catch{w=!0}w||n.push({text:_,range:S,activate:(x,C)=>a?a.activate(x,C,S):yT(x,C),hover:(x,C)=>a?.hover?.(x,C,S),leave:(x,C)=>a?.leave?.(x,C,S)})}d=!1,c.hasExtendedAttrs()&&c.extended.urlId?(m=g,f=c.extended.urlId):(m=-1,f=-1)}}t(n)}};xm=xt([pe(0,_i),pe(1,gi),pe(2,i1)],xm);function yT(e,t){if(confirm(`Do you want to navigate to ${t}?
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var rh=Qt("CharSizeService"),Ts=Qt("CoreBrowserService"),Np=Qt("MouseService"),As=Qt("RenderService"),bT=Qt("SelectionService"),r1=Qt("CharacterJoinerService"),aa=Qt("ThemeService"),s1=Qt("LinkProviderService"),ST=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Uy.isErrorNoTelemetry(e)?new Uy(e.message+`
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},wT=new ST;function bu(e){xT(e)||wT.onUnexpectedError(e)}var Cm="Canceled";function xT(e){return e instanceof CT?!0:e instanceof Error&&e.name===Cm&&e.message===Cm}var CT=class extends Error{constructor(){super(Cm),this.name=this.message}};function ET(e){return new Error(`Illegal argument: ${e}`)}var Uy=class Em extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Em)return t;let r=new Em;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Rm=class n1 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,n1.prototype)}};function Ui(e,t=0){return e[e.length-(1+t)]}var RT;(e=>{function t(c){return c<0}e.isLessThan=t;function r(c){return c<=0}e.isLessThanOrEqual=r;function n(c){return c>0}e.isGreaterThan=n;function a(c){return c===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(RT||={});function kT(e,t){let r=this,n=!1,a;return function(){return n||(n=!0,t||(a=e.apply(r,arguments))),a}}var o1;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*a(A){yield A}e.single=a;function c(A){return t(A)?A:a(A)}e.wrap=c;function u(A){return A||r}e.from=u;function*f(A){for(let j=A.length-1;j>=0;j--)yield A[j]}e.reverse=f;function m(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=m;function d(A){return A[Symbol.iterator]().next().value}e.first=d;function g(A,j){let P=0;for(let F of A)if(j(F,P++))return!0;return!1}e.some=g;function _(A,j){for(let P of A)if(j(P))return P}e.find=_;function*S(A,j){for(let P of A)j(P)&&(yield P)}e.filter=S;function*w(A,j){let P=0;for(let F of A)yield j(F,P++)}e.map=w;function*x(A,j){let P=0;for(let F of A)yield*j(F,P++)}e.flatMap=x;function*C(...A){for(let j of A)yield*j}e.concat=C;function k(A,j,P){let F=P;for(let G of A)F=j(F,G);return F}e.reduce=k;function*T(A,j,P=A.length){for(j<0&&(j+=A.length),P<0?P+=A.length:P>A.length&&(P=A.length);j<P;j++)yield A[j]}e.slice=T;function $(A,j=Number.POSITIVE_INFINITY){let P=[];if(j===0)return[P,A];let F=A[Symbol.iterator]();for(let G=0;G<j;G++){let re=F.next();if(re.done)return[P,e.empty()];P.push(re.value)}return[P,{[Symbol.iterator](){return F}}]}e.consume=$;async function z(A){let j=[];for await(let P of A)j.push(P);return Promise.resolve(j)}e.asyncToArray=z})(o1||={});function Kn(e){if(o1.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function TT(...e){return ft(()=>Kn(e))}function ft(e){return{dispose:kT(()=>{e()})}}var a1=class l1{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{Kn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?l1.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};a1.DISABLE_DISPOSED_WARNING=!1;var fn=a1,Be=class{constructor(){this._store=new fn,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Be.None=Object.freeze({dispose(){}});var ra=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}},ws=typeof window=="object"?window:globalThis,km=class Tm{constructor(t){this.element=t,this.next=Tm.Undefined,this.prev=Tm.Undefined}};km.Undefined=new km(void 0);var pt=km,Iy=class{constructor(){this._first=pt.Undefined,this._last=pt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===pt.Undefined}clear(){let e=this._first;for(;e!==pt.Undefined;){let t=e.next;e.prev=pt.Undefined,e.next=pt.Undefined,e=t}this._first=pt.Undefined,this._last=pt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new pt(e);if(this._first===pt.Undefined)this._first=r,this._last=r;else if(t){let a=this._last;this._last=r,r.prev=a,a.next=r}else{let a=this._first;this._first=r,r.next=a,a.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==pt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==pt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==pt.Undefined&&e.next!==pt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===pt.Undefined&&e.next===pt.Undefined?(this._first=pt.Undefined,this._last=pt.Undefined):e.next===pt.Undefined?(this._last=this._last.prev,this._last.next=pt.Undefined):e.prev===pt.Undefined&&(this._first=this._first.next,this._first.prev=pt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==pt.Undefined;)yield e.element,e=e.next}},AT=globalThis.performance&&typeof globalThis.performance.now=="function",DT=class c1{static create(t){return new c1(t)}constructor(t){this._now=AT&&t===!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}},ai;(e=>{e.None=()=>Be.None;function t(W,M){return _(W,()=>{},0,void 0,!0,void 0,M)}e.defer=t;function r(W){return(M,H=null,N)=>{let R=!1,L;return L=W(U=>{if(!R)return L?L.dispose():R=!0,M.call(H,U)},null,N),R&&L.dispose(),L}}e.once=r;function n(W,M,H){return d((N,R=null,L)=>W(U=>N.call(R,M(U)),null,L),H)}e.map=n;function a(W,M,H){return d((N,R=null,L)=>W(U=>{M(U),N.call(R,U)},null,L),H)}e.forEach=a;function c(W,M,H){return d((N,R=null,L)=>W(U=>M(U)&&N.call(R,U),null,L),H)}e.filter=c;function u(W){return W}e.signal=u;function f(...W){return(M,H=null,N)=>{let R=TT(...W.map(L=>L(U=>M.call(H,U))));return g(R,N)}}e.any=f;function m(W,M,H,N){let R=H;return n(W,L=>(R=M(R,L),R),N)}e.reduce=m;function d(W,M){let H,N={onWillAddFirstListener(){H=W(R.fire,R)},onDidRemoveLastListener(){H?.dispose()}},R=new fe(N);return M?.add(R),R.event}function g(W,M){return M instanceof Array?M.push(W):M&&M.add(W),W}function _(W,M,H=100,N=!1,R=!1,L,U){let se,ee,D,O=0,q,Q={leakWarningThreshold:L,onWillAddFirstListener(){se=W(ae=>{O++,ee=M(ee,ae),N&&!D&&(X.fire(ee),ee=void 0),q=()=>{let de=ee;ee=void 0,D=void 0,(!N||O>1)&&X.fire(de),O=0},typeof H=="number"?(clearTimeout(D),D=setTimeout(q,H)):D===void 0&&(D=0,queueMicrotask(q))})},onWillRemoveListener(){R&&O>0&&q?.()},onDidRemoveLastListener(){q=void 0,se.dispose()}},X=new fe(Q);return U?.add(X),X.event}e.debounce=_;function S(W,M=0,H){return e.debounce(W,(N,R)=>N?(N.push(R),N):[R],M,void 0,!0,void 0,H)}e.accumulate=S;function w(W,M=(N,R)=>N===R,H){let N=!0,R;return c(W,L=>{let U=N||!M(L,R);return N=!1,R=L,U},H)}e.latch=w;function x(W,M,H){return[e.filter(W,M,H),e.filter(W,N=>!M(N),H)]}e.split=x;function C(W,M=!1,H=[],N){let R=H.slice(),L=W(ee=>{R?R.push(ee):se.fire(ee)});N&&N.add(L);let U=()=>{R?.forEach(ee=>se.fire(ee)),R=null},se=new fe({onWillAddFirstListener(){L||(L=W(ee=>se.fire(ee)),N&&N.add(L))},onDidAddFirstListener(){R&&(M?setTimeout(U):U())},onDidRemoveLastListener(){L&&L.dispose(),L=null}});return N&&N.add(se),se.event}e.buffer=C;function k(W,M){return(H,N,R)=>{let L=M(new $);return W(function(U){let se=L.evaluate(U);se!==T&&H.call(N,se)},void 0,R)}}e.chain=k;let T=Symbol("HaltChainable");class ${constructor(){this.steps=[]}map(M){return this.steps.push(M),this}forEach(M){return this.steps.push(H=>(M(H),H)),this}filter(M){return this.steps.push(H=>M(H)?H:T),this}reduce(M,H){let N=H;return this.steps.push(R=>(N=M(N,R),N)),this}latch(M=(H,N)=>H===N){let H=!0,N;return this.steps.push(R=>{let L=H||!M(R,N);return H=!1,N=R,L?R:T}),this}evaluate(M){for(let H of this.steps)if(M=H(M),M===T)break;return M}}function z(W,M,H=N=>N){let N=(...se)=>U.fire(H(...se)),R=()=>W.on(M,N),L=()=>W.removeListener(M,N),U=new fe({onWillAddFirstListener:R,onDidRemoveLastListener:L});return U.event}e.fromNodeEventEmitter=z;function A(W,M,H=N=>N){let N=(...se)=>U.fire(H(...se)),R=()=>W.addEventListener(M,N),L=()=>W.removeEventListener(M,N),U=new fe({onWillAddFirstListener:R,onDidRemoveLastListener:L});return U.event}e.fromDOMEventEmitter=A;function j(W){return new Promise(M=>r(W)(M))}e.toPromise=j;function P(W){let M=new fe;return W.then(H=>{M.fire(H)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}e.fromPromise=P;function F(W,M){return W(H=>M.fire(H))}e.forward=F;function G(W,M,H){return M(H),W(N=>M(N))}e.runAndSubscribe=G;class re{constructor(M,H){this._observable=M,this._counter=0,this._hasChanged=!1;let N={onWillAddFirstListener:()=>{M.addObserver(this)},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new fe(N),H&&H.add(this.emitter)}beginUpdate(M){this._counter++}handlePossibleChange(M){}handleChange(M,H){this._hasChanged=!0}endUpdate(M){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function le(W,M){return new re(W,M).emitter.event}e.fromObservable=le;function ce(W){return(M,H,N)=>{let R=0,L=!1,U={beginUpdate(){R++},endUpdate(){R--,R===0&&(W.reportChanges(),L&&(L=!1,M.call(H)))},handlePossibleChange(){},handleChange(){L=!0}};W.addObserver(U),W.reportChanges();let se={dispose(){W.removeObserver(U)}};return N instanceof fn?N.add(se):Array.isArray(N)&&N.push(se),se}}e.fromObservableLight=ce})(ai||={});var Am=class Dm{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Dm._idPool++}`,Dm.all.add(this)}start(t){this._stopWatch=new DT,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Am.all=new Set,Am._idPool=0;var MT=Am,NT=-1,u1=class h1{constructor(t,r,n=(h1._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[c,u]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${u}):`;console.warn(f),console.warn(c);let m=new LT(f,c);this._errorHandler(m)}return()=>{let c=this._stacks.get(t.value)||0;this._stacks.set(t.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,a]of this._stacks)(!t||r<a)&&(t=[n,a],r=a);return t}};u1._idPool=1;var OT=u1,BT=class d1{constructor(t){this.value=t}static create(){let t=new Error;return new d1(t.stack??"")}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},LT=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},zT=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},jT=0,Wf=class{constructor(e){this.value=e,this.id=jT++}},HT=2,PT,fe=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new OT(t?.onListenerError??bu,this._options?.leakWarningThreshold??NT):void 0,this._perfMon=this._options?._profName?new MT(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??=(t,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let f=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(f);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new zT(`${f}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(this._options?.onListenerError||bu)(d),Be.None}if(this._disposed)return Be.None;r&&(t=t.bind(r));let a=new Wf(t),c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=BT.create(),c=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof Wf?(this._deliveryQueue??=new UT,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let u=ft(()=>{c?.(),this._removeListener(a)});return n instanceof fn?n.add(u):Array.isArray(n)&&n.push(u),u},this._event}_removeListener(t){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 r=this._listeners,n=r.indexOf(t);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--,r[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*HT<=r.length){let c=0;for(let u=0;u<r.length;u++)r[u]?r[c++]=r[u]:a&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=c}}_deliver(t,r){if(!t)return;let n=this._options?.onListenerError||bu;if(!n){t.value(r);return}try{t.value(r)}catch(a){n(a)}}_deliverQueue(t){let r=t.current._listeners;for(;t.i<t.end;)this._deliver(r[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Wf)this._deliver(this._listeners,t);else{let r=this._deliveryQueue;r.enqueue(this,t,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},UT=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Mm=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new fe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new fe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Mm.INSTANCE=new Mm;var Op=Mm;function IT(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}Op.INSTANCE.onDidChangeZoomLevel;function $T(e){return Op.INSTANCE.getZoomFactor(e)}Op.INSTANCE.onDidChangeFullscreen;var la=typeof navigator=="object"?navigator.userAgent:"",Nm=la.indexOf("Firefox")>=0,FT=la.indexOf("AppleWebKit")>=0,Bp=la.indexOf("Chrome")>=0,WT=!Bp&&la.indexOf("Safari")>=0;la.indexOf("Electron/")>=0;la.indexOf("Android")>=0;var qf=!1;if(typeof ws.matchMedia=="function"){let e=ws.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ws.matchMedia("(display-mode: fullscreen)");qf=e.matches,IT(ws,e,({matches:r})=>{qf&&t.matches||(qf=r)})}var Qo="en",Om=!1,Bm=!1,Su=!1,f1=!1,ru,wu=Qo,$y=Qo,qT,ys,Vn=globalThis,$i;typeof Vn.vscode<"u"&&typeof Vn.vscode.process<"u"?$i=Vn.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&($i=process);var VT=typeof $i?.versions?.electron=="string",YT=VT&&$i?.type==="renderer";if(typeof $i=="object"){Om=$i.platform==="win32",Bm=$i.platform==="darwin",Su=$i.platform==="linux",Su&&$i.env.SNAP&&$i.env.SNAP_REVISION,$i.env.CI||$i.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ru=Qo,wu=Qo;let e=$i.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ru=t.userLocale,$y=t.osLocale,wu=t.resolvedLanguage||Qo,qT=t.languagePack?.translationsConfigFile}catch{}f1=!0}else typeof navigator=="object"&&!YT?(ys=navigator.userAgent,Om=ys.indexOf("Windows")>=0,Bm=ys.indexOf("Macintosh")>=0,(ys.indexOf("Macintosh")>=0||ys.indexOf("iPad")>=0||ys.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Su=ys.indexOf("Linux")>=0,ys?.indexOf("Mobi")>=0,wu=globalThis._VSCODE_NLS_LANGUAGE||Qo,ru=navigator.language.toLowerCase(),$y=ru):console.error("Unable to resolve platform.");var m1=Om,Pr=Bm,KT=Su,Fy=f1,$r=ys,nn=wu,GT;(e=>{function t(){return nn}e.value=t;function r(){return nn.length===2?nn==="en":nn.length>=3?nn[0]==="e"&&nn[1]==="n"&&nn[2]==="-":!1}e.isDefaultVariant=r;function n(){return nn==="en"}e.isDefault=n})(GT||={});var XT=typeof Vn.postMessage=="function"&&!Vn.importScripts;(()=>{if(XT){let e=[];Vn.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,a=e.length;n<a;n++){let c=e[n];if(c.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),c.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),Vn.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var ZT=!!($r&&$r.indexOf("Chrome")>=0);$r&&$r.indexOf("Firefox")>=0;!ZT&&$r&&$r.indexOf("Safari")>=0;$r&&$r.indexOf("Edg/")>=0;$r&&$r.indexOf("Android")>=0;var Fo=typeof navigator=="object"?navigator:{};Fy||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fo&&Fo.clipboard&&Fo.clipboard.writeText,Fy||Fo&&Fo.clipboard&&Fo.clipboard.readText;var Lp=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Vf=new Lp,Wy=new Lp,qy=new Lp,QT=new Array(230),p1;(e=>{function t(f){return Vf.keyCodeToStr(f)}e.toString=t;function r(f){return Vf.strToKeyCode(f)}e.fromString=r;function n(f){return Wy.keyCodeToStr(f)}e.toUserSettingsUS=n;function a(f){return qy.keyCodeToStr(f)}e.toUserSettingsGeneral=a;function c(f){return Wy.strToKeyCode(f)||qy.strToKeyCode(f)}e.fromUserSettings=c;function u(f){if(f>=98&&f<=113)return null;switch(f){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Vf.keyCodeToStr(f)}e.toElectronAccelerator=u})(p1||={});var JT=class _1{constructor(t,r,n,a,c){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=a,this.keyCode=c}equals(t){return t instanceof _1&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${r}${n}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new eA([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},eA=class{constructor(e){if(e.length===0)throw ET("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function tA(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return p1.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Nm)switch(t){case 59:return 85;case 60:if(KT)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Pr)return 57;break}else if(FT&&(Pr&&t===93||!Pr&&t===92))return 57;return QT[t]||0}var iA=Pr?256:2048,rA=512,sA=1024,nA=Pr?2048:256,Vy=class{constructor(t){this._standardKeyboardEventBrand=!0;let r=t;this.browserEvent=r,this.target=r.target,this.ctrlKey=r.ctrlKey,this.shiftKey=r.shiftKey,this.altKey=r.altKey,this.metaKey=r.metaKey,this.altGraphKey=r.getModifierState?.("AltGraph"),this.keyCode=tA(r),this.code=r.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 r=0;return this.ctrlKey&&(r|=iA),this.altKey&&(r|=rA),this.shiftKey&&(r|=sA),this.metaKey&&(r|=nA),r|=t,r}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new JT(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},Yy=new WeakMap;function oA(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var aA=class{static getSameOriginWindowChain(e){let t=Yy.get(e);if(!t){t=[],Yy.set(e,t);let r=e,n;do n=oA(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,a=this.getSameOriginWindowChain(e);for(let c of a){let u=c.window.deref();if(r+=u?.scrollY??0,n+=u?.scrollX??0,u===t||!c.iframeElement)break;let f=c.iframeElement.getBoundingClientRect();r+=f.top,n+=f.left}return{top:r,left:n}}},su=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=aA.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Ky=class{constructor(e,t=0,r=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(Bp){let a=navigator.userAgent.match(/Chrome\/(\d+)/);n=(a?parseInt(a[1]):123)<=122}if(e){let a=e,c=e,u=e.view?.devicePixelRatio||1;if(typeof a.wheelDeltaY<"u")n?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof c.VERTICAL_AXIS<"u"&&c.axis===c.VERTICAL_AXIS)this.deltaY=-c.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?Nm&&!Pr?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")WT&&m1?this.deltaX=-(a.wheelDeltaX/120):n?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof c.HORIZONTAL_AXIS<"u"&&c.axis===c.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?Nm&&!Pr?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},g1=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),lA;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof cA?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ai.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:g1})})(lA||={});var cA=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?g1:(this._emitter||(this._emitter=new fe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},zp=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Rm("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Rm("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},uA=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new Rm("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=ft(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},hA;(e=>{async function t(n){let a,c=await Promise.all(n.map(u=>u.then(f=>f,f=>{a||(a=f)})));if(typeof a<"u")throw a;return c}e.settled=t;function r(n){return new Promise(async(a,c)=>{try{await n(a,c)}catch(u){c(u)}})}e.withAsyncBody=r})(hA||={});var Gy=class sr{static fromArray(t){return new sr(r=>{r.emitMany(t)})}static fromPromise(t){return new sr(async r=>{r.emitMany(await t)})}static fromPromises(t){return new sr(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new sr(async r=>{await Promise.all(t.map(async n=>{for await(let a of n)r.emitOne(a)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new fe,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ai.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new sr(async n=>{for await(let a of t)n.emitOne(r(a))})}map(t){return sr.map(this,t)}static filter(t,r){return new sr(async n=>{for await(let a of t)r(a)&&n.emitOne(a)})}filter(t){return sr.filter(this,t)}static coalesce(t){return sr.filter(t,r=>!!r)}coalesce(){return sr.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return sr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Gy.EMPTY=Gy.fromArray([]);var{getWindow:zr,getWindowId:dA,onDidRegisterWindow:fA}=(function(){let e=new Map,t={window:ws,disposables:new fn};e.set(ws.vscodeWindowId,t);let r=new fe,n=new fe,a=new fe;function c(u,f){return(typeof u=="number"?e.get(u):void 0)??(f?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Be.None;let f=new fn,m={window:u,disposables:f.add(new fn)};return e.set(u.vscodeWindowId,m),f.add(ft(()=>{e.delete(u.vscodeWindowId),n.fire(u)})),f.add(Ee(u,qt.BEFORE_UNLOAD,()=>{a.fire(u)})),r.fire(m),f},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:c,getWindow(u){let f=u;if(f?.ownerDocument?.defaultView)return f.ownerDocument.defaultView.window;let m=u;return m?.view?m.view.window:ws},getDocument(u){return zr(u).document}}})(),mA=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,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 Ee(e,t,r,n){return new mA(e,t,r,n)}var Xy=function(e,t,r,n){return Ee(e,t,r,n)},jp,pA=class extends uA{constructor(e){super(),this.defaultTarget=e&&zr(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},Zy=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){bu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,a=c=>{r.set(c,!1);let u=e.get(c)??[];for(t.set(c,u),e.set(c,[]),n.set(c,!0);u.length>0;)u.sort(Zy.sort),u.shift().execute();n.set(c,!1)};jp=(c,u,f=0)=>{let m=dA(c),d=new Zy(u,f),g=e.get(m);return g||(g=[],e.set(m,g)),g.push(d),r.get(m)||(r.set(m,!0),c.requestAnimationFrame(()=>a(m))),d}})();function _A(e){let t=e.getBoundingClientRect(),r=zr(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var qt={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"},gA=class{constructor(e){this.domNode=e,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(e){let t=Ri(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ri(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ri(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ri(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ri(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ri(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ri(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ri(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ri(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ri(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ri(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ri(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ri(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ri(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ri(e){return typeof e=="number"?`${e}px`:e}function bl(e){return new gA(e)}var v1=class{constructor(){this._hooks=new fn,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=a;let c=e;try{e.setPointerCapture(t),this._hooks.add(ft(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{c=zr(e)}this._hooks.add(Ee(c,qt.POINTER_MOVE,u=>{if(u.buttons!==r){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ee(c,qt.POINTER_UP,u=>this.stopMonitoring(!0)))}};function vA(e,t,r){let n=null,a=null;if(typeof r.value=="function"?(n="value",a=r.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",a=r.get),!a)throw new Error("not supported");let c=`$memoize$${t}`;r[n]=function(...u){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[c]}}var Or;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Or||={});var fl=class ui extends Be{constructor(){super(),this.dispatched=!1,this.targets=new Iy,this.ignoreTargets=new Iy,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ai.runAndSubscribe(fA,({window:t,disposables:r})=>{r.add(Ee(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(Ee(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(Ee(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:ws,disposables:this._store}))}static addTarget(t){if(!ui.isTouchDevice())return Be.None;ui.INSTANCE||(ui.INSTANCE=new ui);let r=ui.INSTANCE.targets.push(t);return ft(r)}static ignoreTarget(t){if(!ui.isTouchDevice())return Be.None;ui.INSTANCE||(ui.INSTANCE=new ui);let r=ui.INSTANCE.ignoreTargets.push(t);return ft(r)}static isTouchDevice(){return"ontouchstart"in ws||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,a=t.targetTouches.length;n<a;n++){let c=t.targetTouches.item(n);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:r,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[r],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let u=this.newGestureEvent(Or.Start,c.target);u.pageX=c.pageX,u.pageY=c.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),a=Object.keys(this.activeTouches).length;for(let c=0,u=r.changedTouches.length;c<u;c++){let f=r.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(f.identifier))){console.warn("move of an UNKNOWN touch",f);continue}let m=this.activeTouches[f.identifier],d=Date.now()-m.initialTimeStamp;if(d<ui.HOLD_DELAY&&Math.abs(m.initialPageX-Ui(m.rollingPageX))<30&&Math.abs(m.initialPageY-Ui(m.rollingPageY))<30){let g=this.newGestureEvent(Or.Tap,m.initialTarget);g.pageX=Ui(m.rollingPageX),g.pageY=Ui(m.rollingPageY),this.dispatchEvent(g)}else if(d>=ui.HOLD_DELAY&&Math.abs(m.initialPageX-Ui(m.rollingPageX))<30&&Math.abs(m.initialPageY-Ui(m.rollingPageY))<30){let g=this.newGestureEvent(Or.Contextmenu,m.initialTarget);g.pageX=Ui(m.rollingPageX),g.pageY=Ui(m.rollingPageY),this.dispatchEvent(g)}else if(a===1){let g=Ui(m.rollingPageX),_=Ui(m.rollingPageY),S=Ui(m.rollingTimestamps)-m.rollingTimestamps[0],w=g-m.rollingPageX[0],x=_-m.rollingPageY[0],C=[...this.targets].filter(k=>m.initialTarget instanceof Node&&k.contains(m.initialTarget));this.inertia(t,C,n,Math.abs(w)/S,w>0?1:-1,g,Math.abs(x)/S,x>0?1:-1,_)}this.dispatchEvent(this.newGestureEvent(Or.End,m.initialTarget)),delete this.activeTouches[f.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===Or.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>ui.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===Or.Change||t.type===Or.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let a=0,c=t.initialTarget;for(;c&&c!==n;)a++,c=c.parentElement;r.push([a,n])}r.sort((n,a)=>n[0]-a[0]);for(let[n,a]of r)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,a,c,u,f,m,d){this.handle=jp(t,()=>{let g=Date.now(),_=g-n,S=0,w=0,x=!0;a+=ui.SCROLL_FRICTION*_,f+=ui.SCROLL_FRICTION*_,a>0&&(x=!1,S=c*a*_),f>0&&(x=!1,w=m*f*_);let C=this.newGestureEvent(Or.Change);C.translationX=S,C.translationY=w,r.forEach(k=>k.dispatchEvent(C)),x||this.inertia(t,r,g,a,c,u+S,f,m,d+w)})}onTouchMove(t){let r=Date.now();for(let n=0,a=t.changedTouches.length;n<a;n++){let c=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let u=this.activeTouches[c.identifier],f=this.newGestureEvent(Or.Change,u.initialTarget);f.translationX=c.pageX-Ui(u.rollingPageX),f.translationY=c.pageY-Ui(u.rollingPageY),f.pageX=c.pageX,f.pageY=c.pageY,this.dispatchEvent(f),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(c.pageX),u.rollingPageY.push(c.pageY),u.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};fl.SCROLL_FRICTION=-.005,fl.HOLD_DELAY=700,fl.CLEAR_TAP_COUNT_TIME=400,xt([vA],fl,"isTouchDevice",1);var yA=fl,Hp=class extends Be{onclick(e,t){this._register(Ee(e,qt.CLICK,r=>t(new su(zr(e),r))))}onmousedown(e,t){this._register(Ee(e,qt.MOUSE_DOWN,r=>t(new su(zr(e),r))))}onmouseover(e,t){this._register(Ee(e,qt.MOUSE_OVER,r=>t(new su(zr(e),r))))}onmouseleave(e,t){this._register(Ee(e,qt.MOUSE_LEAVE,r=>t(new su(zr(e),r))))}onkeydown(e,t){this._register(Ee(e,qt.KEY_DOWN,r=>t(new Vy(r))))}onkeyup(e,t){this._register(Ee(e,qt.KEY_UP,r=>t(new Vy(r))))}oninput(e,t){this._register(Ee(e,qt.INPUT,t))}onblur(e,t){this._register(Ee(e,qt.BLUR,t))}onfocus(e,t){this._register(Ee(e,qt.FOCUS,t))}onchange(e,t){this._register(Ee(e,qt.CHANGE,t))}ignoreGesture(e){return yA.ignoreTarget(e)}},Qy=11,bA=class extends Hp{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Qy+"px",this.domNode.style.height=Qy+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new v1),this._register(Xy(this.bgDomNode,qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Xy(this.domNode,qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new pA),this._pointerdownScheduleRepeatTimer=this._register(new zp)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,zr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},SA=class Lm{constructor(t,r,n,a,c,u,f){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,a=a|0,c=c|0,u=u|0,f=f|0),this.rawScrollLeft=a,this.rawScrollTop=f,r<0&&(r=0),a+r>n&&(a=n-r),a<0&&(a=0),c<0&&(c=0),f+c>u&&(f=u-c),f<0&&(f=0),this.width=r,this.scrollWidth=n,this.scrollLeft=a,this.height=c,this.scrollHeight=u,this.scrollTop=f}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new Lm(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Lm(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let n=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,c=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,f=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:a,scrollLeftChanged:c,heightChanged:u,scrollHeightChanged:f,scrollTopChanged:m}}},wA=class extends Be{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new SA(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new eb(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=eb.start(this._state,r,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 e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},Jy=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function Yf(e,t){let r=t-e;return function(n){return e+r*EA(n)}}function xA(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var eb=class zm{constructor(t,r,n,a){this.from=t,this.to=r,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(t,r,n){if(Math.abs(t-r)>2.5*n){let a,c;return t<r?(a=t+.75*n,c=r-.75*n):(a=t-.75*n,c=r+.75*n),xA(Yf(t,a),Yf(c,r),.33)}return Yf(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),a=this.scrollTop(r);return new Jy(n,a,!1)}return new Jy(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return zm.start(t,r,n)}static start(t,r,n){n=n+10;let a=Date.now()-10;return new zm(t,r,a,n)}};function CA(e){return Math.pow(e,3)}function EA(e){return 1-CA(1-e)}var RA=class extends Be{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new zp)}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":"")))}},kA=140,y1=class extends Hp{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 RA(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new v1),this._shouldRender=!0,this.domNode=bl(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(Ee(this.domNode.domNode,qt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new bA(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=bl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ee(this.slider.domNode,qt.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.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 t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);r<=a&&a<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let a=_A(this.domNode.domNode);t=e.pageX-a.left,r=e.pageY-a.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let c=this._sliderOrthogonalPointerPosition(a),u=Math.abs(c-r);if(m1&&u>kA){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let f=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(f))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},b1=class jm{constructor(t,r,n,a,c,u){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=c,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new jm(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,a,c){let u=Math.max(0,n-t),f=Math.max(0,u-2*r),m=a>0&&a>n;if(!m)return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(n*f/a))),g=(f-d)/(a-n),_=c*g;return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(d),computedSliderRatio:g,computedSliderPosition:Math.round(_)}}_refreshComputedValues(){let t=jm._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},TA=class extends y1{constructor(e,t,r){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new b1(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},AA=class extends y1{constructor(e,t,r){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new b1(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},DA=500,tb=50,MA=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Hm=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,n=1,a=this._rear;do{let c=a===this._front?t:Math.pow(2,-n);if(t-=c,r+=this._memory[a].score*c,a===this._front)break;a=(this._capacity+a-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(Bp){let r=zr(t.browserEvent),n=$T(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let a=null,c=new MA(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=c,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]=c),c.score=this._computeScore(c,a)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let a=Math.abs(t.deltaX),c=Math.abs(t.deltaY),u=Math.abs(r.deltaX),f=Math.abs(r.deltaY),m=Math.max(Math.min(a,u),1),d=Math.max(Math.min(c,f),1),g=Math.max(a,u),_=Math.max(c,f);g%m===0&&_%d===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Hm.INSTANCE=new Hm;var NA=Hm,OA=class extends Hp{constructor(e,t,r){super(),this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new fe),this.onWillScroll=this._onWillScroll.event,this._options=LA(t),this._scrollable=r,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 AA(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new TA(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(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=bl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bl(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 zp),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Kn(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Pr&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Ky(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Kn(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new Ky(r))};this._mouseWheelToDispose.push(Ee(this._listenOnDomNode,qt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=NA.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,c=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&c+a===0?c=a=0:Math.abs(a)>=Math.abs(c)?c=0:a=0),this._options.flipAxes&&([a,c]=[c,a]);let u=!Pr&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!c&&(c=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(c=c*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let f=this._scrollable.getFutureScrollPosition(),m={};if(a){let d=tb*a,g=f.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(m,g)}if(c){let d=tb*c,g=f.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(m,g)}m=this._scrollable.validateScrollPosition(m),(f.scrollLeft!==m.scrollLeft||f.scrollTop!==m.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(m):this._scrollable.setScrollPositionNow(m),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||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 e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",a=t?" top":"",c=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${a}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){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(),DA)}},BA=class extends OA{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function LA(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Pr&&(t.className+=" mac"),t}var Pm=class extends Be{constructor(e,t,r,n,a,c,u,f){super(),this._bufferService=r,this._optionsService=u,this._renderService=f,this._onRequestScrollLines=this._register(new fe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new wA({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>jp(n.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new BA(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ai.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ft(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ft(()=>this._styleElement.remove())),this._register(ai.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
`)})),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(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Pm=xt([pe(2,_i),pe(3,Ts),pe(4,e1),pe(5,aa),pe(6,gi),pe(7,As)],Pm);var Um=class extends Be{constructor(e,t,r,n,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,this._renderService=a,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(c=>this._removeDecoration(c))),this._register(ft(()=>{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 t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Um=xt([pe(1,_i),pe(2,Ts),pe(3,Ml),pe(4,As)],Um);var zA=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Dr={full:0,left:0,center:0,right:0},on={full:0,left:0,center:0,right:0},nl={full:0,left:0,center:0,right:0},Lu=class extends Be{constructor(e,t,r,n,a,c,u,f){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=a,this._optionsService=c,this._themeService=u,this._coreBrowserService=f,this._colorZoneStore=new zA,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(ft(()=>this._canvas?.remove()));let m=this._canvas.getContext("2d");if(m)this._ctx=m;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),t=Math.ceil((this._canvas.width-1)/3);on.full=this._canvas.width,on.left=e,on.center=t,on.right=e,this._refreshDrawHeightConstants(),nl.full=1,nl.left=1,nl.center=1+on.left,nl.right=1+on.left+on.center}_refreshDrawHeightConstants(){Dr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Dr.left=t,Dr.center=t,Dr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Dr.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(nl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Dr[e.position||"full"]/2),on[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Dr[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Lu=xt([pe(2,_i),pe(3,Ml),pe(4,As),pe(5,gi),pe(6,aa),pe(7,Ts)],Lu);var oe;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(oe||={});var xu;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(xu||={});var S1;(e=>e.ST=`${oe.ESC}\\`)(S1||={});var Im=class{constructor(e,t,r,n,a,c){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=a,this._renderService=c,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${oe.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Im=xt([pe(2,_i),pe(3,gi),pe(4,eo),pe(5,As)],Im);var Vt=0,Yt=0,Kt=0,bt=0,ib={css:"#00000000",rgba:0},Nt;(e=>{function t(a,c,u,f){return f!==void 0?`#${In(a)}${In(c)}${In(u)}${In(f)}`:`#${In(a)}${In(c)}${In(u)}`}e.toCss=t;function r(a,c,u,f=255){return(a<<24|c<<16|u<<8|f)>>>0}e.toRgba=r;function n(a,c,u,f){return{css:e.toCss(a,c,u,f),rgba:e.toRgba(a,c,u,f)}}e.toColor=n})(Nt||={});var ht;(e=>{function t(m,d){if(bt=(d.rgba&255)/255,bt===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,_=d.rgba>>16&255,S=d.rgba>>8&255,w=m.rgba>>24&255,x=m.rgba>>16&255,C=m.rgba>>8&255;Vt=w+Math.round((g-w)*bt),Yt=x+Math.round((_-x)*bt),Kt=C+Math.round((S-C)*bt);let k=Nt.toCss(Vt,Yt,Kt),T=Nt.toRgba(Vt,Yt,Kt);return{css:k,rgba:T}}e.blend=t;function r(m){return(m.rgba&255)===255}e.isOpaque=r;function n(m,d,g){let _=Cu.ensureContrastRatio(m.rgba,d.rgba,g);if(_)return Nt.toColor(_>>24&255,_>>16&255,_>>8&255)}e.ensureContrastRatio=n;function a(m){let d=(m.rgba|255)>>>0;return[Vt,Yt,Kt]=Cu.toChannels(d),{css:Nt.toCss(Vt,Yt,Kt),rgba:d}}e.opaque=a;function c(m,d){return bt=Math.round(d*255),[Vt,Yt,Kt]=Cu.toChannels(m.rgba),{css:Nt.toCss(Vt,Yt,Kt,bt),rgba:Nt.toRgba(Vt,Yt,Kt,bt)}}e.opacity=c;function u(m,d){return bt=m.rgba&255,c(m,bt*d/255)}e.multiplyOpacity=u;function f(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=f})(ht||={});var _t;(e=>{let t,r;try{let a=document.createElement("canvas");a.width=1,a.height=1;let c=a.getContext("2d",{willReadFrequently:!0});c&&(t=c,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Vt=parseInt(a.slice(1,2).repeat(2),16),Yt=parseInt(a.slice(2,3).repeat(2),16),Kt=parseInt(a.slice(3,4).repeat(2),16),Nt.toColor(Vt,Yt,Kt);case 5:return Vt=parseInt(a.slice(1,2).repeat(2),16),Yt=parseInt(a.slice(2,3).repeat(2),16),Kt=parseInt(a.slice(3,4).repeat(2),16),bt=parseInt(a.slice(4,5).repeat(2),16),Nt.toColor(Vt,Yt,Kt,bt);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 c=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(c)return Vt=parseInt(c[1]),Yt=parseInt(c[2]),Kt=parseInt(c[3]),bt=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),Nt.toColor(Vt,Yt,Kt,bt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Vt,Yt,Kt,bt]=t.getImageData(0,0,1,1).data,bt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Nt.toRgba(Vt,Yt,Kt,bt),css:a}}e.toColor=n})(_t||={});var mi;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,a,c){let u=n/255,f=a/255,m=c/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),g=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),_=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return d*.2126+g*.7152+_*.0722}e.relativeLuminance2=r})(mi||={});var Cu;(e=>{function t(u,f){if(bt=(f&255)/255,bt===1)return f;let m=f>>24&255,d=f>>16&255,g=f>>8&255,_=u>>24&255,S=u>>16&255,w=u>>8&255;return Vt=_+Math.round((m-_)*bt),Yt=S+Math.round((d-S)*bt),Kt=w+Math.round((g-w)*bt),Nt.toRgba(Vt,Yt,Kt)}e.blend=t;function r(u,f,m){let d=mi.relativeLuminance(u>>8),g=mi.relativeLuminance(f>>8);if(gs(d,g)<m){if(g<d){let w=n(u,f,m),x=gs(d,mi.relativeLuminance(w>>8));if(x<m){let C=a(u,f,m),k=gs(d,mi.relativeLuminance(C>>8));return x>k?w:C}return w}let _=a(u,f,m),S=gs(d,mi.relativeLuminance(_>>8));if(S<m){let w=n(u,f,m),x=gs(d,mi.relativeLuminance(w>>8));return S>x?_:w}return _}}e.ensureContrastRatio=r;function n(u,f,m){let d=u>>24&255,g=u>>16&255,_=u>>8&255,S=f>>24&255,w=f>>16&255,x=f>>8&255,C=gs(mi.relativeLuminance2(S,w,x),mi.relativeLuminance2(d,g,_));for(;C<m&&(S>0||w>0||x>0);)S-=Math.max(0,Math.ceil(S*.1)),w-=Math.max(0,Math.ceil(w*.1)),x-=Math.max(0,Math.ceil(x*.1)),C=gs(mi.relativeLuminance2(S,w,x),mi.relativeLuminance2(d,g,_));return(S<<24|w<<16|x<<8|255)>>>0}e.reduceLuminance=n;function a(u,f,m){let d=u>>24&255,g=u>>16&255,_=u>>8&255,S=f>>24&255,w=f>>16&255,x=f>>8&255,C=gs(mi.relativeLuminance2(S,w,x),mi.relativeLuminance2(d,g,_));for(;C<m&&(S<255||w<255||x<255);)S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),C=gs(mi.relativeLuminance2(S,w,x),mi.relativeLuminance2(d,g,_));return(S<<24|w<<16|x<<8|255)>>>0}e.increaseLuminance=a;function c(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=c})(Cu||={});function In(e){let t=e.toString(16);return t.length<2?"0"+t:t}function gs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var jA=class extends Dl{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}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()]}},zu=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new lr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],n=t.translateToString(!0),a=0,c=0,u=0,f=t.getFg(0),m=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==m){if(d-a>1){let g=this._getJoinedRanges(n,u,c,t,a);for(let _=0;_<g.length;_++)r.push(g[_])}a=d,u=c,f=this._workCell.fg,m=this._workCell.bg}c+=this._workCell.getChars().length||hn.length}if(this._bufferService.cols-a>1){let d=this._getJoinedRanges(n,u,c,t,a);for(let g=0;g<d.length;g++)r.push(d[g])}return r}_getJoinedRanges(e,t,r,n,a){let c=e.substring(t,r),u=[];try{u=this._characterJoiners[0].handler(c)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let m=this._characterJoiners[f].handler(c);for(let d=0;d<m.length;d++)zu._mergeRanges(u,m[d])}catch(m){console.error(m)}return this._stringRangesToCellRanges(u,n,a),u}_stringRangesToCellRanges(e,t,r){let n=0,a=!1,c=0,u=e[n];if(u){for(let f=r;f<this._bufferService.cols;f++){let m=t.getWidth(f),d=t.getString(f).length||hn.length;if(m!==0){if(!a&&u[0]<=c&&(u[0]=f,a=!0),u[1]<=c){if(u[1]=f,u=e[++n],!u)break;u[0]<=c?(u[0]=f,a=!0):a=!1}c+=d}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(r){if(t[1]<=a[0])return e[n-1][1]=t[1],e;if(t[1]<=a[1])return e[n-1][1]=Math.max(t[1],a[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=a[0])return e.splice(n,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};zu=xt([pe(0,_i)],zu);function HA(e){return 57508<=e&&e<=57558}function PA(e){return 9472<=e&&e<=9631}function UA(e){return HA(e)||PA(e)}function IA(){return{css:{canvas:nu(),cell:nu()},device:{canvas:nu(),cell:nu(),char:{width:0,height:0,left:0,top:0}}}}function nu(){return{width:0,height:0}}var $m=class{constructor(e,t,r,n,a,c,u){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=a,this._decorationService=c,this._themeService=u,this._workCell=new lr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,a,c,u,f,m,d,g){let _=[],S=this._characterJoinerService.getJoinedCharacters(t),w=this._themeService.colors,x=e.getNoBgTrimmedLength();r&&x<c+1&&(x=c+1);let C,k=0,T="",$=0,z=0,A=0,j=0,P=!1,F=0,G=!1,re=0,le=0,ce=[],W=d!==-1&&g!==-1;for(let M=0;M<x;M++){e.loadCell(M,this._workCell);let H=this._workCell.getWidth();if(H===0)continue;let N=!1,R=M>=le,L=M,U=this._workCell;if(S.length>0&&M===S[0][0]&&R){let Re=S.shift(),mt=this._isCellInSelection(Re[0],t);for($=Re[0]+1;$<Re[1];$++)R&&=mt===this._isCellInSelection($,t);R&&=!r||c<Re[0]||c>=Re[1],R?(N=!0,U=new jA(this._workCell,e.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),L=Re[1]-1,H=U.getWidth()):le=Re[1]}let se=this._isCellInSelection(M,t),ee=r&&M===c,D=W&&M>=d&&M<=g,O=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,Re=>{O=!0});let q=U.getChars()||hn;if(q===" "&&(U.isUnderline()||U.isOverline())&&(q=" "),re=H*f-m.get(q,U.isBold(),U.isItalic()),!C)C=this._document.createElement("span");else if(k&&(se&&G||!se&&!G&&U.bg===z)&&(se&&G&&w.selectionForeground||U.fg===A)&&U.extended.ext===j&&D===P&&re===F&&!ee&&!N&&!O&&R){U.isInvisible()?T+=hn:T+=q,k++;continue}else k&&(C.textContent=T),C=this._document.createElement("span"),k=0,T="";if(z=U.bg,A=U.fg,j=U.extended.ext,P=D,F=re,G=se,N&&c>=M&&c<=L&&(c=M),!this._coreService.isCursorHidden&&ee&&this._coreService.isCursorInitialized){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&ce.push("xterm-cursor-blink"),ce.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline");break}}if(U.isBold()&&ce.push("xterm-bold"),U.isItalic()&&ce.push("xterm-italic"),U.isDim()&&ce.push("xterm-dim"),U.isInvisible()?T=hn:T=U.getChars()||hn,U.isUnderline()&&(ce.push(`xterm-underline-${U.extended.underlineStyle}`),T===" "&&(T=" "),!U.isUnderlineColorDefault()))if(U.isUnderlineColorRGB())C.style.textDecorationColor=`rgb(${Dl.toColorRGB(U.getUnderlineColor()).join(",")})`;else{let Re=U.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&U.isBold()&&Re<8&&(Re+=8),C.style.textDecorationColor=w.ansi[Re].css}U.isOverline()&&(ce.push("xterm-overline"),T===" "&&(T=" ")),U.isStrikethrough()&&ce.push("xterm-strikethrough"),D&&(C.style.textDecoration="underline");let Q=U.getFgColor(),X=U.getFgColorMode(),ae=U.getBgColor(),de=U.getBgColorMode(),_e=!!U.isInverse();if(_e){let Re=Q;Q=ae,ae=Re;let mt=X;X=de,de=mt}let me,Je,ot=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,Re=>{Re.options.layer!=="top"&&ot||(Re.backgroundColorRGB&&(de=50331648,ae=Re.backgroundColorRGB.rgba>>8&16777215,me=Re.backgroundColorRGB),Re.foregroundColorRGB&&(X=50331648,Q=Re.foregroundColorRGB.rgba>>8&16777215,Je=Re.foregroundColorRGB),ot=Re.options.layer==="top")}),!ot&&se&&(me=this._coreBrowserService.isFocused?w.selectionBackgroundOpaque:w.selectionInactiveBackgroundOpaque,ae=me.rgba>>8&16777215,de=50331648,ot=!0,w.selectionForeground&&(X=50331648,Q=w.selectionForeground.rgba>>8&16777215,Je=w.selectionForeground)),ot&&ce.push("xterm-decoration-top");let Ke;switch(de){case 16777216:case 33554432:Ke=w.ansi[ae],ce.push(`xterm-bg-${ae}`);break;case 50331648:Ke=Nt.toColor(ae>>16,ae>>8&255,ae&255),this._addStyle(C,`background-color:#${rb((ae>>>0).toString(16),"0",6)}`);break;default:_e?(Ke=w.foreground,ce.push("xterm-bg-257")):Ke=w.background}switch(me||U.isDim()&&(me=ht.multiplyOpacity(Ke,.5)),X){case 16777216:case 33554432:U.isBold()&&Q<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Q+=8),this._applyMinimumContrast(C,Ke,w.ansi[Q],U,me,void 0)||ce.push(`xterm-fg-${Q}`);break;case 50331648:let Re=Nt.toColor(Q>>16&255,Q>>8&255,Q&255);this._applyMinimumContrast(C,Ke,Re,U,me,Je)||this._addStyle(C,`color:#${rb(Q.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(C,Ke,w.foreground,U,me,Je)||_e&&ce.push("xterm-fg-257")}ce.length&&(C.className=ce.join(" "),ce.length=0),!ee&&!N&&!O&&R?k++:C.textContent=T,re!==this.defaultSpacing&&(C.style.letterSpacing=`${re}px`),_.push(C),M=L}return C&&k&&(C.textContent=T),_}_applyMinimumContrast(e,t,r,n,a,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||UA(n.getCode()))return!1;let u=this._getContrastCache(n),f;if(!a&&!c&&(f=u.getColor(t.rgba,r.rgba)),f===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);f=ht.ensureContrastRatio(a||t,c||r,m),u.setColor((a||t).rgba,(c||r).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,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};$m=xt([pe(1,r1),pe(2,gi),pe(3,Ts),pe(4,eo),pe(5,Ml),pe(6,aa)],$m);function rb(e,t,r){for(;e.length<r;)e=t+e;return e}var $A=class{constructor(e,t){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 r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[r,n,a,c],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(c),t.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,t,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let u=this._measure(e,0);return u>0&&(this._flat[n]=u),u}let a=e;t&&(a+="B"),r&&(a+="I");let c=this._holey.get(a);if(c===void 0){let u=0;t&&(u|=1),r&&(u|=2),c=this._measure(e,u),c>0&&this._holey.set(a,c)}return c}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},FA=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,t,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let a=e.buffers.active.ydisp,c=t[1]-a,u=r[1]-a,f=Math.max(c,0),m=Math.min(u,e.rows-1);if(f>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=c,this.viewportEndRow=u,this.viewportCappedStartRow=f,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function WA(){return new FA}var Kf="xterm-dom-renderer-owner-",rr="xterm-rows",ou="xterm-fg-",sb="xterm-bg-",ol="xterm-focus",au="xterm-selection",qA=1,Fm=class extends Be{constructor(e,t,r,n,a,c,u,f,m,d,g,_,S,w){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=a,this._helperContainer=c,this._linkifier2=u,this._charSizeService=m,this._optionsService=d,this._bufferService=g,this._coreService=_,this._coreBrowserService=S,this._themeService=w,this._terminalClass=qA++,this._rowElements=[],this._selectionRenderModel=WA(),this.onRequestRedraw=this._register(new fe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(rr),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(au),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=IA(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance($m,document),this._element.classList.add(Kf+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(ft(()=>{this._element.classList.remove(Kf+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new $A(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 r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${rr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${rr} { 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}`;t+=`${this._terminalSelector} .${rr} .xterm-dim { color: ${ht.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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 r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${rr}.${ol} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${rr}.${ol} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${rr}.${ol} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${rr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${rr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${rr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${rr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${rr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${au} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${au} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${au} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,u]of e.ansi.entries())t+=`${this._terminalSelector} .${ou}${c} { color: ${u.css}; }${this._terminalSelector} .${ou}${c}.xterm-dim { color: ${ht.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${sb}${c} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${ou}257 { color: ${ht.opaque(e.background).css}; }${this._terminalSelector} .${ou}257.xterm-dim { color: ${ht.multiplyOpacity(ht.opaque(e.background),.5).css}; }${this._terminalSelector} .${sb}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(ol),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ol),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(r){let m=e[0]>t[0];f.appendChild(this._createSelectionElement(c,m?t[0]:e[0],m?e[0]:t[0],u-c+1))}else{let m=n===c?e[0]:0,d=c===a?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(c,m,d));let g=u-c-1;if(f.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,g)),c!==u){let _=a===u?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(u,0,_))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,r,n=1){let a=this._document.createElement("div"),c=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(r-t);return c+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-c),a.style.height=`${n*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${c}px`,a.style.width=`${u}px`,a}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,t){let r=this._bufferService.buffer,n=r.ybase+r.y,a=Math.min(r.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let d=m+r.ydisp,g=this._rowElements[m],_=r.lines.get(d);if(!g||!_)break;g.replaceChildren(...this._rowFactory.createRow(_,d,d===n,u,f,a,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Kf}${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,t,r,n,a,c){r<0&&(e=0),n<0&&(t=0);let u=this._bufferService.rows-1;r=Math.max(Math.min(r,u),0),n=Math.max(Math.min(n,u),0),a=Math.min(a,this._bufferService.cols);let f=this._bufferService.buffer,m=f.ybase+f.y,d=Math.min(f.x,a-1),g=this._optionsService.rawOptions.cursorBlink,_=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;for(let w=r;w<=n;++w){let x=w+f.ydisp,C=this._rowElements[w],k=f.lines.get(x);if(!C||!k)break;C.replaceChildren(...this._rowFactory.createRow(k,x,x===m,_,S,d,g,this.dimensions.css.cell.width,this._widthCache,c?w===r?e:0:-1,c?(w===n?t:a)-1:-1))}}};Fm=xt([pe(7,Mp),pe(8,rh),pe(9,gi),pe(10,_i),pe(11,eo),pe(12,Ts),pe(13,aa)],Fm);var Wm=class extends Be{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new fe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new YA(this._optionsService))}catch{this._measureStrategy=this._register(new VA(e,t,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())}};Wm=xt([pe(2,gi)],Wm);var w1=class extends Be{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},VA=class extends w1{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,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}},YA=class extends w1{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))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}},KA=class extends Be{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new GA(this._window)),this._onDprChange=this._register(new fe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new fe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(ai.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ee(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ee(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}},GA=class extends Be{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ra),this._onDprChange=this._register(new fe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ft(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ee(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)}},XA=class extends Be{constructor(){super(),this.linkProviders=[],this._register(ft(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Pp(e,t,r){let n=r.getBoundingClientRect(),a=e.getComputedStyle(r),c=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-n.left-c,t.clientY-n.top-u]}function ZA(e,t,r,n,a,c,u,f,m){if(!c)return;let d=Pp(e,t,r);if(d)return d[0]=Math.ceil((d[0]+(m?u/2:0))/u),d[1]=Math.ceil(d[1]/f),d[0]=Math.min(Math.max(d[0],1),n+(m?1:0)),d[1]=Math.min(Math.max(d[1],1),a),d}var qm=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,a){return ZA(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let r=Pp(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};qm=xt([pe(0,As),pe(1,rh)],qm);var QA=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},x1={};lT(x1,{getSafariVersion:()=>eD,isChromeOS:()=>k1,isFirefox:()=>C1,isIpad:()=>tD,isIphone:()=>iD,isLegacyEdge:()=>JA,isLinux:()=>Up,isMac:()=>ju,isNode:()=>sh,isSafari:()=>E1,isWindows:()=>R1});var sh=typeof process<"u"&&"title"in process,Nl=sh?"node":navigator.userAgent,Ol=sh?"node":navigator.platform,C1=Nl.includes("Firefox"),JA=Nl.includes("Edge"),E1=/^((?!chrome|android).)*safari/i.test(Nl);function eD(){if(!E1)return 0;let e=Nl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ju=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ol),tD=Ol==="iPad",iD=Ol==="iPhone",R1=["Windows","Win16","Win32","WinCE"].includes(Ol),Up=Ol.indexOf("Linux")>=0,k1=/\bCrOS\b/.test(Nl),T1=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,r=0,n=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),a=e.timeRemaining(),r*1.5>a){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=a}this.clear()}},rD=class extends T1{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},sD=class extends T1{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Hu=!sh&&"requestIdleCallback"in window?sD:rD,nD=class{constructor(){this._queue=new Hu}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Vm=class extends Be{constructor(e,t,r,n,a,c,u,f,m){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=a,this._coreBrowserService=f,this._renderer=this._register(new ra),this._pausedResizeTask=new nD,this._observerDisposable=this._register(new ra),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 fe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new fe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new fe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new fe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new QA((d,g)=>this._renderRows(d,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new oD(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ft(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=ft(()=>r.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,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,r){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,this._renderer.value?.handleSelectionChanged(e,t,r)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Vm=xt([pe(2,gi),pe(3,rh),pe(4,eo),pe(5,Ml),pe(6,_i),pe(7,Ts),pe(8,aa)],Vm);var oD=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function aD(e,t,r,n){let a=r.buffer.x,c=r.buffer.y;if(!r.buffer.hasScrollback)return uD(a,c,e,t,r,n)+nh(c,t,r,n)+hD(a,c,e,t,r,n);let u;if(c===t)return u=a>e?"D":"C",Cl(Math.abs(a-e),xl(u,n));u=c>t?"D":"C";let f=Math.abs(c-t),m=cD(c>t?e:a,r)+(f-1)*r.cols+1+lD(c>t?a:e);return Cl(m,xl(u,n))}function lD(e,t){return e-1}function cD(e,t){return t.cols-e}function uD(e,t,r,n,a,c){return nh(t,n,a,c).length===0?"":Cl(D1(e,t,e,t-Gn(t,a),!1,a).length,xl("D",c))}function nh(e,t,r,n){let a=e-Gn(e,r),c=t-Gn(t,r),u=Math.abs(a-c)-dD(e,t,r);return Cl(u,xl(A1(e,t),n))}function hD(e,t,r,n,a,c){let u;nh(t,n,a,c).length>0?u=n-Gn(n,a):u=t;let f=n,m=fD(e,t,r,n,a,c);return Cl(D1(e,u,r,f,m==="C",a).length,xl(m,c))}function dD(e,t,r){let n=0,a=e-Gn(e,r),c=t-Gn(t,r);for(let u=0;u<Math.abs(a-c);u++){let f=A1(e,t)==="A"?-1:1;r.buffer.lines.get(a+f*u)?.isWrapped&&n++}return n}function Gn(e,t){let r=0,n=t.buffer.lines.get(e),a=n?.isWrapped;for(;a&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),a=n?.isWrapped;return r}function fD(e,t,r,n,a,c){let u;return nh(r,n,a,c).length>0?u=n-Gn(n,a):u=t,e<r&&u<=n||e>=r&&u<n?"C":"D"}function A1(e,t){return e>t?"A":"B"}function D1(e,t,r,n,a,c){let u=e,f=t,m="";for(;(u!==r||f!==n)&&f>=0&&f<c.buffer.lines.length;)u+=a?1:-1,a&&u>c.cols-1?(m+=c.buffer.translateBufferLineToString(f,!1,e,u),u=0,e=0,f++):!a&&u<0&&(m+=c.buffer.translateBufferLineToString(f,!1,0,e+1),u=c.cols-1,e=u,f--);return m+c.buffer.translateBufferLineToString(f,!1,e,u)}function xl(e,t){let r=t?"O":"[";return oe.ESC+r+e}function Cl(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var mD=class{constructor(e){this._bufferService=e,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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function nb(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Gf=50,pD=15,_D=50,gD=500,vD=" ",yD=new RegExp(vD,"g"),Ym=class extends Be{constructor(e,t,r,n,a,c,u,f,m){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=a,this._mouseService=c,this._optionsService=u,this._renderService=f,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new lr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new fe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new fe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new fe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new fe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new mD(this._bufferService),this._activeSelectionMode=0,this._register(ft(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],c=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let f=r.translateBufferLineToString(u,!0,a,c);n.push(f)}}else{let a=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],a));for(let c=e[1]+1;c<=t[1]-1;c++){let u=r.lines.get(c),f=r.translateBufferLineToString(c,!0);u?.isWrapped?n[n.length-1]+=f:n.push(f)}if(e[1]!==t[1]){let c=r.lines.get(t[1]),u=r.translateBufferLineToString(t[1],!0,0,t[0]);c&&c.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(a=>a.replace(yD," ")).join(R1?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Up&&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 t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let r=this._linkifier.currentLink?.link?.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=nb(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Pp(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-Gf),Gf),t/=Gf,t/Math.abs(t)+Math.round(t*(pD-1)))}shouldForceSelection(e){return ju?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(),_D)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(ju&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=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 r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<gD&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=aD(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let a=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:a>1&&t!==n&&(r+=a-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,c=a.lines.get(e[1]);if(!c)return;let u=a.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(c,e[0]),m=f,d=e[0]-f,g=0,_=0,S=0,w=0;if(u.charAt(f)===" "){for(;f>0&&u.charAt(f-1)===" ";)f--;for(;m<u.length&&u.charAt(m+1)===" ";)m++}else{let k=e[0],T=e[0];c.getWidth(k)===0&&(g++,k--),c.getWidth(T)===2&&(_++,T++);let $=c.getString(T).length;for($>1&&(w+=$-1,m+=$-1);k>0&&f>0&&!this._isCharWordSeparator(c.loadCell(k-1,this._workCell));){c.loadCell(k-1,this._workCell);let z=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,k--):z>1&&(S+=z-1,f-=z-1),f--,k--}for(;T<c.length&&m+1<u.length&&!this._isCharWordSeparator(c.loadCell(T+1,this._workCell));){c.loadCell(T+1,this._workCell);let z=this._workCell.getChars().length;this._workCell.getWidth()===2?(_++,T++):z>1&&(w+=z-1,m+=z-1),m++,T++}}m++;let x=f+d-g+S,C=Math.min(this._bufferService.cols,m-f+g+_-S-w);if(!(!t&&u.slice(f,m).trim()==="")){if(r&&x===0&&c.getCodePoint(0)!==32){let k=a.lines.get(e[1]-1);if(k&&c.isWrapped&&k.getCodePoint(this._bufferService.cols-1)!==32){let T=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(T){let $=this._bufferService.cols-T.start;x-=$,C+=$}}}if(n&&x+C===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let k=a.lines.get(e[1]+1);if(k?.isWrapped&&k.getCodePoint(0)!==32){let T=this._getWordAt([0,e[1]+1],!1,!1,!0);T&&(C+=T.length)}}return{start:x,length:C}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=nb(r,this._bufferService.cols)}};Ym=xt([pe(3,_i),pe(4,eo),pe(5,Np),pe(6,gi),pe(7,As),pe(8,Ts)],Ym);var ob=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},ab=class{constructor(){this._color=new ob,this._css=new ob}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},zt=Object.freeze((()=>{let e=[_t.toColor("#2e3436"),_t.toColor("#cc0000"),_t.toColor("#4e9a06"),_t.toColor("#c4a000"),_t.toColor("#3465a4"),_t.toColor("#75507b"),_t.toColor("#06989a"),_t.toColor("#d3d7cf"),_t.toColor("#555753"),_t.toColor("#ef2929"),_t.toColor("#8ae234"),_t.toColor("#fce94f"),_t.toColor("#729fcf"),_t.toColor("#ad7fa8"),_t.toColor("#34e2e2"),_t.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],a=t[r/6%6|0],c=t[r%6];e.push({css:Nt.toCss(n,a,c),rgba:Nt.toRgba(n,a,c)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:Nt.toCss(n,n,n),rgba:Nt.toRgba(n,n,n)})}return e})()),Fn=_t.toColor("#ffffff"),ml=_t.toColor("#000000"),lb=_t.toColor("#ffffff"),cb=ml,al={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},bD=Fn,Km=class extends Be{constructor(e){super(),this._optionsService=e,this._contrastCache=new ab,this._halfContrastCache=new ab,this._onChangeColors=this._register(new fe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Fn,background:ml,cursor:lb,cursorAccent:cb,selectionForeground:void 0,selectionBackgroundTransparent:al,selectionBackgroundOpaque:ht.blend(ml,al),selectionInactiveBackgroundTransparent:al,selectionInactiveBackgroundOpaque:ht.blend(ml,al),scrollbarSliderBackground:ht.opacity(Fn,.2),scrollbarSliderHoverBackground:ht.opacity(Fn,.4),scrollbarSliderActiveBackground:ht.opacity(Fn,.5),overviewRulerBorder:Fn,ansi:zt.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 t=this._colors;if(t.foreground=rt(e.foreground,Fn),t.background=rt(e.background,ml),t.cursor=ht.blend(t.background,rt(e.cursor,lb)),t.cursorAccent=ht.blend(t.background,rt(e.cursorAccent,cb)),t.selectionBackgroundTransparent=rt(e.selectionBackground,al),t.selectionBackgroundOpaque=ht.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=rt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ht.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?rt(e.selectionForeground,ib):void 0,t.selectionForeground===ib&&(t.selectionForeground=void 0),ht.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ht.opacity(t.selectionBackgroundTransparent,.3)),ht.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ht.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=rt(e.scrollbarSliderBackground,ht.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=rt(e.scrollbarSliderHoverBackground,ht.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=rt(e.scrollbarSliderActiveBackground,ht.opacity(t.foreground,.5)),t.overviewRulerBorder=rt(e.overviewRulerBorder,bD),t.ansi=zt.slice(),t.ansi[0]=rt(e.black,zt[0]),t.ansi[1]=rt(e.red,zt[1]),t.ansi[2]=rt(e.green,zt[2]),t.ansi[3]=rt(e.yellow,zt[3]),t.ansi[4]=rt(e.blue,zt[4]),t.ansi[5]=rt(e.magenta,zt[5]),t.ansi[6]=rt(e.cyan,zt[6]),t.ansi[7]=rt(e.white,zt[7]),t.ansi[8]=rt(e.brightBlack,zt[8]),t.ansi[9]=rt(e.brightRed,zt[9]),t.ansi[10]=rt(e.brightGreen,zt[10]),t.ansi[11]=rt(e.brightYellow,zt[11]),t.ansi[12]=rt(e.brightBlue,zt[12]),t.ansi[13]=rt(e.brightMagenta,zt[13]),t.ansi[14]=rt(e.brightCyan,zt[14]),t.ansi[15]=rt(e.brightWhite,zt[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=rt(e.extendedAnsi[n],zt[n+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};Km=xt([pe(0,gi)],Km);function rt(e,t){if(e!==void 0)try{return _t.toColor(e)}catch{}return t}var SD=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},wD=class{constructor(){this._services=new SD,this._services.set(Mp,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=pT(e).sort((c,u)=>c.index-u.index),n=[];for(let c of r){let u=this._services.get(c.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);n.push(u)}let a=r.length>0?r[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},xD={trace:0,debug:1,info:2,warn:3,error:4,off:5},CD="xterm.js: ",Gm=class extends Be{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=xD[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":CD)+t,...r)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Gm=xt([pe(0,gi)],Gm);var ub=class extends Be{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new fe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new fe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new fe),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 t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let a=t-1;a>=0;a--)this.set(e+a+r,this.get(e+a));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ne=3,Mt=Object.freeze(new Dl),lu=0,Xf=2,pl=class M1{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ne);let a=r||lr.fromCharData([0,XS,1,0]);for(let c=0;c<t;++c)this.setCell(c,a);this.length=t}get(t){let r=this._data[t*Ne+0],n=r&2097151;return[this._data[t*Ne+1],r&2097152?this._combined[t]:n?un(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*Ne+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Ne+0]=t|2097152|r[2]<<22):this._data[t*Ne+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Ne+0]>>22}hasWidth(t){return this._data[t*Ne+0]&12582912}getFg(t){return this._data[t*Ne+1]}getBg(t){return this._data[t*Ne+2]}hasContent(t){return this._data[t*Ne+0]&4194303}getCodePoint(t){let r=this._data[t*Ne+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Ne+0]&2097152}getString(t){let r=this._data[t*Ne+0];return r&2097152?this._combined[t]:r&2097151?un(r&2097151):""}isProtected(t){return this._data[t*Ne+2]&536870912}loadCell(t,r){return lu=t*Ne,r.content=this._data[lu+0],r.fg=this._data[lu+1],r.bg=this._data[lu+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Ne+0]=r.content,this._data[t*Ne+1]=r.fg,this._data[t*Ne+2]=r.bg}setCellFromCodepoint(t,r,n,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ne+0]=r|n<<22,this._data[t*Ne+1]=a.fg,this._data[t*Ne+2]=a.bg}addCodepointToCell(t,r,n){let a=this._data[t*Ne+0];a&2097152?this._combined[t]+=un(r):a&2097151?(this._combined[t]=un(a&2097151)+un(r),a&=-2097152,a|=2097152):a=r|1<<22,n&&(a&=-12582913,a|=n<<22),this._data[t*Ne+0]=a}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let a=new lr;for(let c=this.length-t-r-1;c>=0;--c)this.setCell(t+r+c,this.loadCell(t+c,a));for(let c=0;c<r;++c)this.setCell(t+c,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let a=new lr;for(let c=0;c<this.length-t-r;++c)this.setCell(t+c,this.loadCell(t+r+c,a));for(let c=this.length-r;c<this.length;++c)this.setCell(c,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*Xf<this._data.buffer.byteLength;let n=t*Ne;if(t>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<t;++a)this.setCell(a,r)}else{this._data=this._data.subarray(0,n);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let f=parseInt(a[u],10);f>=t&&delete this._combined[f]}let c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){let f=parseInt(c[u],10);f>=t&&delete this._extendedAttrs[f]}}return this.length=t,n*4*Xf<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Xf<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new M1(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ne+0]&4194303)return t+(this._data[t*Ne+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ne+0]&4194303||this._data[t*Ne+2]&50331648)return t+(this._data[t*Ne+0]>>22);return 0}copyCellsFrom(t,r,n,a,c){let u=t._data;if(c)for(let m=a-1;m>=0;m--){for(let d=0;d<Ne;d++)this._data[(n+m)*Ne+d]=u[(r+m)*Ne+d];u[(r+m)*Ne+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[r+m])}else for(let m=0;m<a;m++){for(let d=0;d<Ne;d++)this._data[(n+m)*Ne+d]=u[(r+m)*Ne+d];u[(r+m)*Ne+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[r+m])}let f=Object.keys(t._combined);for(let m=0;m<f.length;m++){let d=parseInt(f[m],10);d>=r&&(this._combined[d-r+n]=t._combined[d])}}translateToString(t,r,n,a){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),a&&(a.length=0);let c="";for(;r<n;){let u=this._data[r*Ne+0],f=u&2097151,m=u&2097152?this._combined[r]:f?un(f):hn;if(c+=m,a)for(let d=0;d<m.length;++d)a.push(r);r+=u>>22||1}return a&&a.push(r),c}};function ED(e,t,r,n,a,c){let u=[];for(let f=0;f<e.length-1;f++){let m=f,d=e.get(++m);if(!d.isWrapped)continue;let g=[e.get(f)];for(;m<e.length&&d.isWrapped;)g.push(d),d=e.get(++m);if(!c&&n>=f&&n<m){f+=g.length-1;continue}let _=0,S=El(g,_,t),w=1,x=0;for(;w<g.length;){let k=El(g,w,t),T=k-x,$=r-S,z=Math.min(T,$);g[_].copyCellsFrom(g[w],x,S,z,!1),S+=z,S===r&&(_++,S=0),x+=z,x===k&&(w++,x=0),S===0&&_!==0&&g[_-1].getWidth(r-1)===2&&(g[_].copyCellsFrom(g[_-1],r-1,S++,1,!1),g[_-1].setCell(r-1,a))}g[_].replaceCells(S,r,a);let C=0;for(let k=g.length-1;k>0&&(k>_||g[k].getTrimmedLength()===0);k--)C++;C>0&&(u.push(f+g.length-C),u.push(C)),f+=g.length-1}return u}function RD(e,t){let r=[],n=0,a=t[n],c=0;for(let u=0;u<e.length;u++)if(a===u){let f=t[++n];e.onDeleteEmitter.fire({index:u-c,amount:f}),u+=f-1,c+=f,a=t[++n]}else r.push(u);return{layout:r,countRemoved:c}}function kD(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function TD(e,t,r){let n=[],a=e.map((m,d)=>El(e,d,t)).reduce((m,d)=>m+d),c=0,u=0,f=0;for(;f<a;){if(a-f<r){n.push(a-f);break}c+=r;let m=El(e,u,t);c>m&&(c-=m,u++);let d=e[u].getWidth(c-1)===2;d&&c--;let g=d?r-1:r;n.push(g),f+=g}return n}function El(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,a=e[t+1].getWidth(0)===2;return n&&a?r-1:r}var N1=class O1{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=O1._nextId++,this._onDispose=this.register(new fe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Kn(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};N1._nextId=1;var AD=N1,Ht={},Wn=Ht.B;Ht[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Ht.A={"#":"£"};Ht.B=void 0;Ht[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Ht.C=Ht[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Ht.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Ht.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Ht.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Ht.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Ht.E=Ht[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Ht.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Ht.H=Ht[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Ht["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var hb=4294967295,db=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Mt.clone(),this.savedCharset=Wn,this.markers=[],this._nullCell=lr.fromCharData([0,XS,1,0]),this._whitespaceCell=lr.fromCharData([0,hn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Hu,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new ub(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Bu),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Bu),this._whitespaceCell}getBlankLine(e,t){return new pl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>hb?hb:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Mt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new ub(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(Mt),n=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(e,r);let c=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new pl(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new pl(e,r)));else for(let u=this._rows;u>t;u--)this.lines.length>t+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,e-1),this.y=Math.min(this.y,t-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let c=0;c<this.lines.length;c++)n+=+this.lines.get(c).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=ED(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Mt),r);if(n.length>0){let a=RD(this.lines,n);kD(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(Mt),a=r;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new pl(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(Mt),a=[],c=0;for(let u=this.lines.length-1;u>=0;u--){let f=this.lines.get(u);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;let m=[f];for(;f.isWrapped&&u>0;)f=this.lines.get(--u),m.unshift(f);if(!r){let z=this.ybase+this.y;if(z>=u&&z<u+m.length)continue}let d=m[m.length-1].getTrimmedLength(),g=TD(m,this._cols,e),_=g.length-m.length,S;this.ybase===0&&this.y!==this.lines.length-1?S=Math.max(0,this.y-this.lines.maxLength+_):S=Math.max(0,this.lines.length-this.lines.maxLength+_);let w=[];for(let z=0;z<_;z++){let A=this.getBlankLine(Mt,!0);w.push(A)}w.length>0&&(a.push({start:u+m.length+c,newLines:w}),c+=w.length),m.push(...w);let x=g.length-1,C=g[x];C===0&&(x--,C=g[x]);let k=m.length-_-1,T=d;for(;k>=0;){let z=Math.min(T,C);if(m[x]===void 0)break;if(m[x].copyCellsFrom(m[k],T-z,C-z,z,!0),C-=z,C===0&&(x--,C=g[x]),T-=z,T===0){k--;let A=Math.max(k,0);T=El(m,A,this._cols)}}for(let z=0;z<m.length;z++)g[z]<e&&m[z].setCell(g[z],n);let $=_-S;for(;$-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+_,this.ybase+t-1)}if(a.length>0){let u=[],f=[];for(let C=0;C<this.lines.length;C++)f.push(this.lines.get(C));let m=this.lines.length,d=m-1,g=0,_=a[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let S=0;for(let C=Math.min(this.lines.maxLength-1,m+c-1);C>=0;C--)if(_&&_.start>d+S){for(let k=_.newLines.length-1;k>=0;k--)this.lines.set(C--,_.newLines[k]);C++,u.push({index:d+1,amount:_.newLines.length}),S+=_.newLines.length,_=a[++g]}else this.lines.set(C,f[d--]);let w=0;for(let C=u.length-1;C>=0;C--)u[C].index+=w,this.lines.onInsertEmitter.fire(u[C]),w+=u[C].amount;let x=Math.max(0,m+c-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}translateBufferLineToString(e,t,r=0,n){let a=this.lines.get(e);return a?a.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new AD(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},DD=class extends Be{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new fe),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 db(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new db(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},B1=2,L1=1,Xm=class extends Be{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new fe),this.onResize=this._onResize.event,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,B1),this.rows=Math.max(e.rawOptions.rows||0,L1),this.buffers=this._register(new DD(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let a=r.ybase+r.scrollTop,c=r.ybase+r.scrollBottom;if(r.scrollTop===0){let u=r.lines.isFull;c===r.lines.length-1?u?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(c+1,0,n.clone()),u?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let u=c-a+1;r.lines.shiftElements(a+1,u-1,-1),r.lines.set(c,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};Xm=xt([pe(0,gi)],Xm);var Wo={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:ju,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},MD=["normal","bold","100","200","300","400","500","600","700","800","900"],ND=class extends Be{constructor(e){super(),this._onOptionChange=this._register(new fe),this.onOptionChange=this._onOptionChange.event;let t={...Wo};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ft(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in Wo))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in Wo))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Wo[e]),!OD(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Wo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=MD.includes(t)?t:Wo[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function OD(e){return e==="block"||e==="underline"||e==="bar"}function _l(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&_l(e[n],t-1);return r}var fb=Object.freeze({insertMode:!1}),mb=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Zm=class extends Be{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new fe),this.onData=this._onData.event,this._onUserInput=this._register(new fe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new fe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new fe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=_l(fb),this.decPrivateModes=_l(mb)}reset(){this.modes=_l(fb),this.decPrivateModes=_l(mb)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Zm=xt([pe(0,_i),pe(1,t1),pe(2,gi)],Zm);var pb={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Zf(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Qf=String.fromCharCode,_b={DEFAULT:e=>{let t=[Zf(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Qf(t[0])}${Qf(t[1])}${Qf(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Zf(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Zf(e,!0)};${e.x};${e.y}${t}`}},Qm=class extends Be{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new fe),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(pb))this.addProtocol(n,pb[n]);for(let n of Object.keys(_b))this.addEncoding(n,_b[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=n+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Qm=xt([pe(0,_i),pe(1,eo),pe(2,gi)],Qm);var Jf=[[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]],BD=[[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]],jt;function LD(e,t){let r=0,n=t.length-1,a;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(a=r+n>>1,e>t[a][1])r=a+1;else if(e<t[a][0])n=a-1;else return!0;return!1}var zD=class{constructor(){if(this.version="6",!jt){jt=new Uint8Array(65536),jt.fill(1),jt[0]=0,jt.fill(0,1,32),jt.fill(0,127,160),jt.fill(2,4352,4448),jt[9001]=2,jt[9002]=2,jt.fill(2,11904,42192),jt[12351]=1,jt.fill(2,44032,55204),jt.fill(2,63744,64256),jt.fill(2,65040,65050),jt.fill(2,65072,65136),jt.fill(2,65280,65377),jt.fill(2,65504,65511);for(let e=0;e<Jf.length;++e)jt.fill(0,Jf[e][0],Jf[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?jt[e]:LD(e,BD)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let a=qn.extractWidth(t);a===0?n=!1:a>r&&(r=a)}return qn.createPropertyValue(0,r,n)}},qn=class Eu{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new fe,this.onChange=this._onChange.event;let t=new zD;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,n=0,a=t.length;for(let c=0;c<a;++c){let u=t.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=a)return r+this.wcwidth(u);let d=t.charCodeAt(c);56320<=d&&d<=57343?u=(u-55296)*1024+d-56320+65536:r+=this.wcwidth(d)}let f=this.charProperties(u,n),m=Eu.extractWidth(f);Eu.extractShouldJoin(f)&&(m-=Eu.extractWidth(n)),r+=m,n=f}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},jD=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function gb(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var ll=2147483647,HD=256,z1=class Jm{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>HD)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Jm;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let a=t[n];if(Array.isArray(a))for(let c=0;c<a.length;++c)r.addSubParam(a[c]);else r.addParam(a)}return r}clone(){let t=new Jm(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,a=this._subParamsIdx[r]&255;a-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>ll?ll:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>ll?ll:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,a=this._subParamsIdx[r]&255;a-n>0&&(t[r]=this._subParams.slice(n,a))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,a=n[r-1];n[r-1]=~a?Math.min(a*10+t,ll):t}},cl=[],PD=class{constructor(){this._state=0,this._active=cl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=cl}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=cl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||cl,!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,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",ih(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!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 r=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=cl,this._id=-1,this._state=0}}},Ii=class{constructor(t){this._handler=t,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(t,r,n){this._hitLimit||(this._data+=ih(t,r,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(t){let r=!1;if(this._hitLimit)r=!1;else if(t&&(r=this._handler(this._data),r instanceof Promise))return r.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,r}},ul=[],UD=class{constructor(){this._handlers=Object.create(null),this._active=ul,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ul}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=ul,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ul,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",ih(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=ul,this._ident=0}},gl=new z1;gl.addParam(0);var vb=class{constructor(e){this._handler=e,this._data="",this._params=gl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():gl,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=ih(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=gl,this._data="",this._hitLimit=!1,r));return this._params=gl,this._data="",this._hitLimit=!1,t}},ID=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=r<<4|n}},ar=160,$D=(function(){let e=new ID(4095),t=Array.apply(null,Array(256)).map((f,m)=>m),r=(f,m)=>t.slice(f,m),n=r(32,127),a=r(0,24);a.push(25),a.push.apply(a,r(28,32));let c=r(0,14),u;e.setDefault(1,0),e.addMany(n,0,2,0);for(u in c)e.addMany([24,26,153,154],u,3,0),e.addMany(r(128,144),u,3,0),e.addMany(r(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(ar,0,2,0),e.add(ar,8,5,8),e.add(ar,6,0,6),e.add(ar,11,0,11),e.add(ar,13,13,13),e})(),FD=class extends Be{constructor(e=$D){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 z1,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ft(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new PD),this._dcsParser=this._register(new UD),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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 a=0;a<e.intermediates.length;++a){let c=e.intermediates.charCodeAt(a);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,r,n,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=a}parse(e,t,r){let n=0,a=0,c=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(r===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,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&m>-1){for(;m>=0&&(u=f[m](this._params),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 4:if(r===!1&&m>-1){for(;m>=0&&(u=f[m](),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],u=this._oscParser.end(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=c;f<t;++f){switch(n=e[f],a=this._transitions.table[this.currentState<<8|(n<160?n:ar)],a>>4){case 2:for(let S=f+1;;++S){if(S>=t||(n=e[S])<32||n>126&&n<ar){this._printHandler(e,f,S),f=S-1;break}if(++S>=t||(n=e[S])<32||n>126&&n<ar){this._printHandler(e,f,S),f=S-1;break}if(++S>=t||(n=e[S])<32||n>126&&n<ar){this._printHandler(e,f,S),f=S-1;break}if(++S>=t||(n=e[S])<32||n>126&&n<ar){this._printHandler(e,f,S),f=S-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|n],d=m?m.length-1:-1;for(;d>=0&&(u=m[d](this._params),u!==!0);d--)if(u instanceof Promise)return this._preserveStack(3,m,d,a,f),u;d<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++f<t&&(n=e[f])>47&&n<60);f--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let g=this._escHandlers[this._collect<<8|n],_=g?g.length-1:-1;for(;_>=0&&(u=g[_](),u!==!0);_--)if(u instanceof Promise)return this._preserveStack(4,g,_,a,f),u;_<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let S=f+1;;++S)if(S>=t||(n=e[S])===24||n===26||n===27||n>127&&n<ar){this._dcsParser.put(e,f,S),f=S-1;break}break;case 14:if(u=this._dcsParser.unhook(n!==24&&n!==26),u)return this._preserveStack(6,[],0,a,f),u;n===27&&(a|=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 S=f+1;;S++)if(S>=t||(n=e[S])<32||n>127&&n<ar){this._oscParser.put(e,f,S),f=S-1;break}break;case 6:if(u=this._oscParser.end(n!==24&&n!==26),u)return this._preserveStack(5,[],0,a,f),u;n===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},WD=/^([\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})$/,qD=/^[\da-f]+$/;function yb(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=WD.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),qD.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let a=0;a<3;++a){let c=parseInt(t.slice(r*a,r*a+r),16);n[a]=r===1?c<<4:r===2?c:r===3?c>>4:c>>8}return n}}function em(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function VD(e,t=16){let[r,n,a]=e;return`rgb:${em(r,t)}/${em(n,t)}/${em(a,t)}`}var YD={"(":0,")":1,"*":2,"+":3,"-":1,".":2},an=131072,bb=10;function Sb(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var wb=5e3,xb=0,KD=class extends Be{constructor(e,t,r,n,a,c,u,f,m=new FD){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=a,this._oscLinkService=c,this._coreMouseService=u,this._unicodeService=f,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new fT,this._utf8Decoder=new mT,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Mt.clone(),this._eraseAttrDataInternal=Mt.clone(),this._onRequestBell=this._register(new fe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new fe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new fe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new fe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new fe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new fe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new fe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new fe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new fe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new fe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new fe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new fe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new fe),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 ep(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:g.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,g,_)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:g,data:_})}),this._parser.setDcsHandlerFallback((d,g,_)=>{g==="HOOK"&&(_=_.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:g,payload:_})}),this._parser.setPrintHandler((d,g,_)=>this.print(d,g,_)),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(oe.BEL,()=>this.bell()),this._parser.setExecuteHandler(oe.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(oe.BS,()=>this.backspace()),this._parser.setExecuteHandler(oe.HT,()=>this.tab()),this._parser.setExecuteHandler(oe.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(oe.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(xu.IND,()=>this.index()),this._parser.setExecuteHandler(xu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(xu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ii(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Ii(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Ii(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Ii(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Ii(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Ii(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Ii(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Ii(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Ii(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Ii(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Ii(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Ii(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 Ht)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 vb((d,g)=>this.requestStatusString(d,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),wb))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${wb} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,a=this._activeBuffer.y,c=0,u=this._parseStack.paused;if(u){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>an&&(c=this._parseStack.position+an)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<an&&(this._parseBuffer=new Uint32Array(Math.min(e.length,an))),u||this._dirtyRowTracker.clearRange(),e.length>an)for(let d=c;d<e.length;d+=an){let g=d+an<e.length?d+an:e.length,_=typeof e=="string"?this._stringDecoder.decode(e.substring(d,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,g),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,_))return this._preserveStack(n,a,_,d),this._logSlowResolvingAsync(r),r}else if(!u){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,a,d,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let f=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),m=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);m<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(m,this._bufferService.rows-1),end:Math.min(f,this._bufferService.rows-1)})}print(e,t,r){let n,a,c=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,f=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,g=this._curAttrData,_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&_.getWidth(this._activeBuffer.x-1)===2&&_.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let S=this._parser.precedingJoinState;for(let w=t;w<r;++w){if(n=e[w],n<127&&c){let T=c[String.fromCharCode(n)];T&&(n=T.charCodeAt(0))}let x=this._unicodeService.charProperties(n,S);a=qn.extractWidth(x);let C=qn.extractShouldJoin(x),k=C?qn.extractWidth(S):0;if(S=x,u&&this._onA11yChar.fire(un(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-k>f){if(m){let T=_,$=this._activeBuffer.x-k;for(this._activeBuffer.x=k,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),_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),k>0&&_ instanceof pl&&_.copyCellsFrom(T,$,0,k,!1);$<f;)T.setCellFromCodepoint($++,0,1,g)}else if(this._activeBuffer.x=f-1,a===2)continue}if(C&&this._activeBuffer.x){let T=_.getWidth(this._activeBuffer.x-1)?1:2;_.addCodepointToCell(this._activeBuffer.x-T,n,a);for(let $=a-k;--$>=0;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(d&&(_.insertCells(this._activeBuffer.x,a-k,this._activeBuffer.getNullCell(g)),_.getWidth(f-1)===2&&_.setCellFromCodepoint(f-1,0,1,g)),_.setCellFromCodepoint(this._activeBuffer.x++,n,a,g),a>0)for(;--a;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=S,this._activeBuffer.x<f&&r-t>0&&_.getWidth(this._activeBuffer.x)===0&&!_.hasContent(this._activeBuffer.x)&&_.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>Sb(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new vb(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Ii(t))}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 e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,n=!1,a=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),a),n&&(c.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);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(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=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(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=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;t--;)this._activeBuffer.lines.splice(r,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(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(Mt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,n=qn.extractWidth(t),a=this._activeBuffer.x-n,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(c.length*r),f=0;for(let d=0;d<c.length;){let g=c.codePointAt(d)||0;u[f++]=g,d+=g>65535?2:1}let m=f;for(let d=1;d<r;++d)u.copyWithin(m,0,f),m+=f;return this.print(u,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(oe.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(oe.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(oe.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(oe.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(oe.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Wn),this._charsetService.setgCharset(1,Wn),this._charsetService.setgCharset(2,Wn),this._charsetService.setgCharset(3,Wn);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(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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(),e.params[t]===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(e,t){let r;(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"))(r||={});let n=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:c}=this._coreMouseService,u=this._coreService,{buffers:f,cols:m}=this._bufferService,{active:d,alt:g}=f,_=this._optionsService.rawOptions,S=(C,k)=>(u.triggerDataEvent(`${oe.ESC}[${t?"":"?"}${C};${k}$y`),!0),w=C=>C?1:2,x=e.params[0];return t?x===2?S(x,4):x===4?S(x,w(u.modes.insertMode)):x===12?S(x,3):x===20?S(x,w(_.convertEol)):S(x,0):x===1?S(x,w(n.applicationCursorKeys)):x===3?S(x,_.windowOptions.setWinLines?m===80?2:m===132?1:0:0):x===6?S(x,w(n.origin)):x===7?S(x,w(n.wraparound)):x===8?S(x,3):x===9?S(x,w(a==="X10")):x===12?S(x,w(_.cursorBlink)):x===25?S(x,w(!u.isCursorHidden)):x===45?S(x,w(n.reverseWraparound)):x===66?S(x,w(n.applicationKeypad)):x===67?S(x,4):x===1e3?S(x,w(a==="VT200")):x===1002?S(x,w(a==="DRAG")):x===1003?S(x,w(a==="ANY")):x===1004?S(x,w(n.sendFocus)):x===1005?S(x,4):x===1006?S(x,w(c==="SGR")):x===1015?S(x,4):x===1016?S(x,w(c==="SGR_PIXELS")):x===1048?S(x,1):x===47||x===1047||x===1049?S(x,w(d===g)):x===2004?S(x,w(n.bracketedPasteMode)):x===2026?S(x,w(n.synchronizedOutput)):S(x,0)}_updateAttrColor(e,t,r,n,a){return t===2?(e|=50331648,e&=-16777216,e|=Dl.fromColorRGB([r,n,a])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],a=0,c=0;do{if(n[c+a]=e.params[t+c],e.hasSubParams(t+c)){let u=e.getSubParams(t+c),f=0;do n[1]===5&&(a=1),n[c+f+1+a]=u[f];while(++f<u.length&&f+c+1+a<n.length);break}if(n[1]===5&&c+a>=2||n[1]===2&&c+a>=5)break;n[1]&&(a=1)}while(++c+t<e.length&&c+a<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return c}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Mt.fg,e.bg=Mt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,n=this._curAttrData;for(let a=0;a<t;a++)r=e.params[a],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=Mt.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=Mt.bg&16777215):r===38||r===48||r===58?a+=this._extractColor(e,a,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=Mt.fg&16777215,n.bg&=-67108864,n.bg|=Mt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${oe.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[?${t};${r}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Mt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Sb(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${oe.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>bb&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>bb&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),a=r.shift();if(/^\d+$/.exec(n)){let c=parseInt(n);if(Cb(c))if(a==="?")t.push({type:0,index:c});else{let u=yb(a);u&&t.push({type:1,index:c,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,a=r.findIndex(c=>c.startsWith("id="));return a!==-1&&(n=r[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=yb(r[n]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let a=parseInt(r[n]);Cb(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Wn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(YD[e[0]],Ht[e[1]]||Wn),!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 e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=Mt.clone(),this._eraseAttrDataInternal=Mt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new lr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=u=>(this._coreService.triggerDataEvent(`${oe.ESC}${u}${oe.ESC}\\`),!0),n=this._bufferService.buffer,a=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},ep=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(xb=e,e=t,t=xb),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};ep=xt([pe(0,_i)],ep);function Cb(e){return 0<=e&&e<256}var GD=5e7,Eb=12,XD=50,ZD=class extends Be{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 fe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){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 r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>GD)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],a=this._action(n,t);if(a){let u=f=>performance.now()-r>=Eb?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(r,f);a.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(u);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=Eb)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>XD&&(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()}},tp=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let f=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(m,f)),this._dataByLinkId.set(m.id,m),m.id}let r=e,n=this._getEntryIdKey(r),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let c=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};tp=xt([pe(0,_i)],tp);var Rb=!1,QD=class extends Be{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ra),this._onBinary=this._register(new fe),this.onBinary=this._onBinary.event,this._onData=this._register(new fe),this.onData=this._onData.event,this._onLineFeed=this._register(new fe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new fe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new fe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new fe),this._instantiationService=new wD,this.optionsService=this._register(new ND(e)),this._instantiationService.setService(gi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Xm)),this._instantiationService.setService(_i,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Gm)),this._instantiationService.setService(t1,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Zm)),this._instantiationService.setService(eo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Qm)),this._instantiationService.setService(e1,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(qn)),this._instantiationService.setService(vT,this.unicodeService),this._charsetService=this._instantiationService.createInstance(jD),this._instantiationService.setService(gT,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(tp),this._instantiationService.setService(i1,this._oscLinkService),this._inputHandler=this._register(new KD(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ai.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ai.forward(this._bufferService.onResize,this._onResize)),this._register(ai.forward(this.coreService.onData,this._onData)),this._register(ai.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 ZD((t,r)=>this._inputHandler.parse(t,r))),this._register(ai.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new fe),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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Rb&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Rb=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,B1),t=Math.max(t,L1),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(gb.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(gb(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ft(()=>{for(let t of e)t.dispose()})}}},JD={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 e5(e,t,r,n){let a={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=oe.ESC+"OA":a.key=oe.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=oe.ESC+"OD":a.key=oe.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=oe.ESC+"OC":a.key=oe.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=oe.ESC+"OB":a.key=oe.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":oe.DEL,e.altKey&&(a.key=oe.ESC+a.key);break;case 9:if(e.shiftKey){a.key=oe.ESC+"[Z";break}a.key=oe.HT,a.cancel=!0;break;case 13:a.key=e.altKey?oe.ESC+oe.CR:oe.CR,a.cancel=!0;break;case 27:a.key=oe.ESC,e.altKey&&(a.key=oe.ESC+oe.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"D":t?a.key=oe.ESC+"OD":a.key=oe.ESC+"[D";break;case 39:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"C":t?a.key=oe.ESC+"OC":a.key=oe.ESC+"[C";break;case 38:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"A":t?a.key=oe.ESC+"OA":a.key=oe.ESC+"[A";break;case 40:if(e.metaKey)break;c?a.key=oe.ESC+"[1;"+(c+1)+"B":t?a.key=oe.ESC+"OB":a.key=oe.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=oe.ESC+"[2~");break;case 46:c?a.key=oe.ESC+"[3;"+(c+1)+"~":a.key=oe.ESC+"[3~";break;case 36:c?a.key=oe.ESC+"[1;"+(c+1)+"H":t?a.key=oe.ESC+"OH":a.key=oe.ESC+"[H";break;case 35:c?a.key=oe.ESC+"[1;"+(c+1)+"F":t?a.key=oe.ESC+"OF":a.key=oe.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=oe.ESC+"[5;"+(c+1)+"~":a.key=oe.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=oe.ESC+"[6;"+(c+1)+"~":a.key=oe.ESC+"[6~";break;case 112:c?a.key=oe.ESC+"[1;"+(c+1)+"P":a.key=oe.ESC+"OP";break;case 113:c?a.key=oe.ESC+"[1;"+(c+1)+"Q":a.key=oe.ESC+"OQ";break;case 114:c?a.key=oe.ESC+"[1;"+(c+1)+"R":a.key=oe.ESC+"OR";break;case 115:c?a.key=oe.ESC+"[1;"+(c+1)+"S":a.key=oe.ESC+"OS";break;case 116:c?a.key=oe.ESC+"[15;"+(c+1)+"~":a.key=oe.ESC+"[15~";break;case 117:c?a.key=oe.ESC+"[17;"+(c+1)+"~":a.key=oe.ESC+"[17~";break;case 118:c?a.key=oe.ESC+"[18;"+(c+1)+"~":a.key=oe.ESC+"[18~";break;case 119:c?a.key=oe.ESC+"[19;"+(c+1)+"~":a.key=oe.ESC+"[19~";break;case 120:c?a.key=oe.ESC+"[20;"+(c+1)+"~":a.key=oe.ESC+"[20~";break;case 121:c?a.key=oe.ESC+"[21;"+(c+1)+"~":a.key=oe.ESC+"[21~";break;case 122:c?a.key=oe.ESC+"[23;"+(c+1)+"~":a.key=oe.ESC+"[23~";break;case 123:c?a.key=oe.ESC+"[24;"+(c+1)+"~":a.key=oe.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=oe.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=oe.DEL:e.keyCode===219?a.key=oe.ESC:e.keyCode===220?a.key=oe.FS:e.keyCode===221&&(a.key=oe.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let u=JD[e.keyCode]?.[e.shiftKey?1:0];if(u)a.key=oe.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let f=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(f);e.shiftKey&&(m=m.toUpperCase()),a.key=oe.ESC+m}else if(e.keyCode===32)a.key=oe.ESC+(e.ctrlKey?oe.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let f=e.code.slice(3,4);e.shiftKey||(f=f.toLowerCase()),a.key=oe.ESC+f,a.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=oe.US),e.key==="@"&&(a.key=oe.NUL));break}return a}var Rt=0,t5=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Hu,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Hu,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((a,c)=>this._getKey(a)-this._getKey(c)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<n.length;a++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[a]=e[t],t++):n[a]=this._array[r++];this._array=n,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 t=this._getKey(e);if(t===void 0||(Rt=this._search(t),Rt===-1)||this._getKey(this._array[Rt])!==t)return!1;do if(this._array[Rt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Rt),!0;while(++Rt<this._array.length&&this._getKey(this._array[Rt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,c)=>a-c),t=0,r=new Array(this._array.length-e.length),n=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:r[n++]=this._array[a];this._array=r,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&&(Rt=this._search(e),!(Rt<0||Rt>=this._array.length)&&this._getKey(this._array[Rt])===e))do yield this._array[Rt];while(++Rt<this._array.length&&this._getKey(this._array[Rt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Rt=this._search(e),!(Rt<0||Rt>=this._array.length)&&this._getKey(this._array[Rt])===e))do t(this._array[Rt]);while(++Rt<this._array.length&&this._getKey(this._array[Rt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,a=this._getKey(this._array[n]);if(a>e)r=n-1;else if(a<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},tm=0,kb=0,i5=class extends Be{constructor(){super(),this._decorations=new t5(e=>e?.marker.line),this._onDecorationRegistered=this._register(new fe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new fe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ft(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new r5(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let n=0,a=0;for(let c of this._decorations.getKeyIterator(t))n=c.options.x??0,a=n+(c.options.width??1),e>=n&&e<a&&(!r||(c.options.layer??"bottom")===r)&&(yield c)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,a=>{tm=a.options.x??0,kb=tm+(a.options.width??1),e>=tm&&e<kb&&(!r||(a.options.layer??"bottom")===r)&&n(a)})}},r5=class extends fn{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new fe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new fe),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=_t.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=_t.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},s5=1e3,n5=class{constructor(e,t=s5){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=n-this._lastRefreshMs,c=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Tb=20,Pu=class extends Be{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,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 c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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 n5(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(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ee(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ft(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Tb+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Tb+1&&(this._liveRegion.textContent+=Sm.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,n=r.lines.length.toString();for(let a=e;a<=t;a++){let c=r.lines.get(r.ydisp+a),u=[],f=c?.translateToString(!0,void 0,void 0,u)||"",m=(r.ydisp+a+1).toString(),d=this._rowElements[a];d&&(f.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=f,this._rowColumns.set(d,u)),d.setAttribute("aria-posinset",m),d.setAttribute("aria-setsize",n),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],a=r.getAttribute("aria-posinset"),c=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===c||e.relatedTarget!==n)return;let u,f;if(t===0?(u=r,f=this._rowElements.pop(),this._rowContainer.removeChild(f)):(u=this._rowElements.shift(),f=r,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),f.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let a=({node:f,offset:m})=>{let d=f instanceof Text?f.parentNode:f,g=parseInt(d?.getAttribute("aria-posinset"),10)-1;if(isNaN(g))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(d);if(!_)return console.warn("columns is null. Race condition?"),null;let S=m<_.length?_[m]:_.slice(-1)[0]+1;return S>=this._terminal.cols&&(++g,S=0),{row:g,column:S}},c=a(t),u=a(r);if(!(!c||!u)){if(c.row>u.row||c.row===u.row&&c.column>=u.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(u.row-c.row)*this._terminal.cols-c.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,r=this._rowColumns.get(e)?.slice(-1)?.[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Pu=xt([pe(1,Mp),pe(2,Ts),pe(3,As)],Pu);var ip=class extends Be{constructor(e,t,r,n,a){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new fe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new fe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ft(()=>{Kn(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(Ee(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ee(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ee(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ee(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n<r.length;n++){let a=r[n];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(n=>{n?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[n,a]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(n)&&(r=this._checkLinkProviderResult(n,e,r)):a.provideLinks(e.y,c=>{if(this._isMouseOut)return;let u=c?.map(f=>({link:f}));this._activeProviderReplies?.set(n,u),r=this._checkLinkProviderResult(n,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let a=t.get(n);if(a)for(let c=0;c<a.length;c++){let u=a[c],f=u.link.range.start.y<e?0:u.link.range.start.x,m=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let d=f;d<=m;d++){if(r.has(d)){a.splice(c--,1);break}r.add(d)}}}}_checkLinkProviderResult(e,t,r){if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),a=!1;for(let c=0;c<e;c++)(!this._activeProviderReplies.has(c)||this._activeProviderReplies.get(c))&&(a=!0);if(!a&&n){let c=n.find(u=>this._linkAtPosition(u.link,t));c&&(r=!0,this._handleNewLink(c))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let c=0;c<this._activeProviderReplies.size;c++){let u=this._activeProviderReplies.get(c)?.find(f=>this._linkAtPosition(f.link,t));if(u){r=!0,this._handleNewLink(u);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&o5(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Kn(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(n,a),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,t,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return r<=a&&a<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,a){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:a}}};ip=xt([pe(1,Np),pe(2,As),pe(3,_i),pe(4,s1)],ip);function o5(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var a5=class extends QD{constructor(e={}){super(e),this._linkifier=this._register(new ra),this.browser=x1,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ra),this._onCursorMove=this._register(new fe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new fe),this.onKey=this._onKey.event,this._onRender=this._register(new fe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new fe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new fe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new fe),this.onBell=this._onBell.event,this._onFocus=this._register(new fe),this._onBlur=this._register(new fe),this._onA11yCharEmitter=this._register(new fe),this._onA11yTabEmitter=this._register(new fe),this._onWillOpen=this._register(new fe),this._setup(),this._decorationService=this._instantiationService.createInstance(i5),this._instantiationService.setService(Ml,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(XA),this._instantiationService.setService(s1,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(xm)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ai.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ai.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ai.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ai.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ft(()=>{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 t of e){let r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let a=ht.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${oe.ESC}]${n};${VD(a)}${S1.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(c=>c.ansi[t.index]=Nt.toColor(...t.color));else{let c=r;this._themeService.modifyColors(u=>u[c]=Nt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(Pu,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(oe.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(oe.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,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,a=t.getWidth(r),c=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,f=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=u+"px",this.textarea.style.width=c+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ee(this.element,"copy",t=>{this.hasSelection()&&hT(t,this._selectionService)}));let e=t=>dT(t,this.textarea,this.coreService,this.optionsService);this._register(Ee(this.textarea,"paste",e)),this._register(Ee(this.element,"paste",e)),C1?this._register(Ee(this.element,"mousedown",t=>{t.button===2&&Hy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ee(this.element,"contextmenu",t=>{Hy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Up&&this._register(Ee(this.element,"auxclick",t=>{t.button===1&&GS(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ee(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ee(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ee(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ee(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ee(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ee(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ee(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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ee(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",bm.get()),k1||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",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(KA,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Ts,this._coreBrowserService),this._register(Ee(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Ee(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Wm,this._document,this._helperContainer),this._instantiationService.setService(rh,this._charSizeService),this._themeService=this._instantiationService.createInstance(Km),this._instantiationService.setService(aa,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(zu),this._instantiationService.setService(r1,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Vm,this.rows,this.screenElement)),this._instantiationService.setService(As,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Im,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(qm),this._instantiationService.setService(Np,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(ip,this.screenElement));this.element.appendChild(t);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(Pm,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ym,this.element,this.screenElement,n)),this._instantiationService.setService(bT,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(ai.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Um,this.screenElement)),this._register(Ee(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),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(Pu,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Lu,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Lu,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Fm,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(c){let u=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!u)return!1;let f,m;switch(c.overrideType||c.type){case"mousemove":m=32,c.buttons===void 0?(f=3,c.button!==void 0&&(f=c.button<3?c.button:3)):f=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":m=0,f=c.button<3?c.button:3;break;case"mousedown":m=1,f=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let d=c.deltaY;if(d===0||e.coreMouseService.consumeWheelEvent(c,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;m=d<0?0:1,f=4;break;default:return!1}return m===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:f,action:m,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:c=>(r(c),c.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(c)),wheel:c=>(r(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&r(c)},mousemove:c=>{c.buttons||r(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),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()),c&8?n.mousemove||(t.addEventListener("mousemove",a.mousemove),n.mousemove=a.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),c&16?n.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),n.wheel=a.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),c&2?n.mouseup||(n.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),c&4?n.mousedrag||(n.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ee(t,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return r(c),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(c)})),this._register(Ee(t,"wheel",c=>{if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(c,!0);let u=oe.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){KS(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,r){this._selectionService.setSelection(e,t,r)}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,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=e5(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.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((r.key===oe.ETX||r.key===oe.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(l5(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){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(Mt));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(oe.ESC+"[I"):this.coreService.triggerDataEvent(oe.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[6;${a};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function l5(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var c5=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-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(t,1)}},u5=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new lr)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},Ab=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new u5(t)}getNullCell(){return new lr}},h5=class extends Be{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new fe),this.onBufferChange=this._onBufferChange.event,this._normal=new Ab(this._core.buffers.normal,"normal"),this._alternate=new Ab(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)}},d5=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},f5=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}},m5=["cols","rows"],Mr=0,j1=class extends Be{constructor(e){super(),this._core=this._register(new a5(e)),this._addonManager=this._register(new c5),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,a)=>{this._checkReadonlyOptions(n),this._core.options[n]=a};for(let n in this._core.options){let a={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,a)}}_checkReadonlyOptions(e){if(m5.includes(e))throw new Error(`Option "${e}" 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 d5(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f5(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 h5(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return bm.get()},set promptLabel(e){bm.set(e)},get tooMuchOutput(){return Sm.get()},set tooMuchOutput(e){Sm.set(e)}}}_verifyIntegers(...e){for(Mr of e)if(Mr===1/0||isNaN(Mr)||Mr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Mr of e)if(Mr&&(Mr===1/0||isNaN(Mr)||Mr%1!==0||Mr<0))throw new Error("This API only accepts positive integers")}};var p5=2,_5=1,H1=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),a=Math.max(0,parseInt(r.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),u={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},f=u.top+u.bottom,m=u.right+u.left,d=n-f,g=a-m-t;return{cols:Math.max(p5,Math.floor(g/e.css.cell.width)),rows:Math.max(_5,Math.floor(d/e.css.cell.height))}}};var g5=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Db.isErrorNoTelemetry(t)?new Db(t.message+`
`+t.stack):new Error(t.message+`
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(r=>{r(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)}},v5=new g5;function im(e){y5(e)||v5.onUnexpectedError(e)}var rp="Canceled";function y5(e){return e instanceof b5?!0:e instanceof Error&&e.name===rp&&e.message===rp}var b5=class extends Error{constructor(){super(rp),this.name=this.message}},Db=class sp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof sp)return t;let r=new sp;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},S5;(e=>{function t(c){return c<0}e.isLessThan=t;function r(c){return c<=0}e.isLessThanOrEqual=r;function n(c){return c>0}e.isGreaterThan=n;function a(c){return c===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(S5||={});function w5(e,t){let r=this,n=!1,a;return function(){return n||(n=!0,t||(a=e.apply(r,arguments))),a}}var P1;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*a(A){yield A}e.single=a;function c(A){return t(A)?A:a(A)}e.wrap=c;function u(A){return A||r}e.from=u;function*f(A){for(let j=A.length-1;j>=0;j--)yield A[j]}e.reverse=f;function m(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=m;function d(A){return A[Symbol.iterator]().next().value}e.first=d;function g(A,j){let P=0;for(let F of A)if(j(F,P++))return!0;return!1}e.some=g;function _(A,j){for(let P of A)if(j(P))return P}e.find=_;function*S(A,j){for(let P of A)j(P)&&(yield P)}e.filter=S;function*w(A,j){let P=0;for(let F of A)yield j(F,P++)}e.map=w;function*x(A,j){let P=0;for(let F of A)yield*j(F,P++)}e.flatMap=x;function*C(...A){for(let j of A)yield*j}e.concat=C;function k(A,j,P){let F=P;for(let G of A)F=j(F,G);return F}e.reduce=k;function*T(A,j,P=A.length){for(j<0&&(j+=A.length),P<0?P+=A.length:P>A.length&&(P=A.length);j<P;j++)yield A[j]}e.slice=T;function $(A,j=Number.POSITIVE_INFINITY){let P=[];if(j===0)return[P,A];let F=A[Symbol.iterator]();for(let G=0;G<j;G++){let re=F.next();if(re.done)return[P,e.empty()];P.push(re.value)}return[P,{[Symbol.iterator](){return F}}]}e.consume=$;async function z(A){let j=[];for await(let P of A)j.push(P);return Promise.resolve(j)}e.asyncToArray=z})(P1||={});function Sl(e){if(P1.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function U1(...e){return ca(()=>Sl(e))}function ca(e){return{dispose:w5(()=>{e()})}}var I1=class $1{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{Sl(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?$1.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};I1.DISABLE_DISPOSED_WARNING=!1;var Ip=I1,mn=class{constructor(){this._store=new Ip,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};mn.None=Object.freeze({dispose(){}});var Uu=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}},x5=globalThis.performance&&typeof globalThis.performance.now=="function",C5=class F1{static create(t){return new F1(t)}constructor(t){this._now=x5&&t===!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}},$p;(e=>{e.None=()=>mn.None;function t(W,M){return _(W,()=>{},0,void 0,!0,void 0,M)}e.defer=t;function r(W){return(M,H=null,N)=>{let R=!1,L;return L=W(U=>{if(!R)return L?L.dispose():R=!0,M.call(H,U)},null,N),R&&L.dispose(),L}}e.once=r;function n(W,M,H){return d((N,R=null,L)=>W(U=>N.call(R,M(U)),null,L),H)}e.map=n;function a(W,M,H){return d((N,R=null,L)=>W(U=>{M(U),N.call(R,U)},null,L),H)}e.forEach=a;function c(W,M,H){return d((N,R=null,L)=>W(U=>M(U)&&N.call(R,U),null,L),H)}e.filter=c;function u(W){return W}e.signal=u;function f(...W){return(M,H=null,N)=>{let R=U1(...W.map(L=>L(U=>M.call(H,U))));return g(R,N)}}e.any=f;function m(W,M,H,N){let R=H;return n(W,L=>(R=M(R,L),R),N)}e.reduce=m;function d(W,M){let H,N={onWillAddFirstListener(){H=W(R.fire,R)},onDidRemoveLastListener(){H?.dispose()}},R=new Br(N);return M?.add(R),R.event}function g(W,M){return M instanceof Array?M.push(W):M&&M.add(W),W}function _(W,M,H=100,N=!1,R=!1,L,U){let se,ee,D,O=0,q,Q={leakWarningThreshold:L,onWillAddFirstListener(){se=W(ae=>{O++,ee=M(ee,ae),N&&!D&&(X.fire(ee),ee=void 0),q=()=>{let de=ee;ee=void 0,D=void 0,(!N||O>1)&&X.fire(de),O=0},typeof H=="number"?(clearTimeout(D),D=setTimeout(q,H)):D===void 0&&(D=0,queueMicrotask(q))})},onWillRemoveListener(){R&&O>0&&q?.()},onDidRemoveLastListener(){q=void 0,se.dispose()}},X=new Br(Q);return U?.add(X),X.event}e.debounce=_;function S(W,M=0,H){return e.debounce(W,(N,R)=>N?(N.push(R),N):[R],M,void 0,!0,void 0,H)}e.accumulate=S;function w(W,M=(N,R)=>N===R,H){let N=!0,R;return c(W,L=>{let U=N||!M(L,R);return N=!1,R=L,U},H)}e.latch=w;function x(W,M,H){return[e.filter(W,M,H),e.filter(W,N=>!M(N),H)]}e.split=x;function C(W,M=!1,H=[],N){let R=H.slice(),L=W(ee=>{R?R.push(ee):se.fire(ee)});N&&N.add(L);let U=()=>{R?.forEach(ee=>se.fire(ee)),R=null},se=new Br({onWillAddFirstListener(){L||(L=W(ee=>se.fire(ee)),N&&N.add(L))},onDidAddFirstListener(){R&&(M?setTimeout(U):U())},onDidRemoveLastListener(){L&&L.dispose(),L=null}});return N&&N.add(se),se.event}e.buffer=C;function k(W,M){return(H,N,R)=>{let L=M(new $);return W(function(U){let se=L.evaluate(U);se!==T&&H.call(N,se)},void 0,R)}}e.chain=k;let T=Symbol("HaltChainable");class ${constructor(){this.steps=[]}map(M){return this.steps.push(M),this}forEach(M){return this.steps.push(H=>(M(H),H)),this}filter(M){return this.steps.push(H=>M(H)?H:T),this}reduce(M,H){let N=H;return this.steps.push(R=>(N=M(N,R),N)),this}latch(M=(H,N)=>H===N){let H=!0,N;return this.steps.push(R=>{let L=H||!M(R,N);return H=!1,N=R,L?R:T}),this}evaluate(M){for(let H of this.steps)if(M=H(M),M===T)break;return M}}function z(W,M,H=N=>N){let N=(...se)=>U.fire(H(...se)),R=()=>W.on(M,N),L=()=>W.removeListener(M,N),U=new Br({onWillAddFirstListener:R,onDidRemoveLastListener:L});return U.event}e.fromNodeEventEmitter=z;function A(W,M,H=N=>N){let N=(...se)=>U.fire(H(...se)),R=()=>W.addEventListener(M,N),L=()=>W.removeEventListener(M,N),U=new Br({onWillAddFirstListener:R,onDidRemoveLastListener:L});return U.event}e.fromDOMEventEmitter=A;function j(W){return new Promise(M=>r(W)(M))}e.toPromise=j;function P(W){let M=new Br;return W.then(H=>{M.fire(H)},()=>{M.fire(void 0)}).finally(()=>{M.dispose()}),M.event}e.fromPromise=P;function F(W,M){return W(H=>M.fire(H))}e.forward=F;function G(W,M,H){return M(H),W(N=>M(N))}e.runAndSubscribe=G;class re{constructor(M,H){this._observable=M,this._counter=0,this._hasChanged=!1;let N={onWillAddFirstListener:()=>{M.addObserver(this)},onDidRemoveLastListener:()=>{M.removeObserver(this)}};this.emitter=new Br(N),H&&H.add(this.emitter)}beginUpdate(M){this._counter++}handlePossibleChange(M){}handleChange(M,H){this._hasChanged=!0}endUpdate(M){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function le(W,M){return new re(W,M).emitter.event}e.fromObservable=le;function ce(W){return(M,H,N)=>{let R=0,L=!1,U={beginUpdate(){R++},endUpdate(){R--,R===0&&(W.reportChanges(),L&&(L=!1,M.call(H)))},handlePossibleChange(){},handleChange(){L=!0}};W.addObserver(U),W.reportChanges();let se={dispose(){W.removeObserver(U)}};return N instanceof Ip?N.add(se):Array.isArray(N)&&N.push(se),se}}e.fromObservableLight=ce})($p||={});var np=class op{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${op._idPool++}`,op.all.add(this)}start(t){this._stopWatch=new C5,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};np.all=new Set,np._idPool=0;var E5=np,R5=-1,W1=class q1{constructor(t,r,n=(q1._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[c,u]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${u}):`;console.warn(f),console.warn(c);let m=new A5(f,c);this._errorHandler(m)}return()=>{let c=this._stacks.get(t.value)||0;this._stacks.set(t.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,a]of this._stacks)(!t||r<a)&&(t=[n,a],r=a);return t}};W1._idPool=1;var k5=W1,T5=class V1{constructor(t){this.value=t}static create(){let t=new Error;return new V1(t.stack??"")}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},A5=class extends Error{constructor(t,r){super(t),this.name="ListenerLeakError",this.stack=r}},D5=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},M5=0,rm=class{constructor(t){this.value=t,this.id=M5++}},N5=2,O5,Br=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new k5(e?.onListenerError??im,this._options?.leakWarningThreshold??R5):void 0,this._perfMon=this._options?._profName?new E5(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,t,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new D5(`${u}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||im)(m),mn.None}if(this._disposed)return mn.None;t&&(e=e.bind(t));let n=new rm(e),a;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=T5.create(),a=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof rm?(this._deliveryQueue??=new B5,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._size++;let c=ca(()=>{a?.(),this._removeListener(n)});return r instanceof Ip?r.add(c):Array.isArray(r)&&r.push(c),c},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 t=this._listeners,r=t.indexOf(e);if(r===-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--,t[r]=void 0;let n=this._deliveryQueue.current===this;if(this._size*N5<=t.length){let a=0;for(let c=0;c<t.length;c++)t[c]?t[a++]=t[c]:n&&(this._deliveryQueue.end--,a<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=a}}_deliver(e,t){if(!e)return;let r=this._options?.onListenerError||im;if(!r){e.value(t);return}try{e.value(t)}catch(n){r(n)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[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 rm)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},B5=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Y1=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),L5;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof z5?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:$p.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Y1})})(L5||={});var z5=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?Y1:(this._emitter||(this._emitter=new Br),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Jo="en",sm=!1,cu,Ru=Jo,Mb=Jo,j5,bs,Yn=globalThis,Fi;typeof Yn.vscode<"u"&&typeof Yn.vscode.process<"u"?Fi=Yn.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Fi=process);var H5=typeof Fi?.versions?.electron=="string",P5=H5&&Fi?.type==="renderer";if(typeof Fi=="object"){Fi.platform,Fi.platform,sm=Fi.platform==="linux",sm&&Fi.env.SNAP&&Fi.env.SNAP_REVISION,Fi.env.CI||Fi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cu=Jo,Ru=Jo;let e=Fi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cu=t.userLocale,Mb=t.osLocale,Ru=t.resolvedLanguage||Jo,j5=t.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!P5?(bs=navigator.userAgent,bs.indexOf("Windows")>=0,bs.indexOf("Macintosh")>=0,(bs.indexOf("Macintosh")>=0||bs.indexOf("iPad")>=0||bs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,sm=bs.indexOf("Linux")>=0,bs?.indexOf("Mobi")>=0,Ru=globalThis._VSCODE_NLS_LANGUAGE||Jo,cu=navigator.language.toLowerCase(),Mb=cu):console.error("Unable to resolve platform.");var Fr=bs,ln=Ru,U5;(e=>{function t(){return ln}e.value=t;function r(){return ln.length===2?ln==="en":ln.length>=3?ln[0]==="e"&&ln[1]==="n"&&ln[2]==="-":!1}e.isDefaultVariant=r;function n(){return ln==="en"}e.isDefault=n})(U5||={});var I5=typeof Yn.postMessage=="function"&&!Yn.importScripts;(()=>{if(I5){let e=[];Yn.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,a=e.length;n<a;n++){let c=e[n];if(c.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),c.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),Yn.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var $5=!!(Fr&&Fr.indexOf("Chrome")>=0);Fr&&Fr.indexOf("Firefox")>=0;!$5&&Fr&&Fr.indexOf("Safari")>=0;Fr&&Fr.indexOf("Edg/")>=0;Fr&&Fr.indexOf("Android")>=0;function K1(e,t=0,r){let n=setTimeout(()=>{e()},t);return ca(()=>{clearTimeout(n)})}var F5;(e=>{async function t(n){let a,c=await Promise.all(n.map(u=>u.then(f=>f,f=>{a||(a=f)})));if(typeof a<"u")throw a;return c}e.settled=t;function r(n){return new Promise(async(a,c)=>{try{await n(a,c)}catch(u){c(u)}})}e.withAsyncBody=r})(F5||={});var Nb=class nr{static fromArray(t){return new nr(r=>{r.emitMany(t)})}static fromPromise(t){return new nr(async r=>{r.emitMany(await t)})}static fromPromises(t){return new nr(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new nr(async r=>{await Promise.all(t.map(async n=>{for await(let a of n)r.emitOne(a)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Br,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await $p.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,r){return new nr(async n=>{for await(let a of t)n.emitOne(r(a))})}map(t){return nr.map(this,t)}static filter(t,r){return new nr(async n=>{for await(let a of t)r(a)&&n.emitOne(a)})}filter(t){return nr.filter(this,t)}static coalesce(t){return nr.filter(t,r=>!!r)}coalesce(){return nr.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return nr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Nb.EMPTY=Nb.fromArray([]);var W5=class extends mn{constructor(t){super(),this._terminal=t,this._linesCacheTimeout=this._register(new Uu),this._linesCacheDisposables=this._register(new Uu),this._register(ca(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=U1(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=K1(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(t){return this._linesCache?.[t]}setLineInCache(t,r){this._linesCache&&(this._linesCache[t]=r)}translateBufferLineToStringWithWrap(t,r){let n=[],a=[0],c=this._terminal.buffer.active.getLine(t);for(;c;){let u=this._terminal.buffer.active.getLine(t+1),f=u?u.isWrapped:!1,m=c.translateToString(!f&&r);if(f&&u){let d=c.getCell(c.length-1);d&&d.getCode()===0&&d.getWidth()===1&&u.getCell(0)?.getWidth()===2&&(m=m.slice(0,-1))}if(n.push(m),f)a.push(a[a.length-1]+m.length);else break;t++,c=u}return[n.join(""),a]}},q5=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(t){this._cachedSearchTerm=t}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(t){this._lastSearchOptions=t}isValidSearchTerm(t){return!!(t&&t.length>0)}didOptionsChange(t){return this._lastSearchOptions?t?this._lastSearchOptions.caseSensitive!==t.caseSensitive||this._lastSearchOptions.regex!==t.regex||this._lastSearchOptions.wholeWord!==t.wholeWord:!1:!0}shouldUpdateHighlighting(t,r){return r?.decorations?this._cachedSearchTerm===void 0||t!==this._cachedSearchTerm||this.didOptionsChange(r):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},V5=class{constructor(t,r){this._terminal=t,this._lineCache=r}find(t,r,n,a){if(!t||t.length===0){this._terminal.clearSelection();return}if(n>this._terminal.cols)throw new Error(`Invalid col: ${n} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let c={startRow:r,startCol:n},u=this._findInLine(t,c,a);if(!u)for(let f=r+1;f<this._terminal.buffer.active.baseY+this._terminal.rows&&(c.startRow=f,c.startCol=0,u=this._findInLine(t,c,a),!u);f++);return u}findNextWithSelection(t,r,n){if(!t||t.length===0){this._terminal.clearSelection();return}let a=this._terminal.getSelectionPosition();this._terminal.clearSelection();let c=0,u=0;a&&(n===t?(c=a.end.x,u=a.end.y):(c=a.start.x,u=a.start.y)),this._lineCache.initLinesCache();let f={startRow:u,startCol:c},m=this._findInLine(t,f,r);if(!m)for(let d=u+1;d<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=d,f.startCol=0,m=this._findInLine(t,f,r),!m);d++);if(!m&&u!==0)for(let d=0;d<u&&(f.startRow=d,f.startCol=0,m=this._findInLine(t,f,r),!m);d++);return!m&&a&&(f.startRow=a.start.y,f.startCol=0,m=this._findInLine(t,f,r)),m}findPreviousWithSelection(t,r,n){if(!t||t.length===0){this._terminal.clearSelection();return}let a=this._terminal.getSelectionPosition();this._terminal.clearSelection();let c=this._terminal.buffer.active.baseY+this._terminal.rows-1,u=this._terminal.cols,f=!0;this._lineCache.initLinesCache();let m={startRow:c,startCol:u},d;if(a&&(m.startRow=c=a.start.y,m.startCol=u=a.start.x,n!==t&&(d=this._findInLine(t,m,r,!1),d||(m.startRow=c=a.end.y,m.startCol=u=a.end.x))),d||(d=this._findInLine(t,m,r,f)),!d){m.startCol=Math.max(m.startCol,this._terminal.cols);for(let g=c-1;g>=0&&(m.startRow=g,d=this._findInLine(t,m,r,f),!d);g--);}if(!d&&c!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let g=this._terminal.buffer.active.baseY+this._terminal.rows-1;g>=c&&(m.startRow=g,d=this._findInLine(t,m,r,f),!d);g--);return d}_isWholeWord(t,r,n){return(t===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[t-1]))&&(t+n.length===r.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[t+n.length]))}_findInLine(t,r,n={},a=!1){let c=r.startRow,u=r.startCol;if(this._terminal.buffer.active.getLine(c)?.isWrapped){if(a){r.startCol+=this._terminal.cols;return}return r.startRow--,r.startCol+=this._terminal.cols,this._findInLine(t,r,n)}let f=this._lineCache.getLineFromCache(c);f||(f=this._lineCache.translateBufferLineToStringWithWrap(c,!0),this._lineCache.setLineInCache(c,f));let[m,d]=f,g=this._bufferColsToStringOffset(c,u),_=t,S=m;n.regex||(_=n.caseSensitive?t:t.toLowerCase(),S=n.caseSensitive?m:m.toLowerCase());let w=-1;if(n.regex){let x=RegExp(_,n.caseSensitive?"g":"gi"),C;if(a)for(;C=x.exec(S.slice(0,g));)w=x.lastIndex-C[0].length,t=C[0],x.lastIndex-=t.length-1;else C=x.exec(S.slice(g)),C&&C[0].length>0&&(w=g+(x.lastIndex-C[0].length),t=C[0])}else a?g-_.length>=0&&(w=S.lastIndexOf(_,g-_.length)):w=S.indexOf(_,g);if(w>=0){if(n.wholeWord&&!this._isWholeWord(w,S,t))return;let x=0;for(;x<d.length-1&&w>=d[x+1];)x++;let C=x;for(;C<d.length-1&&w+t.length>=d[C+1];)C++;let k=w-d[x],T=w+t.length-d[C],$=this._stringLengthToBufferSize(c+x,k),z=this._stringLengthToBufferSize(c+C,T)-$+this._terminal.cols*(C-x);return{term:t,col:$,row:c+x,size:z}}}_stringLengthToBufferSize(t,r){let n=this._terminal.buffer.active.getLine(t);if(!n)return 0;for(let a=0;a<r;a++){let c=n.getCell(a);if(!c)break;let u=c.getChars();u.length>1&&(r-=u.length-1);let f=n.getCell(a+1);f&&f.getWidth()===0&&r++}return r}_bufferColsToStringOffset(t,r){let n=t,a=0,c=this._terminal.buffer.active.getLine(n);for(;r>0&&c;){for(let u=0;u<r&&u<this._terminal.cols;u++){let f=c.getCell(u);if(!f)break;f.getWidth()&&(a+=f.getCode()===0?1:f.getChars().length)}if(n++,c=this._terminal.buffer.active.getLine(n),c&&!c.isWrapped)break;r-=this._terminal.cols}return a}},Y5=class extends mn{constructor(t){super(),this._terminal=t,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(ca(()=>this.clearHighlightDecorations()))}createHighlightDecorations(t,r){this.clearHighlightDecorations();for(let n of t){let a=this._createResultDecorations(n,r,!1);if(a)for(let c of a)this._storeDecoration(c,n)}}createActiveDecoration(t,r){let n=this._createResultDecorations(t,r,!0);if(n)return{decorations:n,match:t,dispose(){Sl(n)}}}clearHighlightDecorations(){Sl(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,r){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:r,dispose(){t.dispose()}})}_applyStyles(t,r,n){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),r&&(t.style.outline=`1px solid ${r}`)),n&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,r,n){let a=[],c=t.col,u=t.size,f=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;u>0;){let d=Math.min(this._terminal.cols-c,u);a.push([f,c,d]),c=0,u-=d,f++}let m=[];for(let d of a){let g=this._terminal.registerMarker(d[0]),_=this._terminal.registerDecoration({marker:g,x:d[1],width:d[2],backgroundColor:n?r.activeMatchBackground:r.matchBackground,overviewRulerOptions:this._highlightedLines.has(g.line)?void 0:{color:n?r.activeMatchColorOverviewRuler:r.matchOverviewRuler,position:"center"}});if(_){let S=[];S.push(g),S.push(_.onRender(w=>this._applyStyles(w,n?r.activeMatchBorder:r.matchBorder,!1))),S.push(_.onDispose(()=>Sl(S))),m.push(_)}}return m.length===0?void 0:m}},K5=class extends mn{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new Br)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,r){this._searchResults=t.slice(0,r)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let r=0;r<this._searchResults.length;r++){let n=this._searchResults[r];if(n.row===t.row&&n.col===t.col&&n.size===t.size)return r}return-1}fireResultsChanged(t){if(!t)return;let r=-1;this._selectedDecoration&&(r=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:r,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},G5=class extends mn{constructor(e){super(),this._highlightTimeout=this._register(new Uu),this._lineCache=this._register(new Uu),this._state=new q5,this._resultTracker=this._register(new K5),this._highlightLimit=e?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new W5(e),this._engine=new V5(e,this._lineCache.value),this._decorationManager=new Y5(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(ca(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=K1(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let n=this._findNextAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,n}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e)){this.clearDecorations();return}this.clearDecorations(!0);let r=[],n,a=this._engine.find(e,0,0,t);for(;a&&(n?.row!==a.row||n?.col!==a.col)&&!(r.length>=this._highlightLimit);)n=a,r.push(n),a=this._engine.find(e,n.col+n.term.length>=this._terminal.cols?n.row+1:n.row,n.col+n.term.length>=this._terminal.cols?0:n.col+1,t);this._resultTracker.updateResults(r,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(r,t.decorations)}_findNextAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let n=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(n,t?.decorations,r?.noScroll)}findPrevious(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let n=this._findPreviousAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,n}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let n=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(n,t?.decorations,r?.noScroll)}_selectResult(e,t,r){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let n=this._decorationManager.createActiveDecoration(e,t);n&&(this._resultTracker.selectedDecoration=n)}if(!r&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let n=e.row-this._terminal.buffer.active.viewportY;n-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(n)}return!0}};var Gt=0,Xt=0,Zt=0,St=0,hi;(e=>{function t(a,c,u,f){return f!==void 0?`#${$n(a)}${$n(c)}${$n(u)}${$n(f)}`:`#${$n(a)}${$n(c)}${$n(u)}`}e.toCss=t;function r(a,c,u,f=255){return(a<<24|c<<16|u<<8|f)>>>0}e.toRgba=r;function n(a,c,u,f){return{css:e.toCss(a,c,u,f),rgba:e.toRgba(a,c,u,f)}}e.toColor=n})(hi||={});var X5;(e=>{function t(m,d){if(St=(d.rgba&255)/255,St===1)return{css:d.css,rgba:d.rgba};let g=d.rgba>>24&255,_=d.rgba>>16&255,S=d.rgba>>8&255,w=m.rgba>>24&255,x=m.rgba>>16&255,C=m.rgba>>8&255;Gt=w+Math.round((g-w)*St),Xt=x+Math.round((_-x)*St),Zt=C+Math.round((S-C)*St);let k=hi.toCss(Gt,Xt,Zt),T=hi.toRgba(Gt,Xt,Zt);return{css:k,rgba:T}}e.blend=t;function r(m){return(m.rgba&255)===255}e.isOpaque=r;function n(m,d,g){let _=ku.ensureContrastRatio(m.rgba,d.rgba,g);if(_)return hi.toColor(_>>24&255,_>>16&255,_>>8&255)}e.ensureContrastRatio=n;function a(m){let d=(m.rgba|255)>>>0;return[Gt,Xt,Zt]=ku.toChannels(d),{css:hi.toCss(Gt,Xt,Zt),rgba:d}}e.opaque=a;function c(m,d){return St=Math.round(d*255),[Gt,Xt,Zt]=ku.toChannels(m.rgba),{css:hi.toCss(Gt,Xt,Zt,St),rgba:hi.toRgba(Gt,Xt,Zt,St)}}e.opacity=c;function u(m,d){return St=m.rgba&255,c(m,St*d/255)}e.multiplyOpacity=u;function f(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=f})(X5||={});var oi;(e=>{let t,r;try{let a=document.createElement("canvas");a.width=1,a.height=1;let c=a.getContext("2d",{willReadFrequently:!0});c&&(t=c,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Gt=parseInt(a.slice(1,2).repeat(2),16),Xt=parseInt(a.slice(2,3).repeat(2),16),Zt=parseInt(a.slice(3,4).repeat(2),16),hi.toColor(Gt,Xt,Zt);case 5:return Gt=parseInt(a.slice(1,2).repeat(2),16),Xt=parseInt(a.slice(2,3).repeat(2),16),Zt=parseInt(a.slice(3,4).repeat(2),16),St=parseInt(a.slice(4,5).repeat(2),16),hi.toColor(Gt,Xt,Zt,St);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 c=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(c)return Gt=parseInt(c[1]),Xt=parseInt(c[2]),Zt=parseInt(c[3]),St=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),hi.toColor(Gt,Xt,Zt,St);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Gt,Xt,Zt,St]=t.getImageData(0,0,1,1).data,St!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:hi.toRgba(Gt,Xt,Zt,St),css:a}}e.toColor=n})(oi||={});var pi;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,a,c){let u=n/255,f=a/255,m=c/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),g=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),_=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return d*.2126+g*.7152+_*.0722}e.relativeLuminance2=r})(pi||={});var ku;(e=>{function t(u,f){if(St=(f&255)/255,St===1)return f;let m=f>>24&255,d=f>>16&255,g=f>>8&255,_=u>>24&255,S=u>>16&255,w=u>>8&255;return Gt=_+Math.round((m-_)*St),Xt=S+Math.round((d-S)*St),Zt=w+Math.round((g-w)*St),hi.toRgba(Gt,Xt,Zt)}e.blend=t;function r(u,f,m){let d=pi.relativeLuminance(u>>8),g=pi.relativeLuminance(f>>8);if(vs(d,g)<m){if(g<d){let w=n(u,f,m),x=vs(d,pi.relativeLuminance(w>>8));if(x<m){let C=a(u,f,m),k=vs(d,pi.relativeLuminance(C>>8));return x>k?w:C}return w}let _=a(u,f,m),S=vs(d,pi.relativeLuminance(_>>8));if(S<m){let w=n(u,f,m),x=vs(d,pi.relativeLuminance(w>>8));return S>x?_:w}return _}}e.ensureContrastRatio=r;function n(u,f,m){let d=u>>24&255,g=u>>16&255,_=u>>8&255,S=f>>24&255,w=f>>16&255,x=f>>8&255,C=vs(pi.relativeLuminance2(S,w,x),pi.relativeLuminance2(d,g,_));for(;C<m&&(S>0||w>0||x>0);)S-=Math.max(0,Math.ceil(S*.1)),w-=Math.max(0,Math.ceil(w*.1)),x-=Math.max(0,Math.ceil(x*.1)),C=vs(pi.relativeLuminance2(S,w,x),pi.relativeLuminance2(d,g,_));return(S<<24|w<<16|x<<8|255)>>>0}e.reduceLuminance=n;function a(u,f,m){let d=u>>24&255,g=u>>16&255,_=u>>8&255,S=f>>24&255,w=f>>16&255,x=f>>8&255,C=vs(pi.relativeLuminance2(S,w,x),pi.relativeLuminance2(d,g,_));for(;C<m&&(S<255||w<255||x<255);)S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),C=vs(pi.relativeLuminance2(S,w,x),pi.relativeLuminance2(d,g,_));return(S<<24|w<<16|x<<8|255)>>>0}e.increaseLuminance=a;function c(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=c})(ku||={});function $n(e){let t=e.toString(16);return t.length<2?"0"+t:t}function vs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Z5=Object.freeze((()=>{let e=[oi.toColor("#2e3436"),oi.toColor("#cc0000"),oi.toColor("#4e9a06"),oi.toColor("#c4a000"),oi.toColor("#3465a4"),oi.toColor("#75507b"),oi.toColor("#06989a"),oi.toColor("#d3d7cf"),oi.toColor("#555753"),oi.toColor("#ef2929"),oi.toColor("#8ae234"),oi.toColor("#fce94f"),oi.toColor("#729fcf"),oi.toColor("#ad7fa8"),oi.toColor("#34e2e2"),oi.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],a=t[r/6%6|0],c=t[r%6];e.push({css:hi.toCss(n,a,c),rgba:hi.toRgba(n,a,c)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:hi.toCss(n,n,n),rgba:hi.toRgba(n,n,n)})}return e})());function Ob(e,t,r){return Math.max(t,Math.min(e,r))}function Q5(e){switch(e){case"&":return"&amp;";case"<":return"&lt;"}return e}var G1=class{constructor(e){this._buffer=e}serialize(e,t){let r=this._buffer.getNullCell(),n=this._buffer.getNullCell(),a=r,c=e.start.y,u=e.end.y,f=e.start.x,m=e.end.x;this._beforeSerialize(u-c,c,u);for(let d=c;d<=u;d++){let g=this._buffer.getLine(d);if(g){let _=d===e.start.y?f:0,S=d===e.end.y?m:g.length;for(let w=_;w<S;w++){let x=g.getCell(w,a===r?n:r);if(!x){console.warn(`Can't get cell at row=${d}, col=${w}`);continue}this._nextCell(x,a,d,w),a=x}}this._rowEnd(d,d===u)}return this._afterSerialize(),this._serializeString(t)}_nextCell(e,t,r,n){}_rowEnd(e,t){}_beforeSerialize(e,t,r){}_afterSerialize(){}_serializeString(e){return""}};function X1(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Ss(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function Z1(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var J5=class extends G1{constructor(t,r){super(t),this._terminal=r,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,r,n){this._allRows=new Array(t),this._lastContentCursorRow=r,this._lastCursorRow=r,this._firstRow=r}_rowEnd(t,r){this._nullCellCount>0&&!Ss(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let n="";if(!r){t-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);let a=this._buffer.getLine(t),c=this._buffer.getLine(t+1);if(!c.isWrapped)n=`\r
`,this._lastCursorRow=t+1,this._lastCursorCol=0;else{n="";let u=a.getCell(a.length-1,this._thisRowLastChar),f=a.getCell(a.length-2,this._thisRowLastSecondChar),m=c.getCell(0,this._nextRowFirstChar),d=m.getWidth()>1,g=!1;(m.getChars()&&d?this._nullCellCount<=1:this._nullCellCount<=0)&&((u.getChars()||u.getWidth()===0)&&Ss(u,m)&&(g=!0),d&&(f.getChars()||f.getWidth()===0)&&Ss(u,m)&&Ss(f,m)&&(g=!0)),g||(n="-".repeat(this._nullCellCount+1),n+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(n+="\x1B[A",n+=`\x1B[${a.length-this._nullCellCount}C`,n+=`\x1B[${this._nullCellCount}X`,n+=`\x1B[${a.length-this._nullCellCount}D`,n+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=n,this._currentRow="",this._nullCellCount=0}_diffStyle(t,r){let n=[],a=!X1(t,r),c=!Ss(t,r),u=!Z1(t,r);if(a||c||u)if(t.isAttributeDefault())r.isAttributeDefault()||n.push(0);else{if(a){let f=t.getFgColor();t.isFgRGB()?n.push(38,2,f>>>16&255,f>>>8&255,f&255):t.isFgPalette()?f>=16?n.push(38,5,f):n.push(f&8?90+(f&7):30+(f&7)):n.push(39)}if(c){let f=t.getBgColor();t.isBgRGB()?n.push(48,2,f>>>16&255,f>>>8&255,f&255):t.isBgPalette()?f>=16?n.push(48,5,f):n.push(f&8?100+(f&7):40+(f&7)):n.push(49)}u&&(t.isInverse()!==r.isInverse()&&n.push(t.isInverse()?7:27),t.isBold()!==r.isBold()&&n.push(t.isBold()?1:22),t.isUnderline()!==r.isUnderline()&&n.push(t.isUnderline()?4:24),t.isOverline()!==r.isOverline()&&n.push(t.isOverline()?53:55),t.isBlink()!==r.isBlink()&&n.push(t.isBlink()?5:25),t.isInvisible()!==r.isInvisible()&&n.push(t.isInvisible()?8:28),t.isItalic()!==r.isItalic()&&n.push(t.isItalic()?3:23),t.isDim()!==r.isDim()&&n.push(t.isDim()?2:22),t.isStrikethrough()!==r.isStrikethrough()&&n.push(t.isStrikethrough()?9:29))}return n}_nextCell(t,r,n,a){if(t.getWidth()===0)return;let c=t.getChars()==="",u=this._diffStyle(t,this._cursorStyle);if(c?!Ss(this._cursorStyle,t):u.length>0){this._nullCellCount>0&&(Ss(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=a,this._currentRow+=`\x1B[${u.join(";")}m`;let f=this._buffer.getLine(n);f!==void 0&&(f.getCell(a,this._cursorStyle),this._cursorStyleRow=n,this._cursorStyleCol=a)}c?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(Ss(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=a+t.getWidth())}_serializeString(t){let r=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(r=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let n="";for(let u=0;u<r;u++)n+=this._allRows[u],u+1<r&&(n+=this._allRowSeparators[u]);if(!t){let u=this._buffer.baseY+this._buffer.cursorY,f=this._buffer.cursorX,m=u!==this._lastCursorRow||f!==this._lastCursorCol,d=g=>{g>0?n+=`\x1B[${g}C`:g<0&&(n+=`\x1B[${-g}D`)};m&&((g=>{g>0?n+=`\x1B[${g}B`:g<0&&(n+=`\x1B[${-g}A`)})(u-this._lastCursorRow),d(f-this._lastCursorCol))}let a=this._terminal._core._inputHandler._curAttrData,c=this._diffStyle(a,this._cursorStyle);return c.length>0&&(n+=`\x1B[${c.join(";")}m`),n}},eM=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,r,n){let a=r.length,c=n===void 0?a:Ob(n+t.rows,0,a);return this._serializeBufferByRange(t,r,{start:a-c,end:a-1},!1)}_serializeBufferByRange(t,r,n,a){return new J5(r,t).serialize({start:{x:0,y:typeof n.start=="number"?n.start:n.start.line},end:{x:t.cols,y:typeof n.end=="number"?n.end:n.end.line}},a)}_serializeBufferAsHTML(t,r){let n=t.buffer.active,a=new tM(n,t,r),c=r.onlySelection??!1,u=r.range;if(u)return a.serialize({start:{x:u.startCol,y:(u.startLine,u.startLine)},end:{x:t.cols,y:(u.endLine,u.endLine)}});if(!c){let m=n.length,d=r.scrollback,g=d===void 0?m:Ob(d+t.rows,0,m);return a.serialize({start:{x:0,y:m-g},end:{x:t.cols,y:m-1}})}let f=this._terminal?.getSelectionPosition();return f!==void 0?a.serialize({start:{x:f.start.x,y:f.start.y},end:{x:f.end.x,y:f.end.y}}):""}_serializeModes(t){let r="",n=t.modes;if(n.applicationCursorKeysMode&&(r+="\x1B[?1h"),n.applicationKeypadMode&&(r+="\x1B[?66h"),n.bracketedPasteMode&&(r+="\x1B[?2004h"),n.insertMode&&(r+="\x1B[4h"),n.originMode&&(r+="\x1B[?6h"),n.reverseWraparoundMode&&(r+="\x1B[?45h"),n.sendFocusMode&&(r+="\x1B[?1004h"),n.wraparoundMode===!1&&(r+="\x1B[?7l"),n.mouseTrackingMode!=="none")switch(n.mouseTrackingMode){case"x10":r+="\x1B[?9h";break;case"vt200":r+="\x1B[?1000h";break;case"drag":r+="\x1B[?1002h";break;case"any":r+="\x1B[?1003h";break}return r}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let r=t?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t?.scrollback);if(!t?.excludeAltBuffer&&this._terminal.buffer.active.type==="alternate"){let n=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);r+=`\x1B[?1049h\x1B[H${n}`}return t?.excludeModes||(r+=this._serializeModes(this._terminal)),r}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},tM=class extends G1{constructor(e,t,r){super(e),this._terminal=t,this._options=r,this._currentRow="",this._htmlContent="",t._core._themeService?this._ansiColors=t._core._themeService.colors.ansi:this._ansiColors=Z5}_padStart(e,t,r){return t=t>>0,r=r??" ",e.length>t?e:(t-=e.length,t>r.length&&(r+=r.repeat(t/r.length)),r.slice(0,t)+e)}_beforeSerialize(e,t,r){this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",a="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=this._terminal.options.theme?.foreground??"#ffffff",a=this._terminal.options.theme?.background??"#000000");let c=[];c.push("color: "+n+";"),c.push("background-color: "+a+";"),c.push("font-family: "+this._terminal.options.fontFamily+";"),c.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+c.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,t){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,t){let r=t?e.getFgColor():e.getBgColor();if(t?e.isFgRGB():e.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(t?e.isFgPalette():e.isBgPalette())return this._ansiColors[r].css}_diffStyle(e,t){let r=[],n=!X1(e,t),a=!Ss(e,t),c=!Z1(e,t);if(n||a||c){let u=this._getHexColor(e,!0);u&&r.push("color: "+u+";");let f=this._getHexColor(e,!1);return f&&r.push("background-color: "+f+";"),e.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&r.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?r.push("text-decoration: overline underline;"):e.isUnderline()?r.push("text-decoration: underline;"):e.isOverline()&&r.push("text-decoration: overline;"),e.isBlink()&&r.push("text-decoration: blink;"),e.isInvisible()&&r.push("visibility: hidden;"),e.isItalic()&&r.push("font-style: italic;"),e.isDim()&&r.push("opacity: 0.5;"),e.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(e,t,r,n){if(e.getWidth()===0)return;let a=e.getChars()==="",c=this._diffStyle(e,t);c&&(this._currentRow+=c.length===0?"</span><span>":"</span><span style='"+c.join(" ")+"'>"),a?this._currentRow+=" ":this._currentRow+=Q5(e.getChars())}_serializeString(){return this._htmlContent}};const Q1=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();const iM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const rM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());const Bb=e=>{const t=rM(e);return t.charAt(0).toUpperCase()+t.slice(1)};var sM={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 nM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const oM=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:c,iconNode:u,...f},m)=>y.createElement("svg",{ref:m,...sM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Q1("lucide",a),...!c&&!nM(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>y.createElement(d,g)),...Array.isArray(c)?c:[c]]));const Qe=(e,t)=>{const r=y.forwardRef(({className:n,...a},c)=>y.createElement(oM,{ref:c,iconNode:t,className:Q1(`lucide-${iM(Bb(e))}`,`lucide-${e}`,n),...a}));return r.displayName=Bb(e),r};const aM=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],lM=Qe("activity",aM);const cM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],uM=Qe("arrow-right",cM);const hM=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],dM=Qe("brush",hM);const fM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mM=Qe("chevron-down",fM);const pM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_M=Qe("chevron-up",pM);const gM=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],vM=Qe("cloud-download",gM);const yM=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],bM=Qe("cpu",yM);const SM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],wM=Qe("download",SM);const xM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],CM=Qe("external-link",xM);const EM=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],RM=Qe("hard-drive",EM);const kM=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],TM=Qe("house",kM);const AM=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],DM=Qe("log-out",AM);const MM=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],NM=Qe("memory-stick",MM);const OM=[["path",{d:"m14.5 12.5-5-5",key:"1jahn5"}],["path",{d:"m9.5 12.5 5-5",key:"1k2t7b"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]],Lb=Qe("monitor-x",OM);const BM=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],LM=Qe("moon",BM);const zM=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],J1=Qe("network",zM);const jM=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],HM=Qe("package-minus",jM);const PM=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],UM=Qe("pencil",PM);const IM=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],zb=Qe("play",IM);const $M=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ew=Qe("plus",$M);const FM=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],WM=Qe("rotate-cw",FM);const qM=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],VM=Qe("save",qM);const YM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tw=Qe("search",YM);const KM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],iw=Qe("square",KM);const GM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],XM=Qe("sun",GM);const ZM=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ap=Qe("terminal",ZM);const QM=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],rw=Qe("trash-2",QM);const JM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],eN=Qe("triangle-alert",JM);const tN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fp=Qe("x",tN);function iN({stackName:e}){const t=y.useRef(null),r=y.useRef(null),n=y.useRef(null),a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),[m,d]=y.useState(!1),[g,_]=y.useState("");y.useEffect(()=>{if(!t.current){console.error("Terminal ref not ready");return}if(r.current)try{r.current.dispose()}catch{}if(f.current)try{f.current.close()}catch{}let k=!0;const $=setTimeout(()=>{if(!(!k||!t.current))try{const j=new j1({cursorBlink:!0,convertEol:!0,allowProposedApi:!0,theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#ffffff"},fontFamily:"'JetBrains Mono', Consolas, Monaco, monospace",fontSize:13,scrollback:1e4}),P=new H1,F=new G5,G=new eM;j.loadAddon(P),j.loadAddon(F),j.loadAddon(G),n.current=P,a.current=F,c.current=G,j.open(t.current),r.current=j,j.attachCustomKeyEventHandler(M=>M.ctrlKey&&M.key==="f"&&M.type==="keydown"?(M.preventDefault(),d(H=>{const N=!H;return N&&setTimeout(()=>u.current?.focus(),50),N}),!1):!0),requestAnimationFrame(()=>{if(!(!k||!n.current||!t.current))try{n.current.fit()}catch(M){console.error("Error fitting terminal:",M)}});const re=window.location.protocol==="https:"?"wss:":"ws:",le=e?.replace(/\.(yml|yaml)$/,""),ce=le?`${re}//${window.location.host}/api/stacks/${le}/logs`:`${re}//${window.location.host}`,W=new WebSocket(ce);f.current=W,W.onopen=()=>{k&&(le||W.send(JSON.stringify({action:"connectTerminal"})))},W.onmessage=M=>{if(k&&r.current){const H=typeof M.data=="string"?M.data:M.data.toString();r.current.write(H.replace(/\r?\n/g,`\r
`))}},W.onerror=M=>{console.error("WebSocket error:",M)}}catch(j){console.error("Error initializing terminal:",j)}},50);let z;const A=new ResizeObserver(()=>{z&&clearTimeout(z),z=setTimeout(()=>{if(n.current&&t.current&&k)try{n.current.fit()}catch{}},50)});return t.current.parentElement&&A.observe(t.current.parentElement),()=>{if(k=!1,clearTimeout($),A.disconnect(),f.current){try{f.current.close()}catch{}f.current=null}if(r.current){try{r.current.dispose()}catch{}r.current=null}n.current=null,a.current=null,c.current=null}},[e]);const S=()=>{if(!c.current)return;const k=c.current.serialize(),T=new Blob([k],{type:"text/plain"}),$=URL.createObjectURL(T),z=document.createElement("a");z.href=$;const A=new Date().toISOString().replace(/[:.]/g,"-");z.download=`logs-${e||"terminal"}-${A}.txt`,document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL($)},w=()=>{!a.current||!g||a.current.findNext(g)},x=()=>{!a.current||!g||a.current.findPrevious(g)},C=k=>{k.key==="Enter"?k.shiftKey?x():w():k.key==="Escape"&&d(!1)};return v.jsxs("div",{className:"flex flex-col h-full w-full relative group",children:[v.jsxs("div",{className:`absolute top-2 right-6 z-10 flex gap-2 transition-opacity duration-200 ${m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"}`,children:[m?v.jsxs("div",{className:"flex flex-row items-center p-1 pr-1 bg-background/95 backdrop-blur-sm border border-border shadow-md rounded-md",children:[v.jsx(xs,{ref:u,value:g,onChange:k=>_(k.target.value),onKeyDown:C,placeholder:"Find in terminal...",className:"h-7 w-48 border-none focus-visible:ring-0 bg-transparent text-sm min-h-0"}),v.jsx(Ie,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:x,title:"Previous (Shift+Enter)",children:v.jsx(_M,{className:"w-4 h-4"})}),v.jsx(Ie,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:w,title:"Next (Enter)",children:v.jsx(mM,{className:"w-4 h-4"})}),v.jsx("div",{className:"w-px h-4 bg-border mx-1"}),v.jsx(Ie,{variant:"ghost",size:"icon",className:"h-6 w-6 hover:bg-destructive/10 hover:text-destructive",onClick:()=>d(!1),title:"Close (Esc)",children:v.jsx(Fp,{className:"w-4 h-4"})})]}):v.jsxs(Ie,{variant:"outline",size:"sm",onClick:()=>{d(!0),setTimeout(()=>u.current?.focus(),50)},className:"h-8 bg-background/80 backdrop-blur-sm shadow-sm",title:"Search (Ctrl+F)",children:[v.jsx(tw,{className:"w-4 h-4 mr-2"}),"Search"]}),v.jsxs(Ie,{variant:"outline",size:"sm",onClick:S,className:"h-8 bg-background/80 backdrop-blur-sm shadow-sm",title:"Download Logs",children:[v.jsx(wM,{className:"w-4 h-4 mr-2"}),"Download"]})]}),v.jsx("div",{ref:t,className:"flex-1 w-full overflow-hidden"})]})}class jb extends y.Component{state={hasError:!1,error:null};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("ErrorBoundary caught an error:",t,r)}render(){return this.state.hasError?v.jsxs("div",{className:"p-6 bg-red-900/20 border border-red-500 rounded-xl m-4",children:[v.jsx("h2",{className:"text-lg font-bold text-red-500 mb-2",children:"Something went wrong"}),v.jsx("p",{className:"text-red-300 text-sm mb-4",children:this.state.error?.message||"Unknown error"}),v.jsx("button",{className:"px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-red-600",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}function Ve(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}function rN(e,t){const r=y.createContext(t),n=c=>{const{children:u,...f}=c,m=y.useMemo(()=>f,Object.values(f));return v.jsx(r.Provider,{value:m,children:u})};n.displayName=e+"Provider";function a(c){const u=y.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[n,a]}function yn(e,t=[]){let r=[];function n(c,u){const f=y.createContext(u),m=r.length;r=[...r,u];const d=_=>{const{scope:S,children:w,...x}=_,C=S?.[e]?.[m]||f,k=y.useMemo(()=>x,Object.values(x));return v.jsx(C.Provider,{value:k,children:w})};d.displayName=c+"Provider";function g(_,S){const w=S?.[e]?.[m]||f,x=y.useContext(w);if(x)return x;if(u!==void 0)return u;throw new Error(`\`${_}\` must be used within \`${c}\``)}return[d,g]}const a=()=>{const c=r.map(u=>y.createContext(u));return function(f){const m=f?.[e]||c;return y.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return a.scopeName=e,[n,sN(a,...t)]}function sN(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const u=n.reduce((f,{useScope:m,scopeName:d})=>{const _=m(c)[`__scope${d}`];return{...f,..._}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var Es=globalThis?.document?y.useLayoutEffect:()=>{},nN=xp[" useId ".trim().toString()]||(()=>{}),oN=0;function cr(e){const[t,r]=y.useState(nN());return Es(()=>{r(n=>n??String(oN++))},[e]),t?`radix-${t}`:""}var aN=xp[" useInsertionEffect ".trim().toString()]||Es;function oh({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,c,u]=lN({defaultProp:t,onChange:r}),f=e!==void 0,m=f?e:a;{const g=y.useRef(e!==void 0);y.useEffect(()=>{const _=g.current;_!==f&&console.warn(`${n} is changing from ${_?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=f},[f,n])}const d=y.useCallback(g=>{if(f){const _=cN(g)?g(e):g;_!==e&&u.current?.(_)}else c(g)},[f,e,c,u]);return[m,d]}function lN({defaultProp:e,onChange:t}){const[r,n]=y.useState(e),a=y.useRef(r),c=y.useRef(t);return aN(()=>{c.current=t},[t]),y.useEffect(()=>{a.current!==r&&(c.current?.(r),a.current=r)},[r,a]),[r,n,c]}function cN(e){return typeof e=="function"}function uN(e){const t=hN(e),r=y.forwardRef((n,a)=>{const{children:c,...u}=n,f=y.Children.toArray(c),m=f.find(fN);if(m){const d=m.props.children,g=f.map(_=>_===m?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:_);return v.jsx(t,{...u,ref:a,children:y.isValidElement(d)?y.cloneElement(d,void 0,g):null})}return v.jsx(t,{...u,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function hN(e){const t=y.forwardRef((r,n)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const u=pN(a),f=mN(c,a.props);return a.type!==y.Fragment&&(f.ref=n?Ir(n,u):u),y.cloneElement(a,f)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dN=Symbol("radix.slottable");function fN(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dN}function mN(e,t){const r={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?r[n]=(...f)=>{const m=c(...f);return a(...f),m}:a&&(r[n]=a):n==="style"?r[n]={...a,...c}:n==="className"&&(r[n]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function pN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _N=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=_N.reduce((e,t)=>{const r=uN(`Primitive.${t}`),n=y.forwardRef((a,c)=>{const{asChild:u,...f}=a,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(m,{...f,ref:c})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function gN(e,t){e&&Dp.flushSync(()=>e.dispatchEvent(t))}function Ti(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>t.current?.(...r),[])}function vN(e,t=globalThis?.document){const r=Ti(e);y.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var yN="DismissableLayer",lp="dismissableLayer.update",bN="dismissableLayer.pointerDownOutside",SN="dismissableLayer.focusOutside",Hb,sw=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wp=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...m}=e,d=y.useContext(sw),[g,_]=y.useState(null),S=g?.ownerDocument??globalThis?.document,[,w]=y.useState({}),x=wt(t,F=>_(F)),C=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=C.indexOf(k),$=g?C.indexOf(g):-1,z=d.layersWithOutsidePointerEventsDisabled.size>0,A=$>=T,j=CN(F=>{const G=F.target,re=[...d.branches].some(le=>le.contains(G));!A||re||(a?.(F),u?.(F),F.defaultPrevented||f?.())},S),P=EN(F=>{const G=F.target;[...d.branches].some(le=>le.contains(G))||(c?.(F),u?.(F),F.defaultPrevented||f?.())},S);return vN(F=>{$===d.layers.size-1&&(n?.(F),!F.defaultPrevented&&f&&(F.preventDefault(),f()))},S),y.useEffect(()=>{if(g)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Hb=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(g)),d.layers.add(g),Pb(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(S.body.style.pointerEvents=Hb)}},[g,S,r,d]),y.useEffect(()=>()=>{g&&(d.layers.delete(g),d.layersWithOutsidePointerEventsDisabled.delete(g),Pb())},[g,d]),y.useEffect(()=>{const F=()=>w({});return document.addEventListener(lp,F),()=>document.removeEventListener(lp,F)},[]),v.jsx($e.div,{...m,ref:x,style:{pointerEvents:z?A?"auto":"none":void 0,...e.style},onFocusCapture:Ve(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Ve(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ve(e.onPointerDownCapture,j.onPointerDownCapture)})});Wp.displayName=yN;var wN="DismissableLayerBranch",xN=y.forwardRef((e,t)=>{const r=y.useContext(sw),n=y.useRef(null),a=wt(t,n);return y.useEffect(()=>{const c=n.current;if(c)return r.branches.add(c),()=>{r.branches.delete(c)}},[r.branches]),v.jsx($e.div,{...e,ref:a})});xN.displayName=wN;function CN(e,t=globalThis?.document){const r=Ti(e),n=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const c=f=>{if(f.target&&!n.current){let m=function(){nw(bN,r,d,{discrete:!0})};const d={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=m,t.addEventListener("click",a.current,{once:!0})):m()}else t.removeEventListener("click",a.current);n.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function EN(e,t=globalThis?.document){const r=Ti(e),n=y.useRef(!1);return y.useEffect(()=>{const a=c=>{c.target&&!n.current&&nw(SN,r,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Pb(){const e=new CustomEvent(lp);document.dispatchEvent(e)}function nw(e,t,r,{discrete:n}){const a=r.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?gN(a,c):a.dispatchEvent(c)}var nm="focusScope.autoFocusOnMount",om="focusScope.autoFocusOnUnmount",Ub={bubbles:!1,cancelable:!0},RN="FocusScope",ow=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:c,...u}=e,[f,m]=y.useState(null),d=Ti(a),g=Ti(c),_=y.useRef(null),S=wt(t,C=>m(C)),w=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let C=function(z){if(w.paused||!f)return;const A=z.target;f.contains(A)?_.current=A:cn(_.current,{select:!0})},k=function(z){if(w.paused||!f)return;const A=z.relatedTarget;A!==null&&(f.contains(A)||cn(_.current,{select:!0}))},T=function(z){if(document.activeElement===document.body)for(const j of z)j.removedNodes.length>0&&cn(f)};document.addEventListener("focusin",C),document.addEventListener("focusout",k);const $=new MutationObserver(T);return f&&$.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",k),$.disconnect()}}},[n,f,w.paused]),y.useEffect(()=>{if(f){$b.add(w);const C=document.activeElement;if(!f.contains(C)){const T=new CustomEvent(nm,Ub);f.addEventListener(nm,d),f.dispatchEvent(T),T.defaultPrevented||(kN(NN(aw(f)),{select:!0}),document.activeElement===C&&cn(f))}return()=>{f.removeEventListener(nm,d),setTimeout(()=>{const T=new CustomEvent(om,Ub);f.addEventListener(om,g),f.dispatchEvent(T),T.defaultPrevented||cn(C??document.body,{select:!0}),f.removeEventListener(om,g),$b.remove(w)},0)}}},[f,d,g,w]);const x=y.useCallback(C=>{if(!r&&!n||w.paused)return;const k=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(k&&T){const $=C.currentTarget,[z,A]=TN($);z&&A?!C.shiftKey&&T===A?(C.preventDefault(),r&&cn(z,{select:!0})):C.shiftKey&&T===z&&(C.preventDefault(),r&&cn(A,{select:!0})):T===$&&C.preventDefault()}},[r,n,w.paused]);return v.jsx($e.div,{tabIndex:-1,...u,ref:S,onKeyDown:x})});ow.displayName=RN;function kN(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(cn(n,{select:t}),document.activeElement!==r)return}function TN(e){const t=aw(e),r=Ib(t,e),n=Ib(t.reverse(),e);return[r,n]}function aw(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ib(e,t){for(const r of e)if(!AN(r,{upTo:t}))return r}function AN(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function DN(e){return e instanceof HTMLInputElement&&"select"in e}function cn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&DN(e)&&t&&e.select()}}var $b=MN();function MN(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Fb(e,t),e.unshift(t)},remove(t){e=Fb(e,t),e[0]?.resume()}}}function Fb(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function NN(e){return e.filter(t=>t.tagName!=="A")}var ON="Portal",qp=y.forwardRef((e,t)=>{const{container:r,...n}=e,[a,c]=y.useState(!1);Es(()=>c(!0),[]);const u=r||a&&globalThis?.document?.body;return u?zS.createPortal(v.jsx($e.div,{...n,ref:t}),u):null});qp.displayName=ON;function BN(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var wr=e=>{const{present:t,children:r}=e,n=LN(t),a=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),c=wt(n.ref,zN(a));return typeof r=="function"||n.isPresent?y.cloneElement(a,{ref:c}):null};wr.displayName="Presence";function LN(e){const[t,r]=y.useState(),n=y.useRef(null),a=y.useRef(e),c=y.useRef("none"),u=e?"mounted":"unmounted",[f,m]=BN(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=uu(n.current);c.current=f==="mounted"?d:"none"},[f]),Es(()=>{const d=n.current,g=a.current;if(g!==e){const S=c.current,w=uu(d);e?m("MOUNT"):w==="none"||d?.display==="none"?m("UNMOUNT"):m(g&&S!==w?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,m]),Es(()=>{if(t){let d;const g=t.ownerDocument.defaultView??window,_=w=>{const C=uu(n.current).includes(CSS.escape(w.animationName));if(w.target===t&&C&&(m("ANIMATION_END"),!a.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",d=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},S=w=>{w.target===t&&(c.current=uu(n.current))};return t.addEventListener("animationstart",S),t.addEventListener("animationcancel",_),t.addEventListener("animationend",_),()=>{g.clearTimeout(d),t.removeEventListener("animationstart",S),t.removeEventListener("animationcancel",_),t.removeEventListener("animationend",_)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:y.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function uu(e){return e?.animationName||"none"}function zN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var am=0;function jN(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Wb()),document.body.insertAdjacentElement("beforeend",e[1]??Wb()),am++,()=>{am===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),am--}},[])}function Wb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Lr=function(){return Lr=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])}return t},Lr.apply(this,arguments)};function lw(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function HN(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,c;n<a;n++)(c||!(n in t))&&(c||(c=Array.prototype.slice.call(t,0,n)),c[n]=t[n]);return e.concat(c||Array.prototype.slice.call(t))}var Tu="right-scroll-bar-position",Au="width-before-scroll-bar",PN="with-scroll-bars-hidden",UN="--removed-body-scroll-bar-size";function lm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function IN(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var $N=typeof window<"u"?y.useLayoutEffect:y.useEffect,qb=new WeakMap;function FN(e,t){var r=IN(null,function(n){return e.forEach(function(a){return lm(a,n)})});return $N(function(){var n=qb.get(r);if(n){var a=new Set(n),c=new Set(e),u=r.current;a.forEach(function(f){c.has(f)||lm(f,null)}),c.forEach(function(f){a.has(f)||lm(f,u)})}qb.set(r,e)},[e]),r}function WN(e){return e}function qN(e,t){t===void 0&&(t=WN);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(c){var u=t(c,n);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(c){for(n=!0;r.length;){var u=r;r=[],u.forEach(c)}r={push:function(f){return c(f)},filter:function(){return r}}},assignMedium:function(c){n=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(c),u=r}var m=function(){var g=u;u=[],g.forEach(c)},d=function(){return Promise.resolve().then(m)};d(),r={push:function(g){u.push(g),d()},filter:function(g){return u=u.filter(g),r}}}};return a}function VN(e){e===void 0&&(e={});var t=qN(null);return t.options=Lr({async:!0,ssr:!1},e),t}var cw=function(e){var t=e.sideCar,r=lw(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return y.createElement(n,Lr({},r))};cw.isSideCarExport=!0;function YN(e,t){return e.useMedium(t),cw}var uw=VN(),cm=function(){},ah=y.forwardRef(function(e,t){var r=y.useRef(null),n=y.useState({onScrollCapture:cm,onWheelCapture:cm,onTouchMoveCapture:cm}),a=n[0],c=n[1],u=e.forwardProps,f=e.children,m=e.className,d=e.removeScrollBar,g=e.enabled,_=e.shards,S=e.sideCar,w=e.noRelative,x=e.noIsolation,C=e.inert,k=e.allowPinchZoom,T=e.as,$=T===void 0?"div":T,z=e.gapMode,A=lw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=S,P=FN([r,t]),F=Lr(Lr({},A),a);return y.createElement(y.Fragment,null,g&&y.createElement(j,{sideCar:uw,removeScrollBar:d,shards:_,noRelative:w,noIsolation:x,inert:C,setCallbacks:c,allowPinchZoom:!!k,lockRef:r,gapMode:z}),u?y.cloneElement(y.Children.only(f),Lr(Lr({},F),{ref:P})):y.createElement($,Lr({},F,{className:m,ref:P}),f))});ah.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ah.classNames={fullWidth:Au,zeroRight:Tu};var KN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KN();return t&&e.setAttribute("nonce",t),e}function XN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var QN=function(){var e=0,t=null;return{add:function(r){e==0&&(t=GN())&&(XN(t,r),ZN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},JN=function(){var e=QN();return function(t,r){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},hw=function(){var e=JN(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},eO={left:0,top:0,right:0,gap:0},um=function(e){return parseInt(e||"",10)||0},tO=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[um(r),um(n),um(a)]},iO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eO;var t=tO(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},rO=hw(),ea="data-scroll-locked",sO=function(e,t,r,n){var a=e.left,c=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
.`.concat(PN,` {
overflow: hidden `).concat(n,`;
padding-right: `).concat(f,"px ").concat(n,`;
}
body[`).concat(ea,`] {
overflow: hidden `).concat(n,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
padding-left: `.concat(a,`px;
padding-top: `).concat(c,`px;
padding-right: `).concat(u,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(f,"px ").concat(n,`;
`),r==="padding"&&"padding-right: ".concat(f,"px ").concat(n,";")].filter(Boolean).join(""),`
}
.`).concat(Tu,` {
right: `).concat(f,"px ").concat(n,`;
}
.`).concat(Au,` {
margin-right: `).concat(f,"px ").concat(n,`;
}
.`).concat(Tu," .").concat(Tu,` {
right: 0 `).concat(n,`;
}
.`).concat(Au," .").concat(Au,` {
margin-right: 0 `).concat(n,`;
}
body[`).concat(ea,`] {
`).concat(UN,": ").concat(f,`px;
}
`)},Vb=function(){var e=parseInt(document.body.getAttribute(ea)||"0",10);return isFinite(e)?e:0},nO=function(){y.useEffect(function(){return document.body.setAttribute(ea,(Vb()+1).toString()),function(){var e=Vb()-1;e<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,e.toString())}},[])},oO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;nO();var c=y.useMemo(function(){return iO(a)},[a]);return y.createElement(rO,{styles:sO(c,!t,a,r?"":"!important")})},cp=!1;if(typeof window<"u")try{var hu=Object.defineProperty({},"passive",{get:function(){return cp=!0,!0}});window.addEventListener("test",hu,hu),window.removeEventListener("test",hu,hu)}catch{cp=!1}var qo=cp?{passive:!1}:!1,aO=function(e){return e.tagName==="TEXTAREA"},dw=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!aO(e)&&r[t]==="visible")},lO=function(e){return dw(e,"overflowY")},cO=function(e){return dw(e,"overflowX")},Yb=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=fw(e,n);if(a){var c=mw(e,n),u=c[1],f=c[2];if(u>f)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},uO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},hO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},fw=function(e,t){return e==="v"?lO(t):cO(t)},mw=function(e,t){return e==="v"?uO(t):hO(t)},dO=function(e,t){return e==="h"&&t==="rtl"?-1:1},fO=function(e,t,r,n,a){var c=dO(e,window.getComputedStyle(t).direction),u=c*n,f=r.target,m=t.contains(f),d=!1,g=u>0,_=0,S=0;do{if(!f)break;var w=mw(e,f),x=w[0],C=w[1],k=w[2],T=C-k-c*x;(x||T)&&fw(e,f)&&(_+=T,S+=x);var $=f.parentNode;f=$&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE?$.host:$}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(g&&Math.abs(_)<1||!g&&Math.abs(S)<1)&&(d=!0),d},du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kb=function(e){return[e.deltaX,e.deltaY]},Gb=function(e){return e&&"current"in e?e.current:e},mO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pO=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},_O=0,Vo=[];function gO(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),a=y.useState(_O++)[0],c=y.useState(hw)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var C=HN([e.lockRef.current],(e.shards||[]).map(Gb),!0).filter(Boolean);return C.forEach(function(k){return k.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),C.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var f=y.useCallback(function(C,k){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var T=du(C),$=r.current,z="deltaX"in C?C.deltaX:$[0]-T[0],A="deltaY"in C?C.deltaY:$[1]-T[1],j,P=C.target,F=Math.abs(z)>Math.abs(A)?"h":"v";if("touches"in C&&F==="h"&&P.type==="range")return!1;var G=window.getSelection(),re=G&&G.anchorNode,le=re?re===P||re.contains(P):!1;if(le)return!1;var ce=Yb(F,P);if(!ce)return!0;if(ce?j=F:(j=F==="v"?"h":"v",ce=Yb(F,P)),!ce)return!1;if(!n.current&&"changedTouches"in C&&(z||A)&&(n.current=j),!j)return!0;var W=n.current||j;return fO(W,k,C,W==="h"?z:A)},[]),m=y.useCallback(function(C){var k=C;if(!(!Vo.length||Vo[Vo.length-1]!==c)){var T="deltaY"in k?Kb(k):du(k),$=t.current.filter(function(j){return j.name===k.type&&(j.target===k.target||k.target===j.shadowParent)&&mO(j.delta,T)})[0];if($&&$.should){k.cancelable&&k.preventDefault();return}if(!$){var z=(u.current.shards||[]).map(Gb).filter(Boolean).filter(function(j){return j.contains(k.target)}),A=z.length>0?f(k,z[0]):!u.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),d=y.useCallback(function(C,k,T,$){var z={name:C,delta:k,target:T,should:$,shadowParent:vO(T)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(A){return A!==z})},1)},[]),g=y.useCallback(function(C){r.current=du(C),n.current=void 0},[]),_=y.useCallback(function(C){d(C.type,Kb(C),C.target,f(C,e.lockRef.current))},[]),S=y.useCallback(function(C){d(C.type,du(C),C.target,f(C,e.lockRef.current))},[]);y.useEffect(function(){return Vo.push(c),e.setCallbacks({onScrollCapture:_,onWheelCapture:_,onTouchMoveCapture:S}),document.addEventListener("wheel",m,qo),document.addEventListener("touchmove",m,qo),document.addEventListener("touchstart",g,qo),function(){Vo=Vo.filter(function(C){return C!==c}),document.removeEventListener("wheel",m,qo),document.removeEventListener("touchmove",m,qo),document.removeEventListener("touchstart",g,qo)}},[]);var w=e.removeScrollBar,x=e.inert;return y.createElement(y.Fragment,null,x?y.createElement(c,{styles:pO(a)}):null,w?y.createElement(oO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const yO=YN(uw,gO);var pw=y.forwardRef(function(e,t){return y.createElement(ah,Lr({},e,{ref:t,sideCar:yO}))});pw.classNames=ah.classNames;var bO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yo=new WeakMap,fu=new WeakMap,mu={},hm=0,_w=function(e){return e&&(e.host||_w(e.parentNode))},SO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=_w(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},wO=function(e,t,r,n){var a=SO(t,Array.isArray(e)?e:[e]);mu[r]||(mu[r]=new WeakMap);var c=mu[r],u=[],f=new Set,m=new Set(a),d=function(_){!_||f.has(_)||(f.add(_),d(_.parentNode))};a.forEach(d);var g=function(_){!_||m.has(_)||Array.prototype.forEach.call(_.children,function(S){if(f.has(S))g(S);else try{var w=S.getAttribute(n),x=w!==null&&w!=="false",C=(Yo.get(S)||0)+1,k=(c.get(S)||0)+1;Yo.set(S,C),c.set(S,k),u.push(S),C===1&&x&&fu.set(S,!0),k===1&&S.setAttribute(r,"true"),x||S.setAttribute(n,"true")}catch(T){console.error("aria-hidden: cannot operate on ",S,T)}})};return g(t),f.clear(),hm++,function(){u.forEach(function(_){var S=Yo.get(_)-1,w=c.get(_)-1;Yo.set(_,S),c.set(_,w),S||(fu.has(_)||_.removeAttribute(n),fu.delete(_)),w||_.removeAttribute(r)}),hm--,hm||(Yo=new WeakMap,Yo=new WeakMap,fu=new WeakMap,mu={})}},xO=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=bO(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),wO(n,a,r,"aria-hidden")):function(){return null}};function CO(e){const t=EO(e),r=y.forwardRef((n,a)=>{const{children:c,...u}=n,f=y.Children.toArray(c),m=f.find(kO);if(m){const d=m.props.children,g=f.map(_=>_===m?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:_);return v.jsx(t,{...u,ref:a,children:y.isValidElement(d)?y.cloneElement(d,void 0,g):null})}return v.jsx(t,{...u,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function EO(e){const t=y.forwardRef((r,n)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const u=AO(a),f=TO(c,a.props);return a.type!==y.Fragment&&(f.ref=n?Ir(n,u):u),y.cloneElement(a,f)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RO=Symbol("radix.slottable");function kO(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RO}function TO(e,t){const r={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?r[n]=(...f)=>{const m=c(...f);return a(...f),m}:a&&(r[n]=a):n==="style"?r[n]={...a,...c}:n==="className"&&(r[n]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function AO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lh="Dialog",[gw,vw]=yn(lh),[DO,xr]=gw(lh),yw=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:c,modal:u=!0}=e,f=y.useRef(null),m=y.useRef(null),[d,g]=oh({prop:n,defaultProp:a??!1,onChange:c,caller:lh});return v.jsx(DO,{scope:t,triggerRef:f,contentRef:m,contentId:cr(),titleId:cr(),descriptionId:cr(),open:d,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(_=>!_),[g]),modal:u,children:r})};yw.displayName=lh;var bw="DialogTrigger",Sw=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=xr(bw,r),c=wt(t,a.triggerRef);return v.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Kp(a.open),...n,ref:c,onClick:Ve(e.onClick,a.onOpenToggle)})});Sw.displayName=bw;var Vp="DialogPortal",[MO,ww]=gw(Vp,{forceMount:void 0}),xw=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,c=xr(Vp,t);return v.jsx(MO,{scope:t,forceMount:r,children:y.Children.map(n,u=>v.jsx(wr,{present:r||c.open,children:v.jsx(qp,{asChild:!0,container:a,children:u})}))})};xw.displayName=Vp;var Iu="DialogOverlay",Cw=y.forwardRef((e,t)=>{const r=ww(Iu,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,c=xr(Iu,e.__scopeDialog);return c.modal?v.jsx(wr,{present:n||c.open,children:v.jsx(OO,{...a,ref:t})}):null});Cw.displayName=Iu;var NO=CO("DialogOverlay.RemoveScroll"),OO=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=xr(Iu,r);return v.jsx(pw,{as:NO,allowPinchZoom:!0,shards:[a.contentRef],children:v.jsx($e.div,{"data-state":Kp(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Xn="DialogContent",Ew=y.forwardRef((e,t)=>{const r=ww(Xn,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,c=xr(Xn,e.__scopeDialog);return v.jsx(wr,{present:n||c.open,children:c.modal?v.jsx(BO,{...a,ref:t}):v.jsx(LO,{...a,ref:t})})});Ew.displayName=Xn;var BO=y.forwardRef((e,t)=>{const r=xr(Xn,e.__scopeDialog),n=y.useRef(null),a=wt(t,r.contentRef,n);return y.useEffect(()=>{const c=n.current;if(c)return xO(c)},[]),v.jsx(Rw,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ve(e.onCloseAutoFocus,c=>{c.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ve(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&c.preventDefault()}),onFocusOutside:Ve(e.onFocusOutside,c=>c.preventDefault())})}),LO=y.forwardRef((e,t)=>{const r=xr(Xn,e.__scopeDialog),n=y.useRef(!1),a=y.useRef(!1);return v.jsx(Rw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(n.current||r.triggerRef.current?.focus(),c.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(n.current=!0,c.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=c.target;r.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&a.current&&c.preventDefault()}})}),Rw=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:c,...u}=e,f=xr(Xn,r),m=y.useRef(null),d=wt(t,m);return jN(),v.jsxs(v.Fragment,{children:[v.jsx(ow,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:c,children:v.jsx(Wp,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Kp(f.open),...u,ref:d,onDismiss:()=>f.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(jO,{titleId:f.titleId}),v.jsx(PO,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Yp="DialogTitle",kw=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=xr(Yp,r);return v.jsx($e.h2,{id:a.titleId,...n,ref:t})});kw.displayName=Yp;var Tw="DialogDescription",Aw=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=xr(Tw,r);return v.jsx($e.p,{id:a.descriptionId,...n,ref:t})});Aw.displayName=Tw;var Dw="DialogClose",Mw=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=xr(Dw,r);return v.jsx($e.button,{type:"button",...n,ref:t,onClick:Ve(e.onClick,()=>a.onOpenChange(!1))})});Mw.displayName=Dw;function Kp(e){return e?"open":"closed"}var Nw="DialogTitleWarning",[zO,Ow]=rN(Nw,{contentName:Xn,titleName:Yp,docsSlug:"dialog"}),jO=({titleId:e})=>{const t=Ow(Nw),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},HO="DialogDescriptionWarning",PO=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ow(HO).contentName}}.`;return y.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Gp=yw,Bw=Sw,Xp=xw,ch=Cw,uh=Ew,Zp=kw,Qp=Aw,Jp=Mw;const hh=Gp,UO=Bw,IO=Xp,Lw=y.forwardRef(({className:e,...t},r)=>v.jsx(ch,{ref:r,className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Lw.displayName=ch.displayName;const Bl=y.forwardRef(({className:e,children:t,...r},n)=>v.jsxs(IO,{children:[v.jsx(Lw,{}),v.jsxs(uh,{ref:n,className:Le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,v.jsxs(Jp,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(Fp,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bl.displayName=uh.displayName;const Ll=({className:e,...t})=>v.jsx("div",{className:Le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ll.displayName="DialogHeader";const e_=({className:e,...t})=>v.jsx("div",{className:Le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});e_.displayName="DialogFooter";const zl=y.forwardRef(({className:e,...t},r)=>v.jsx(Zp,{ref:r,className:Le("text-lg font-semibold leading-none tracking-tight",e),...t}));zl.displayName=Zp.displayName;const t_=y.forwardRef(({className:e,...t},r)=>v.jsx(Qp,{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));t_.displayName=Qp.displayName;const $O="/api";async function at(e,t={}){const r=`${$O}${e}`,n={credentials:"include",headers:{"Content-Type":"application/json",...t.headers}},a=await fetch(r,{...n,...t});if(a.status===401)throw window.location.href="/",new Error("Unauthorized");return a}function FO(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const WO=e=>{switch(e){case"success":return YO;case"info":return GO;case"warning":return KO;case"error":return XO;default:return null}},qO=Array(12).fill(0),VO=({visible:e,className:t})=>ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ue.createElement("div",{className:"sonner-spinner"},qO.map((r,n)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),YO=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),KO=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),GO=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),XO=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ZO=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),QO=()=>{const[e,t]=ue.useState(document.hidden);return ue.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let up=1;class JO{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...a}=t,c=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:up++,u=this.toasts.find(m=>m.id===c),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(m=>m.id===c?(this.publish({...m,...t,id:c,title:n}),{...m,...t,id:c,dismissible:f,title:n}):m):this.addToast({title:n,...a,dismissible:f,id:c}),c},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let c=n!==void 0,u;const f=a.then(async d=>{if(u=["resolve",d],ue.isValidElement(d))c=!1,this.create({id:n,type:"default",message:d});else if(t3(d)&&!d.ok){c=!1;const _=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,S=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof _=="object"&&!ue.isValidElement(_)?_:{message:_};this.create({id:n,type:"error",description:S,...x})}else if(d instanceof Error){c=!1;const _=typeof r.error=="function"?await r.error(d):r.error,S=typeof r.description=="function"?await r.description(d):r.description,x=typeof _=="object"&&!ue.isValidElement(_)?_:{message:_};this.create({id:n,type:"error",description:S,...x})}else if(r.success!==void 0){c=!1;const _=typeof r.success=="function"?await r.success(d):r.success,S=typeof r.description=="function"?await r.description(d):r.description,x=typeof _=="object"&&!ue.isValidElement(_)?_:{message:_};this.create({id:n,type:"success",description:S,...x})}}).catch(async d=>{if(u=["reject",d],r.error!==void 0){c=!1;const g=typeof r.error=="function"?await r.error(d):r.error,_=typeof r.description=="function"?await r.description(d):r.description,w=typeof g=="object"&&!ue.isValidElement(g)?g:{message:g};this.create({id:n,type:"error",description:_,...w})}}).finally(()=>{c&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),m=()=>new Promise((d,g)=>f.then(()=>u[0]==="reject"?g(u[1]):d(u[1])).catch(g));return typeof n!="string"&&typeof n!="number"?{unwrap:m}:Object.assign(n,{unwrap:m})},this.custom=(t,r)=>{const n=r?.id||up++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ki=new JO,e3=(e,t)=>{const r=t?.id||up++;return ki.addToast({title:e,...t,id:r}),r},t3=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",i3=e3,r3=()=>ki.toasts,s3=()=>ki.getActiveToasts(),jr=Object.assign(i3,{success:ki.success,info:ki.info,warning:ki.warning,error:ki.error,custom:ki.custom,message:ki.message,promise:ki.promise,dismiss:ki.dismiss,loading:ki.loading},{getHistory:r3,getToasts:s3});FO("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function pu(e){return e.label!==void 0}const n3=3,o3="24px",a3="16px",Xb=4e3,l3=356,c3=14,u3=45,h3=200;function Nr(...e){return e.filter(Boolean).join(" ")}function d3(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const f3=e=>{var t,r,n,a,c,u,f,m,d;const{invert:g,toast:_,unstyled:S,interacting:w,setHeights:x,visibleToasts:C,heights:k,index:T,toasts:$,expanded:z,removeToast:A,defaultRichColors:j,closeButton:P,style:F,cancelButtonStyle:G,actionButtonStyle:re,className:le="",descriptionClassName:ce="",duration:W,position:M,gap:H,expandByDefault:N,classNames:R,icons:L,closeButtonAriaLabel:U="Close toast"}=e,[se,ee]=ue.useState(null),[D,O]=ue.useState(null),[q,Q]=ue.useState(!1),[X,ae]=ue.useState(!1),[de,_e]=ue.useState(!1),[me,Je]=ue.useState(!1),[ot,Ke]=ue.useState(!1),[Re,mt]=ue.useState(0),[vi,Yr]=ue.useState(0),Kr=ue.useRef(_.duration||W||Xb),bn=ue.useRef(null),di=ue.useRef(null),Sn=T===0,wn=T+1<=C,Jt=_.type,Cr=_.dismissible!==!1,ei=_.className||"",da=_.descriptionClassName||"",Gr=ue.useMemo(()=>k.findIndex(xe=>xe.toastId===_.id)||0,[k,_.id]),to=ue.useMemo(()=>{var xe;return(xe=_.closeButton)!=null?xe:P},[_.closeButton,P]),Xr=ue.useMemo(()=>_.duration||W||Xb,[_.duration,W]),hr=ue.useRef(0),dr=ue.useRef(0),io=ue.useRef(0),fr=ue.useRef(null),[Zr,Pt]=M.split("-"),Di=ue.useMemo(()=>k.reduce((xe,Ge,gt)=>gt>=Gr?xe:xe+Ge.height,0),[k,Gr]),Ut=QO(),ro=_.invert||g,he=Jt==="loading";dr.current=ue.useMemo(()=>Gr*H+Di,[Gr,Di]),ue.useEffect(()=>{Kr.current=Xr},[Xr]),ue.useEffect(()=>{Q(!0)},[]),ue.useEffect(()=>{const xe=di.current;if(xe){const Ge=xe.getBoundingClientRect().height;return Yr(Ge),x(gt=>[{toastId:_.id,height:Ge,position:_.position},...gt]),()=>x(gt=>gt.filter(It=>It.toastId!==_.id))}},[x,_.id]),ue.useLayoutEffect(()=>{if(!q)return;const xe=di.current,Ge=xe.style.height;xe.style.height="auto";const gt=xe.getBoundingClientRect().height;xe.style.height=Ge,Yr(gt),x(It=>It.find(st=>st.toastId===_.id)?It.map(st=>st.toastId===_.id?{...st,height:gt}:st):[{toastId:_.id,height:gt,position:_.position},...It])},[q,_.title,_.description,x,_.id,_.jsx,_.action,_.cancel]);const Se=ue.useCallback(()=>{ae(!0),mt(dr.current),x(xe=>xe.filter(Ge=>Ge.toastId!==_.id)),setTimeout(()=>{A(_)},h3)},[_,A,x,dr]);ue.useEffect(()=>{if(_.promise&&Jt==="loading"||_.duration===1/0||_.type==="loading")return;let xe;return z||w||Ut?(()=>{if(io.current<hr.current){const It=new Date().getTime()-hr.current;Kr.current=Kr.current-It}io.current=new Date().getTime()})():Kr.current!==1/0&&(hr.current=new Date().getTime(),xe=setTimeout(()=>{_.onAutoClose==null||_.onAutoClose.call(_,_),Se()},Kr.current)),()=>clearTimeout(xe)},[z,w,_,Jt,Ut,Se]),ue.useEffect(()=>{_.delete&&(Se(),_.onDismiss==null||_.onDismiss.call(_,_))},[Se,_.delete]);function Te(){var xe;if(L?.loading){var Ge;return ue.createElement("div",{className:Nr(R?.loader,_==null||(Ge=_.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":Jt==="loading"},L.loading)}return ue.createElement(VO,{className:Nr(R?.loader,_==null||(xe=_.classNames)==null?void 0:xe.loader),visible:Jt==="loading"})}const Me=_.icon||L?.[Jt]||WO(Jt);var lt,Ye;return ue.createElement("li",{tabIndex:0,ref:di,className:Nr(le,ei,R?.toast,_==null||(t=_.classNames)==null?void 0:t.toast,R?.default,R?.[Jt],_==null||(r=_.classNames)==null?void 0:r[Jt]),"data-sonner-toast":"","data-rich-colors":(lt=_.richColors)!=null?lt:j,"data-styled":!(_.jsx||_.unstyled||S),"data-mounted":q,"data-promise":!!_.promise,"data-swiped":ot,"data-removed":X,"data-visible":wn,"data-y-position":Zr,"data-x-position":Pt,"data-index":T,"data-front":Sn,"data-swiping":de,"data-dismissible":Cr,"data-type":Jt,"data-invert":ro,"data-swipe-out":me,"data-swipe-direction":D,"data-expanded":!!(z||N&&q),"data-testid":_.testId,style:{"--index":T,"--toasts-before":T,"--z-index":$.length-T,"--offset":`${X?Re:dr.current}px`,"--initial-height":N?"auto":`${vi}px`,...F,..._.style},onDragEnd:()=>{_e(!1),ee(null),fr.current=null},onPointerDown:xe=>{xe.button!==2&&(he||!Cr||(bn.current=new Date,mt(dr.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(_e(!0),fr.current={x:xe.clientX,y:xe.clientY})))},onPointerUp:()=>{var xe,Ge,gt;if(me||!Cr)return;fr.current=null;const It=Number(((xe=di.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Er=Number(((Ge=di.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),st=new Date().getTime()-((gt=bn.current)==null?void 0:gt.getTime()),$t=se==="x"?It:Er,Mi=Math.abs($t)/st;if(Math.abs($t)>=u3||Mi>.11){mt(dr.current),_.onDismiss==null||_.onDismiss.call(_,_),O(se==="x"?It>0?"right":"left":Er>0?"down":"up"),Se(),Je(!0);return}else{var Ot,li;(Ot=di.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(li=di.current)==null||li.style.setProperty("--swipe-amount-y","0px")}Ke(!1),_e(!1),ee(null)},onPointerMove:xe=>{var Ge,gt,It;if(!fr.current||!Cr||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;const st=xe.clientY-fr.current.y,$t=xe.clientX-fr.current.x;var Mi;const Ot=(Mi=e.swipeDirections)!=null?Mi:d3(M);!se&&(Math.abs($t)>1||Math.abs(st)>1)&&ee(Math.abs($t)>Math.abs(st)?"x":"y");let li={x:0,y:0};const Ms=Ni=>1/(1.5+Math.abs(Ni)/20);if(se==="y"){if(Ot.includes("top")||Ot.includes("bottom"))if(Ot.includes("top")&&st<0||Ot.includes("bottom")&&st>0)li.y=st;else{const Ni=st*Ms(st);li.y=Math.abs(Ni)<Math.abs(st)?Ni:st}}else if(se==="x"&&(Ot.includes("left")||Ot.includes("right")))if(Ot.includes("left")&&$t<0||Ot.includes("right")&&$t>0)li.x=$t;else{const Ni=$t*Ms($t);li.x=Math.abs(Ni)<Math.abs($t)?Ni:$t}(Math.abs(li.x)>0||Math.abs(li.y)>0)&&Ke(!0),(gt=di.current)==null||gt.style.setProperty("--swipe-amount-x",`${li.x}px`),(It=di.current)==null||It.style.setProperty("--swipe-amount-y",`${li.y}px`)}},to&&!_.jsx&&Jt!=="loading"?ue.createElement("button",{"aria-label":U,"data-disabled":he,"data-close-button":!0,onClick:he||!Cr?()=>{}:()=>{Se(),_.onDismiss==null||_.onDismiss.call(_,_)},className:Nr(R?.closeButton,_==null||(n=_.classNames)==null?void 0:n.closeButton)},(Ye=L?.close)!=null?Ye:ZO):null,(Jt||_.icon||_.promise)&&_.icon!==null&&(L?.[Jt]!==null||_.icon)?ue.createElement("div",{"data-icon":"",className:Nr(R?.icon,_==null||(a=_.classNames)==null?void 0:a.icon)},_.promise||_.type==="loading"&&!_.icon?_.icon||Te():null,_.type!=="loading"?Me:null):null,ue.createElement("div",{"data-content":"",className:Nr(R?.content,_==null||(c=_.classNames)==null?void 0:c.content)},ue.createElement("div",{"data-title":"",className:Nr(R?.title,_==null||(u=_.classNames)==null?void 0:u.title)},_.jsx?_.jsx:typeof _.title=="function"?_.title():_.title),_.description?ue.createElement("div",{"data-description":"",className:Nr(ce,da,R?.description,_==null||(f=_.classNames)==null?void 0:f.description)},typeof _.description=="function"?_.description():_.description):null),ue.isValidElement(_.cancel)?_.cancel:_.cancel&&pu(_.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:_.cancelButtonStyle||G,onClick:xe=>{pu(_.cancel)&&Cr&&(_.cancel.onClick==null||_.cancel.onClick.call(_.cancel,xe),Se())},className:Nr(R?.cancelButton,_==null||(m=_.classNames)==null?void 0:m.cancelButton)},_.cancel.label):null,ue.isValidElement(_.action)?_.action:_.action&&pu(_.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:_.actionButtonStyle||re,onClick:xe=>{pu(_.action)&&(_.action.onClick==null||_.action.onClick.call(_.action,xe),!xe.defaultPrevented&&Se())},className:Nr(R?.actionButton,_==null||(d=_.classNames)==null?void 0:d.actionButton)},_.action.label):null)};function Zb(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function m3(e,t){const r={};return[e,t].forEach((n,a)=>{const c=a===1,u=c?"--mobile-offset":"--offset",f=c?a3:o3;function m(d){["top","right","bottom","left"].forEach(g=>{r[`${u}-${g}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?m(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${u}-${d}`]=f:r[`${u}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):m(f)}),r}const p3=ue.forwardRef(function(t,r){const{id:n,invert:a,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:f,closeButton:m,className:d,offset:g,mobileOffset:_,theme:S="light",richColors:w,duration:x,style:C,visibleToasts:k=n3,toastOptions:T,dir:$=Zb(),gap:z=c3,icons:A,containerAriaLabel:j="Notifications"}=t,[P,F]=ue.useState([]),G=ue.useMemo(()=>n?P.filter(q=>q.toasterId===n):P.filter(q=>!q.toasterId),[P,n]),re=ue.useMemo(()=>Array.from(new Set([c].concat(G.filter(q=>q.position).map(q=>q.position)))),[G,c]),[le,ce]=ue.useState([]),[W,M]=ue.useState(!1),[H,N]=ue.useState(!1),[R,L]=ue.useState(S!=="system"?S:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=ue.useRef(null),se=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=ue.useRef(null),D=ue.useRef(!1),O=ue.useCallback(q=>{F(Q=>{var X;return(X=Q.find(ae=>ae.id===q.id))!=null&&X.delete||ki.dismiss(q.id),Q.filter(({id:ae})=>ae!==q.id)})},[]);return ue.useEffect(()=>ki.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{F(Q=>Q.map(X=>X.id===q.id?{...X,delete:!0}:X))});return}setTimeout(()=>{zS.flushSync(()=>{F(Q=>{const X=Q.findIndex(ae=>ae.id===q.id);return X!==-1?[...Q.slice(0,X),{...Q[X],...q},...Q.slice(X+1)]:[q,...Q]})})})}),[P]),ue.useEffect(()=>{if(S!=="system"){L(S);return}if(S==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:Q})=>{L(Q?"dark":"light")})}catch{q.addListener(({matches:X})=>{try{L(X?"dark":"light")}catch(ae){console.error(ae)}})}},[S]),ue.useEffect(()=>{P.length<=1&&M(!1)},[P]),ue.useEffect(()=>{const q=Q=>{var X;if(u.every(_e=>Q[_e]||Q.code===_e)){var de;M(!0),(de=U.current)==null||de.focus()}Q.code==="Escape"&&(document.activeElement===U.current||(X=U.current)!=null&&X.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[u]),ue.useEffect(()=>{if(U.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,D.current=!1)}},[U.current]),ue.createElement("section",{ref:r,"aria-label":`${j} ${se}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},re.map((q,Q)=>{var X;const[ae,de]=q.split("-");return G.length?ue.createElement("ol",{key:q,dir:$==="auto"?Zb():$,tabIndex:-1,ref:U,className:d,"data-sonner-toaster":!0,"data-sonner-theme":R,"data-y-position":ae,"data-x-position":de,style:{"--front-toast-height":`${((X=le[0])==null?void 0:X.height)||0}px`,"--width":`${l3}px`,"--gap":`${z}px`,...C,...m3(g,_)},onBlur:_e=>{D.current&&!_e.currentTarget.contains(_e.relatedTarget)&&(D.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:_e=>{_e.target instanceof HTMLElement&&_e.target.dataset.dismissible==="false"||D.current||(D.current=!0,ee.current=_e.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{H||M(!1)},onDragEnd:()=>M(!1),onPointerDown:_e=>{_e.target instanceof HTMLElement&&_e.target.dataset.dismissible==="false"||N(!0)},onPointerUp:()=>N(!1)},G.filter(_e=>!_e.position&&Q===0||_e.position===q).map((_e,me)=>{var Je,ot;return ue.createElement(f3,{key:_e.id,icons:A,index:me,toast:_e,defaultRichColors:w,duration:(Je=T?.duration)!=null?Je:x,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:a,visibleToasts:k,closeButton:(ot=T?.closeButton)!=null?ot:m,interacting:H,position:q,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:O,toasts:G.filter(Ke=>Ke.position==_e.position),heights:le.filter(Ke=>Ke.position==_e.position),setHeights:ce,expandByDefault:f,gap:z,expanded:W,swipeDirections:t.swipeDirections})})):null}))}),Ko=e=>{if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]};function _3(){const[e,t]=y.useState(""),[r,n]=y.useState(!1),[a,c]=y.useState(""),[u,f]=y.useState(!1),[m,d]=y.useState(""),[g,_]=y.useState({active:0,exited:0,total:0,inactive:0}),[S,w]=y.useState(null);y.useEffect(()=>{const T=async()=>{try{const A=await(await at("/stats")).json();_(A)}catch(z){console.error("Failed to fetch stats:",z)}};T();const $=setInterval(T,5e3);return()=>clearInterval($)},[]),y.useEffect(()=>{const T=async()=>{try{const A=await(await at("/system/stats")).json();w(A)}catch(z){console.error("Failed to fetch system stats:",z)}};T();const $=setInterval(T,5e3);return()=>clearInterval($)},[]);const x=async()=>{if(e.trim()){n(!0);try{const T=await at("/convert",{method:"POST",body:JSON.stringify({dockerRun:e})});if(!T.ok)throw new Error("Conversion failed");const $=await T.json();c($.yaml)}catch(T){console.error("Conversion error:",T),jr.error("Failed to convert docker run command")}finally{n(!1)}}},C=async()=>{if(!m.trim()||!a)return;const T=m.trim();try{if(!(await at("/stacks",{method:"POST",body:JSON.stringify({stackName:T})})).ok)throw new Error("Failed to create stack");if(!(await at(`/stacks/${T}`,{method:"PUT",body:JSON.stringify({content:a})})).ok)throw new Error("Failed to save stack content");f(!1),d(""),c(""),t(""),window.location.reload()}catch($){console.error("Failed to create stack:",$),jr.error("Failed to create stack")}},k=()=>{f(!0)};return v.jsxs("div",{className:"flex-1 p-6 space-y-6",children:[v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[v.jsx(vr,{className:"text-sm font-medium text-muted-foreground",children:"Active Containers"}),v.jsx(lM,{className:"h-4 w-4 text-green-500"})]}),v.jsxs(yr,{children:[v.jsx("div",{className:"text-3xl font-bold text-green-500",children:g.active}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Currently running"})]})]}),v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[v.jsx(vr,{className:"text-sm font-medium text-muted-foreground",children:"Exited Containers"}),v.jsx(iw,{className:"h-4 w-4 text-red-500"})]}),v.jsxs(yr,{children:[v.jsx("div",{className:"text-3xl font-bold text-red-500",children:g.exited}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Stopped or crashed"})]})]}),v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[v.jsx(vr,{className:"text-sm font-medium text-muted-foreground",children:"Host Network"}),v.jsx(J1,{className:"h-4 w-4 text-cyan-500"})]}),v.jsxs(yr,{children:[v.jsx("div",{className:"text-xl font-bold text-cyan-500 whitespace-nowrap",children:S?.network?`${Ko(S.network.rxSec)}/s ↓`:"..."}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1 whitespace-nowrap",children:S?.network?`${Ko(S.network.txSec)}/s ↑`:"Loading..."})]})]})]}),v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[v.jsx(vr,{className:"text-sm font-medium text-muted-foreground",children:"Host CPU"}),v.jsx(bM,{className:"h-4 w-4 text-blue-500"})]}),v.jsxs(yr,{children:[v.jsx("div",{className:"text-3xl font-bold text-blue-500",children:S?`${S.cpu.usage}%`:"..."}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S?`${S.cpu.cores} cores`:"Loading..."})]})]}),v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[v.jsx(vr,{className:"text-sm font-medium text-muted-foreground",children:"Host RAM"}),v.jsx(NM,{className:"h-4 w-4 text-purple-500"})]}),v.jsxs(yr,{children:[v.jsx("div",{className:"text-3xl font-bold text-purple-500",children:S?`${S.memory.usagePercent}%`:"..."}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S?`${Ko(S.memory.used)} / ${Ko(S.memory.total)}`:"Loading..."})]})]}),v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[v.jsx(vr,{className:"text-sm font-medium text-muted-foreground",children:"Host Disk"}),v.jsx(RM,{className:"h-4 w-4 text-orange-500"})]}),v.jsxs(yr,{children:[v.jsx("div",{className:"text-3xl font-bold text-orange-500",children:S?.disk?`${S.disk.usagePercent}%`:"..."}),v.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S?.disk?`${Ko(S.disk.used)} / ${Ko(S.disk.total)}`:"Loading..."})]})]})]}),v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsxs(gr,{children:[v.jsx(vr,{className:"text-lg",children:"Convert Docker Run to Compose"}),v.jsxs("p",{className:"text-sm text-muted-foreground",children:["Paste your ",v.jsx("code",{className:"bg-muted px-1 rounded",children:"docker run"})," command below to convert it to a Docker Compose YAML file."]})]}),v.jsxs(yr,{className:"space-y-4",children:[v.jsx("textarea",{className:"w-full h-32 p-3 rounded-lg border border-muted bg-background text-foreground font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary",placeholder:"docker run -d --name my-app -p 8080:80 -e TZ=UTC nginx:latest",value:e,onChange:T=>t(T.target.value)}),v.jsx("div",{className:"flex gap-2",children:v.jsxs(Ie,{onClick:x,disabled:r||!e.trim(),children:[r?"Converting...":"Convert",v.jsx(uM,{className:"w-4 h-4 ml-2"})]})}),a&&v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{className:"p-3 rounded-lg bg-muted/50 font-mono text-sm whitespace-pre-wrap overflow-auto max-h-64",children:a}),v.jsxs(Ie,{onClick:k,children:[v.jsx(ew,{className:"w-4 h-4 mr-2"}),"Create Stack from YAML"]})]})]})]}),v.jsx(hh,{open:u,onOpenChange:f,children:v.jsxs(Bl,{children:[v.jsx(Ll,{children:v.jsx(zl,{children:"Create New Stack"})}),v.jsxs("div",{className:"py-4 space-y-4",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx(Cs,{htmlFor:"stack-name",children:"Stack Name"}),v.jsx(xs,{id:"stack-name",placeholder:"e.g., myapp",value:m,onChange:T=>d(T.target.value)})]}),a&&v.jsxs("div",{className:"space-y-2",children:[v.jsx(Cs,{children:"Converted Compose File (Preview)"}),v.jsx("div",{className:"p-3 rounded-lg bg-muted/50 font-mono text-sm whitespace-pre-wrap overflow-auto max-h-48",children:a})]})]}),v.jsxs(e_,{children:[v.jsx(Ie,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),v.jsx(Ie,{onClick:C,disabled:!m.trim(),children:"Create Stack"})]})]})})]})}function g3({isOpen:e,onClose:t,containerId:r,containerName:n}){const a=y.useRef(null),c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),m=y.useRef(null),[d,g]=y.useState(!1),_=y.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),f.current&&(f.current.close(),f.current=null),c.current&&(c.current.dispose(),c.current=null),u.current=null,g(!1)},[]);y.useEffect(()=>{if(!e){_();return}let w=0;const x=15,C=()=>{if(c.current)return;const T=a.current;if(!T){w++<x?m.current=setTimeout(C,100):console.error("BashExecModal: terminalRef never populated.");return}const $=T.getBoundingClientRect();if($.width===0||$.height===0){w++<x?m.current=setTimeout(C,100):(console.warn("BashExecModal: terminal container has zero dimensions after 1.5s, forcing init anyway."),k(T));return}k(T)};m.current=setTimeout(C,50);function k(T){const $=new j1({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#000000",selectionBackground:"rgba(255, 255, 255, 0.3)"},fontFamily:'Consolas, "Courier New", monospace',fontSize:14,cursorBlink:!0}),z=new H1;$.loadAddon(z),$.open(T),c.current=$,u.current=z,requestAnimationFrame(()=>{try{z.fit()}catch{}});const A=window.location.protocol==="https:"?"wss:":"ws:",j=new WebSocket(`${A}//${window.location.host}`);f.current=j,j.onopen=()=>{j.send(JSON.stringify({action:"execContainer",containerId:r})),g(!0),$.focus(),setTimeout(()=>{try{z.fit()}catch{}j.readyState===WebSocket.OPEN&&$.rows>0&&$.cols>0&&j.send(JSON.stringify({type:"resize",rows:$.rows,cols:$.cols}))},100)},j.onmessage=F=>{$.write(F.data)},j.onerror=()=>{$.write(`\r
\x1B[31mConnection error\x1B[0m\r
`),g(!1)},j.onclose=()=>{$.write(`\r
\x1B[33mSession ended\x1B[0m\r
`),g(!1)},$.onData(F=>{j.readyState===WebSocket.OPEN&&j.send(JSON.stringify({type:"input",data:F}))});const P=new ResizeObserver(()=>{if(!(!u.current||!f.current)){try{u.current.fit()}catch{return}f.current.readyState===WebSocket.OPEN&&$.rows>0&&$.cols>0&&f.current.send(JSON.stringify({type:"resize",rows:$.rows,cols:$.cols}))}});P.observe(T),T.__resizeObserver=P}return()=>{a.current&&a.current.__resizeObserver&&(a.current.__resizeObserver.disconnect(),delete a.current.__resizeObserver)}},[e,r,_]);const S=()=>{_(),t()};return v.jsx(hh,{open:e,onOpenChange:S,children:v.jsxs(Bl,{className:"max-w-4xl h-[600px] flex flex-col",children:[v.jsxs(Ll,{children:[v.jsxs(zl,{className:"flex items-center gap-2",children:[v.jsx(ap,{className:"w-5 h-5"}),"Bash: ",n,d&&v.jsx("span",{className:"ml-2 text-xs bg-green-500/20 text-green-500 px-2 py-0.5 rounded-full",children:"Connected"})]}),v.jsxs(t_,{className:"hidden",children:["Interactive bash terminal session for ",n]})]}),v.jsx("div",{className:"flex-1 rounded-lg bg-[#1e1e1e] p-1 min-h-0",style:{overflow:"hidden"},children:v.jsx("div",{ref:a,style:{width:"100%",height:"100%"}})})]})})}var v3=Symbol("radix.slottable");function y3(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=v3,t}var zw="AlertDialog",[b3]=yn(zw,[vw]),Ds=vw(),jw=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ds(t);return v.jsx(Gp,{...n,...r,modal:!0})};jw.displayName=zw;var S3="AlertDialogTrigger",w3=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ds(r);return v.jsx(Bw,{...a,...n,ref:t})});w3.displayName=S3;var x3="AlertDialogPortal",Hw=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ds(t);return v.jsx(Xp,{...n,...r})};Hw.displayName=x3;var C3="AlertDialogOverlay",Pw=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ds(r);return v.jsx(ch,{...a,...n,ref:t})});Pw.displayName=C3;var ta="AlertDialogContent",[E3,R3]=b3(ta),k3=y3("AlertDialogContent"),Uw=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...a}=e,c=Ds(r),u=y.useRef(null),f=wt(t,u),m=y.useRef(null);return v.jsx(zO,{contentName:ta,titleName:Iw,docsSlug:"alert-dialog",children:v.jsx(E3,{scope:r,cancelRef:m,children:v.jsxs(uh,{role:"alertdialog",...c,...a,ref:f,onOpenAutoFocus:Ve(a.onOpenAutoFocus,d=>{d.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[v.jsx(k3,{children:n}),v.jsx(A3,{contentRef:u})]})})})});Uw.displayName=ta;var Iw="AlertDialogTitle",$w=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ds(r);return v.jsx(Zp,{...a,...n,ref:t})});$w.displayName=Iw;var Fw="AlertDialogDescription",Ww=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ds(r);return v.jsx(Qp,{...a,...n,ref:t})});Ww.displayName=Fw;var T3="AlertDialogAction",qw=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=Ds(r);return v.jsx(Jp,{...a,...n,ref:t})});qw.displayName=T3;var Vw="AlertDialogCancel",Yw=y.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=R3(Vw,r),c=Ds(r),u=wt(t,a);return v.jsx(Jp,{...c,...n,ref:u})});Yw.displayName=Vw;var A3=({contentRef:e})=>{const t=`\`${ta}\` requires a description for the component to be accessible for screen reader users.
You can add a description to the \`${ta}\` by passing a \`${Fw}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ta}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},D3=jw,M3=Hw,Kw=Pw,Gw=Uw,Xw=qw,Zw=Yw,Qw=$w,Jw=Ww;const hp=D3,N3=M3,ex=y.forwardRef(({className:e,...t},r)=>v.jsx(Kw,{className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));ex.displayName=Kw.displayName;const $u=y.forwardRef(({className:e,...t},r)=>v.jsxs(N3,{children:[v.jsx(ex,{}),v.jsx(Gw,{ref:r,className:Le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));$u.displayName=Gw.displayName;const Fu=({className:e,...t})=>v.jsx("div",{className:Le("flex flex-col space-y-2 text-center sm:text-left",e),...t});Fu.displayName="AlertDialogHeader";const Wu=({className:e,...t})=>v.jsx("div",{className:Le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wu.displayName="AlertDialogFooter";const qu=y.forwardRef(({className:e,...t},r)=>v.jsx(Qw,{ref:r,className:Le("text-lg font-semibold",e),...t}));qu.displayName=Qw.displayName;const Vu=y.forwardRef(({className:e,...t},r)=>v.jsx(Jw,{ref:r,className:Le("text-sm text-muted-foreground",e),...t}));Vu.displayName=Jw.displayName;const Yu=y.forwardRef(({className:e,...t},r)=>v.jsx(Xw,{ref:r,className:Le(Tp(),e),...t}));Yu.displayName=Xw.displayName;const Ku=y.forwardRef(({className:e,...t},r)=>v.jsx(Zw,{ref:r,className:Le(Tp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ku.displayName=Zw.displayName;function Qb(e){const t=O3(e),r=y.forwardRef((n,a)=>{const{children:c,...u}=n,f=y.Children.toArray(c),m=f.find(L3);if(m){const d=m.props.children,g=f.map(_=>_===m?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:_);return v.jsx(t,{...u,ref:a,children:y.isValidElement(d)?y.cloneElement(d,void 0,g):null})}return v.jsx(t,{...u,ref:a,children:c})});return r.displayName=`${e}.Slot`,r}function O3(e){const t=y.forwardRef((r,n)=>{const{children:a,...c}=r;if(y.isValidElement(a)){const u=j3(a),f=z3(c,a.props);return a.type!==y.Fragment&&(f.ref=n?Ir(n,u):u),y.cloneElement(a,f)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B3=Symbol("radix.slottable");function L3(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B3}function z3(e,t){const r={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?r[n]=(...f)=>{const m=c(...f);return a(...f),m}:a&&(r[n]=a):n==="style"?r[n]={...a,...c}:n==="className"&&(r[n]=[a,c].filter(Boolean).join(" "))}return{...e,...r}}function j3(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function H3(e){const t=e+"CollectionProvider",[r,n]=yn(t),[a,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=C=>{const{scope:k,children:T}=C,$=ue.useRef(null),z=ue.useRef(new Map).current;return v.jsx(a,{scope:k,itemMap:z,collectionRef:$,children:T})};u.displayName=t;const f=e+"CollectionSlot",m=Qb(f),d=ue.forwardRef((C,k)=>{const{scope:T,children:$}=C,z=c(f,T),A=wt(k,z.collectionRef);return v.jsx(m,{ref:A,children:$})});d.displayName=f;const g=e+"CollectionItemSlot",_="data-radix-collection-item",S=Qb(g),w=ue.forwardRef((C,k)=>{const{scope:T,children:$,...z}=C,A=ue.useRef(null),j=wt(k,A),P=c(g,T);return ue.useEffect(()=>(P.itemMap.set(A,{ref:A,...z}),()=>{P.itemMap.delete(A)})),v.jsx(S,{[_]:"",ref:j,children:$})});w.displayName=g;function x(C){const k=c(e+"CollectionConsumer",C);return ue.useCallback(()=>{const $=k.collectionRef.current;if(!$)return[];const z=Array.from($.querySelectorAll(`[${_}]`));return Array.from(k.itemMap.values()).sort((P,F)=>z.indexOf(P.ref.current)-z.indexOf(F.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:u,Slot:d,ItemSlot:w},x,n]}var P3=y.createContext(void 0);function i_(e){const t=y.useContext(P3);return e||t||"ltr"}var dm="rovingFocusGroup.onEntryFocus",U3={bubbles:!1,cancelable:!0},jl="RovingFocusGroup",[dp,tx,I3]=H3(jl),[$3,ix]=yn(jl,[I3]),[F3,W3]=$3(jl),rx=y.forwardRef((e,t)=>v.jsx(dp.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(dp.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(q3,{...e,ref:t})})}));rx.displayName=jl;var q3=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,..._}=e,S=y.useRef(null),w=wt(t,S),x=i_(c),[C,k]=oh({prop:u,defaultProp:f??null,onChange:m,caller:jl}),[T,$]=y.useState(!1),z=Ti(d),A=tx(r),j=y.useRef(!1),[P,F]=y.useState(0);return y.useEffect(()=>{const G=S.current;if(G)return G.addEventListener(dm,z),()=>G.removeEventListener(dm,z)},[z]),v.jsx(F3,{scope:r,orientation:n,dir:x,loop:a,currentTabStopId:C,onItemFocus:y.useCallback(G=>k(G),[k]),onItemShiftTab:y.useCallback(()=>$(!0),[]),onFocusableItemAdd:y.useCallback(()=>F(G=>G+1),[]),onFocusableItemRemove:y.useCallback(()=>F(G=>G-1),[]),children:v.jsx($e.div,{tabIndex:T||P===0?-1:0,"data-orientation":n,..._,ref:w,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{j.current=!0}),onFocus:Ve(e.onFocus,G=>{const re=!j.current;if(G.target===G.currentTarget&&re&&!T){const le=new CustomEvent(dm,U3);if(G.currentTarget.dispatchEvent(le),!le.defaultPrevented){const ce=A().filter(R=>R.focusable),W=ce.find(R=>R.active),M=ce.find(R=>R.id===C),N=[W,M,...ce].filter(Boolean).map(R=>R.ref.current);ox(N,g)}}j.current=!1}),onBlur:Ve(e.onBlur,()=>$(!1))})})}),sx="RovingFocusGroupItem",nx=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:c,children:u,...f}=e,m=cr(),d=c||m,g=W3(sx,r),_=g.currentTabStopId===d,S=tx(r),{onFocusableItemAdd:w,onFocusableItemRemove:x,currentTabStopId:C}=g;return y.useEffect(()=>{if(n)return w(),()=>x()},[n,w,x]),v.jsx(dp.ItemSlot,{scope:r,id:d,focusable:n,active:a,children:v.jsx($e.span,{tabIndex:_?0:-1,"data-orientation":g.orientation,...f,ref:t,onMouseDown:Ve(e.onMouseDown,k=>{n?g.onItemFocus(d):k.preventDefault()}),onFocus:Ve(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:Ve(e.onKeyDown,k=>{if(k.key==="Tab"&&k.shiftKey){g.onItemShiftTab();return}if(k.target!==k.currentTarget)return;const T=K3(k,g.orientation,g.dir);if(T!==void 0){if(k.metaKey||k.ctrlKey||k.altKey||k.shiftKey)return;k.preventDefault();let z=S().filter(A=>A.focusable).map(A=>A.ref.current);if(T==="last")z.reverse();else if(T==="prev"||T==="next"){T==="prev"&&z.reverse();const A=z.indexOf(k.currentTarget);z=g.loop?G3(z,A+1):z.slice(A+1)}setTimeout(()=>ox(z))}}),children:typeof u=="function"?u({isCurrentTabStop:_,hasTabStop:C!=null}):u})})});nx.displayName=sx;var V3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Y3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function K3(e,t,r){const n=Y3(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return V3[n]}function ox(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function G3(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var X3=rx,Z3=nx,dh="Tabs",[Q3]=yn(dh,[ix]),ax=ix(),[J3,r_]=Q3(dh),lx=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:c,orientation:u="horizontal",dir:f,activationMode:m="automatic",...d}=e,g=i_(f),[_,S]=oh({prop:n,onChange:a,defaultProp:c??"",caller:dh});return v.jsx(J3,{scope:r,baseId:cr(),value:_,onValueChange:S,orientation:u,dir:g,activationMode:m,children:v.jsx($e.div,{dir:g,"data-orientation":u,...d,ref:t})})});lx.displayName=dh;var cx="TabsList",ux=y.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,c=r_(cx,r),u=ax(r);return v.jsx(X3,{asChild:!0,...u,orientation:c.orientation,dir:c.dir,loop:n,children:v.jsx($e.div,{role:"tablist","aria-orientation":c.orientation,...a,ref:t})})});ux.displayName=cx;var hx="TabsTrigger",dx=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...c}=e,u=r_(hx,r),f=ax(r),m=px(u.baseId,n),d=_x(u.baseId,n),g=n===u.value;return v.jsx(Z3,{asChild:!0,...f,focusable:!a,active:g,children:v.jsx($e.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":d,"data-state":g?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:m,...c,ref:t,onMouseDown:Ve(e.onMouseDown,_=>{!a&&_.button===0&&_.ctrlKey===!1?u.onValueChange(n):_.preventDefault()}),onKeyDown:Ve(e.onKeyDown,_=>{[" ","Enter"].includes(_.key)&&u.onValueChange(n)}),onFocus:Ve(e.onFocus,()=>{const _=u.activationMode!=="manual";!g&&!a&&_&&u.onValueChange(n)})})})});dx.displayName=hx;var fx="TabsContent",mx=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:a,children:c,...u}=e,f=r_(fx,r),m=px(f.baseId,n),d=_x(f.baseId,n),g=n===f.value,_=y.useRef(g);return y.useEffect(()=>{const S=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(S)},[]),v.jsx(wr,{present:a||g,children:({present:S})=>v.jsx($e.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!S,id:d,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:_.current?"0s":void 0},children:S&&c})})});mx.displayName=fx;function px(e,t){return`${e}-trigger-${t}`}function _x(e,t){return`${e}-content-${t}`}var e4=lx,gx=ux,vx=dx,yx=mx;const bx=e4,s_=y.forwardRef(({className:e,...t},r)=>v.jsx(gx,{ref:r,className:Le("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));s_.displayName=gx.displayName;const Rl=y.forwardRef(({className:e,...t},r)=>v.jsx(vx,{ref:r,className:Le("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Rl.displayName=vx.displayName;const fp=y.forwardRef(({className:e,...t},r)=>v.jsx(yx,{ref:r,className:Le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));fp.displayName=yx.displayName;const t4=kp("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function mp({className:e,variant:t,...r}){return v.jsx("div",{className:Le(t4({variant:t}),e),...r})}function i4({isOpen:e,onClose:t}){const[r,n]=y.useState("ghosts"),[a,c]=y.useState({}),[u,f]=y.useState(!1),[m,d]=y.useState([]),[g,_]=y.useState(!1),[S,w]=y.useState(!1),[x,C]=y.useState(null),[k,T]=y.useState(!1),[$,z]=y.useState(!1),[A,j]=y.useState(null);y.useEffect(()=>{e&&r==="ghosts"?P():C(null)},[e,r]);const P=async()=>{f(!0);try{const N=await(await at("/system/orphans")).json();c(N),d([])}catch(H){console.error("Failed to fetch orphans:",H)}finally{f(!1)}},F=H=>{d(N=>N.includes(H)?N.filter(R=>R!==H):[...N,H])},G=()=>{const H=Object.values(a).flat().map(N=>N.Id);m.length===H.length?d([]):d(H)},re=()=>{m.length!==0&&T(!0)},le=async()=>{T(!1),_(!0);try{if(!(await at("/system/prune/orphans",{method:"POST",body:JSON.stringify({containerIds:m})})).ok)throw new Error("Purge failed");await P(),jr.success(`Purged ${m.length} ghost container(s)`)}catch(H){console.error("Failed to purge orphans:",H),jr.error("Failed to purge selected containers.")}finally{_(!1)}},ce=H=>{j(H),z(!0)},W=async()=>{if(A){z(!1),w(!0),C(null);try{const N=await(await at("/system/prune/system",{method:"POST",body:JSON.stringify({target:A})})).json();C(N),jr.success(`Successfully pruned ${A}`)}catch(H){console.error(`Failed to prune ${A}: `,H),jr.error(`Failed to prune ${A}.`)}finally{w(!1),j(null)}}},M=Object.values(a).flat().length;return v.jsxs(hh,{open:e,onOpenChange:H=>!H&&t(),children:[v.jsxs(Bl,{className:"max-w-4xl h-[80vh] flex flex-col",children:[v.jsxs(Ll,{children:[v.jsxs(zl,{className:"flex items-center gap-2",children:[v.jsx(eN,{className:"w-5 h-5 text-yellow-500"}),"System Janitor"]}),v.jsx(t_,{children:"Clean up orphaned containers and perform generic system maintenance."})]}),v.jsxs(bx,{value:r,onValueChange:H=>n(H),className:"flex-1 flex flex-col min-h-0 mt-4",children:[v.jsxs(s_,{className:"grid w-full grid-cols-2",children:[v.jsx(Rl,{value:"ghosts",children:"Ghost Hunter"}),v.jsx(Rl,{value:"system",children:"System Cleanup"})]}),v.jsxs(fp,{value:"ghosts",className:"flex-1 overflow-auto flex flex-col mt-4 border rounded-lg p-4 bg-muted/20",children:[v.jsxs("div",{className:"flex justify-between items-center mb-4",children:[v.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:["Detected Orphan Stacks ",v.jsx(mp,{variant:"secondary",children:M})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Ie,{variant:"outline",size:"sm",onClick:P,disabled:u,children:"Refresh"}),v.jsxs(Ie,{variant:"destructive",size:"sm",onClick:re,disabled:m.length===0||g,children:[v.jsx(rw,{className:"w-4 h-4 mr-2"}),g?"Purging...":`Purge Selected(${m.length})`]})]})]}),u?v.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Hunting for ghosts..."}):M===0?v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-muted-foreground",children:[v.jsx(Lb,{className:"w-12 h-12 mb-2 opacity-50"}),v.jsx("p",{children:"No orphaned containers detected."}),v.jsx("p",{className:"text-xs mt-1",children:"Your system is clean!"})]}):v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[v.jsxs("div",{className:"mb-2 flex items-center gap-2 px-2",children:[v.jsx("input",{type:"checkbox",onChange:G,checked:m.length===M&&M>0,className:"rounded border-gray-300 focus:ring-primary"}),v.jsx("span",{className:"text-sm font-medium",children:"Select All"})]}),Object.entries(a).map(([H,N])=>v.jsxs("div",{className:"mb-6 last:mb-0 bg-card rounded-lg border shadow-sm overflow-hidden",children:[v.jsxs("div",{className:"bg-muted px-4 py-2 border-b font-medium text-sm flex items-center gap-2",children:[v.jsx("span",{className:"w-3 h-3 rounded-full bg-red-500/80"}),"Project: ",H]}),v.jsx("div",{className:"divide-y",children:N.map(R=>v.jsxs("div",{className:"flex items-center gap-4 p-3 hover:bg-muted/50 transition-colors",children:[v.jsx("input",{type:"checkbox",checked:m.includes(R.Id),onChange:()=>F(R.Id),className:"rounded border-gray-300"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-mono text-sm font-semibold truncate",children:R.Names[0]?.replace(/^\//,"")||R.Id.substring(0,12)}),v.jsx(mp,{variant:R.State==="running"?"default":"secondary",className:"text-[10px] h-4",children:R.State})]}),v.jsxs("div",{className:"text-xs text-muted-foreground truncate mt-1",children:["Image: ",R.Image]})]})]},R.Id))})]},H))]})]}),v.jsxs(fp,{value:"system",className:"flex-1 mt-4 p-4 border rounded-lg bg-card",children:[v.jsx("h3",{className:"text-lg font-semibold mb-6",children:"Global Docker Pruning"}),v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:[v.jsxs(Ie,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2",onClick:()=>ce("containers"),disabled:S,children:[v.jsx(Lb,{className:"w-6 h-6 text-orange-500"}),v.jsxs("div",{className:"text-center",children:[v.jsx("div",{className:"font-bold",children:"Prune Containers"}),v.jsx("div",{className:"text-xs text-muted-foreground font-normal",children:"Removes all stopped containers"})]})]}),v.jsxs(Ie,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2",onClick:()=>ce("images"),disabled:S,children:[v.jsx(HM,{className:"w-6 h-6 text-blue-500"}),v.jsxs("div",{className:"text-center",children:[v.jsx("div",{className:"font-bold",children:"Prune Images"}),v.jsx("div",{className:"text-xs text-muted-foreground font-normal",children:"Removes unused & dangling images"})]})]}),v.jsxs(Ie,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2",onClick:()=>ce("networks"),disabled:S,children:[v.jsx(J1,{className:"w-6 h-6 text-green-500"}),v.jsxs("div",{className:"text-center",children:[v.jsx("div",{className:"font-bold",children:"Prune Networks"}),v.jsx("div",{className:"text-xs text-muted-foreground font-normal",children:"Removes all unused networks"})]})]})]}),x&&v.jsxs("div",{className:"bg-muted p-4 rounded-lg font-mono text-sm overflow-x-auto whitespace-pre-wrap",children:[v.jsx("div",{className:"font-bold mb-2",children:"Result:"}),v.jsx("div",{className:"text-green-600 dark:text-green-400",children:x.message}),x.stdout&&v.jsx("div",{className:"mt-2 text-foreground",children:x.stdout}),x.stderr&&v.jsx("div",{className:"mt-2 text-red-500",children:x.stderr})]})]})]})]}),v.jsx(hp,{open:k,onOpenChange:T,children:v.jsxs($u,{children:[v.jsxs(Fu,{children:[v.jsx(qu,{children:"Forcefully Remove Containers"}),v.jsxs(Vu,{children:["Are you sure you want to forcefully remove ",m.length," ghost container(s)?"]})]}),v.jsxs(Wu,{children:[v.jsx(Ku,{onClick:()=>T(!1),children:"Cancel"}),v.jsx(Yu,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:le,children:"Remove"})]})]})}),v.jsx(hp,{open:$,onOpenChange:z,children:v.jsxs($u,{children:[v.jsxs(Fu,{children:[v.jsxs(qu,{children:["Prune ",A]}),v.jsxs(Vu,{children:["Are you sure you want to prune all unused ",A,"? This cannot be undone."]})]}),v.jsxs(Wu,{children:[v.jsx(Ku,{onClick:()=>z(!1),children:"Cancel"}),v.jsx(Yu,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:W,children:"Prune"})]})]})})]})}var Jb=1,r4=.9,s4=.8,n4=.17,fm=.1,mm=.999,o4=.9999,a4=.99,l4=/[\\\/_+.#"@\[\(\{&]/,c4=/[\\\/_+.#"@\[\(\{&]/g,u4=/[\s-]/,Sx=/[\s-]/g;function pp(e,t,r,n,a,c,u){if(c===t.length)return a===e.length?Jb:a4;var f=`${a},${c}`;if(u[f]!==void 0)return u[f];for(var m=n.charAt(c),d=r.indexOf(m,a),g=0,_,S,w,x;d>=0;)_=pp(e,t,r,n,d+1,c+1,u),_>g&&(d===a?_*=Jb:l4.test(e.charAt(d-1))?(_*=s4,w=e.slice(a,d-1).match(c4),w&&a>0&&(_*=Math.pow(mm,w.length))):u4.test(e.charAt(d-1))?(_*=r4,x=e.slice(a,d-1).match(Sx),x&&a>0&&(_*=Math.pow(mm,x.length))):(_*=n4,a>0&&(_*=Math.pow(mm,d-a))),e.charAt(d)!==t.charAt(c)&&(_*=o4)),(_<fm&&r.charAt(d-1)===n.charAt(c+1)||n.charAt(c+1)===n.charAt(c)&&r.charAt(d-1)!==n.charAt(c))&&(S=pp(e,t,r,n,d+1,c+2,u),S*fm>_&&(_=S*fm)),_>g&&(g=_),d=r.indexOf(m,d+1);return u[f]=g,g}function eS(e){return e.toLowerCase().replace(Sx," ")}function h4(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,pp(e,t,eS(e),eS(t),0,0,{})}var hl='[cmdk-group=""]',pm='[cmdk-group-items=""]',d4='[cmdk-group-heading=""]',wx='[cmdk-item=""]',tS=`${wx}:not([aria-disabled="true"])`,_p="cmdk-item-select",Go="data-value",f4=(e,t,r)=>h4(e,t,r),xx=y.createContext(void 0),Hl=()=>y.useContext(xx),Cx=y.createContext(void 0),n_=()=>y.useContext(Cx),Ex=y.createContext(void 0),Rx=y.forwardRef((e,t)=>{let r=Xo(()=>{var O,q;return{search:"",value:(q=(O=e.value)!=null?O:e.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Xo(()=>new Set),a=Xo(()=>new Map),c=Xo(()=>new Map),u=Xo(()=>new Set),f=kx(e),{label:m,children:d,value:g,onValueChange:_,filter:S,shouldFilter:w,loop:x,disablePointerSelection:C=!1,vimBindings:k=!0,...T}=e,$=cr(),z=cr(),A=cr(),j=y.useRef(null),P=C4();Zn(()=>{if(g!==void 0){let O=g.trim();r.current.value=O,F.emit()}},[g]),Zn(()=>{P(6,M)},[]);let F=y.useMemo(()=>({subscribe:O=>(u.current.add(O),()=>u.current.delete(O)),snapshot:()=>r.current,setState:(O,q,Q)=>{var X,ae,de,_e;if(!Object.is(r.current[O],q)){if(r.current[O]=q,O==="search")W(),le(),P(1,ce);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let me=document.getElementById(A);me?me.focus():(X=document.getElementById($))==null||X.focus()}if(P(7,()=>{var me;r.current.selectedItemId=(me=H())==null?void 0:me.id,F.emit()}),Q||P(5,M),((ae=f.current)==null?void 0:ae.value)!==void 0){let me=q??"";(_e=(de=f.current).onValueChange)==null||_e.call(de,me);return}}F.emit()}},emit:()=>{u.current.forEach(O=>O())}}),[]),G=y.useMemo(()=>({value:(O,q,Q)=>{var X;q!==((X=c.current.get(O))==null?void 0:X.value)&&(c.current.set(O,{value:q,keywords:Q}),r.current.filtered.items.set(O,re(q,Q)),P(2,()=>{le(),F.emit()}))},item:(O,q)=>(n.current.add(O),q&&(a.current.has(q)?a.current.get(q).add(O):a.current.set(q,new Set([O]))),P(3,()=>{W(),le(),r.current.value||ce(),F.emit()}),()=>{c.current.delete(O),n.current.delete(O),r.current.filtered.items.delete(O);let Q=H();P(4,()=>{W(),Q?.getAttribute("id")===O&&ce(),F.emit()})}),group:O=>(a.current.has(O)||a.current.set(O,new Set),()=>{c.current.delete(O),a.current.delete(O)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:$,inputId:A,labelId:z,listInnerRef:j}),[]);function re(O,q){var Q,X;let ae=(X=(Q=f.current)==null?void 0:Q.filter)!=null?X:f4;return O?ae(O,r.current.search,q):0}function le(){if(!r.current.search||f.current.shouldFilter===!1)return;let O=r.current.filtered.items,q=[];r.current.filtered.groups.forEach(X=>{let ae=a.current.get(X),de=0;ae.forEach(_e=>{let me=O.get(_e);de=Math.max(me,de)}),q.push([X,de])});let Q=j.current;N().sort((X,ae)=>{var de,_e;let me=X.getAttribute("id"),Je=ae.getAttribute("id");return((de=O.get(Je))!=null?de:0)-((_e=O.get(me))!=null?_e:0)}).forEach(X=>{let ae=X.closest(pm);ae?ae.appendChild(X.parentElement===ae?X:X.closest(`${pm} > *`)):Q.appendChild(X.parentElement===Q?X:X.closest(`${pm} > *`))}),q.sort((X,ae)=>ae[1]-X[1]).forEach(X=>{var ae;let de=(ae=j.current)==null?void 0:ae.querySelector(`${hl}[${Go}="${encodeURIComponent(X[0])}"]`);de?.parentElement.appendChild(de)})}function ce(){let O=N().find(Q=>Q.getAttribute("aria-disabled")!=="true"),q=O?.getAttribute(Go);F.setState("value",q||void 0)}function W(){var O,q,Q,X;if(!r.current.search||f.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ae=0;for(let de of n.current){let _e=(q=(O=c.current.get(de))==null?void 0:O.value)!=null?q:"",me=(X=(Q=c.current.get(de))==null?void 0:Q.keywords)!=null?X:[],Je=re(_e,me);r.current.filtered.items.set(de,Je),Je>0&&ae++}for(let[de,_e]of a.current)for(let me of _e)if(r.current.filtered.items.get(me)>0){r.current.filtered.groups.add(de);break}r.current.filtered.count=ae}function M(){var O,q,Q;let X=H();X&&(((O=X.parentElement)==null?void 0:O.firstChild)===X&&((Q=(q=X.closest(hl))==null?void 0:q.querySelector(d4))==null||Q.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function H(){var O;return(O=j.current)==null?void 0:O.querySelector(`${wx}[aria-selected="true"]`)}function N(){var O;return Array.from(((O=j.current)==null?void 0:O.querySelectorAll(tS))||[])}function R(O){let q=N()[O];q&&F.setState("value",q.getAttribute(Go))}function L(O){var q;let Q=H(),X=N(),ae=X.findIndex(_e=>_e===Q),de=X[ae+O];(q=f.current)!=null&&q.loop&&(de=ae+O<0?X[X.length-1]:ae+O===X.length?X[0]:X[ae+O]),de&&F.setState("value",de.getAttribute(Go))}function U(O){let q=H(),Q=q?.closest(hl),X;for(;Q&&!X;)Q=O>0?w4(Q,hl):x4(Q,hl),X=Q?.querySelector(tS);X?F.setState("value",X.getAttribute(Go)):L(O)}let se=()=>R(N().length-1),ee=O=>{O.preventDefault(),O.metaKey?se():O.altKey?U(1):L(1)},D=O=>{O.preventDefault(),O.metaKey?R(0):O.altKey?U(-1):L(-1)};return y.createElement($e.div,{ref:t,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:O=>{var q;(q=T.onKeyDown)==null||q.call(T,O);let Q=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||Q))switch(O.key){case"n":case"j":{k&&O.ctrlKey&&ee(O);break}case"ArrowDown":{ee(O);break}case"p":case"k":{k&&O.ctrlKey&&D(O);break}case"ArrowUp":{D(O);break}case"Home":{O.preventDefault(),R(0);break}case"End":{O.preventDefault(),se();break}case"Enter":{O.preventDefault();let X=H();if(X){let ae=new Event(_p);X.dispatchEvent(ae)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:G.inputId,id:G.labelId,style:R4},m),fh(e,O=>y.createElement(Cx.Provider,{value:F},y.createElement(xx.Provider,{value:G},O))))}),m4=y.forwardRef((e,t)=>{var r,n;let a=cr(),c=y.useRef(null),u=y.useContext(Ex),f=Hl(),m=kx(e),d=(n=(r=m.current)==null?void 0:r.forceMount)!=null?n:u?.forceMount;Zn(()=>{if(!d)return f.item(a,u?.id)},[d]);let g=Tx(a,c,[e.value,e.children,c],e.keywords),_=n_(),S=pn(P=>P.value&&P.value===g.current),w=pn(P=>d||f.filter()===!1?!0:P.search?P.filtered.items.get(a)>0:!0);y.useEffect(()=>{let P=c.current;if(!(!P||e.disabled))return P.addEventListener(_p,x),()=>P.removeEventListener(_p,x)},[w,e.onSelect,e.disabled]);function x(){var P,F;C(),(F=(P=m.current).onSelect)==null||F.call(P,g.current)}function C(){_.setState("value",g.current,!0)}if(!w)return null;let{disabled:k,value:T,onSelect:$,forceMount:z,keywords:A,...j}=e;return y.createElement($e.div,{ref:Ir(c,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!S,"data-disabled":!!k,"data-selected":!!S,onPointerMove:k||f.getDisablePointerSelection()?void 0:C,onClick:k?void 0:x},e.children)}),p4=y.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...c}=e,u=cr(),f=y.useRef(null),m=y.useRef(null),d=cr(),g=Hl(),_=pn(w=>a||g.filter()===!1?!0:w.search?w.filtered.groups.has(u):!0);Zn(()=>g.group(u),[]),Tx(u,f,[e.value,e.heading,m]);let S=y.useMemo(()=>({id:u,forceMount:a}),[a]);return y.createElement($e.div,{ref:Ir(f,t),...c,"cmdk-group":"",role:"presentation",hidden:_?void 0:!0},r&&y.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),fh(e,w=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},y.createElement(Ex.Provider,{value:S},w))))}),_4=y.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=y.useRef(null),c=pn(u=>!u.search);return!r&&!c?null:y.createElement($e.div,{ref:Ir(a,t),...n,"cmdk-separator":"",role:"separator"})}),g4=y.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=e.value!=null,c=n_(),u=pn(d=>d.search),f=pn(d=>d.selectedItemId),m=Hl();return y.useEffect(()=>{e.value!=null&&c.setState("search",e.value)},[e.value]),y.createElement($e.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:a?e.value:u,onChange:d=>{a||c.setState("search",d.target.value),r?.(d.target.value)}})}),v4=y.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,c=y.useRef(null),u=y.useRef(null),f=pn(d=>d.selectedItemId),m=Hl();return y.useEffect(()=>{if(u.current&&c.current){let d=u.current,g=c.current,_,S=new ResizeObserver(()=>{_=requestAnimationFrame(()=>{let w=d.offsetHeight;g.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return S.observe(d),()=>{cancelAnimationFrame(_),S.unobserve(d)}}},[]),y.createElement($e.div,{ref:Ir(c,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":n,id:m.listId},fh(e,d=>y.createElement("div",{ref:Ir(u,m.listInnerRef),"cmdk-list-sizer":""},d)))}),y4=y.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:c,container:u,...f}=e;return y.createElement(Gp,{open:r,onOpenChange:n},y.createElement(Xp,{container:u},y.createElement(ch,{"cmdk-overlay":"",className:a}),y.createElement(uh,{"aria-label":e.label,"cmdk-dialog":"",className:c},y.createElement(Rx,{ref:t,...f}))))}),b4=y.forwardRef((e,t)=>pn(r=>r.filtered.count===0)?y.createElement($e.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),S4=y.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...c}=e;return y.createElement($e.div,{ref:t,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},fh(e,u=>y.createElement("div",{"aria-hidden":!0},u)))}),Ai=Object.assign(Rx,{List:v4,Item:m4,Input:g4,Group:p4,Separator:_4,Dialog:y4,Empty:b4,Loading:S4});function w4(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function x4(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function kx(e){let t=y.useRef(e);return Zn(()=>{t.current=e}),t}var Zn=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Xo(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function pn(e){let t=n_(),r=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,r,r)}function Tx(e,t,r,n=[]){let a=y.useRef(),c=Hl();return Zn(()=>{var u;let f=(()=>{var d;for(let g of r){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(d=g.current.textContent)==null?void 0:d.trim():a.current}})(),m=n.map(d=>d.trim());c.value(e,f,m),(u=t.current)==null||u.setAttribute(Go,f),a.current=f}),a}var C4=()=>{let[e,t]=y.useState(),r=Xo(()=>new Map);return Zn(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,a)=>{r.current.set(n,a),t({})}};function E4(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function fh({asChild:e,children:t},r){return e&&y.isValidElement(t)?y.cloneElement(E4(t),{ref:t.ref},r(t.props.children)):r(t)}var R4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ax=y.forwardRef(({className:e,...t},r)=>v.jsx(Ai,{ref:r,className:Le("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ax.displayName=Ai.displayName;const Dx=y.forwardRef(({className:e,...t},r)=>v.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[v.jsx(tw,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),v.jsx(Ai.Input,{ref:r,className:Le("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Dx.displayName=Ai.Input.displayName;const Mx=y.forwardRef(({className:e,...t},r)=>v.jsx(Ai.List,{ref:r,className:Le("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Mx.displayName=Ai.List.displayName;const k4=y.forwardRef((e,t)=>v.jsx(Ai.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));k4.displayName=Ai.Empty.displayName;const T4=y.forwardRef(({className:e,...t},r)=>v.jsx(Ai.Group,{ref:r,className:Le("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));T4.displayName=Ai.Group.displayName;const A4=y.forwardRef(({className:e,...t},r)=>v.jsx(Ai.Separator,{ref:r,className:Le("-mx-1 h-px bg-border",e),...t}));A4.displayName=Ai.Separator.displayName;const Nx=y.forwardRef(({className:e,...t},r)=>v.jsx(Ai.Item,{ref:r,className:Le("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Nx.displayName=Ai.Item.displayName;function D4(e,[t,r]){return Math.min(r,Math.max(t,e))}function M4(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var o_="ScrollArea",[Ox]=yn(o_),[N4,ur]=Ox(o_),Bx=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:a,scrollHideDelay:c=600,...u}=e,[f,m]=y.useState(null),[d,g]=y.useState(null),[_,S]=y.useState(null),[w,x]=y.useState(null),[C,k]=y.useState(null),[T,$]=y.useState(0),[z,A]=y.useState(0),[j,P]=y.useState(!1),[F,G]=y.useState(!1),re=wt(t,ce=>m(ce)),le=i_(a);return v.jsx(N4,{scope:r,type:n,dir:le,scrollHideDelay:c,scrollArea:f,viewport:d,onViewportChange:g,content:_,onContentChange:S,scrollbarX:w,onScrollbarXChange:x,scrollbarXEnabled:j,onScrollbarXEnabledChange:P,scrollbarY:C,onScrollbarYChange:k,scrollbarYEnabled:F,onScrollbarYEnabledChange:G,onCornerWidthChange:$,onCornerHeightChange:A,children:v.jsx($e.div,{dir:le,...u,ref:re,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":z+"px",...e.style}})})});Bx.displayName=o_;var Lx="ScrollAreaViewport",zx=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:a,...c}=e,u=ur(Lx,r),f=y.useRef(null),m=wt(t,f,u.onViewportChange);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),v.jsx($e.div,{"data-radix-scroll-area-viewport":"",...c,ref:m,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:v.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});zx.displayName=Lx;var qr="ScrollAreaScrollbar",a_=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=ur(qr,e.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:u}=a,f=e.orientation==="horizontal";return y.useEffect(()=>(f?c(!0):u(!0),()=>{f?c(!1):u(!1)}),[f,c,u]),a.type==="hover"?v.jsx(O4,{...n,ref:t,forceMount:r}):a.type==="scroll"?v.jsx(B4,{...n,ref:t,forceMount:r}):a.type==="auto"?v.jsx(jx,{...n,ref:t,forceMount:r}):a.type==="always"?v.jsx(l_,{...n,ref:t}):null});a_.displayName=qr;var O4=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=ur(qr,e.__scopeScrollArea),[c,u]=y.useState(!1);return y.useEffect(()=>{const f=a.scrollArea;let m=0;if(f){const d=()=>{window.clearTimeout(m),u(!0)},g=()=>{m=window.setTimeout(()=>u(!1),a.scrollHideDelay)};return f.addEventListener("pointerenter",d),f.addEventListener("pointerleave",g),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",d),f.removeEventListener("pointerleave",g)}}},[a.scrollArea,a.scrollHideDelay]),v.jsx(wr,{present:r||c,children:v.jsx(jx,{"data-state":c?"visible":"hidden",...n,ref:t})})}),B4=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=ur(qr,e.__scopeScrollArea),c=e.orientation==="horizontal",u=ph(()=>m("SCROLL_END"),100),[f,m]=M4("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(f==="idle"){const d=window.setTimeout(()=>m("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[f,a.scrollHideDelay,m]),y.useEffect(()=>{const d=a.viewport,g=c?"scrollLeft":"scrollTop";if(d){let _=d[g];const S=()=>{const w=d[g];_!==w&&(m("SCROLL"),u()),_=w};return d.addEventListener("scroll",S),()=>d.removeEventListener("scroll",S)}},[a.viewport,c,m,u]),v.jsx(wr,{present:r||f!=="hidden",children:v.jsx(l_,{"data-state":f==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Ve(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:Ve(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),jx=y.forwardRef((e,t)=>{const r=ur(qr,e.__scopeScrollArea),{forceMount:n,...a}=e,[c,u]=y.useState(!1),f=e.orientation==="horizontal",m=ph(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,g=r.viewport.offsetHeight<r.viewport.scrollHeight;u(f?d:g)}},10);return sa(r.viewport,m),sa(r.content,m),v.jsx(wr,{present:n||c,children:v.jsx(l_,{"data-state":c?"visible":"hidden",...a,ref:t})})}),l_=y.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,a=ur(qr,e.__scopeScrollArea),c=y.useRef(null),u=y.useRef(0),[f,m]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=$x(f.viewport,f.content),g={...n,sizes:f,onSizesChange:m,hasThumb:d>0&&d<1,onThumbChange:S=>c.current=S,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:S=>u.current=S};function _(S,w){return U4(S,u.current,f,w)}return r==="horizontal"?v.jsx(L4,{...g,ref:t,onThumbPositionChange:()=>{if(a.viewport&&c.current){const S=a.viewport.scrollLeft,w=iS(S,f,a.dir);c.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:S=>{a.viewport&&(a.viewport.scrollLeft=S)},onDragScroll:S=>{a.viewport&&(a.viewport.scrollLeft=_(S,a.dir))}}):r==="vertical"?v.jsx(z4,{...g,ref:t,onThumbPositionChange:()=>{if(a.viewport&&c.current){const S=a.viewport.scrollTop,w=iS(S,f);c.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:S=>{a.viewport&&(a.viewport.scrollTop=S)},onDragScroll:S=>{a.viewport&&(a.viewport.scrollTop=_(S))}}):null}),L4=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,c=ur(qr,e.__scopeScrollArea),[u,f]=y.useState(),m=y.useRef(null),d=wt(t,m,c.onScrollbarXChange);return y.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),v.jsx(Px,{"data-orientation":"horizontal",...a,ref:d,sizes:r,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":mh(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,_)=>{if(c.viewport){const S=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(S),Wx(S,_)&&g.preventDefault()}},onResize:()=>{m.current&&c.viewport&&u&&n({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:Xu(u.paddingLeft),paddingEnd:Xu(u.paddingRight)}})}})}),z4=y.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,c=ur(qr,e.__scopeScrollArea),[u,f]=y.useState(),m=y.useRef(null),d=wt(t,m,c.onScrollbarYChange);return y.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),v.jsx(Px,{"data-orientation":"vertical",...a,ref:d,sizes:r,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":mh(r)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,_)=>{if(c.viewport){const S=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(S),Wx(S,_)&&g.preventDefault()}},onResize:()=>{m.current&&c.viewport&&u&&n({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:Xu(u.paddingTop),paddingEnd:Xu(u.paddingBottom)}})}})}),[j4,Hx]=Ox(qr),Px=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:a,onThumbChange:c,onThumbPointerUp:u,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:d,onWheelScroll:g,onResize:_,...S}=e,w=ur(qr,r),[x,C]=y.useState(null),k=wt(t,re=>C(re)),T=y.useRef(null),$=y.useRef(""),z=w.viewport,A=n.content-n.viewport,j=Ti(g),P=Ti(m),F=ph(_,10);function G(re){if(T.current){const le=re.clientX-T.current.left,ce=re.clientY-T.current.top;d({x:le,y:ce})}}return y.useEffect(()=>{const re=le=>{const ce=le.target;x?.contains(ce)&&j(le,A)};return document.addEventListener("wheel",re,{passive:!1}),()=>document.removeEventListener("wheel",re,{passive:!1})},[z,x,A,j]),y.useEffect(P,[n,P]),sa(x,F),sa(w.content,F),v.jsx(j4,{scope:r,scrollbar:x,hasThumb:a,onThumbChange:Ti(c),onThumbPointerUp:Ti(u),onThumbPositionChange:P,onThumbPointerDown:Ti(f),children:v.jsx($e.div,{...S,ref:k,style:{position:"absolute",...S.style},onPointerDown:Ve(e.onPointerDown,re=>{re.button===0&&(re.target.setPointerCapture(re.pointerId),T.current=x.getBoundingClientRect(),$.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",w.viewport&&(w.viewport.style.scrollBehavior="auto"),G(re))}),onPointerMove:Ve(e.onPointerMove,G),onPointerUp:Ve(e.onPointerUp,re=>{const le=re.target;le.hasPointerCapture(re.pointerId)&&le.releasePointerCapture(re.pointerId),document.body.style.webkitUserSelect=$.current,w.viewport&&(w.viewport.style.scrollBehavior=""),T.current=null})})})}),Gu="ScrollAreaThumb",Ux=y.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Hx(Gu,e.__scopeScrollArea);return v.jsx(wr,{present:r||a.hasThumb,children:v.jsx(H4,{ref:t,...n})})}),H4=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...a}=e,c=ur(Gu,r),u=Hx(Gu,r),{onThumbPositionChange:f}=u,m=wt(t,_=>u.onThumbChange(_)),d=y.useRef(void 0),g=ph(()=>{d.current&&(d.current(),d.current=void 0)},100);return y.useEffect(()=>{const _=c.viewport;if(_){const S=()=>{if(g(),!d.current){const w=I4(_,f);d.current=w,f()}};return f(),_.addEventListener("scroll",S),()=>_.removeEventListener("scroll",S)}},[c.viewport,g,f]),v.jsx($e.div,{"data-state":u.hasThumb?"visible":"hidden",...a,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Ve(e.onPointerDownCapture,_=>{const w=_.target.getBoundingClientRect(),x=_.clientX-w.left,C=_.clientY-w.top;u.onThumbPointerDown({x,y:C})}),onPointerUp:Ve(e.onPointerUp,u.onThumbPointerUp)})});Ux.displayName=Gu;var c_="ScrollAreaCorner",Ix=y.forwardRef((e,t)=>{const r=ur(c_,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?v.jsx(P4,{...e,ref:t}):null});Ix.displayName=c_;var P4=y.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,a=ur(c_,r),[c,u]=y.useState(0),[f,m]=y.useState(0),d=!!(c&&f);return sa(a.scrollbarX,()=>{const g=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(g),m(g)}),sa(a.scrollbarY,()=>{const g=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(g),u(g)}),d?v.jsx($e.div,{...n,ref:t,style:{width:c,height:f,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Xu(e){return e?parseInt(e,10):0}function $x(e,t){const r=e/t;return isNaN(r)?0:r}function mh(e){const t=$x(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function U4(e,t,r,n="ltr"){const a=mh(r),c=a/2,u=t||c,f=a-u,m=r.scrollbar.paddingStart+u,d=r.scrollbar.size-r.scrollbar.paddingEnd-f,g=r.content-r.viewport,_=n==="ltr"?[0,g]:[g*-1,0];return Fx([m,d],_)(e)}function iS(e,t,r="ltr"){const n=mh(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,c=t.scrollbar.size-a,u=t.content-t.viewport,f=c-n,m=r==="ltr"?[0,u]:[u*-1,0],d=D4(e,m);return Fx([0,u],[0,f])(d)}function Fx(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Wx(e,t){return e>0&&e<t}var I4=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function a(){const c={left:e.scrollLeft,top:e.scrollTop},u=r.left!==c.left,f=r.top!==c.top;(u||f)&&t(),r=c,n=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(n)};function ph(e,t){const r=Ti(e),n=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(n.current),[]),y.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function sa(e,t){const r=Ti(t);Es(()=>{let n=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(n),a.unobserve(e)}}},[e,r])}var qx=Bx,$4=zx,F4=Ix;const Vx=y.forwardRef(({className:e,children:t,...r},n)=>v.jsxs(qx,{ref:n,className:Le("relative overflow-hidden",e),...r,children:[v.jsx($4,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(Yx,{}),v.jsx(F4,{})]}));Vx.displayName=qx.displayName;const Yx=y.forwardRef(({className:e,orientation:t="vertical",...r},n)=>v.jsx(a_,{ref:n,orientation:t,className:Le("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:v.jsx(Ux,{className:"relative flex-1 rounded-full bg-border"})}));Yx.displayName=a_.displayName;function _m({className:e,...t}){return v.jsx("div",{className:Le("animate-pulse rounded-md bg-primary/10",e),...t})}const W4=["top","right","bottom","left"],_n=Math.min,qi=Math.max,Zu=Math.round,_u=Math.floor,Ur=e=>({x:e,y:e}),q4={left:"right",right:"left",bottom:"top",top:"bottom"},V4={start:"end",end:"start"};function gp(e,t,r){return qi(e,_n(t,r))}function Rs(e,t){return typeof e=="function"?e(t):e}function ks(e){return e.split("-")[0]}function ua(e){return e.split("-")[1]}function u_(e){return e==="x"?"y":"x"}function h_(e){return e==="y"?"height":"width"}const Y4=new Set(["top","bottom"]);function Hr(e){return Y4.has(ks(e))?"y":"x"}function d_(e){return u_(Hr(e))}function K4(e,t,r){r===void 0&&(r=!1);const n=ua(e),a=d_(e),c=h_(a);let u=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=Qu(u)),[u,Qu(u)]}function G4(e){const t=Qu(e);return[vp(e),t,vp(t)]}function vp(e){return e.replace(/start|end/g,t=>V4[t])}const rS=["left","right"],sS=["right","left"],X4=["top","bottom"],Z4=["bottom","top"];function Q4(e,t,r){switch(e){case"top":case"bottom":return r?t?sS:rS:t?rS:sS;case"left":case"right":return t?X4:Z4;default:return[]}}function J4(e,t,r,n){const a=ua(e);let c=Q4(ks(e),r==="start",n);return a&&(c=c.map(u=>u+"-"+a),t&&(c=c.concat(c.map(vp)))),c}function Qu(e){return e.replace(/left|right|bottom|top/g,t=>q4[t])}function eB(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kx(e){return typeof e!="number"?eB(e):{top:e,right:e,bottom:e,left:e}}function Ju(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function nS(e,t,r){let{reference:n,floating:a}=e;const c=Hr(t),u=d_(t),f=h_(u),m=ks(t),d=c==="y",g=n.x+n.width/2-a.width/2,_=n.y+n.height/2-a.height/2,S=n[f]/2-a[f]/2;let w;switch(m){case"top":w={x:g,y:n.y-a.height};break;case"bottom":w={x:g,y:n.y+n.height};break;case"right":w={x:n.x+n.width,y:_};break;case"left":w={x:n.x-a.width,y:_};break;default:w={x:n.x,y:n.y}}switch(ua(t)){case"start":w[u]-=S*(r&&d?-1:1);break;case"end":w[u]+=S*(r&&d?-1:1);break}return w}async function tB(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:c,rects:u,elements:f,strategy:m}=e,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:_="floating",altBoundary:S=!1,padding:w=0}=Rs(t,e),x=Kx(w),k=f[S?_==="floating"?"reference":"floating":_],T=Ju(await c.getClippingRect({element:(r=await(c.isElement==null?void 0:c.isElement(k)))==null||r?k:k.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(f.floating)),boundary:d,rootBoundary:g,strategy:m})),$=_==="floating"?{x:n,y:a,width:u.floating.width,height:u.floating.height}:u.reference,z=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f.floating)),A=await(c.isElement==null?void 0:c.isElement(z))?await(c.getScale==null?void 0:c.getScale(z))||{x:1,y:1}:{x:1,y:1},j=Ju(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:$,offsetParent:z,strategy:m}):$);return{top:(T.top-j.top+x.top)/A.y,bottom:(j.bottom-T.bottom+x.bottom)/A.y,left:(T.left-j.left+x.left)/A.x,right:(j.right-T.right+x.right)/A.x}}const iB=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:c=[],platform:u}=r,f=c.filter(Boolean),m=await(u.isRTL==null?void 0:u.isRTL(t));let d=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:g,y:_}=nS(d,n,m),S=n,w={},x=0;for(let k=0;k<f.length;k++){var C;const{name:T,fn:$}=f[k],{x:z,y:A,data:j,reset:P}=await $({x:g,y:_,initialPlacement:n,placement:S,strategy:a,middlewareData:w,rects:d,platform:{...u,detectOverflow:(C=u.detectOverflow)!=null?C:tB},elements:{reference:e,floating:t}});g=z??g,_=A??_,w={...w,[T]:{...w[T],...j}},P&&x<=50&&(x++,typeof P=="object"&&(P.placement&&(S=P.placement),P.rects&&(d=P.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):P.rects),{x:g,y:_}=nS(d,S,m)),k=-1)}return{x:g,y:_,placement:S,strategy:a,middlewareData:w}},rB=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:c,platform:u,elements:f,middlewareData:m}=t,{element:d,padding:g=0}=Rs(e,t)||{};if(d==null)return{};const _=Kx(g),S={x:r,y:n},w=d_(a),x=h_(w),C=await u.getDimensions(d),k=w==="y",T=k?"top":"left",$=k?"bottom":"right",z=k?"clientHeight":"clientWidth",A=c.reference[x]+c.reference[w]-S[w]-c.floating[x],j=S[w]-c.reference[w],P=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let F=P?P[z]:0;(!F||!await(u.isElement==null?void 0:u.isElement(P)))&&(F=f.floating[z]||c.floating[x]);const G=A/2-j/2,re=F/2-C[x]/2-1,le=_n(_[T],re),ce=_n(_[$],re),W=le,M=F-C[x]-ce,H=F/2-C[x]/2+G,N=gp(W,H,M),R=!m.arrow&&ua(a)!=null&&H!==N&&c.reference[x]/2-(H<W?le:ce)-C[x]/2<0,L=R?H<W?H-W:H-M:0;return{[w]:S[w]+L,data:{[w]:N,centerOffset:H-N-L,...R&&{alignmentOffset:L}},reset:R}}}),sB=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:c,rects:u,initialPlacement:f,platform:m,elements:d}=t,{mainAxis:g=!0,crossAxis:_=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:C=!0,...k}=Rs(e,t);if((r=c.arrow)!=null&&r.alignmentOffset)return{};const T=ks(a),$=Hr(f),z=ks(f)===f,A=await(m.isRTL==null?void 0:m.isRTL(d.floating)),j=S||(z||!C?[Qu(f)]:G4(f)),P=x!=="none";!S&&P&&j.push(...J4(f,C,x,A));const F=[f,...j],G=await m.detectOverflow(t,k),re=[];let le=((n=c.flip)==null?void 0:n.overflows)||[];if(g&&re.push(G[T]),_){const H=K4(a,u,A);re.push(G[H[0]],G[H[1]])}if(le=[...le,{placement:a,overflows:re}],!re.every(H=>H<=0)){var ce,W;const H=(((ce=c.flip)==null?void 0:ce.index)||0)+1,N=F[H];if(N&&(!(_==="alignment"?$!==Hr(N):!1)||le.every(U=>Hr(U.placement)===$?U.overflows[0]>0:!0)))return{data:{index:H,overflows:le},reset:{placement:N}};let R=(W=le.filter(L=>L.overflows[0]<=0).sort((L,U)=>L.overflows[1]-U.overflows[1])[0])==null?void 0:W.placement;if(!R)switch(w){case"bestFit":{var M;const L=(M=le.filter(U=>{if(P){const se=Hr(U.placement);return se===$||se==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(se=>se>0).reduce((se,ee)=>se+ee,0)]).sort((U,se)=>U[1]-se[1])[0])==null?void 0:M[0];L&&(R=L);break}case"initialPlacement":R=f;break}if(a!==R)return{reset:{placement:R}}}return{}}}};function oS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aS(e){return W4.some(t=>e[t]>=0)}const nB=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...c}=Rs(e,t);switch(a){case"referenceHidden":{const u=await n.detectOverflow(t,{...c,elementContext:"reference"}),f=oS(u,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:aS(f)}}}case"escaped":{const u=await n.detectOverflow(t,{...c,altBoundary:!0}),f=oS(u,r.floating);return{data:{escapedOffsets:f,escaped:aS(f)}}}default:return{}}}}},Gx=new Set(["left","top"]);async function oB(e,t){const{placement:r,platform:n,elements:a}=e,c=await(n.isRTL==null?void 0:n.isRTL(a.floating)),u=ks(r),f=ua(r),m=Hr(r)==="y",d=Gx.has(u)?-1:1,g=c&&m?-1:1,_=Rs(t,e);let{mainAxis:S,crossAxis:w,alignmentAxis:x}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:_.mainAxis||0,crossAxis:_.crossAxis||0,alignmentAxis:_.alignmentAxis};return f&&typeof x=="number"&&(w=f==="end"?x*-1:x),m?{x:w*g,y:S*d}:{x:S*d,y:w*g}}const aB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:c,placement:u,middlewareData:f}=t,m=await oB(t,e);return u===((r=f.offset)==null?void 0:r.placement)&&(n=f.arrow)!=null&&n.alignmentOffset?{}:{x:a+m.x,y:c+m.y,data:{...m,placement:u}}}}},lB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:c}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:m={fn:T=>{let{x:$,y:z}=T;return{x:$,y:z}}},...d}=Rs(e,t),g={x:r,y:n},_=await c.detectOverflow(t,d),S=Hr(ks(a)),w=u_(S);let x=g[w],C=g[S];if(u){const T=w==="y"?"top":"left",$=w==="y"?"bottom":"right",z=x+_[T],A=x-_[$];x=gp(z,x,A)}if(f){const T=S==="y"?"top":"left",$=S==="y"?"bottom":"right",z=C+_[T],A=C-_[$];C=gp(z,C,A)}const k=m.fn({...t,[w]:x,[S]:C});return{...k,data:{x:k.x-r,y:k.y-n,enabled:{[w]:u,[S]:f}}}}}},cB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:c,middlewareData:u}=t,{offset:f=0,mainAxis:m=!0,crossAxis:d=!0}=Rs(e,t),g={x:r,y:n},_=Hr(a),S=u_(_);let w=g[S],x=g[_];const C=Rs(f,t),k=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(m){const z=S==="y"?"height":"width",A=c.reference[S]-c.floating[z]+k.mainAxis,j=c.reference[S]+c.reference[z]-k.mainAxis;w<A?w=A:w>j&&(w=j)}if(d){var T,$;const z=S==="y"?"width":"height",A=Gx.has(ks(a)),j=c.reference[_]-c.floating[z]+(A&&((T=u.offset)==null?void 0:T[_])||0)+(A?0:k.crossAxis),P=c.reference[_]+c.reference[z]+(A?0:(($=u.offset)==null?void 0:$[_])||0)-(A?k.crossAxis:0);x<j?x=j:x>P&&(x=P)}return{[S]:w,[_]:x}}}},uB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:c,platform:u,elements:f}=t,{apply:m=()=>{},...d}=Rs(e,t),g=await u.detectOverflow(t,d),_=ks(a),S=ua(a),w=Hr(a)==="y",{width:x,height:C}=c.floating;let k,T;_==="top"||_==="bottom"?(k=_,T=S===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(T=_,k=S==="end"?"top":"bottom");const $=C-g.top-g.bottom,z=x-g.left-g.right,A=_n(C-g[k],$),j=_n(x-g[T],z),P=!t.middlewareData.shift;let F=A,G=j;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(G=z),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(F=$),P&&!S){const le=qi(g.left,0),ce=qi(g.right,0),W=qi(g.top,0),M=qi(g.bottom,0);w?G=x-2*(le!==0||ce!==0?le+ce:qi(g.left,g.right)):F=C-2*(W!==0||M!==0?W+M:qi(g.top,g.bottom))}await m({...t,availableWidth:G,availableHeight:F});const re=await u.getDimensions(f.floating);return x!==re.width||C!==re.height?{reset:{rects:!0}}:{}}}};function _h(){return typeof window<"u"}function ha(e){return Xx(e)?(e.nodeName||"").toLowerCase():"#document"}function Vi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vr(e){var t;return(t=(Xx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xx(e){return _h()?e instanceof Node||e instanceof Vi(e).Node:!1}function br(e){return _h()?e instanceof Element||e instanceof Vi(e).Element:!1}function Wr(e){return _h()?e instanceof HTMLElement||e instanceof Vi(e).HTMLElement:!1}function lS(e){return!_h()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vi(e).ShadowRoot}const hB=new Set(["inline","contents"]);function Pl(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!hB.has(a)}const dB=new Set(["table","td","th"]);function fB(e){return dB.has(ha(e))}const mB=[":popover-open",":modal"];function gh(e){return mB.some(t=>{try{return e.matches(t)}catch{return!1}})}const pB=["transform","translate","scale","rotate","perspective"],_B=["transform","translate","scale","rotate","perspective","filter"],gB=["paint","layout","strict","content"];function f_(e){const t=m_(),r=br(e)?Sr(e):e;return pB.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||_B.some(n=>(r.willChange||"").includes(n))||gB.some(n=>(r.contain||"").includes(n))}function vB(e){let t=gn(e);for(;Wr(t)&&!na(t);){if(f_(t))return t;if(gh(t))return null;t=gn(t)}return null}function m_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yB=new Set(["html","body","#document"]);function na(e){return yB.has(ha(e))}function Sr(e){return Vi(e).getComputedStyle(e)}function vh(e){return br(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gn(e){if(ha(e)==="html")return e;const t=e.assignedSlot||e.parentNode||lS(e)&&e.host||Vr(e);return lS(t)?t.host:t}function Zx(e){const t=gn(e);return na(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wr(t)&&Pl(t)?t:Zx(t)}function kl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Zx(e),c=a===((n=e.ownerDocument)==null?void 0:n.body),u=Vi(a);if(c){const f=yp(u);return t.concat(u,u.visualViewport||[],Pl(a)?a:[],f&&r?kl(f):[])}return t.concat(a,kl(a,[],r))}function yp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qx(e){const t=Sr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Wr(e),c=a?e.offsetWidth:r,u=a?e.offsetHeight:n,f=Zu(r)!==c||Zu(n)!==u;return f&&(r=c,n=u),{width:r,height:n,$:f}}function p_(e){return br(e)?e:e.contextElement}function ia(e){const t=p_(e);if(!Wr(t))return Ur(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:c}=Qx(t);let u=(c?Zu(r.width):r.width)/n,f=(c?Zu(r.height):r.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const bB=Ur(0);function Jx(e){const t=Vi(e);return!m_()||!t.visualViewport?bB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Vi(e)?!1:t}function Qn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),c=p_(e);let u=Ur(1);t&&(n?br(n)&&(u=ia(n)):u=ia(e));const f=SB(c,r,n)?Jx(c):Ur(0);let m=(a.left+f.x)/u.x,d=(a.top+f.y)/u.y,g=a.width/u.x,_=a.height/u.y;if(c){const S=Vi(c),w=n&&br(n)?Vi(n):n;let x=S,C=yp(x);for(;C&&n&&w!==x;){const k=ia(C),T=C.getBoundingClientRect(),$=Sr(C),z=T.left+(C.clientLeft+parseFloat($.paddingLeft))*k.x,A=T.top+(C.clientTop+parseFloat($.paddingTop))*k.y;m*=k.x,d*=k.y,g*=k.x,_*=k.y,m+=z,d+=A,x=Vi(C),C=yp(x)}}return Ju({width:g,height:_,x:m,y:d})}function yh(e,t){const r=vh(e).scrollLeft;return t?t.left+r:Qn(Vr(e)).left+r}function eC(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-yh(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function wB(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const c=a==="fixed",u=Vr(n),f=t?gh(t.floating):!1;if(n===u||f&&c)return r;let m={scrollLeft:0,scrollTop:0},d=Ur(1);const g=Ur(0),_=Wr(n);if((_||!_&&!c)&&((ha(n)!=="body"||Pl(u))&&(m=vh(n)),Wr(n))){const w=Qn(n);d=ia(n),g.x=w.x+n.clientLeft,g.y=w.y+n.clientTop}const S=u&&!_&&!c?eC(u,m):Ur(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-m.scrollLeft*d.x+g.x+S.x,y:r.y*d.y-m.scrollTop*d.y+g.y+S.y}}function xB(e){return Array.from(e.getClientRects())}function CB(e){const t=Vr(e),r=vh(e),n=e.ownerDocument.body,a=qi(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),c=qi(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let u=-r.scrollLeft+yh(e);const f=-r.scrollTop;return Sr(n).direction==="rtl"&&(u+=qi(t.clientWidth,n.clientWidth)-a),{width:a,height:c,x:u,y:f}}const cS=25;function EB(e,t){const r=Vi(e),n=Vr(e),a=r.visualViewport;let c=n.clientWidth,u=n.clientHeight,f=0,m=0;if(a){c=a.width,u=a.height;const g=m_();(!g||g&&t==="fixed")&&(f=a.offsetLeft,m=a.offsetTop)}const d=yh(n);if(d<=0){const g=n.ownerDocument,_=g.body,S=getComputedStyle(_),w=g.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,x=Math.abs(n.clientWidth-_.clientWidth-w);x<=cS&&(c-=x)}else d<=cS&&(c+=d);return{width:c,height:u,x:f,y:m}}const RB=new Set(["absolute","fixed"]);function kB(e,t){const r=Qn(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,c=Wr(e)?ia(e):Ur(1),u=e.clientWidth*c.x,f=e.clientHeight*c.y,m=a*c.x,d=n*c.y;return{width:u,height:f,x:m,y:d}}function uS(e,t,r){let n;if(t==="viewport")n=EB(e,r);else if(t==="document")n=CB(Vr(e));else if(br(t))n=kB(t,r);else{const a=Jx(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Ju(n)}function tC(e,t){const r=gn(e);return r===t||!br(r)||na(r)?!1:Sr(r).position==="fixed"||tC(r,t)}function TB(e,t){const r=t.get(e);if(r)return r;let n=kl(e,[],!1).filter(f=>br(f)&&ha(f)!=="body"),a=null;const c=Sr(e).position==="fixed";let u=c?gn(e):e;for(;br(u)&&!na(u);){const f=Sr(u),m=f_(u);!m&&f.position==="fixed"&&(a=null),(c?!m&&!a:!m&&f.position==="static"&&!!a&&RB.has(a.position)||Pl(u)&&!m&&tC(e,u))?n=n.filter(g=>g!==u):a=f,u=gn(u)}return t.set(e,n),n}function AB(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const u=[...r==="clippingAncestors"?gh(t)?[]:TB(t,this._c):[].concat(r),n],f=u[0],m=u.reduce((d,g)=>{const _=uS(t,g,a);return d.top=qi(_.top,d.top),d.right=_n(_.right,d.right),d.bottom=_n(_.bottom,d.bottom),d.left=qi(_.left,d.left),d},uS(t,f,a));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function DB(e){const{width:t,height:r}=Qx(e);return{width:t,height:r}}function MB(e,t,r){const n=Wr(t),a=Vr(t),c=r==="fixed",u=Qn(e,!0,c,t);let f={scrollLeft:0,scrollTop:0};const m=Ur(0);function d(){m.x=yh(a)}if(n||!n&&!c)if((ha(t)!=="body"||Pl(a))&&(f=vh(t)),n){const w=Qn(t,!0,c,t);m.x=w.x+t.clientLeft,m.y=w.y+t.clientTop}else a&&d();c&&!n&&a&&d();const g=a&&!n&&!c?eC(a,f):Ur(0),_=u.left+f.scrollLeft-m.x-g.x,S=u.top+f.scrollTop-m.y-g.y;return{x:_,y:S,width:u.width,height:u.height}}function gm(e){return Sr(e).position==="static"}function hS(e,t){if(!Wr(e)||Sr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Vr(e)===r&&(r=r.ownerDocument.body),r}function iC(e,t){const r=Vi(e);if(gh(e))return r;if(!Wr(e)){let a=gn(e);for(;a&&!na(a);){if(br(a)&&!gm(a))return a;a=gn(a)}return r}let n=hS(e,t);for(;n&&fB(n)&&gm(n);)n=hS(n,t);return n&&na(n)&&gm(n)&&!f_(n)?r:n||vB(e)||r}const NB=async function(e){const t=this.getOffsetParent||iC,r=this.getDimensions,n=await r(e.floating);return{reference:MB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function OB(e){return Sr(e).direction==="rtl"}const BB={convertOffsetParentRelativeRectToViewportRelativeRect:wB,getDocumentElement:Vr,getClippingRect:AB,getOffsetParent:iC,getElementRects:NB,getClientRects:xB,getDimensions:DB,getScale:ia,isElement:br,isRTL:OB};function rC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function LB(e,t){let r=null,n;const a=Vr(e);function c(){var f;clearTimeout(n),(f=r)==null||f.disconnect(),r=null}function u(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),c();const d=e.getBoundingClientRect(),{left:g,top:_,width:S,height:w}=d;if(f||t(),!S||!w)return;const x=_u(_),C=_u(a.clientWidth-(g+S)),k=_u(a.clientHeight-(_+w)),T=_u(g),z={rootMargin:-x+"px "+-C+"px "+-k+"px "+-T+"px",threshold:qi(0,_n(1,m))||1};let A=!0;function j(P){const F=P[0].intersectionRatio;if(F!==m){if(!A)return u();F?u(!1,F):n=setTimeout(()=>{u(!1,1e-7)},1e3)}F===1&&!rC(d,e.getBoundingClientRect())&&u(),A=!1}try{r=new IntersectionObserver(j,{...z,root:a.ownerDocument})}catch{r=new IntersectionObserver(j,z)}r.observe(e)}return u(!0),c}function zB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=n,d=p_(e),g=a||c?[...d?kl(d):[],...kl(t)]:[];g.forEach(T=>{a&&T.addEventListener("scroll",r,{passive:!0}),c&&T.addEventListener("resize",r)});const _=d&&f?LB(d,r):null;let S=-1,w=null;u&&(w=new ResizeObserver(T=>{let[$]=T;$&&$.target===d&&w&&(w.unobserve(t),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var z;(z=w)==null||z.observe(t)})),r()}),d&&!m&&w.observe(d),w.observe(t));let x,C=m?Qn(e):null;m&&k();function k(){const T=Qn(e);C&&!rC(C,T)&&r(),C=T,x=requestAnimationFrame(k)}return r(),()=>{var T;g.forEach($=>{a&&$.removeEventListener("scroll",r),c&&$.removeEventListener("resize",r)}),_?.(),(T=w)==null||T.disconnect(),w=null,m&&cancelAnimationFrame(x)}}const jB=aB,HB=lB,PB=sB,UB=uB,IB=nB,dS=rB,$B=cB,FB=(e,t,r)=>{const n=new Map,a={platform:BB,...r},c={...a.platform,_c:n};return iB(e,t,{...a,platform:c})};var WB=typeof document<"u",qB=function(){},Du=WB?y.useLayoutEffect:qB;function eh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!eh(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const c=a[n];if(!(c==="_owner"&&e.$$typeof)&&!eh(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function sC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fS(e,t){const r=sC(e);return Math.round(t*r)/r}function vm(e){const t=y.useRef(e);return Du(()=>{t.current=e}),t}function VB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:c,floating:u}={},transform:f=!0,whileElementsMounted:m,open:d}=e,[g,_]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[S,w]=y.useState(n);eh(S,n)||w(n);const[x,C]=y.useState(null),[k,T]=y.useState(null),$=y.useCallback(U=>{U!==P.current&&(P.current=U,C(U))},[]),z=y.useCallback(U=>{U!==F.current&&(F.current=U,T(U))},[]),A=c||x,j=u||k,P=y.useRef(null),F=y.useRef(null),G=y.useRef(g),re=m!=null,le=vm(m),ce=vm(a),W=vm(d),M=y.useCallback(()=>{if(!P.current||!F.current)return;const U={placement:t,strategy:r,middleware:S};ce.current&&(U.platform=ce.current),FB(P.current,F.current,U).then(se=>{const ee={...se,isPositioned:W.current!==!1};H.current&&!eh(G.current,ee)&&(G.current=ee,Dp.flushSync(()=>{_(ee)}))})},[S,t,r,ce,W]);Du(()=>{d===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,_(U=>({...U,isPositioned:!1})))},[d]);const H=y.useRef(!1);Du(()=>(H.current=!0,()=>{H.current=!1}),[]),Du(()=>{if(A&&(P.current=A),j&&(F.current=j),A&&j){if(le.current)return le.current(A,j,M);M()}},[A,j,M,le,re]);const N=y.useMemo(()=>({reference:P,floating:F,setReference:$,setFloating:z}),[$,z]),R=y.useMemo(()=>({reference:A,floating:j}),[A,j]),L=y.useMemo(()=>{const U={position:r,left:0,top:0};if(!R.floating)return U;const se=fS(R.floating,g.x),ee=fS(R.floating,g.y);return f?{...U,transform:"translate("+se+"px, "+ee+"px)",...sC(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:se,top:ee}},[r,f,R.floating,g.x,g.y]);return y.useMemo(()=>({...g,update:M,refs:N,elements:R,floatingStyles:L}),[g,M,N,R,L])}const YB=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?dS({element:n.current,padding:a}).fn(r):{}:n?dS({element:n,padding:a}).fn(r):{}}}},KB=(e,t)=>({...jB(e),options:[e,t]}),GB=(e,t)=>({...HB(e),options:[e,t]}),XB=(e,t)=>({...$B(e),options:[e,t]}),ZB=(e,t)=>({...PB(e),options:[e,t]}),QB=(e,t)=>({...UB(e),options:[e,t]}),JB=(e,t)=>({...IB(e),options:[e,t]}),eL=(e,t)=>({...YB(e),options:[e,t]});var tL="Arrow",nC=y.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...c}=e;return v.jsx($e.svg,{...c,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});nC.displayName=tL;var iL=nC;function rL(e){const[t,r]=y.useState(void 0);return Es(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const c=a[0];let u,f;if("borderBoxSize"in c){const m=c.borderBoxSize,d=Array.isArray(m)?m[0]:m;u=d.inlineSize,f=d.blockSize}else u=e.offsetWidth,f=e.offsetHeight;r({width:u,height:f})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var __="Popper",[oC,aC]=yn(__),[sL,lC]=oC(__),cC=e=>{const{__scopePopper:t,children:r}=e,[n,a]=y.useState(null);return v.jsx(sL,{scope:t,anchor:n,onAnchorChange:a,children:r})};cC.displayName=__;var uC="PopperAnchor",hC=y.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,c=lC(uC,r),u=y.useRef(null),f=wt(t,u),m=y.useRef(null);return y.useEffect(()=>{const d=m.current;m.current=n?.current||u.current,d!==m.current&&c.onAnchorChange(m.current)}),n?null:v.jsx($e.div,{...a,ref:f})});hC.displayName=uC;var g_="PopperContent",[nL,oL]=oC(g_),dC=y.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:c="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:d=[],collisionPadding:g=0,sticky:_="partial",hideWhenDetached:S=!1,updatePositionStrategy:w="optimized",onPlaced:x,...C}=e,k=lC(g_,r),[T,$]=y.useState(null),z=wt(t,de=>$(de)),[A,j]=y.useState(null),P=rL(A),F=P?.width??0,G=P?.height??0,re=n+(c!=="center"?"-"+c:""),le=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},ce=Array.isArray(d)?d:[d],W=ce.length>0,M={padding:le,boundary:ce.filter(lL),altBoundary:W},{refs:H,floatingStyles:N,placement:R,isPositioned:L,middlewareData:U}=VB({strategy:"fixed",placement:re,whileElementsMounted:(...de)=>zB(...de,{animationFrame:w==="always"}),elements:{reference:k.anchor},middleware:[KB({mainAxis:a+G,alignmentAxis:u}),m&&GB({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?XB():void 0,...M}),m&&ZB({...M}),QB({...M,apply:({elements:de,rects:_e,availableWidth:me,availableHeight:Je})=>{const{width:ot,height:Ke}=_e.reference,Re=de.floating.style;Re.setProperty("--radix-popper-available-width",`${me}px`),Re.setProperty("--radix-popper-available-height",`${Je}px`),Re.setProperty("--radix-popper-anchor-width",`${ot}px`),Re.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),A&&eL({element:A,padding:f}),cL({arrowWidth:F,arrowHeight:G}),S&&JB({strategy:"referenceHidden",...M})]}),[se,ee]=pC(R),D=Ti(x);Es(()=>{L&&D?.()},[L,D]);const O=U.arrow?.x,q=U.arrow?.y,Q=U.arrow?.centerOffset!==0,[X,ae]=y.useState();return Es(()=>{T&&ae(window.getComputedStyle(T).zIndex)},[T]),v.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:L?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(nL,{scope:r,placedSide:se,onArrowChange:j,arrowX:O,arrowY:q,shouldHideArrow:Q,children:v.jsx($e.div,{"data-side":se,"data-align":ee,...C,ref:z,style:{...C.style,animation:L?void 0:"none"}})})})});dC.displayName=g_;var fC="PopperArrow",aL={top:"bottom",right:"left",bottom:"top",left:"right"},mC=y.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,c=oL(fC,n),u=aL[c.placedSide];return v.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:v.jsx(iL,{...a,ref:r,style:{...a.style,display:"block"}})})});mC.displayName=fC;function lL(e){return e!==null}var cL=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,u=a.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[d,g]=pC(r),_={start:"0%",center:"50%",end:"100%"}[g],S=(a.arrow?.x??0)+f/2,w=(a.arrow?.y??0)+m/2;let x="",C="";return d==="bottom"?(x=u?_:`${S}px`,C=`${-m}px`):d==="top"?(x=u?_:`${S}px`,C=`${n.floating.height+m}px`):d==="right"?(x=`${-m}px`,C=u?_:`${w}px`):d==="left"&&(x=`${n.floating.width+m}px`,C=u?_:`${w}px`),{data:{x,y:C}}}});function pC(e){const[t,r="center"]=e.split("-");return[t,r]}var uL=cC,hL=hC,dL=dC,fL=mC,mL=Symbol("radix.slottable");function pL(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=mL,t}var _L=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gL="VisuallyHidden",_C=y.forwardRef((e,t)=>v.jsx($e.span,{...e,ref:t,style:{..._L,...e.style}}));_C.displayName=gL;var vL=_C,[bh]=yn("Tooltip",[aC]),Sh=aC(),gC="TooltipProvider",yL=700,bp="tooltip.open",[bL,v_]=bh(gC),vC=e=>{const{__scopeTooltip:t,delayDuration:r=yL,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:c}=e,u=y.useRef(!0),f=y.useRef(!1),m=y.useRef(0);return y.useEffect(()=>{const d=m.current;return()=>window.clearTimeout(d)},[]),v.jsx(bL,{scope:t,isOpenDelayedRef:u,delayDuration:r,onOpen:y.useCallback(()=>{window.clearTimeout(m.current),u.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,n)},[n]),isPointerInTransitRef:f,onPointerInTransitChange:y.useCallback(d=>{f.current=d},[]),disableHoverableContent:a,children:c})};vC.displayName=gC;var Tl="Tooltip",[SL,Ul]=bh(Tl),yC=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:c,disableHoverableContent:u,delayDuration:f}=e,m=v_(Tl,e.__scopeTooltip),d=Sh(t),[g,_]=y.useState(null),S=cr(),w=y.useRef(0),x=u??m.disableHoverableContent,C=f??m.delayDuration,k=y.useRef(!1),[T,$]=oh({prop:n,defaultProp:a??!1,onChange:F=>{F?(m.onOpen(),document.dispatchEvent(new CustomEvent(bp))):m.onClose(),c?.(F)},caller:Tl}),z=y.useMemo(()=>T?k.current?"delayed-open":"instant-open":"closed",[T]),A=y.useCallback(()=>{window.clearTimeout(w.current),w.current=0,k.current=!1,$(!0)},[$]),j=y.useCallback(()=>{window.clearTimeout(w.current),w.current=0,$(!1)},[$]),P=y.useCallback(()=>{window.clearTimeout(w.current),w.current=window.setTimeout(()=>{k.current=!0,$(!0),w.current=0},C)},[C,$]);return y.useEffect(()=>()=>{w.current&&(window.clearTimeout(w.current),w.current=0)},[]),v.jsx(uL,{...d,children:v.jsx(SL,{scope:t,contentId:S,open:T,stateAttribute:z,trigger:g,onTriggerChange:_,onTriggerEnter:y.useCallback(()=>{m.isOpenDelayedRef.current?P():A()},[m.isOpenDelayedRef,P,A]),onTriggerLeave:y.useCallback(()=>{x?j():(window.clearTimeout(w.current),w.current=0)},[j,x]),onOpen:A,onClose:j,disableHoverableContent:x,children:r})})};yC.displayName=Tl;var Sp="TooltipTrigger",bC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Ul(Sp,r),c=v_(Sp,r),u=Sh(r),f=y.useRef(null),m=wt(t,f,a.onTriggerChange),d=y.useRef(!1),g=y.useRef(!1),_=y.useCallback(()=>d.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",_),[_]),v.jsx(hL,{asChild:!0,...u,children:v.jsx($e.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:m,onPointerMove:Ve(e.onPointerMove,S=>{S.pointerType!=="touch"&&!g.current&&!c.isPointerInTransitRef.current&&(a.onTriggerEnter(),g.current=!0)}),onPointerLeave:Ve(e.onPointerLeave,()=>{a.onTriggerLeave(),g.current=!1}),onPointerDown:Ve(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",_,{once:!0})}),onFocus:Ve(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:Ve(e.onBlur,a.onClose),onClick:Ve(e.onClick,a.onClose)})})});bC.displayName=Sp;var y_="TooltipPortal",[wL,xL]=bh(y_,{forceMount:void 0}),SC=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,c=Ul(y_,t);return v.jsx(wL,{scope:t,forceMount:r,children:v.jsx(wr,{present:r||c.open,children:v.jsx(qp,{asChild:!0,container:a,children:n})})})};SC.displayName=y_;var oa="TooltipContent",wC=y.forwardRef((e,t)=>{const r=xL(oa,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...c}=e,u=Ul(oa,e.__scopeTooltip);return v.jsx(wr,{present:n||u.open,children:u.disableHoverableContent?v.jsx(xC,{side:a,...c,ref:t}):v.jsx(CL,{side:a,...c,ref:t})})}),CL=y.forwardRef((e,t)=>{const r=Ul(oa,e.__scopeTooltip),n=v_(oa,e.__scopeTooltip),a=y.useRef(null),c=wt(t,a),[u,f]=y.useState(null),{trigger:m,onClose:d}=r,g=a.current,{onPointerInTransitChange:_}=n,S=y.useCallback(()=>{f(null),_(!1)},[_]),w=y.useCallback((x,C)=>{const k=x.currentTarget,T={x:x.clientX,y:x.clientY},$=AL(T,k.getBoundingClientRect()),z=DL(T,$),A=ML(C.getBoundingClientRect()),j=OL([...z,...A]);f(j),_(!0)},[_]);return y.useEffect(()=>()=>S(),[S]),y.useEffect(()=>{if(m&&g){const x=k=>w(k,g),C=k=>w(k,m);return m.addEventListener("pointerleave",x),g.addEventListener("pointerleave",C),()=>{m.removeEventListener("pointerleave",x),g.removeEventListener("pointerleave",C)}}},[m,g,w,S]),y.useEffect(()=>{if(u){const x=C=>{const k=C.target,T={x:C.clientX,y:C.clientY},$=m?.contains(k)||g?.contains(k),z=!NL(T,u);$?S():z&&(S(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[m,g,u,d,S]),v.jsx(xC,{...e,ref:c})}),[EL,RL]=bh(Tl,{isInside:!1}),kL=pL("TooltipContent"),xC=y.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:c,onPointerDownOutside:u,...f}=e,m=Ul(oa,r),d=Sh(r),{onClose:g}=m;return y.useEffect(()=>(document.addEventListener(bp,g),()=>document.removeEventListener(bp,g)),[g]),y.useEffect(()=>{if(m.trigger){const _=S=>{S.target?.contains(m.trigger)&&g()};return window.addEventListener("scroll",_,{capture:!0}),()=>window.removeEventListener("scroll",_,{capture:!0})}},[m.trigger,g]),v.jsx(Wp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:_=>_.preventDefault(),onDismiss:g,children:v.jsxs(dL,{"data-state":m.stateAttribute,...d,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(kL,{children:n}),v.jsx(EL,{scope:r,isInside:!0,children:v.jsx(vL,{id:m.contentId,role:"tooltip",children:a||n})})]})})});wC.displayName=oa;var CC="TooltipArrow",TL=y.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Sh(r);return RL(CC,r).isInside?null:v.jsx(fL,{...a,...n,ref:t})});TL.displayName=CC;function AL(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),c=Math.abs(t.left-e.x);switch(Math.min(r,n,a,c)){case c:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function DL(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function ML(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function NL(e,t){const{x:r,y:n}=e;let a=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const f=t[c],m=t[u],d=f.x,g=f.y,_=m.x,S=m.y;g>n!=S>n&&r<(_-d)*(n-g)/(S-g)+d&&(a=!a)}return a}function OL(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),BL(t)}function BL(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const c=t[t.length-1],u=t[t.length-2];if((c.x-u.x)*(a.y-u.y)>=(c.y-u.y)*(a.x-u.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const c=r[r.length-1],u=r[r.length-2];if((c.x-u.x)*(a.y-u.y)>=(c.y-u.y)*(a.x-u.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var LL=vC,zL=yC,jL=bC,HL=SC,EC=wC;const gu=LL,vu=zL,yu=jL,vl=y.forwardRef(({className:e,sideOffset:t=4,...r},n)=>v.jsx(HL,{children:v.jsx(EC,{ref:n,sideOffset:t,className:Le("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));vl.displayName=EC.displayName;const mS=e=>{if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(2))+" "+r[n]};function PL(){const{logout:e}=Cp(),[t,r]=y.useState([]),[n,a]=y.useState(null),[c,u]=y.useState(""),[f,m]=y.useState(""),[d,g]=y.useState(""),[_,S]=y.useState(""),[w,x]=y.useState(!1),[C,k]=y.useState([]),[T,$]=y.useState({}),[z,A]=y.useState("compose"),[j,P]=y.useState(!1),[F,G]=y.useState(!1),[re,le]=y.useState(""),[ce,W]=y.useState(null),[M,H]=y.useState(!1),[N,R]=y.useState(!1),[L,U]=y.useState(!1),[se,ee]=y.useState(()=>{const he=localStorage.getItem("sencho-theme");return he!==null?he==="dark":!0}),[D,O]=y.useState(!0),[q,Q]=y.useState(!1),[X,ae]=y.useState(""),[de,_e]=y.useState({}),[me,Je]=y.useState(!1),[ot,Ke]=y.useState(null),[Re,mt]=y.useState(!1);y.useEffect(()=>{const he=document.documentElement;se?(he.classList.add("dark"),localStorage.setItem("sencho-theme","dark")):(he.classList.remove("dark"),localStorage.setItem("sencho-theme","light"))},[se]);const vi=async(he=!1)=>{he||H(!0);try{const Te=await(await at("/stacks")).json();r(Array.isArray(Te)?Te:[]);const Me={};for(const lt of Te)try{const xe=await(await at(`/stacks/${lt}/containers`)).json(),Ge=Array.isArray(xe)&&xe.some(gt=>gt.State==="running");Me[lt]=Ge?"running":Array.isArray(xe)&&xe.length>0?"exited":"unknown"}catch{Me[lt]="unknown"}_e(Me)}catch(Se){console.error("Failed to refresh stacks:",Se),r([])}finally{H(!1)}};y.useEffect(()=>{vi()},[]),y.useEffect(()=>{const he={};return(C||[]).forEach(Se=>{if(Se?.Id)try{const Te=window.location.protocol==="https:"?"wss:":"ws:",Me=new WebSocket(`${Te}//${window.location.host}`);he[Se.Id]=Me,Me.onopen=()=>Me.send(JSON.stringify({action:"streamStats",containerId:Se.Id})),Me.onmessage=lt=>{try{const Ye=JSON.parse(lt.data);if(!Ye.cpu_stats?.cpu_usage||!Ye.precpu_stats?.cpu_usage||!Ye.memory_stats?.usage)return;const xe=Ye.cpu_stats.cpu_usage.total_usage-Ye.precpu_stats.cpu_usage.total_usage,Ge=(Ye.cpu_stats.system_cpu_usage||0)-(Ye.precpu_stats.system_cpu_usage||0),gt=Ye.cpu_stats.online_cpus||1,It=Ge>0?(xe/Ge*gt*100).toFixed(2):"0.00",Er=(Ye.memory_stats.usage/(1024*1024)).toFixed(2)+" MB";let st=0,$t=0;Ye.networks&&Object.values(Ye.networks).forEach(Mi=>{st+=Mi.rx_bytes||0,$t+=Mi.tx_bytes||0}),$(Mi=>{const Ot=Mi[Se.Id],li=Ot?.lastRx!==void 0?Math.max(0,st-Ot.lastRx):0,Ms=Ot?.lastTx!==void 0?Math.max(0,$t-Ot.lastTx):0,Ni=`${mS(li)}/s ↓ / ${mS(Ms)}/s ↑`;return{...Mi,[Se.Id]:{cpu:It+"%",ram:Er,net:Ni,lastRx:st,lastTx:$t}}})}catch{}}}catch{}}),()=>{Object.values(he).forEach(Se=>{try{Se.close()}catch{}})}},[C]);const Yr=async he=>{if(he){U(!0),Q(!1);try{const Te=await(await at(`/stacks/${he}`)).text();a(he),u(Te||""),m(Te||"");try{const Me=await at(`/stacks/${he}/env`);if(Me.ok){const lt=await Me.text();g(lt||""),S(lt||""),x(!0)}else g(""),S(""),x(!1)}catch{g(""),S(""),x(!1)}try{const lt=await(await at(`/stacks/${he}/containers`)).json();k(Array.isArray(lt)?lt:[])}catch(Me){console.error("Failed to load containers:",Me),k([])}}catch(Se){console.error("Failed to load file:",Se),a(null),u(""),m(""),g(""),S(""),k([])}finally{U(!1)}}},Kr=async()=>{if(!n)return;const he=z==="compose"?c||"":d||"",Se=z==="compose"?`/stacks/${n}`:`/stacks/${n}/env`;try{const Te=await at(Se,{method:"PUT",body:JSON.stringify({content:he})});if(!Te.ok)throw new Error(`HTTP ${Te.status}: ${await Te.text()}`);z==="compose"?m(c):S(d),Q(!1),jr.success("File saved successfully!")}catch(Te){console.error("Failed to save file:",Te),jr.error(`Failed to save file: ${Te.message}`)}},bn=()=>{z==="compose"?u(f):g(_),Q(!1)},di=()=>{Q(!0)},Sn=async he=>{if(he.preventDefault(),he.stopPropagation(),!n||N)return;const Se=n.replace(/\.(yml|yaml)$/,"");R(!0);try{await at(`/stacks/${Se}/up`,{method:"POST"});const Me=await(await at(`/stacks/${Se}/containers`)).json();k(Array.isArray(Me)?Me:[]),await vi(!0)}catch(Te){console.error("Failed to deploy:",Te)}finally{R(!1)}},wn=async he=>{if(he.preventDefault(),he.stopPropagation(),!n||N)return;const Se=n.replace(/\.(yml|yaml)$/,"");R(!0);try{await at(`/stacks/${Se}/stop`,{method:"POST"});const Me=await(await at(`/stacks/${Se}/containers`)).json();k(Array.isArray(Me)?Me:[]),await vi(!0)}catch(Te){console.error("Failed to stop:",Te)}finally{R(!1)}},Jt=async he=>{if(he.preventDefault(),he.stopPropagation(),!n||N)return;const Se=n.replace(/\.(yml|yaml)$/,"");R(!0);try{await at(`/stacks/${Se}/start`,{method:"POST"});const Me=await(await at(`/stacks/${Se}/containers`)).json();k(Array.isArray(Me)?Me:[]),await vi(!0)}catch(Te){console.error("Failed to start:",Te)}finally{R(!1)}},Cr=async he=>{if(he.preventDefault(),he.stopPropagation(),!n||N)return;const Se=n.replace(/\.(yml|yaml)$/,"");R(!0);try{await at(`/stacks/${Se}/restart`,{method:"POST"});const Me=await(await at(`/stacks/${Se}/containers`)).json();k(Array.isArray(Me)?Me:[]),await vi(!0)}catch(Te){console.error("Failed to restart:",Te)}finally{R(!1)}},ei=async he=>{if(he.preventDefault(),he.stopPropagation(),!n||N)return;const Se=n.replace(/\.(yml|yaml)$/,"");R(!0);try{await at(`/stacks/${Se}/update`,{method:"POST"});const Me=await(await at(`/stacks/${Se}/containers`)).json();k(Array.isArray(Me)?Me:[]),await vi(!0)}catch(Te){console.error("Failed to update:",Te)}finally{R(!1)}},da=async()=>{if(ce){R(!0);try{if(!(await at(`/stacks/${ce}`,{method:"DELETE"})).ok)throw new Error("Failed to delete stack");G(!1),W(null),n===ce&&(a(null),u(""),m(""),g(""),S(""),x(!1),k([]),Q(!1)),await vi()}catch(he){console.error("Failed to delete stack:",he),jr.error("Failed to delete stack")}finally{R(!1)}}},Gr=async()=>{if(!re.trim())return;const he=re.trim();try{const Se=await at("/stacks",{method:"POST",body:JSON.stringify({stackName:he})});if(!Se.ok)throw Se.status===409?new Error("Stack already exists"):Se.status===400?new Error("Invalid stack name (use alphanumeric characters and hyphens only)"):new Error("Failed to create stack");P(!1),le(""),await vi(),await Yr(he)}catch(Se){console.error("Failed to create stack:",Se),jr.error(Se.message||"Failed to create stack")}},to=(he,Se)=>{Ke({id:he,name:Se}),Je(!0)},Xr=()=>{Je(!1),Ke(null)},hr=C||[],dr=c||"",io=d||"",fr=hr&&hr.length>0,Zr=hr?.some(he=>he.State==="running"),Pt=n||"",Di=t.filter(he=>he.toLowerCase().includes(X.toLowerCase())),Ut=he=>he,ro=he=>{const Se=(he.Status||"").toLowerCase(),Te=(he.State||"").toLowerCase();return Se.includes("(unhealthy)")||Te==="exited"||Te==="dead"?{variant:"destructive",text:he.State}:Se.includes("(starting)")?{variant:"secondary",text:he.State}:{variant:"default",text:he.State}};return v.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-background text-foreground",children:[v.jsxs("div",{className:"w-64 border-r border-border bg-card flex flex-col",children:[v.jsxs("div",{className:"h-16 flex items-center justify-between px-4 border-b border-border",children:[v.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Sencho"}),v.jsx(gu,{children:v.jsxs(vu,{children:[v.jsx(yu,{asChild:!0,children:v.jsx(Ie,{variant:"ghost",size:"icon",onClick:e,className:"text-muted-foreground hover:text-foreground",children:v.jsx(DM,{className:"w-5 h-5"})})}),v.jsx(vl,{children:"Logout"})]})})]}),v.jsx("div",{className:"p-4",children:v.jsxs(hh,{open:j,onOpenChange:P,children:[v.jsx(UO,{asChild:!0,children:v.jsxs(Ie,{className:"w-full rounded-lg",children:[v.jsx(ew,{className:"w-4 h-4 mr-2"}),"Create Stack"]})}),v.jsxs(Bl,{children:[v.jsx(Ll,{children:v.jsx(zl,{children:"Create New Stack"})}),v.jsxs("div",{className:"py-4 space-y-2",children:[v.jsx(Cs,{htmlFor:"create-stack-name",children:"Stack Name"}),v.jsx(xs,{id:"create-stack-name",placeholder:"Stack name (e.g., myapp)",value:re,onChange:he=>le(he.target.value)})]}),v.jsx(e_,{children:v.jsx(Ie,{onClick:Gr,children:"Create"})})]})]})}),v.jsxs(Ax,{className:"bg-transparent flex-1 flex flex-col overflow-hidden",children:[v.jsx("div",{className:"px-4 py-2 border-b border-border flex-none",children:v.jsx(Dx,{placeholder:"Search stacks...",value:X,onValueChange:ae,className:"h-9"})}),v.jsx("h3",{className:"text-sm font-semibold text-muted-foreground px-4 py-2 mt-2 flex-none",children:"STACKS"}),v.jsx(Vx,{className:"flex-1 px-2 pb-2",children:v.jsx(Mx,{className:"max-h-none overflow-visible",children:M?v.jsxs("div",{className:"space-y-2 px-2 mt-2",children:[v.jsx(_m,{className:"h-12 w-full"}),v.jsx(_m,{className:"h-12 w-full"}),v.jsx(_m,{className:"h-12 w-full"})]}):(Di||[]).map(he=>v.jsx(Nx,{value:he,onSelect:()=>Yr(he),className:`justify-start rounded-lg mb-1 cursor-pointer ${n===he?"bg-accent text-accent-foreground":""}`,children:v.jsxs("div",{className:"flex items-center gap-2 w-full",children:[v.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${de[he]==="running"?"bg-green-500":de[he]==="exited"?"bg-red-500":"bg-gray-400"}`}),Ut(he)]})},he))})})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"h-16 flex items-center justify-end px-6 border-b border-border gap-4",children:[v.jsxs(Ie,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>{a(null),u(""),m(""),g(""),S(""),x(!1),k([]),Q(!1)},title:"Go to Home Dashboard",children:[v.jsx(TM,{className:"w-4 h-4 mr-2"}),"Home"]}),v.jsxs(Ie,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>O(!D),children:[v.jsx(ap,{className:"w-4 h-4 mr-2"}),"Console"]}),v.jsxs(Ie,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>mt(!0),title:"System Maintenance",children:[v.jsx(dM,{className:"w-4 h-4 mr-2"}),"Janitor"]}),v.jsx(Ie,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>ee(!se),children:se?v.jsxs(v.Fragment,{children:[v.jsx(XM,{className:"w-4 h-4 mr-2"}),"Light"]}):v.jsxs(v.Fragment,{children:[v.jsx(LM,{className:"w-4 h-4 mr-2"}),"Dark"]})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:!M&&n?v.jsx(jb,{children:v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-stretch",children:[v.jsxs("div",{className:"flex flex-col h-full gap-6",children:[v.jsxs(or,{className:"rounded-xl border-muted bg-card",children:[v.jsx(gr,{className:"p-4 pb-2",children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(vr,{className:"text-2xl font-bold",children:Pt}),v.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[!fr&&v.jsxs(Ie,{type:"button",size:"sm",className:"rounded-lg",onClick:Sn,disabled:N,children:[v.jsx(zb,{className:"w-4 h-4 mr-2"}),N?"Working...":"Deploy"]}),fr&&v.jsxs(v.Fragment,{children:[Zr?v.jsxs(Ie,{type:"button",size:"sm",variant:"outline",className:"rounded-lg",onClick:wn,disabled:N,children:[v.jsx(iw,{className:"w-4 h-4 mr-2"}),N?"Working...":"Stop"]}):v.jsxs(Ie,{type:"button",size:"sm",className:"rounded-lg",onClick:Jt,disabled:N,children:[v.jsx(zb,{className:"w-4 h-4 mr-2"}),N?"Working...":"Start"]}),v.jsxs(Ie,{type:"button",size:"sm",variant:"outline",className:"rounded-lg",onClick:Cr,disabled:N,children:[v.jsx(WM,{className:"w-4 h-4 mr-2"}),"Restart"]}),v.jsxs(Ie,{type:"button",size:"sm",variant:"outline",className:"rounded-lg",onClick:ei,disabled:N,children:[v.jsx(vM,{className:"w-4 h-4 mr-2"}),"Update"]})]}),v.jsxs(Ie,{type:"button",size:"sm",variant:"destructive",className:"rounded-lg",disabled:N,onClick:()=>{W(n),G(!0)},children:[v.jsx(rw,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}),v.jsx(yr,{className:"p-4 pt-2",children:v.jsxs("div",{className:"mt-4",children:[v.jsx("h4",{className:"text-sm font-semibold text-muted-foreground mb-3",children:"CONTAINERS"}),hr.length===0?v.jsx("div",{className:"text-muted-foreground text-sm",children:"No containers running for this stack."}):v.jsx("div",{className:"flex flex-col gap-3",children:hr.map(he=>{let Se;if(he.Ports&&he.Ports.length>0){const Te=[32400,8989,7878,9696,5055,8080,80,443,3e3,9e3],Me=[1900,53,22];let lt=he.Ports.find(Ye=>Te.includes(Ye.PrivatePort));lt||(lt=he.Ports.find(Ye=>Te.includes(Ye.PublicPort))),lt||(lt=he.Ports.find(Ye=>!Me.includes(Ye.PrivatePort)&&!Me.includes(Ye.PublicPort))),Se=(lt||he.Ports[0]).PublicPort}return v.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[v.jsx("div",{className:"flex flex-col gap-1",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(gu,{children:v.jsxs(vu,{children:[v.jsx(yu,{asChild:!0,children:v.jsx("div",{className:"cursor-help inline-flex",children:v.jsx(mp,{variant:ro(he).variant,className:"text-xs",children:ro(he).text||"unknown"})})}),v.jsx(vl,{children:v.jsx("p",{children:he?.Status||"No status details available"})})]})}),v.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["CPU: ",T[he?.Id]?.cpu||"N/A"," | RAM: ",T[he?.Id]?.ram||"N/A"," | NET: ",T[he?.Id]?.net||"0 B ↓ / 0 B ↑"]})]})}),v.jsxs("div",{className:"flex gap-1",children:[Se&&v.jsx(gu,{children:v.jsxs(vu,{children:[v.jsx(yu,{asChild:!0,children:v.jsxs(Ie,{size:"sm",variant:"outline",className:"rounded-lg h-8 px-2 mr-1",onClick:()=>window.open(`http://${window.location.hostname}:${Se}`,"_blank"),children:[v.jsx(CM,{className:"w-3 h-3 mr-1"}),Se]})}),v.jsxs(vl,{children:["Open App (",Se,")"]})]})}),v.jsx(gu,{children:v.jsxs(vu,{children:[v.jsx(yu,{asChild:!0,children:v.jsx(Ie,{size:"icon",variant:"ghost",className:"rounded-lg h-8 w-8",onClick:()=>to(he?.Id,he?.Names?.[0]?.replace("/","")||"container"),disabled:he?.State!=="running",children:v.jsx(ap,{className:"w-4 h-4"})})}),v.jsx(vl,{children:"Open Bash Terminal"})]})})]})]},he?.Id||Math.random())})})]})})]}),D&&v.jsxs("div",{className:"flex-1 rounded-xl overflow-hidden border border-muted bg-black p-3 min-h-[300px]",children:[v.jsx("h3",{className:"text-sm font-semibold text-muted-foreground mb-2",children:"Terminal"}),v.jsx("div",{className:"h-[calc(100%-24px)]",children:v.jsx(jb,{children:v.jsx(iN,{stackName:Pt})})})]})]}),v.jsxs(or,{className:"rounded-xl border-muted overflow-hidden flex flex-col h-full min-h-[600px] bg-card",children:[v.jsxs("div",{className:"p-4 border-b border-muted flex items-center justify-between",children:[v.jsx(bx,{value:z,onValueChange:he=>A(he),children:v.jsxs(s_,{className:"bg-muted",children:[v.jsx(Rl,{value:"compose",className:"rounded-lg",children:"compose.yaml"}),v.jsx(Rl,{value:"env",disabled:!w,className:"rounded-lg",children:".env"})]})}),v.jsx("div",{className:"flex gap-2",children:q?v.jsxs(v.Fragment,{children:[v.jsxs(Ie,{size:"sm",variant:"outline",className:"rounded-lg",onClick:bn,children:[v.jsx(Fp,{className:"w-4 h-4 mr-2"}),"Discard"]}),v.jsxs(Ie,{size:"sm",variant:"default",className:"rounded-lg",onClick:Kr,children:[v.jsx(VM,{className:"w-4 h-4 mr-2"}),"Save"]})]}):v.jsxs(Ie,{size:"sm",variant:"default",className:"rounded-lg",onClick:di,children:[v.jsx(UM,{className:"w-4 h-4 mr-2"}),"Edit"]})})]}),v.jsxs("div",{className:"flex-1 min-h-0",children:[!L&&v.jsx(oT,{height:"100%",language:z==="compose"?"yaml":"plaintext",theme:se?"vs-dark":"vs",value:z==="compose"?dr:io,onChange:he=>{q&&(z==="compose"?u(he||""):g(he||""))},options:{minimap:{enabled:!1},fontSize:14,padding:{top:10},scrollBeyondLastLine:!1,readOnly:!q}}),L&&v.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Loading..."})]})]})]})}):v.jsx(_3,{})})]}),v.jsx(hp,{open:F,onOpenChange:G,children:v.jsxs($u,{children:[v.jsxs(Fu,{children:[v.jsx(qu,{children:"Delete Stack"}),v.jsxs(Vu,{children:["Are you sure you want to delete ",ce,"? This action cannot be undone."]})]}),v.jsxs(Wu,{children:[v.jsx(Ku,{onClick:()=>G(!1),children:"Cancel"}),v.jsx(Yu,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:da,children:"Delete"})]})]})}),ot&&v.jsx(g3,{isOpen:me,onClose:Xr,containerId:ot.id,containerName:ot.name}),v.jsx(i4,{isOpen:Re,onClose:()=>mt(!1)})]})}function UL(){const{appStatus:e,isAuthenticated:t,needsSetup:r,completeSetup:n}=Cp();return e==="loading"?v.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:v.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}):r?v.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:v.jsx(ZR,{className:"w-full max-w-sm",onComplete:n})}):t?v.jsx(PL,{}):v.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:v.jsx(XR,{className:"w-full max-w-sm"})})}function IL(){return v.jsxs(YE,{children:[v.jsx(UL,{}),v.jsx(p3,{position:"bottom-right",richColors:!0})]})}VE.createRoot(document.getElementById("root")).render(v.jsx(y.StrictMode,{children:v.jsx(IL,{})}));